Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
JJ FX

Merge multiple VDBs

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

VDB combine does exactly what you need. check if you are working with fog volumes (density or whatever you have called them)

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
2 people like this

Share this post


Link to post
Share on other sites

@Skybar Yes! This is much better haha I was going stupid way, thanks!

Edited by takanori

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  
Followers 0