jonp Posted September 9, 2017 Share Posted September 9, 2017 Is there some secret function or script that will let me merge multiple edit SOP operations into one node? I'm not seeing a big performance hit with lots of them chained together but... OCD is kicking in. Quote Link to comment Share on other sites More sharing options...
bandini Posted September 10, 2017 Share Posted September 10, 2017 Check out this command:http://www.sidefx.com/docs/houdini/commands/sopcreateedit It is a little convoluted to use, but it should work for you. Quote Link to comment Share on other sites More sharing options...
jonp Posted September 10, 2017 Author Share Posted September 10, 2017 Yes, that's excellent! Thanks! Quote Link to comment Share on other sites More sharing options...
f1480187 Posted September 10, 2017 Share Posted September 10, 2017 (edited) <?xml version="1.0" encoding="UTF-8"?> <shelfDocument> <tool name="delta_edit" label="Delta Edit" icon="SOP_edit"> <helpText> <![CDATA[ #type: tool #icon: SOP/edit = Delta Edit = """Create Edit SOP from difference between two SOPs.""" ]]> </helpText> <script scriptType="python"> <![CDATA[ def safe_name(network, name): ''' Append a digit to the name making it unique within the network. Depends on existing nodes inside the network. E.g. if the network contains edit1, edit5 and edit6 nodes, 'edit7' will be returned, ignoring vacant numbers between edit1 and edit5, the way Houdini does it. ''' digits = [n.digitsInName() for n in network.glob(name + '*')] return '{}{}'.format(name, max([0] + digits) + 1) def delta_edit(selected_nodes): '''Create Edit SOP from difference between two SOPs.''' nodes = [x.name() for x in selected_nodes if isinstance(x, hou.SopNode)] if len(nodes) != 2: return network = selected_nodes[0].parent() name = safe_name(network, 'delta') script = 'cd {}; sopcreateedit {} {} {}'.format(network.path(), name, *nodes) hou.hscript(script) delta_edit(hou.selectedNodes()) ]]> </script> </tool> </shelfDocument> I made a shelf tool wrapping this command. Usage: Select "from this state" node, shift-select "into this state" node, click the tool. Origin and target nodes should share topology. Installation: Save to $(HIP|JOB|HOUDINI_USER_PREF_DIR)/toolbar/delta_edit.shelf Launch Houdini Right-click on empty place in shelf tab, select "Edit Shelf Tab..." Find "Delta Edit" in the long list of tools, hightlight it Accept Edited September 10, 2017 by f1480187 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.