mantra program procedural in python, calling delayed loads

   3677   2   1
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
hi,
I'm currently looking into “Mantrarogram Procedural” through the mantra_program procedural shop.

I would like to use a python script as a Program Procedural that will then create several child procedurals, these could be either program procedurals or delayed load procedurals.

So far I managed to use a little python script to generate my geometry and write it to the stdout which is then picked up by mantra. I can also write out the geometry to disk as a .geo file.

I am unable to get child procedurals working through the Mantra: Program Procedural shop.
Ideally I would want to be able to write my own string into the ifd file, but I do not know if this is directly possible from within houdini. (I would like to avoid having to post process ifd files with a script.)

I would really like the delayed load partitioning to happen at rendertime, as in I would like to avoid creating a pre-renderscript that puts down 1000 geo nodes with 1000 delayed load shops attached to them. I know how the ifd command is built up and I would simply like to write it in the ifd directly.

at the moment the ifd section with the procedural looks like this:

ray_start object # {
ray_transform 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
ray_procedural program program “/opt/hfs10.0.430/python/bin/python /home/pclaes/houdini10.0/scripts/python/makegeo.py”
ray_property object name “/obj/geo4”
ray_end # }


makegeo.py should generate a bunch of:
ray_start object # {
ray_transform 1 0 0 0 0 1 0 0 0 0 1 0 1.51268315315 0 0 1
ray_procedural -m -0.850650846958 -0.894427359104 -1 -M 0.850650846958 0.894427359104 1 file file “/home/pclaes/houdini_rnd/procedurals/test_01/ifd_geo/test_sphere_0001.geo”
ray_end # }

ray_start object # {
ray_transform 1 0 0 0 0 1 0 0 0 0 1 0 1.51268315315 0 0 1
ray_procedural -m -0.850650846958 -0.894427359104 -1 -M 0.850650846958 0.894427359104 1 file file “/home/pclaes/houdini_rnd/procedurals/test_01/ifd_geo/test_sphere_0002.geo”
ray_end # }


ray_start object # {

ray_end # }


So is there any way to write into the ifd file from within houdini? Or to generate nested program procedurals from within houdini?


I have briefly looked at the possibility of doing it through the HDK, but would like to know if it is at all possible from within houdini with python.

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=13558&postdays=0&postorder=asc&highlight=ray_procedural&start=0 [sidefx.com]

and

http://www.sidefx.com/docs/hdk10.0/hdk_vray_procedural.html#HDK_VRAY_Procedural_Intro [sidefx.com]

seem very useful.
Any help appreciated, even if it is a straightforward redirection towards the HDK or the clusterThis procedural.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
89 posts
Joined: April 2008
Offline
There might be better ways (I dont have access to a commercial license), but I'd look at the soho scripts in $HH/soho. You could probably set up a rop hda that calls a modified version of soho.py, and you could send whatever info you need to your soho script via the rop.
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
thanks, I had not considered soho yet. I will look into it.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
  • Quick Links