# Quirk with Variants + Specializes

**URL:** <https://forum.aousd.org/t/quirk-with-variants-specializes/1787>\
**Category:** USD\
**Created:** [August 21, 2024, 3:19am UTC](https://forum.aousd.org/t/quirk-with-variants-specializes/1787 "2024-08-21T03:19:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tymon](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@Tymon](https://forum.aousd.org/u/Tymon)\
**Post date:** [August 21, 2024, 3:19am UTC](https://forum.aousd.org/t/quirk-with-variants-specializes/1787/1 "2024-08-21T03:19:22Z")

</div>

I’ve run across an odd result of composition with usd-23.08 which I can’t explain. Given the following layer:

```auto
#usda 1.0
class "_class_"
{
    class "asset"
    {
        class "representations"
        {
            class "modelHero" (
                variants = {
                    string lookdev = "v2"
                }
                prepend variantSets = "lookdev"
            )
            {
                def "geo"
                {
                    def "foo"
                    {
                    }
                }
                variantSet "lookdev" = {
                    "v2" {
                        def "mtl"
                        {
                            def Material "myMaterial"
                            {
                            }
                        }

                    }
                }
            }
        }
    }
}

def Xform "element" (
    variants = {
        string mode = "foo"
    }
    prepend variantSets = "mode"
)
{
    variantSet "mode" = {
        "foo" (
            prepend specializes = </_class_/asset/representations/modelHero>
        ) {

        }
    }
}

```

In the composed stage, the `modelHero` prim has the `mtl/myMaterial` prim as expected but the `element` prim does not.

Using Inherits instead of Specializes gives the expected result but causes strength ordering issues in other places. Adding an indirection between `element` and `modelHero` by specializing a different prim which then specializes modelHero also gives the expected result weirdly.

I believe this might have something to do with how Specializes arcs are ignored while recursing but I can’t wrap my head around why the specialize partially works but ignores the “lookdev=v2” variant completely.

Can anyone explain what’s happening here? Is this intended behaviour or is it a bug?

---

<div class="post-metadata">

**Author:** ![Tymon](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@Tymon](https://forum.aousd.org/u/Tymon)\
**Post date:** [August 21, 2024, 3:24am UTC](https://forum.aousd.org/t/quirk-with-variants-specializes/1787/2 "2024-08-21T03:24:14Z")

</div>

oh also, Specializing the `representations` parent prim rather than `modelHero` also gives the expected result, albeit with an extra `representations` prim underneath the element.

---

<div class="post-metadata">

**Author:** ![sunya](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sunya](https://forum.aousd.org/u/sunya)\
**Post date:** [August 21, 2024, 6:36pm UTC](https://forum.aousd.org/t/quirk-with-variants-specializes/1787/3 "2024-08-21T18:36:03Z")

</div>

Hi @Tymon, this is a bug in composition where variant sets on the specialized prim aren’t being expanded properly. I’ve confirmed this is still broken on the most recent 24.08 release.

Would you mind filing an issue on the GitHub repository to track this? Thank you for the simple repro case!

---

<div class="post-metadata">

**Author:** ![Tymon](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@Tymon](https://forum.aousd.org/u/Tymon)\
**Post date:** [August 21, 2024, 10:54pm UTC](https://forum.aousd.org/t/quirk-with-variants-specializes/1787/4 "2024-08-21T22:54:07Z")

</div>

Thanks @sunya! That’s actually good news for me since it means my mental model of how LIVRPS is supposed to work is not flawed. In the short term we can just remove the “mode” variantSet since it’s not critical to our workflows right now.

I’ve filed an issue on GitHub: [Variant sets on the specialized prims aren’t being expanded properly · Issue #3244 · PixarAnimationStudios/OpenUSD · GitHub](https://github.com/PixarAnimationStudios/OpenUSD/issues/3244)
