Batch render workflow from Softimage

   3429   0   0
User Avatar
Member
1 posts
Joined: March 2017
Offline
Hi all,

I would like to find a way to set some options and render a scene (RS) from external .bat file.
I was using Softimage until now and achieve this with these steps :

1 - An application call a .bat file with multiple arguments.
2 - the .bat file launch Softimage and a js script to execute :
Here the sample of batch file :
call "C:\Program Files\Autodesk\Softimage 2014 SP2\Application\bin\setenv.bat"

"C:\Program Files\Autodesk\Softimage 2014 SP2\Application\bin\XSI.exe" -script my_script.js -continue -main my_function_in_my_script -args -fov %1 -px %2 -py %3 -pz %4 -tx %5 -ty %6 -tz %7 -width %8 -height %9

3 - the .js file open my scene, set my options and then do the render :
Here a sample of my javascript file :
function my_function_in_my_script(fov, px, py, pz, tx, ty, tz, width, height)
{
	// Open scene
	OpenScene("C:\\folder\\other_folder\\my_scene.scn", null, null);
	
	// Set the Options
	SelectObj("Cam_Node", null, null);
	
	SetValue("Cam_Node.camera.fovtype", 1, null);
	SetValue("Cam_Node.camera.fov", fov, null);
	SetValue("Cam_Node.camera.aspect", (width / height), null);
	
	SetValue("Passes.RenderOptions.ImageLockAspectRatio", false, null);
	SetValue("Passes.RenderOptions.ImageWidth", width, null);
	SetValue("Passes.RenderOptions.ImageHeight", height, null);
	
	Translate(null, px, 0, 0, siAbsolute, siGlobal, siObj, siX, null, null, null, null, null, null, null, null, null, 0, null);
	Translate(null, 0, py, 0, siAbsolute, siGlobal, siObj, siY, null, null, null, null, null, null, null, null, null, 0, null);
	Translate(null, 0, 0, pz, siAbsolute, siGlobal, siObj, siZ, null, null, null, null, null, null, null, null, null, 0, null);
	
	// Launch render
	RenderPasses(null, null, null, null, siRenderVerbosityDefault);
}

4 - When bat's process end, my application can use the rendered image.

With this 4 steps it's working great. So now, I would like to do the same with Houdini.
I saw many post “Render from batch file” but it seems that all of them need Houdini already open and use the Command Line Tools.

I have tried a bat to launch csh.exe and then hrender like :
"C:/Program Files/Side Effects Software/Houdini 16.0.504.20/bin/csh.exe" -f
hrender -e -v -d ROP cno_spaces_in_path/no_spaces_in_file_name.hip

but it does nothing else than launch csh.exe.
I think i have to follow the same step as Softimage, launch Houdini and pass it a script to execute like it's specify in sidefx documentation :
houdini [options] [file ...]

I know file must be in python but without example i wasn't able to make it working.
In this example line from doc:
houdini -foreground myscript.cmd waitforui setupshelf.py my.hip

“houdini” refere to wich exe ? I usually launch houdinicore.exe but for this purpose i don't want houdini to open.
Where can I find py function to do same thing than my js ?

Thanks for your assistance.
  • Quick Links