I have run into the same issue. It appears that a prim can have it's activation turned off in a variant, but not on. If I create a cube and a sphere, and turn the sphere active attribute off and save it as .usd, the sphere data saves properly.
def Xform "asset"
{
def Cube "cube1"
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
double size = 2
matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
def Sphere "sphere1" (
active = false
)
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
double radius = 1
matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
}
Notice "active = false" under "def Sphere". Now, I create a variant set with a variant, set the active on the sphere to true, and set the active to the cube to false.
over "asset" (
prepend variantSets = "geo"
)
{
variantSet "geo" = {
"sphere_on" {
over "cube1" (
active = false
)
{
}
over "sphere1" (
active = true
)
{
}
}
}
}
The cube turns off, but the sphere doesn't turn on. Even when I'm setting these opinions up on another layer, I'm still not seeing the sphere turn on. This appears to be a USD-thing, as usdView also shows the variant having both elements off.
Does this make sense to anyone? The code seems like it should be overriding the active = false. I could remove the active = false on the sphere creation, have both the cube and sphere active by default, then create 2 variants, only setting active = false. This ultimately means that any asset that has a variant requires a variant to always be set, and removing the variant with "clear from active layer" would break the asset prims. Is there a solution to this?