diff --git a/client/ayon_max/plugins/publish/save_scenes_for_cameras.py b/client/ayon_max/plugins/publish/save_scenes_for_cameras.py index a211210550..eff1c59852 100644 --- a/client/ayon_max/plugins/publish/save_scenes_for_cameras.py +++ b/client/ayon_max/plugins/publish/save_scenes_for_cameras.py @@ -55,6 +55,9 @@ def process(self, instance): new_filepath = "{new_filepath}" new_output = "{new_output}" camera = "{camera}" +target_cam = next((c for c in rt.Objects if rt.Classof(c) in rt.Camera.classes and c.name == camera), None) +if target_cam: + rt.viewport.setCamera(target_cam) rt.rendOutputFilename = new_output directory = os.path.dirname(rt.rendOutputFilename) directory = os.path.join(directory, filename)