Jump to content

Multiple IFD rendering (Windows)


Tom

Recommended Posts

Hi, I would like to know, how I can render multiple IFD's at one time using houdini's command line tools on Windows7.

Lets say I have a list like this:

render_001
render_002
render_003
render_004
render_005

how I can render them, without doing

mantra -f render_001.ifd

for every file?

Thanks in advance,

Tom

Edited by Tom
Link to comment
Share on other sites

I usually do that with a python script like that one :

# import dos commands
import os

# variables
startFrame = 1
endFrame =6
ifdName = "renderme."
ext = ".ifd"

for i in range (startFrame, endFrame):
    renderFile = '%s%04d%s'%(ifdName,i,ext)

    renderCmd = "mantra -f "+ renderFile

    print "----------------------------------------------------------------"
    print "Mantra is rendering file: " + renderFile
    print "----------------------------------------------------------------"
    print renderCmd
    os.system(renderCmd)

  • Like 4
Link to comment
Share on other sites

Guest mantragora

PowerShell way:

$mantra = "C:\Houdini\bin\mantra"
$flags = "-f "
$ifdpath = "C:\ifd"

$childs = Get-ChildItem $ifdpath

foreach($child in $childs) {Start-Process $mantra ($flags + $child.FullName)}

Link to comment
Share on other sites

Guest mantragora

Or with custom dialog box for ifd folder:

function Select-Folder($message='Select a folder') 
{ 
    $object = New-Object -comObject Shell.Application  

    $folder = $object.BrowseForFolder(0, $message, 0) 
    if ($folder -ne $null) { $folder.self.Path } 
} 

$mantra = "C:\Houdini\bin\mantra"
$flags = "-f "

$ifd = (Select-Folder "Select IFD folder:")

if($ifd -ne $null)
{
    Get-ChildItem -path $ifd | Where-Object {!$_.PSIsContainer} | Where-Object {$_.Extension -eq ".ifd"} | ForEach-Object {Start-Process $mantra ($flags + $_.FullName)}
}

To run them you need to have PowerShell "ExcutionPolicy" set to at least "RemoteSigned". Without it Windows will not allow to execute the script. To do that Run CommandLine as Administrator and write:

powershell Set-ExecutionPolicy RemoteSigned

To check you policy type:

powershell Get-ExecutionPolicy

than you can run this script (save it before as "ifd.ps1") and type

powershell ifd.ps1

PS.

Don't forget to specify path to your mantra. I got this solved by creating environment variable that always points to actually used by me houdini build and then, instead of baking by hand mantra folder, I extract environment variable. To do this just change this line:

$mantra = "C:\Houdini\bin\mantra"

to

$mantra = $env:YOUR_ENVIROMENT_VARIABLE_NAME + "\bin\mantra.exe"

I use this setup to also manage paths in Visual Studio so I don't have to change anything when I install new build. I just change my custom enviroment variable houdini path and thats it.

PS 2:

Above script filters directory for ".ifd" files only. It will bypass all catalogs and other file formats that selected directory contains so you can keep your ".ifd" files with other files in the same directory and it will work without errors. It will not try to render your Porn flics :).

PS 3:

Of course you can also switch CommandLine into Powershell mode by typing "powershell" or launching Powershell instead of CommandLine from Windows Accessories menu. Than you don't have to write every time "powershell" on begin of every command.

Edited by mantragora
  • Like 1
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...