Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
update animation instance frames attribute on reset frame range
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fricard committed May 24, 2023
1 parent fdf6f43 commit 1755ce4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,12 @@ def reset_frame_range(playback=True, render=True, fps=True):
recursive=True,
objectsOnly=True
)
frames_attributes = {
'frameStart': frame_start,
'frameEnd': frame_end,
'handleStart': handle_start,
'handleEnd': handle_end
}

for instance in instances:
if not cmds.attributeQuery("id", node=instance, exists=True):
Expand All @@ -2315,7 +2321,11 @@ def reset_frame_range(playback=True, render=True, fps=True):
if cmds.getAttr(id_attr) != "pyblish.avalon.instance":
continue

cmds.setAttr("{}.frameStart".format(instance), frame_start)
for key, value in frames_attributes.items():
cmds.setAttr(
"{}.{}".format(instance, key),
value
)


def reset_scene_resolution():
Expand Down

0 comments on commit 1755ce4

Please sign in to comment.