Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PointInstancers don't respect transform stack #2359

Closed
guidoq opened this issue Mar 24, 2023 · 1 comment
Closed

PointInstancers don't respect transform stack #2359

guidoq opened this issue Mar 24, 2023 · 1 comment

Comments

@guidoq
Copy link

guidoq commented Mar 24, 2023

Description of Issue

The simple USDA shows the problem. The two triangles should be in the same spot (the base should be coincident).

Steps to Reproduce

Render the following. One triangle get the root transformation of (90,0,0) but not the other.

#usda 1.0
(
defaultPrim = "RootXform"
metersPerUnit = 0.01
upAxis = "Y"
)
def Xform "RootXform"
{
def PointInstancer "top_instancer"
{
int64[] ids = [0]
quath[] orientations = [(0, 0, 0, 0)]
point3f[] positions = [(0, 0, 0)]
int[] protoIndices = [0]
prepend rel prototypes = </RootXform/top_instancer/Prototypes/inner_xform>

    def Scope "Prototypes"
    {
        def Xform "inner_xform"
        {
            double3 xformOp:translate = (90, 0, 0)
            uniform token[] xformOpOrder = ["xformOp:translate"]

            def Mesh "blue_triangle"
            {
                int[] faceVertexCounts = [3]
                int[] faceVertexIndices = [0, 1, 2]
                point3f[] points = [(-40, 0, 0), (40, 0, 0), (-40, 80, 0)]
                uniform token subdivisionScheme = "none"
                color3f[] primvars:displayColor = [(0, 0, 1)]( interpolation = "constant" )
            }

            def PointInstancer "nested_instancer"
            {
                int64[] ids = [0]
                quath[] orientations = [(0, 0, 0, 0)]
                point3f[] positions = [(0, 0, 0)]
                int[] protoIndices = [0]
                prepend rel prototypes = </RootXform/top_instancer/Prototypes/inner_xform/nested_instancer/Prototypes/green_triangle>

                def Scope "Prototypes"
                {
                    def Mesh "green_triangle"
                    {
                        int[] faceVertexCounts = [3]
                        int[] faceVertexIndices = [0, 1, 2]
                        point3f[] points = [(-40, 0, 0), (40, 0, 0), (40, 80, 0)]
                        uniform token subdivisionScheme = "none"
                        color3f[] primvars:displayColor = [(0, 1, 0)]( interpolation = "constant" )
                    }
                }
            }
        }
    }
}
def Mesh "red_square"
{
    int[] faceVertexCounts = [4]
    int[] faceVertexIndices = [0, 1, 2, 3]
    point3f[] points = [(-40, 0, 40), (40, 0, 40), (40, 0, -40), (-40, 0, -40)]
color3f[] primvars:displayColor = [(1, 0, 0)]( interpolation = "constant" )
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants