4D printing, combining the advantages of 3D printing and stimuli-responsive materials, provides a precise and rapid fabrication method for complex-shaped smart objects. In this study, the photoisomerization characteristic of azobenzene is used to develop 4D printable resins composed of azobenzene-based acrylates (AZO) and other acrylate compounds, which can be UV-cured and 3D printed into objects with photo and thermal dual responsiveness. UV-curing kinetics reveal that AZO competes with the photoinitiator for photons during photopolymerization, reducing the generation of reactive oxygen species and subsequently affecting the mechanical properties of UV-cured resin. The optimum content of AZO in 4D printing resins is 0.5 wt%, producing 3D printed objects with excellent mechanical properties, including a maximum stress of 25.2 MPa and a strain of 100 %. This ensures the successful formation of complex-shaped objects in the 3D printing process. Moreover, the objects printed with this photosensitive resin demonstrate exceptional shape memory capabilities, achieving a 100 % shape recovery ratio over three cycles of thermal stimulation. The printed openwork spheroid with a concave shape can successfully revert to its original form after 48 s of irradiation with 365 nm UV light. The degree of shape recovery can be precisely controlled by adjusting the UV irradiation time and position. Therefore, these photo/thermal dual-responsive 4D objects show great application prospects in medical devices and smart materials.