empty-leaves#

Code

HI.012

Validator

Compatibility

openusd

Tags

🚀

Summary#

Avoid empty leaf nodes in scene hierarchy

Description#

Empty leaf nodes take up space and add complexity to the scene. Remove any empty leaf nodes that are not required. Empty leaf nodes can include for example xforms, scopes, general grouping prims, empty geometry prims.

Why is it required?#

  • Improves scene size, load time and memory usage.

Examples#

Invalid - unnecessary, empty leaf prims#

#usda 1.0
(
    defaultPrim = "root"
)

def Xform "root"
{
    def Xform "World"
    {
        def Xform "Leaf1" {}

        def Xform "Leaf2"
        {
            def Xform "Leaf1" {}
            def Xform "Leaf2" {}
            def Scope "Leaf3" {}
        }

        def Xform "Leaf3" {}

        def Xform "NotLeaf1"
        {
            def Xform "Leaf1" {}

            def Xform "NotLeaf1" {
                def Mesh "Mesh1" {}
            }
        }

        def Xform "Leaf4"
        {
            def Xform "XformRefChild" {}
        }

        def Xform "NotLeaf2"
        {
            def Xform "NotLeaf1" {
                def Mesh "Mesh1" {}
            }
        }
    }
    def Xform "Leaf1" {}
}

Valid - prim hierarchy without unnecessary leaf prims#

#usda 1.0
(
    defaultPrim = "root"
)

def Xform "root"
{
    def Xform "World"
    {

        def Xform "NotLeaf1"
        {
            def Xform "NotLeaf1" {
                def Mesh "Mesh1" {}
            }
        }

        def Xform "NotLeaf2"
        {
            def Xform "NotLeaf1" {
                def Mesh "Mesh1" {}
            }
        }
    }
}

How to comply#

For More Information#