@mestela I have this code lying around for copying parm values from one node to another
(from the first selected node to the second)
“`def copyParmValues(source_node, target_node): “”” Copy parameter values of the source node to those of the target node if a parameter with the same name exists. “”” for parm_to_copy in source_node.parms(): parm_template = parm_to_copy.parmTemplate() # Skip folder parms. if isinstance(parm_template, hou.FolderSetParmTemplate): continue
parm_to_copy_to = target_node.parm(parm_to_copy.name()) # If the parameter on the target node does not exist, skip this parm. if parm_to_copy_to is None: continue
# If we have keys/expressions we need to copy them all. if parm_to_copy.keyframes(): # Copy all hou.Keyframe objects. for key in parm_to_copy.keyframes(): parm_to_copy_to.setKeyframe(key) else: # If the parameter is a string copy the raw string. if isinstance(parm_template, hou.StringParmTemplate): parm_to_copy_to.set(parm_to_copy.unexpandedString()) # Copy the raw value. else: parm_to_copy_to.set(parm_to_copy.eval())
#initial setup srcpath = hou.selectedNodes()[0].path() targetpath = hou.selectedNodes()[1].path()
#src and target definition srcNode = hou.node(srcpath) targetNode = hou.node(targetpath)
#copyparms copyParmValues(srcNode,targetNode)“`