🎨 improve imprinting

This commit is contained in:
Ondrej Samohel 2022-10-21 17:51:30 +02:00
parent 0e0920336b
commit f4b92f4d1d
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 11 additions and 8 deletions

View file

@ -324,14 +324,16 @@ def imprint(node, data, update=False):
parm = get_template_from_value(key, value)
if key in current_parms.keys():
if key in current_parms:
if node.evalParm(key) == data[key]:
continue
if not update:
log.debug("{} already exists on {}".format(key, node))
log.debug(f"{key} already exists on {node}")
else:
log.debug("replacing {}".format(key))
log.debug(f"replacing {key}")
update_parms.append(parm)
continue
# parm.hide(True)
templates.append(parm)
parm_group = node.parmTemplateGroup()

View file

@ -184,12 +184,13 @@ class HoudiniCreator(NewCreator):
instance_node = hou.node(created_inst.get("instance_node"))
current_data = read(instance_node)
new_values = {
key: new_value
for key, (_old_value, new_value) in _changes.items()
}
imprint(
instance_node,
{
key: value[1] for key, value in _changes.items()
if current_data.get(key) != value[1]
},
new_values,
update=True
)