Jump to content
Sign in to follow this  
probiner

PDG: Python to change the OBJ level with TOPs makes sense?

Recommended Posts

I have a collection of 3D assets and want to setup a PDG network to do a couple of test renders on each, individually, to for quality control purposes. These 3D assets are NOT just bgeo.sc geometry caches but instead are small networks of Houdini OBJ nodes inside a subnet, where there's a simple OBJ hierarchy of multiple geo and null nodes, with material networks inside of the geo nodes. So I need to actually import nodes into the scene to be rendered, not just change the file parameter in a File SOP like seen in many PDG demos. Is this scene network modification something that is fit for PDG or I should just stick to scripting?

My overall idea of the routine would be:

1 - Set on template points or primitives an attribute referencing which 3D assets network will be loaded and use them to generate with geometryimport TOP the work items per 3D asset to be processed.

2 - Load the designated 3D asset into /obj network or an OBJ network, using Python; hou.node("/obj").loadItemsFromFile().

3 - Fit the 4 cameras (Front, Top, Side, Perspective) camera to the 3D asset. This can be done by having the cameras rigged already waiting for a subnet to be referenced so they fit to its contents.

4 - Render the 4 images. (Maybe generating 4 new work items per render?)

5 - Composite those 4 rendered images into a single image contact sheet probably with ImageMagik TOP

I suspect I'll find enough material out there for the last two items, but it's the first two and especially step 2 is what I'm asking for some insight. Does it even makes sense to use TOPs for this since I'll be doing changes to the hip scene graph not just changing parameters to load different cached data. I guess I could use a Python TOP to do the loading but will it make any sense in the TOP workflow? Would using LOPs instead of OBJ networks help in this process?

Thanks
prb
 

Edited by probiner

Share this post


Link to post
Share on other sites

Here's a video and scene file exemplifying the issue I'm having.

While I can change the scene with python and create items, the renders show nothing, but if I manually render, all the items are rendered. And I want to have each item loaded on its work_item to be rendered alone without the others.

I'm still not grasping if loading several OBJ networks(scenegraph changes) and render each separately is unfit for PDG or I'm just missing the plot.

Cheers
prb

PRB_OBJ_PDG.hiplc
rec_-2021-11-11_17.46.33.mp4

Share this post


Link to post
Share on other sites

So most of my issues were solved by switching to "Cook(Out-of-Process)" in the parameter: Evaluate Script During.
image.png.71ed81345d55b72e94ca4ee2c9d69d8b.png

Now I can run my deeds like Hython on a template scene file, easy peasy.
Cheers
prb

Edited by probiner

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×