walterbehrnes Posted December 22, 2009 Share Posted December 22, 2009 Hey guys, I am trying to create curves at render time using an external script and am wondering if any of you know how to do this outside of the HKD. Specifically I am trying to figure out how the program procedural is suppose to communicate the curve information back to Mantra. Any help is appreciated! Thanks, Walt Quote Link to comment Share on other sites More sharing options...
pclaes Posted December 23, 2009 Share Posted December 23, 2009 Hey guys, I am trying to create curves at render time using an external script and am wondering if any of you know how to do this outside of the HKD. Specifically I am trying to figure out how the program procedural is suppose to communicate the curve information back to Mantra. Any help is appreciated! Thanks, Walt Heh, I've just been playing around with this kind of thing myself . It is quite fun stuff. Basically the way it works is that the program procedural will be triggered at rendertime. Anything that comes from the standard out (stdout) from your program will be interpreted as geometry. So if you look at the basic example where they: gconvert default.bgeo stdout It will basically print all the information in the default.bgeo to the stdout, which will then be picked up in the ifdstream. It seems to be exactly the same as in renderman. In order for it to work better it needs to have bounding information, so it will only compute when a ray falls within that box. If you are using python it will save you a lot of time if you put your python scripts under : $HOME/houdinix.x/scripts/python Initially I didn't do that and there was a conflict between the version of python houdini was using and the one installed on the system. If you are using additional modules you should probably also put them into the above directory. In terms of getting started I recommend: *) in houdini create a line sop *) attach an attributecreate -> create a "width" attribute and give it a small value (like 0.01). *) add a mantra node, camera & light and render. The line should be there. *) back in sops -> rightclick on the last node of your line network and -> save geometry as: myline.geo *) open myline.geo with a text editor and have a look at this geometry. *) Now make a new python script like: geostring="""PGEOMETRY V5 NPoints 2 NPrims 1 NPointGroups 0 NPrimGroups 0 NPointAttrib 1 NVertexAttrib 0 NPrimAttrib 0 NAttrib 1 PointAttrib width 1 float 0 0 0 0 1 (0.00999999978) 0 1 0 1 (0.00999999978) Poly 2 : 0 1 DetailAttrib varmap 1 index 1 "width -> WIDTH" (0) beginExtra endExtra""" print geostring Then refer to that script $HOME/houdinix.x/scripts/python/makegeo.py in your program procedural and assign this procedural shader to an empty geo node in Render -> Geometry -> procedural shader. Now make the kind of curve you would desire and save it again as a curve.geo, then have a look inside. Now you'll just need to use that other script to generate the right kind of data for you. I've just made a little clifford attractor as a quicktest with 10 million points (uses about 5gigs of ram). What I personally really want to start looking into is a program procedural that writes delayed load procedurals into the stream. That way you can generate huge amounts of geo on the fly, put it in little buckets and have those buckets rendered in optimal memory conditions. Kind of what Eetu is doing in his billion particles test, but more automated. Quote Link to comment Share on other sites More sharing options...
mawi Posted July 1, 2010 Share Posted July 1, 2010 Hmm. Your example does not work for me and for sure I´m doing something really wrong here. I´m having no problems to import the script in the shell, but at render console gives me "CreateProcess failed" and "mantra: program[/obj/render] unable to run program" My path looks like $HOME/houdini10.0/scripts/python/makeGeo.py Since my $HOME contains blank space I tried it at other location, but same story there. Is this something someone met while playing around with this? Quote Link to comment Share on other sites More sharing options...
Jason Posted July 1, 2010 Share Posted July 1, 2010 Perhaps if you execute "python $HOME/houdini10.0/scripts/python/makeGeo.py" instead? Quote Link to comment Share on other sites More sharing options...
mawi Posted July 2, 2010 Share Posted July 2, 2010 Perhaps if you execute "python $HOME/houdini10.0/scripts/python/makeGeo.py" instead? Doesn´t help. I would not be surprised if this is just some simple f* up from my side. I will have to take a look at this after the weekend, my head is just blank now. Quote Link to comment Share on other sites More sharing options...
Jason Posted July 2, 2010 Share Posted July 2, 2010 Yeah, perhaps $HOME isn't being expanded? 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.