Skip to content

Commit

Permalink
hotfix update placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Zaccaria authored and ClementHector committed Feb 8, 2022
1 parent 0ba04c4 commit 4bf6288
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions openpype/hosts/maya/api/lib_template_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ def get_placeholder_attributes(node):
for attr in cmds.listAttr(node, userDefined=True)}


def delete_placeholder_attributes(node):
'''
function to delete all extra placeholder attributes
'''
extra_attributes = get_placeholder_attributes(node)
for attribute in extra_attributes:
cmds.deleteAttr(node + '.' + attribute)


def create_placeholder():
args = placeholder_window()

Expand Down Expand Up @@ -56,11 +65,15 @@ def update_placeholder():
placeholder = placeholder[0]

args = placeholder_window(get_placeholder_attributes(placeholder))
#delete placeholder attributes
delete_placeholder_attributes(placeholder)
if not args:
return # operation canceled

options = {str(arg): arg._data.get("items") or arg.read()
for arg in args if not type(arg) == qargparse.Separator}
options = OrderedDict()
for arg in args:
if not type(arg) == qargparse.Separator:
options[str(arg)] = arg._data.get("items") or arg.read()
imprint(placeholder, options)
imprint_enum(placeholder, args)

Expand Down

0 comments on commit 4bf6288

Please sign in to comment.