Skip to content

Commit

Permalink
Channel Master: catch error when attributeQuery fails #74
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Feb 1, 2023
1 parent 134ae67 commit 751a85f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions release/scripts/mgear/animbits/channel_master_utils.py
Expand Up @@ -70,7 +70,10 @@ def get_single_attribute_config(node, attr):
# config["ctl"] = pm.NameParser(node).stripNamespace().__str__()
config["ctl"] = node
config["color"] = None # This is a place holder for the channel UI color
config["type"] = cmds.attributeQuery(attr, node=node, attributeType=True)
try:
config["type"] = cmds.attributeQuery(attr, node=node, attributeType=True)
except:
return

# check it the attr is alias
alias = cmds.aliasAttr(node, q=True)
Expand Down Expand Up @@ -127,8 +130,9 @@ def get_attributes_config(node):
for attr in keyable_attrs:
config = get_single_attribute_config(node, attr)
# attrs_config[attr] = config
config_data["channels"].append(config["fullName"])
config_data["channels_data"][config["fullName"]] = config
if config:
config_data["channels"].append(config["fullName"])
config_data["channels_data"][config["fullName"]] = config

return config_data

Expand Down

0 comments on commit 751a85f

Please sign in to comment.