andyhosking
Hi all,
I'm looking to batch write .vdb files of 100's of 45-60 second Maya scenes 1 scene at a time as they're created. I've tried using mayabatch and a simple python script, but it doesn't like simply using maya.cmds.currentTime() to step through the frame range to write each vdb file, saying time is already connected to something else.

Background:
To create our final rendered videos, we run seeded simulations, then run several other fx passes, and then render, all through our own custom c++ app and python scripts ... and all is working fine.

But we are looking to update our fx pipeline to use vdb files for obvious efficiency gains etc. We're starting to be limited in our fx choices simply using Maya fx solutions because of processing time / storage etc.

Could anyone offer any thoughts on how this could be achieved?
Quote 0 0
pshipkov
There is a wide range of potential issues with batching, which can lead to extensive for and back between us, before we narrow down a fix/solution/workflow that works for you.
The fastest way for us to help you is if you can provide a minimal example of a scene with data that has to be written out as VDB cache.
Let me know if you don't have the time to create such a case, but can share a production scene - we can do this in private.

Thanks.
Quote 0 0
andyhosking
It was really just a general question about if it's possible to create the .vdb files using mayabatch and a mel/python command, ... instead of pressing play from within the maya ui.
Quote 0 0
andyhosking
I found this script and managed to solve it for my simple purposes.
https://gist.github.com/taikomatsu/260a290111c6fd78831c53eda0ae4025

It seems I needed to use 'evaluate()' to force the files to be created.
Here's my simple solution if anywhere cares >>>


from pymel.core import *

def exportVDB():

    print "\n\n ====== export vdb started"

    start=0
    end=100

    loadPlugin('BE_OpenVDB', qt=True)

    writeNodeName = 'BE_VDBWrite1'
    writeNode = PyNode(writeNodeName)

    currentTime(start)

    for frame in range(start,end+1):
        ## goto next frame
        currentTime(frame)

        ## evaluate writeNode
        writeNode.VdbOutput.evaluate()

print "\n\n ====== export vdb complete"
Quote 0 0
pshipkov
Glad to hear you figured it out.
Quote 0 0

Add a Website Forum to your website.