Tom Posted February 15, 2012 Share Posted February 15, 2012 (edited) 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 February 15, 2012 by Tom Quote Link to comment Share on other sites More sharing options...
br1 Posted February 16, 2012 Share Posted February 16, 2012 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) 4 Quote Link to comment Share on other sites More sharing options...
petz Posted February 18, 2012 Share Posted February 18, 2012 (edited) go to the folder where your ifds are saved and then put for %i in (*.*) do mantra -f %i into the command prompt(cmd). hth. petz Edited February 18, 2012 by petz 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted February 18, 2012 Author Share Posted February 18, 2012 Thanks for helping guys! @petz worked nicely @br1 interesting, it seems I need to start learning python Quote Link to comment Share on other sites More sharing options...
eetu Posted February 18, 2012 Share Posted February 18, 2012 Ok, now someone make a pretty otl out of that and put it on exchange Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted February 19, 2012 Share Posted February 19, 2012 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)} Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted February 19, 2012 Share Posted February 19, 2012 (edited) 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 February 22, 2012 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted February 21, 2012 Author Share Posted February 21, 2012 Thanks mantragora, I will check it test it later! Quote Link to comment Share on other sites More sharing options...
eetu Posted February 21, 2012 Share Posted February 21, 2012 Actually, it would be nice if Mantra ROP had in addition of the 'write to ifd' a matching 'read from ifd'. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.