SOP to LOP - instancing geo according to specific attrib val

   2533   2   3
User Avatar
Member
15 posts
Joined: May 2014
Offline
Hey,

I have a SOP network that provides me :
- several geometries
- a point cloud with “orient”, “scale” and “inst” attributes. “inst” contains the geometry name for that point.

Like so :



I'd like to instance those geometries on the point cloud.

For now, I succeeded into making the LOP instancer take into account the orient and scale (really simple, works without doing too much things), but I'm struggling into making appear the specific geo on each point according to that “inst” data attribute.


(here I'd like to have one primitive on each point, not all of them at once)

I'd like to have the least nodes at the stage level because I'm going to have a lot of assets, that's why I kept the “complexity” into sop level. I'm pretty sure I'm doing it wrong at that Sop level already, I don't even know if it's useful to pack the geometries before merging them together.

Anyway, if you have indications on what would be the best way to arrange this, I would really appreciate this .

PS : I'm sharing that hip file too.
Image Not Found


Thanks

Attachments:
sop_to_lop_instances.hip (103.4 KB)

User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Look at the prototypes section at the bottom of the Instancer LOP's parameters; you can set the prototypes to come from the 2nd input, and use an attribute to identify the prototypes by name.

https://www.sidefx.com/docs/houdini/nodes/lop/instancer.html#parameters [www.sidefx.com]

Hope that helps!
I'm o.d.d.
User Avatar
Member
15 posts
Joined: May 2014
Offline
Hey Goldleaf,

Yes, it's been really helpful, thanks ! I played with those attributes without success before I posted that message but I kept looking at that direction because you pointed it out again to me.

So, for all the newbies like me out there (or was I the only one struggling with this ? ^^), here is the complete solution :

In the instancer node and the attribute Prototype Primitives, you could specify the specific names of the meshes that comes into the Second Input (if you set it this way in the attribute Prototype Source). In my scene example, it works if I specify :

mySphere myTorus myCube

But in order to be a little bit more procedural (like.. what if the number of intanced geometries is varying ?), Before the instancer, I… :

- added a configurePrimitive node in order to set the Kind to subcomponent.




- Back to the instancer, I used the little arrow on the right of the “Prototype Primitives” attribute and selected the “all Components” preset.
- A little expression appeared : { usd_kind(0, @primpath) == “component” }. I just had to change the word component to subcomponent.



And voilà !



Cheers

PS : I don't know if that's the perfect way to deal with this, but it works. If someone has a better input, I'd be glad to know about it .

Attachments:
sop_to_lop_instances.hip (106.6 KB)

  • Quick Links