Skip to content

Commit

Permalink
check if attribute exsits before modifying it
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fricard committed Apr 11, 2023
1 parent 38eed31 commit fde0b50
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,18 +2126,16 @@ def reset_frame_range():
}

for instance in instances:
if not cmds.attributeQuery("id", node=instance, exists=True):
continue

id_attr = "{}.id".format(instance)
if cmds.getAttr(id_attr) != "pyblish.avalon.instance":
continue

for key, value in frames_attributes.items():
cmds.setAttr(
"{}.{}".format(instance, key),
value
)
if cmds.attributeQuery(key, node=instance, exists=True):
cmds.setAttr(
"{}.{}".format(instance, key),
value
)


def reset_scene_resolution():
Expand Down

0 comments on commit fde0b50

Please sign in to comment.