usdgeom-invisible-prims#
Code |
VG.034 |
|---|---|
Version |
1.0.0 |
Validator |
|
Compatibility |
core-usd |
Tags |
š |
Summary#
Avoid invisible prims when deactivation is more appropriate.
Description#
Prims with visibility set to āinvisibleā still consume memory and processing resources during stage traversal and composition. When prims are permanently invisible and not intended to be toggled visible at runtime, they should be deactivated instead. Deactivated prims are excluded from stage traversal and do not consume runtime resources.
Why is it required?#
Reduces memory usage by excluding unnecessary prims from the stage
Improves stage traversal performance
Reduces file loading time
Provides clearer intent - deactivation indicates the prim is not needed
Examples#
Not recommended: Invisible prim consuming resources#
#usda 1.0
(
metersPerUnit = 1
upAxis = "Z"
)
def Xform "World"
{
def Mesh "HiddenCube"
{
token visibility = "invisible"
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 5, 4, 2, 3, 7, 6, 0, 3, 7, 4, 1, 2, 6, 5]
point3f[] points = [(-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, 0.5, -0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5)]
}
}
Recommended: Deactivated prim excluded from traversal#
#usda 1.0
(
metersPerUnit = 1
upAxis = "Z"
)
def Xform "World"
{
def Mesh "HiddenCube" (
active = false
)
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 5, 4, 2, 3, 7, 6, 0, 3, 7, 4, 1, 2, 6, 5]
point3f[] points = [(-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, 0.5, -0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5)]
}
}
How to comply#
Use Scene Optimizer āRemove Primsā operation to deactivate invisible prims
Only use visibility for prims that need runtime visibility toggling