Hello!
I’m trying to compute light linking members after blocking the collection:lightLink:includeRoot attribute. As the fallback value for this attribute is True, I am expecting the collection to be in relationship-mode and thus ignore membershipExpression attribute value if set which is not what I see after running below snippet.
from pxr import Usd, UsdGeom, Sdf
stage = Usd.Stage.CreateInMemory()
sphere = UsdGeom.Sphere.Define(stage, "/sphere")
light_prim = stage.DefinePrim("/lights/light", "DiskLight")
lp_ll_coll = Usd.CollectionAPI.Apply(light_prim, "lightLink")
include_root = lp_ll_coll.GetIncludeRootAttr()
include_root.Get()
# None
include_root.Block()
mem_expr = lp_ll_coll.GetMembershipExpressionAttr()
mem_expr.Set(Sdf.PathExpression("/sphere"))
mquery = lp_ll_coll.ComputeMembershipQuery()
Usd.CollectionAPI.ComputeIncludedObjects(mquery, stage)
# [Usd.Prim(</sphere>)]
Is this a bug or am I using the wrong API to compute collection membership?