Author Topic: Workaround: animated substances in Houdini (Maya required)  (Read 13422 times)

Hey there!

I know that the Houdini integration is being rewritten from the ground up right now but since I don't know a release date I had to come up with a workaround to animate exposed parameters and render the results in Houdini.
In the end it requires you to set up a material in Houdini that loads the animated texture sequences. This workaround also requires access to Maya as of this moment :-X

I am still a newbie in Substance so if there is an easier way to get animated substances to Houdini, let me know please! ;D

If there are people like me who created a substance, loaded it into Houdini, started setting up animations and then ended up in frustration since none of the parameters update over time: here is a custom workaround:

1. Load your substance into Maya and apply it to your geometry.
2. Animate everything you want.
3. Enable automatic baking in the substance node and set your desired output path and file extension.
4. Open up the script editor and create a new python script by pressing the small "+" symbol.
5. Paste the following code:
Code: [Select]
import maya.cmds as cmds
import os

# Enter your automatic baking output path here
path = "Q:/VFX_0000_substanceRnD/futureArchA001/mayaBake/"

# Enter file extension of baked textures (as selected in the Automatic Baking settings)
fileType = ".png"

# Set your desired frame range
start = 1000
end = 1100

for i in range(start,end+1):
    # Tell maya to set the current frame
    cmds.currentTime( i, edit=True )
    # Create the new file name based on Substance's auto-naming "*substance1.png", adding frame count
    newName = "e." + str(i) + ".png"
    # Search for files in output path and rename them on every frame
    for root, dirs, files in os.walk(path):
        for file in files:           
            if newName in file:            # checks if the file you are about to write already exists and removes it
                print "Existing file has been overwritten"
    print "Frame " + str(i) + " exported"
6. Enter your values for "path", "extension" and frame range.
7. Run the script (e.g. select all and press Ctrl+Enter)

Hint: you don't need to display the substance in the viewport for this to work.

I enjoy writing little helpers like this but I don't have a programming background. If there is "stupid code", let me know:)

Maybe this helps someone out there in the wilderness!

Take care,
freelance matte painter and environment concept artist