Jump to content
Sign in to follow this  
JJ FX

Merge multiple VDBs

Recommended Posts

Hi, 

How can I merge multiple VDBs? Like VDB Combine (SDF Union).

Because when I usre just simple merge and then I convert to poly, all VDB objects have separate meshes. And I want only one mesh.

Share this post


Link to post
Share on other sites

Yeah, but if i have 30 different VDB objects? VDB combine has ony 2 inputs

right now im doing: convert all VDBs to poly and then back to VDB. Can I somehow merge all vdbs into one without the conversion to poly?

Edited by JJ FX

Share this post


Link to post
Share on other sites
14 hours ago, JJ FX said:

Yeah, but if i have 30 different VDB objects? VDB combine has ony 2 inputs

right now im doing: convert all VDBs to poly and then back to VDB. Can I somehow merge all vdbs into one without the conversion to poly?

hmm 30 vdbs. That's an interesting problem there. Probably for each is the way to go, but how to properly set it up then. or volume wrangle/vop. I don't have time now to have a look at it, but I'm curious how to do it now.

Share this post


Link to post
Share on other sites

You just use multiple VDB Combine nodes, kind of like compositing. Foreground over background. 15 nodes is not really a lot in a network.

Share this post


Link to post
Share on other sites

Hi Try to use this shelf tool to make a chain of multiple VDB combine nodes by selecting & clicking once.

  1. Select multiple VDBs.
  2. Execute this script.
selected_nodes = hou.selectedNodes()
vdbcombines = []

for x, node in enumerate(selected_nodes):
    if x < len(selected_nodes)-1:
        vdbcombine = node.createOutputNode('vdbcombine')
        vdbcombine.setNextInput(selected_nodes[x+1])
        vdbcombine.setParms({'operation':'add'})
        vdbcombines.append(vdbcombine)

for x, vdbcombine in enumerate(vdbcombines):
    if x < len(vdbcombines)-1:
        vdbcombine.setInput(1, vdbcombines[x+1])

 

Share this post


Link to post
Share on other sites

No need for loops and stuff. Take one VDB and put it in the first input, merge all the others and put it in the second input. On the VDB Combine choose "Flatten All B into A" and choose the appropriate operation, like SDF Union for sdfs.

 

Screenshot from 2017-03-29 11-29-36.png

Edited by Skybar
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×