UV-driven switching of chain orientation and liquid crystal alignment in nanoscale thin films of a novel polyimide bearing stilbene moieties in the backbone.