Problem Accessing Mesh in Component Builder Mtl Assign

   1219   7   0
User Avatar
Member
27 posts
Joined: Sept. 2017
Offline
Hi All,

Having used the Component Builder for creating Geo and Mtl variants reasonably successfully so far in my adventure inside the Solaris/USD universe, I have now hit a brick wall..

As can be seen in the attached .hip I have two similar variants of the same set of objects, they differ in one object (sphere vs torus), a very simple setup.

When I get to assigning materials only the meshes from the last added variant to the Component Geometry Variants node are visible in the stage tree and the meshes from the other variants are nowhere to be found and therefore not possible to assign materials to them and it seems that it's not possible to create material variants with geometry variants that don't have the same meshes.

My question:

How to add geo and mtl variants using objects that are not necessarily made up of exactly the same set of meshes and be able to apply materials to all the meshes?

So far I've spent days trying different network configurations with no much success. It could be that my approach is not correct, namely that in creating variants we have to keep the geometry very similar, is that's the case?

Thanks
P

Attachments:
example-for-forum.hip (412.9 KB)

User Avatar
Member
16 posts
Joined: July 2014
Offline
You can use the 'component material' to assign materials per instance, see attached.
Of course you can use a different material library per variant.

Watch this video for more details:
https://www.youtube.com/watch?v=EgTqz6y_oAs [www.youtube.com]

Attachments:
Screenshot 2023-08-24 184410.png (65.3 KB)

User Avatar
Member
27 posts
Joined: Sept. 2017
Offline
That's one of the first things I tried but the scene was laging too much, I tried now with Principled Shaders, the cooking time is still there but not as bad as the third party renderer and shaders that I use (VRay), especdially with the complex HDAs involved the lag becomes unbareable.

With that sort of lag it seems that the Component Builder network was not meant for that sort of usage. Would be nice to hear from SideFX in regards to this.

So in the end I am experimenting with a different solution that involves dummy prims to force propagate disapearing names, that seems to work but is a messy solution.

Oh and that video I watched a while ago, it's old and there are more recent USD videos and the examples are somewhat contrived but is probably worth a second look, thanks.
Edited by netlander - Aug. 25, 2023 04:23:52
User Avatar
Member
27 posts
Joined: Sept. 2017
Offline
Find attached a hip example using the approach mentioned above and using Karma shaders exclusively.

The solution mentioned above and also mentioned in a SideFX video doesn't seem to work:

(1) it doesn't producer the desired results when referencing back the exported USD (see attached .hip)
(2) When using third party shaders the lag becomes too much making it impossible to iterate (that's provided it'll have worked).

Can anyone point out what is wrong with the attached hip?

Attachments:
example-for-forum-new-idea.hip (706.0 KB)

User Avatar
Member
16 posts
Joined: July 2014
Offline
(1)
Because of the different material variation names, press the 'Nested Variants' Button in the 'Explore Variants' LOP.

Note that if you use the 'Set Variant' LOP, set the geo variant first and in a second 'Set Variant' LOP set the mtl variant. The second LOP is needed to populate the list of mtl variants correctly.
Or you can set them by index.

As for the (2) ¯\_(ツ)_/¯
The only thing to suggest is to work on the variants individually and writing them out.
User Avatar
Member
27 posts
Joined: Sept. 2017
Offline
If you bother answering, the least you can do is take a moment to look at the attached hip and comment on that.

It has nothing to do with the Explore Variants node that's there just for looking at what the Reference node has brought in, in other words the same result is seen when setting the variant in the Asset Reference itself or using a Set Variant node after that.

Even though both sets of variants are available Solaris is having a hard time showing the materials on all variants.
User Avatar
Member
16 posts
Joined: July 2014
Offline
I did check out the attached hip.

The only thing I did was press the 'Nested Variants' on the 'Explore Variants' LOP for the materials to show up.

Also I described what to do when using the Set Variant Node.
Edited by stheo - Aug. 25, 2023 16:21:08
User Avatar
Member
27 posts
Joined: Sept. 2017
Offline
Thanks

The second Set Variant seems necassary

Still leaves the lag problem. Oh, well!
Edited by netlander - Aug. 26, 2023 07:51:20
  • Quick Links