{"id":476,"date":"2020-02-17T09:57:59","date_gmt":"2020-02-17T17:57:59","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=476"},"modified":"2020-02-17T09:58:01","modified_gmt":"2020-02-17T17:58:01","slug":"archived-post-by-shadesoforange-2","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2020\/02\/17\/archived-post-by-shadesoforange-2\/","title":{"rendered":"Archived post by shadesoforange"},"content":{"rendered":"<p class=\"\">@mestela I have this code lying around for copying parm values from one node to another<\/p>\n<p class=\"\">(from the first selected node to the second)<\/p>\n<p class=\"\">&#8220;`def copyParmValues(source_node, target_node):     &#8220;&#8221;&#8221; Copy parameter values of the source node to those of the target node          if a parameter with the same name exists.     &#8220;&#8221;&#8221;     for parm_to_copy in source_node.parms():         parm_template = parm_to_copy.parmTemplate()         # Skip folder parms.         if isinstance(parm_template, hou.FolderSetParmTemplate):             continue<br \/>\n        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<br \/>\n        # 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())<\/p>\n<p>#initial setup srcpath = hou.selectedNodes()[0].path() targetpath = hou.selectedNodes()[1].path()<br \/>\n#src and target definition srcNode = hou.node(srcpath) targetNode = hou.node(targetpath)<br \/>\n#copyparms copyParmValues(srcNode,targetNode)&#8220;`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>@mestela I have this code lying around for copying parm values from one node to another (from the first selected node to the second) &#8220;`def copyParmValues(source_node, target_node): &#8220;&#8221;&#8221; Copy parameter values of the source node to those of the target node if a parameter with the same name exists. &#8220;&#8221;&#8221; for parm_to_copy in source_node.parms(): parm_template &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2020\/02\/17\/archived-post-by-shadesoforange-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by shadesoforange<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/476"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=476"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/476\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}