Skip to content

Commit

Permalink
add setting viewport camera before render setup in the script which s…
Browse files Browse the repository at this point in the history
…ave the separate camera scene
  • Loading branch information
moonyuet committed Sep 17, 2024
1 parent ddd4dbd commit f27570e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/ayon_max/plugins/publish/save_scenes_for_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f27570e

Please sign in to comment.