#usda 1.0
(
    """
    This museum case demonstrates the expected behavior with instances
    that are nested in namespace. The same restrictions on overrides on
    descendant objects apply to all instances, including the nested ones.
    """
)

over "Flattened_Master_1"
{
    def "PropInstance_1" (
        instanceable = true
        add references = </Flattened_Master_2>
    )
    {
        int foo = 1
        int propInstanceAttr.connect = [
            </Flattened_Master_1/PropInstance_1/geom.foo>,
            </Flattened_Master_1/PropInstance_2/geom.foo>,
            </Flattened_Master_1/PropNotAnInstance_1/geom.foo>,
        ]
        rel propInstanceRel = [
            </Flattened_Master_1/PropInstance_1/geom>,
            </Flattened_Master_1/PropInstance_2/geom>,
            </Flattened_Master_1/PropNotAnInstance_1/geom>,
        ]
        rel propRel = </Flattened_Master_1/PropInstance_1/geom>
    }

    def "PropInstance_2" (
        instanceable = true
        add references = </Flattened_Master_2>
    )
    {
        int foo = 1
        int propInstanceAttr.connect = [
            </Flattened_Master_1/PropInstance_1/geom.foo>,
            </Flattened_Master_1/PropInstance_2/geom.foo>,
            </Flattened_Master_1/PropNotAnInstance_1/geom.foo>,
        ]
        rel propInstanceRel = [
            </Flattened_Master_1/PropInstance_1/geom>,
            </Flattened_Master_1/PropInstance_2/geom>,
            </Flattened_Master_1/PropNotAnInstance_1/geom>,
        ]
        rel propRel = </Flattened_Master_1/PropInstance_2/geom>
    }

    def "PropNotAnInstance_1"
    {
        int foo = 1
        rel propRel = </Flattened_Master_1/PropNotAnInstance_1/geom>

        def "geom"
        {
            int foo.connect = </Flattened_Master_1/PropNotAnInstance_1.foo>
        }
    }
}

over "Flattened_Master_2"
{
    def "geom"
    {
        int foo.connect = </Flattened_Master_2.foo>
    }
}

def "Set_1" (
    instanceable = true
    add references = </Flattened_Master_1>
)
{
    int setAttr.connect = [
        </Set_1/PropInstance_1.foo>,
        </Set_1/PropInstance_1/geom.foo>,
        </Set_1/PropInstance_2.foo>,
        </Set_1/PropInstance_2/geom.foo>,
        </Set_1/PropNotAnInstance_1.foo>,
        </Set_1/PropNotAnInstance_1/geom.foo>,
    ]
    int setInstanceAttr.connect = [
        </Set_1/PropInstance_1.foo>,
        </Set_1/PropInstance_1/geom.foo>,
        </Set_1/PropInstance_2.foo>,
        </Set_1/PropInstance_2/geom.foo>,
        </Set_1/PropNotAnInstance_1.foo>,
        </Set_1/PropNotAnInstance_1/geom.foo>,
    ]
    rel setInstanceRel = [
        </Set_1/PropInstance_1>,
        </Set_1/PropInstance_1/geom>,
        </Set_1/PropInstance_2>,
        </Set_1/PropInstance_2/geom>,
        </Set_1/PropNotAnInstance_1>,
        </Set_1/PropNotAnInstance_1/geom>,
    ]
    rel setRel = [
        </Set_1/PropInstance_1>,
        </Set_1/PropInstance_1/geom>,
        </Set_1/PropInstance_2>,
        </Set_1/PropInstance_2/geom>,
        </Set_1/PropNotAnInstance_1>,
        </Set_1/PropNotAnInstance_1/geom>,
    ]
}


