Jump to content

Wedge / Delayed Load Shader Procedural Pipeline


Valentino

Recommended Posts

Hey guys i have been searching odforce for a solution on my problem and cant find anything even though i believe this came up before.

I want to make a script or an asset that takes the number of steps in a wedge node [lets say 10 steps] and the automatically it creates 10 delayed load shaders that bring in the rendered data to houdini and 10 geo nodes thats linked to the delayed load shader.

i posted some pictures of something am working on now. You can see am using 10 steps in the wedge rop , then i created 10 delayed load shaders that i use to bring in the rendered data, and then 10 geo nodes that i linked to the Delayed load shader.

its ok if its a small number of steps but what if i want to use 100 steps?

post-5850-129777101538_thumb.jpg post-5850-129777102454_thumb.jpg post-5850-129777103339_thumb.jpg

is there a possible way of making this easier?

thanks in advance,

valentino

Link to comment
Share on other sites

Either you do all that node creation in python... but there is still a lot of overhead to write out ifd's.

Or you program your own delayed load instancer in the HDK:

http://www.peterclaes.be/blog/

- seriously, have a brief look into the source code and you will see that it generates delayed loads for each point. It is easier than you think, but is a bit challenging because of the HDK.

Link to comment
Share on other sites

i am currently learning python in university right now so i wouldnt mind using that. at the moment though i have no idea how to tackle the problem or anything about HDK! Your website looks amazing though so i will read through it to see what i can pick up. thank you! :)

Link to comment
Share on other sites

I would def try peter's method first, but an alternative road to go down, or inaddition, is to make an otl from a obj level subnet make all the extra options invisible, make a button called Create Instances, and in the call back script use an opadd or opwrite to create an embeded otl based on a geo/instance node inside the subnet that would contain your delayed load inside a shop in there with some paths based on object name or opdigits at the geo level, you can use another hscript command to check if the embedded otl already exist.

This way you have more control of modifying your assets down the pipeline. Also you can contain your ropnet mantra archive inside the geo otl, and promote them to your per object level or any global common ones to your global obj subnet level.

There is a trade off of writing ifds, to the python calls required to read the instances, that you should be aware of. Lots of control, good computer load handling, network traffic can vary, but there can be slower result when you are into the thousands of calls it is really noticeable with the python.

lol, I'm gona go look at peter's stuff now on this...

Link to comment
Share on other sites

I WROTE THE PYTHON CODE :D yoohoo!

Basically wat is doing now is getting the number of steps from the wedge rop and creates the same amount of delayed load shaders and same amount of geo nodes, i manage to link the geo nodes to the appropriate delayed load shader but i havent figure out how to load the files that wedge rop renders on the Delayed load shader yet.. any tips?

Link to comment
Share on other sites

  • 2 weeks later...

Hey guys i cant figure it out in the end :(

this is my code

hou.node("/obj").createNode("subnet")
netobj = hou.node("/obj/subnet1")
netshop = hou.node("shop")
wedge = hou.node('/out/wedge1')
geoout = hou.node('/out/geometry1')

i= 0
while i < wedge.parm("steps1").eval():
    newnode = netobj.createNode("geo")
    newnode.setPosition([i,(i*(-1))])
    newdls = netshop.createNode("vm_geo_file")
    newdls.setPosition([i,(i*(-1))])
    newnode.parm("shop_geometrypath").set(newdls.path())
i = i + 1

I Dont know how to get the out/geometry node output file from this "$HIP/bgeoparticles/particles.$WEDGE.$F.bgeo.gz" and turn it to something like this "particles._wedge_seed_0.000000.1.bgeo.gz" using code in the while loop so everytime the loop goes through and a new delayed load shader is created to load the files.

any more help please?

thanks in advance,

valentino

Edited by valentino.vfx
Link to comment
Share on other sites

Hi there,

You can use re.sub (regular expressions) to substitute the text.

Here's an example applied to your code:

import re
netobj = hou.node("/obj/subnet1")
netshop = hou.node("shop")
wedge = hou.node('/out/wedge1')
geoout = hou.node('/out/geometry1')
steps = wedge.parm("steps1").eval()

for i in range(steps):
	newnode = netobj.createNode("geo")
	newnode.setPosition([i,(i*(-1))])
	newdls = netshop.createNode("vm_geo_file")
	newdls.setPosition([i,(i*(-1))])
	newnode.parm("shop_geometrypath").set(newdls.path())
	#
	geoOutputFile = geoout.parm("sopoutput").unexpandedString()
	wedgeSeedString = '_wedge_seed_%d' %i
	geoOutputFile = re.sub('\$WEDGE', wedgeSeedString, geoOutputFile)
	newdls.parm("file").set(geoOutputFile)

Link to comment
Share on other sites

Hi there,

You can use re.sub (regular expressions) to substitute the text.

Here's an example applied to your code:

import re
netobj = hou.node("/obj/subnet1")
netshop = hou.node("shop")
wedge = hou.node('/out/wedge1')
geoout = hou.node('/out/geometry1')
steps = wedge.parm("steps1").eval()

for i in range(steps):
	newnode = netobj.createNode("geo")
	newnode.setPosition([i,(i*(-1))])
	newdls = netshop.createNode("vm_geo_file")
	newdls.setPosition([i,(i*(-1))])
	newnode.parm("shop_geometrypath").set(newdls.path())
	#
	geoOutputFile = geoout.parm("sopoutput").unexpandedString()
	wedgeSeedString = '_wedge_seed_%d' %i
	geoOutputFile = re.sub('\$WEDGE', wedgeSeedString, geoOutputFile)
	newdls.parm("file").set(geoOutputFile)

What would you do if you use random steps for your wedge?

I would say that you have to link your create nodes script to the ROP that is controlled by the Wedge ROP and use it as a post-render script. This way it would be really easy to get the path to the simulated files because you can simply eval() the output path at every wedge cycle. It also has the advantage that it only creates the delayed load shader and geo nodes that it actually has generated, incase you cancel the wedge cycle half way through, for what ever reason. Thus you can can prompt the user to deleted existing nodes, turn them off and create a new version when the wedge cycle is rerun.

This is off topic, but I was thinking about a similar thing, but taking it a step further, by rendering low quality previews of wedge simulations after the simulation is finished. This might come in handy if you sim 25 wedges over night and you want to be able to easily review them the next day, without manually bringing al the data in and having to flipbook it.

Any way, just my 2 cents

Link to comment
Share on other sites

What would you do if you use random steps for your wedge?

I would say that you have to link your create nodes script to the ROP that is controlled by the Wedge ROP and use it as a post-render script. This way it would be really easy to get the path to the simulated files because you can simply eval() the output path at every wedge cycle. It also has the advantage that it only creates the delayed load shader and geo nodes that it actually has generated, incase you cancel the wedge cycle half way through, for what ever reason. Thus you can can prompt the user to deleted existing nodes, turn them off and create a new version when the wedge cycle is rerun.

This is off topic, but I was thinking about a similar thing, but taking it a step further, by rendering low quality previews of wedge simulations after the simulation is finished. This might come in handy if you sim 25 wedges over night and you want to be able to easily review them the next day, without manually bringing al the data in and having to flipbook it.

Any way, just my 2 cents

thats an awesome idea my friend and thanks a lot for your help much appreciated!

unfortunately am quite weak on the scripting side of houdini at the moment only just started learning python to do this script i posted, how should i proceed to tackle the issue u pointed out?

am thinking of an if_then_else condition that checks if the random samples are on so it proceeds this way and if they are not proceeds the other way. how do i check that every step is finished and then create the loaders and geo node tho?

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...