Batching processing multiple geometries

   2837   9   1
User Avatar
Member
32 posts
Joined: 8月 2014
Offline
Hi,

If I load an FBX file with multiple geometries I get a sub-network with multiple geometries (see image attached). I want to run all these geometries through the same SOP operation. The problem now is that the only way I know of doing this would be to go into the individual object SOP and add my network there which seems very cumbersome. Is it possible to send the top level subnetwork through some kind of node that merges all objects into the same SOP node so I can process them together. Ideally with some kind of primitive attribute saying which geometry it came from so I eventually can split them up again. Another potential solution would be to do some for each for every object sending them through a SOP node.
Advice is appreciated, I'm new to Houdini.

Attachments:
multigeom.PNG (52.0 KB)

User Avatar
スタッフ
6245 posts
Joined: 7月 2005
Offline
Object Merge.

/obj/test_*

There is an option there to add a per-object attribute to store where it comes from.

You can also turn on Pack Geometry Before Merging to make them all packed primitives, and foreach -> unpack -> process -> pack to process them…
User Avatar
Member
32 posts
Joined: 8月 2014
Offline
That looks promising.
I can't figure out where to enter the filter or do I have to explicitly add every object I want to merge?
User Avatar
スタッフ
6245 posts
Joined: 7月 2005
Offline
The Object 1 field can take a glob pattern to match more than one object.

Note the Transform “Into This Object”.

Attachments:
objectmerge.png (142.6 KB)

User Avatar
Member
32 posts
Joined: 8月 2014
Offline
Thanks, that did the trick. Forgot to add the sub-network for the FBX file the first time I tried.
Thanks for helping out.
User Avatar
Member
7743 posts
Joined: 7月 2005
Online
Another idea is to hit Ctrl+A inside the subnet to select them all and then hit the Modify > Combine shelf tool.
User Avatar
Member
32 posts
Joined: 8月 2014
Offline
Thanks,

I have another issue that came up in the process.
Most of my objects have object level material assignments as opposed to primitive level assignments. This means when I do a Object Merge I lose the materials since the primitives have no shop_material attribute. Is there a way of globally push the object materials down to primitives?

David
User Avatar
Member
7743 posts
Joined: 7月 2005
Online
Good point, I don't know of a way offhand except for scripting it in python within Houdini.
User Avatar
Member
8599 posts
Joined: 7月 2007
Offline
select your object nodes and run this script:
import hou
sel = hou.selectedNodes()
geos =

for geo in geos:
matpathparm = geo.parm(“shop_materialpath”)
matpath = matpathparm.unexpandedString()
if matpath != “”:
matpathparm.set(“”)
rendernode = geo.renderNode()
displaynode = geo.displayNode()
matnode = rendernode.createOutputNode('material')
matnode.parm(“shop_materialpath1”).set(matpath)
matnode.setRenderFlag(1)
matnode.setDisplayFlag(rendernode == displaynode)
matnode.moveToGoodPosition()

it will add material sop inside of every geo object in render stream
then just use one of above mentioned methods to combine the objects
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
32 posts
Joined: 8月 2014
Offline
Thanks!

That solved it.
A word of warning for other people reading this, it doesn't play well with relative path names but in my case that part was pretty easy to solve manually.
  • Quick Links