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

Commit

Permalink
check id attribute before family attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fricard committed May 15, 2023
1 parent df6cc8c commit 6fcb0a6
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3073,27 +3073,28 @@ def update_instances_frame_range():
objectsOnly=True
)
asset_doc = get_current_project_asset()
new_asset = asset_doc["name"]
new_data = asset_doc["data"]
asset_name = asset_doc["name"]
asset_data = asset_doc["data"]

frames_attributes = {
'frameStart': new_data["frameStart"],
'frameEnd': new_data["frameEnd"],
'handleStart': new_data["handleStart"],
'handleEnd': new_data["handleEnd"],
'asset': new_asset
'frameStart': asset_data["frameStart"],
'frameEnd': asset_data["frameEnd"],
'handleStart': asset_data["handleStart"],
'handleEnd': asset_data["handleEnd"],
'asset': asset_name
}

for instance in collected_instances:
family_attr = "{}.family".format(instance)
if (cmds.attributeQuery('family', node=instance, exists=True) and
cmds.getAttr(family_attr) == "render"):
continue

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

if (
cmds.attributeQuery('family', node=instance, exists=True) and
cmds.getAttr("{}.family".format(instance)) == "render"
):
continue

for key, value in frames_attributes.items():
if cmds.attributeQuery(key, node=instance, exists=True):
if key == 'asset':
Expand Down

0 comments on commit 6fcb0a6

Please sign in to comment.