{"id":751,"date":"2023-12-14T11:38:33","date_gmt":"2023-12-14T19:38:33","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=751"},"modified":"2023-12-14T11:55:20","modified_gmt":"2023-12-14T19:55:20","slug":"archived-post-by-bonsain","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2023\/12\/14\/archived-post-by-bonsain\/","title":{"rendered":"Archived post by bonsain"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">Yep, precisely:<br \/>\nPythonModule (or external module to be reused). It&#8217;s quite simple, really. Most of the below is just the docstring \ud83d\ude1b &#8220;` def fix_inputs(node):     &#8220;&#8221;&#8221;Shifts inputs of node to remove gaps          This function is to be called from an onInputChanged Event Handler inside     of the Operator Type Properties&#8217; Script section.          To avoid triggering further onInputChanged callbacks while running, a     temporary cachedUserData gets added that exits this function early until it     is complete.          Args:         node (:class:`hou.Node`): node to remove empty inputs from.          &#8220;&#8221;&#8221;     if node.cachedUserData(&#8220;skip_onInputChanged&#8221;):         return     if not all(node.inputs()):         node.setCachedUserData(&#8220;skip_onInputChanged&#8221;, True)         for i, input_connection in enumerate(node.inputConnections()):             node.setInput(input_connection.inputIndex(), None)             node.setInput(i, input_connection.inputItem())         node.destroyCachedUserData(&#8220;skip_onInputChanged&#8221;) &#8220;`<br \/>\nonInputChanged: &#8220;` node = kwargs[&#8220;node&#8221;] node.hdaModule().fix_inputs(node) &#8220;`<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20233812\/14\/23\/custom_merge_vs_naive_01.gif\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20233812\/14\/23\/custom_merge_vs_naive_01.gif<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yep, precisely: PythonModule (or external module to be reused). It&#8217;s quite simple, really. Most of the below is just the docstring \ud83d\ude1b &#8220;` def fix_inputs(node): &#8220;&#8221;&#8221;Shifts inputs of node to remove gaps This function is to be called from an onInputChanged Event Handler inside of the Operator Type Properties&#8217; Script section. To avoid triggering further &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2023\/12\/14\/archived-post-by-bonsain\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by bonsain<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/751"}],"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=751"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/751\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=751"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}