Importing multiple Objects as components for instancing

   2202   5   1
User Avatar
Member
36 posts
Joined: Nov. 2013
Offline
Hello!

I am still trying to export USD files with instances and multi-materials.
So far I got everything working except I had to use "referenceable instances" because 3dsmax (or any other software) aren't importing the point instances correctly..

When using referenceable geometry, it seems to be a lot more complicated to create instances with multi-materials...

The only way I got this working was by merging to "create sop" nodes, which returns separate objects which the instancer can use..

Of course I don't want to manually create sops and merging them, so I created an for each loop which fetches at each iteration another piece which I want to add to the instancer, which picks them by name attribute.... But I am doing this for thousands of objects which gets really slow and feels too complicated. And if things weren't complicated enough - i looks like the objects can't be imported as packed geometry because this won't allow me to assign materials based on the shop_materialpath partition...

The whole thing would work if I tell the instancer to use the entire stage, but for this I need to import the objects properly like the two manually created and merged objects.

Would be great I anyone knew how to do this properly

Cheers
Felix

Attachments:
instancer_sop_cerate.hiplc (407.9 KB)
sopcreate.jpg (38.7 KB)

User Avatar
Member
36 posts
Joined: Nov. 2013
Offline
I tried a bit more... The problem alway is the instanceable reference.. As soon this is checked, it won't accept the materials...

Attachments:
instanceableref.jpg (686.8 KB)
instanceable_ref.hiplc (458.0 KB)

User Avatar
Staff
4441 posts
Joined: July 2005
Offline
I think you can get everything you want using a single SOP Create LOP, but using a "path" primitive attribute on the geometry inside the SOP create to fully sontrol the scene graph path of the primitives created by the SOP Create. See the attached file, which does something similar to yours, but with a single SOP Create.

Attachments:
instancer_sop_create_2.hiplc (458.5 KB)

User Avatar
Staff
4441 posts
Joined: July 2005
Offline
Sorry, I should say my file also sets up the materials properly. The trick there is that your materials need to be defined as siblings of the geometry/mesh primitives, then you make your prototype one level up in the hierarchy (above the geo and materials). This is because the materials have to be defined "inside" the reference for them to be available as part of the reference (I believe this is true whether you make the references instanceable or not).
User Avatar
Member
36 posts
Joined: Nov. 2013
Offline
thank you mtucker!

I think I understand the problem, but I have no idea what you are doing in the sop create material paths.
Guess that's because I am far away from understanding how USD in depth works...

But the good news is: I switched to the first input like you did and under the instancer -> prototypes section, I changed it to "specialize" and now it works! No I idea why but but I now I have instances with multi materials with a super simple setup.

(The path attribute also was an issue in my attempts...)
Edited by Fele - Oct. 25, 2021 11:26:29

Attachments:
instanceable_ref.hiplc (450.5 KB)

User Avatar
Staff
4441 posts
Joined: July 2005
Offline
No problem! I was going to suggest Inherit or Specialize for the instancer prototype, but didn't want to get sucked into trying to explain exactly what they mean... But if you don't care what they mean, then go for it! It's a perfectly valid solution to the material visibility issue (though it might make the creators of USD over at Pixar cringe a bit... )
  • Quick Links