Jump to content

Merge All option?


Recommended Posts

I'm restoring a bunch of old subnets that have 400 dangling transform sops and none of them are merged. I'd like to connect all the xform sops into one merge sop that I can display from. Is there a merge all technique for this? I've exhausted my useless bag of tricks--never needed to do a merge all until now. Any tips before I look at hou.Node and travel down that path?

Link to comment
Share on other sites

There's a couple ways you could do it I suppose.

One way would be to have a general tool that merged all your selected nodes together automatically for you, the other a more one off scripting approach.

For the scripting approach you could do something like this:

def mergeXforms(container):
    xform_nodes = [child for child in container.children() if child.type() == hou.nodeType(hou.sopNodeTypeCategory(), "xform")]

    merge = container.createNode("merge")

    for xform in xform_nodes:
        if len(xform.outputs()) is 0:
            merge.setNextInput(xform)

    merge.setRenderFlag(True)
    merge.setDisplayFlag(True)
    merge.moveToGoodPosition()

I've also attached a tool I wrote a while ago that handles easy merging of selected nodes in all contexts except OBJ and VOPs. Just select some nodes and run the tool. It should merge them together.

net_automerge.shelf

Link to comment
Share on other sites

you can just select all the xform sops, either manually or by network editor's "Find Node..." button to search/select the xform nodes. Once selected, wire the output of 1 of the selected nodes into a merge sop. That will wire all the selected nodes into your merge.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...