How to set Material Binding to None?

Hi there

def Xform "Root"
{
    def Capsule "Capsule" (
        active = true
        prepend apiSchemas = ["MaterialBindingAPI"]
    )
    {
        uniform token axis = "Y"
        double height = 0.2
        rel material:binding = None (
            bindMaterialAs = "weakerThanDescendants"
        )
        double radius = 0.1
    }
}


I checked the corresponding API and found no method to set it to None. ClearTargets also does not work.

Thanks!

Thanks everyone, I found a way!

  auto directRel = bindingApi.GetDirectBindingRel();
  bound = directRel.SetTargets({});

There are a handful of Unbind methods you might want to consider as well.

Universal Scene Description: UsdShadeMaterialBindingAPI Class Reference

1 Like

When I do this, I get the following:

custom rel material:binding = None (
            bindMaterialAs = "weakerThanDescendants"
        )

How did you get rid of the custom tag?

Unless it’s causing your CI/testing problems, I wouldn’t worry about the custom tag - it is not meaningful to USD’s core, nor should clients be ascribing anyything to it (it’s something that came along with the underpinnings that USD inherited from Presto; we facilitate encoding “custom user properties” using the “userProperties:” property namespace… albeit that is not well-documented).

Thanks for the explanation! It doesn’t appear to cause problems; I just thought maybe I was doing something wrong.