Authoring variants and materials?

   1360   3   3
User Avatar
Member
355 posts
Joined: 11月 2015
Offline
I have this setup (see attached file) where I'm creating variants, each with a different material. Now, if the set variant LOP comes before the assign material, it works, but if it comes after, it doesn't work. I don't want to use the component builder for this because I'm wanting to understand what the composition engine is really doing. So, my question is, what is happening behind the scenes why I'm getting these results, and what can be done to fix it? Variants are very cool for how I want to work and I really want to get a hold of what's happening and when local arcs are messing me up.

Attachments:
export_file_forum.hiplc (116.2 KB)

hou.f*ckatdskmaya().forever()
User Avatar
スタッフ
4159 posts
Joined: 9月 2007
Online
It's because the Assign Material LOP can only see cube1 or sphere1 at a time. If the node can't see a primitive, it won't author a material binding. USD supports authoring to a pure "over", which basically says "if a prim is ever defined here, give it this material binding". Most LOP nodes don't work like this, because usually that's not what people want/expect.

It's usually better for the assignments to either be authored within the variant. Even if the material itself is not defined within the variant.

Another approach is to only control visibility or activation in the variants. This means that all (or nearly all, if using activates) of the prims are present, and can be edited by LOP nodes. I believe this is the approach Pixar takes for model variants. I've attached an example of visibility-variants.

Hope this helps!

Attachments:
export_file_forum_visibilityvariants.hiplc (145.5 KB)

I'm o.d.d.
User Avatar
Member
355 posts
Joined: 11月 2015
Offline
goldleaf
It's because the Assign Material LOP can only see cube1 or sphere1 at a time. If the node can't see a primitive, it won't author a material binding. USD supports authoring to a pure "over", which basically says "if a prim is ever defined here, give it this material binding". Most LOP nodes don't work like this, because usually that's not what people want/expect.

It's usually better for the assignments to either be authored within the variant. Even if the material itself is not defined within the variant.

Another approach is to only control visibility or activation in the variants. This means that all (or nearly all, if using activates) of the prims are present, and can be edited by LOP nodes. I believe this is the approach Pixar takes for model variants. I've attached an example of visibility-variants.

Hope this helps!

This is great! thanks much. I also did another version (attached file) that seems to work ok, what would be the pro and cons of both versions?

Attachments:
export_file_forum_v2.hiplc (136.7 KB)

hou.f*ckatdskmaya().forever()
User Avatar
スタッフ
4159 posts
Joined: 9月 2007
Online
The pros of visibility-variants is the prims are always available for edits; the downside is USD does some level of composition/processing, even for invisible prims.

Variant-exclusive prims, where the prim doesn't exist except in its variant, are more efficient for USD (because USD has no awareness of the contents of un-selected variants). The cons are that you don't have the prims available to overlay changes, unless you loop through all of the variants.

I'm sure there are other pros/cons to each approach, but those are the ones I can think of.
I'm o.d.d.
  • Quick Links