-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[usdImaging] Nested point instancers aren't correctly transformed
When a point instancer is within the prototype of another instancer, it may be incorrectly transformed when a transform is authored on the prototype root. UsdImagingPointInstancerDelegate only captured transforms up to the prototype root, but not on the prototype root itself. This is inconsistent with the treatment of other, non-point-instancer prims within the prototype subtree, which do correctly take the transform on the prototype root. This fix corrects this behavior by causing UsdImagingPointInstancerAdapter to return the point instancer's transform relative to the prototype root's parent, rather than relative to the prototype root. This approach will produce the correct relative transform regardless of the parent instancer type (point vs native), or of whether the prototype root is a descendant of the parent instancer. An additional test case is also added to testUsdImagingGLPointInstancer to cover this issue. Fixes #2359 (Internal change: 2277872)
- Loading branch information
Showing
3 changed files
with
104 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+13 KB
...ng/usdImagingGL/testenv/testUsdImagingGLPointInstancer/baseline/pi_pi_xform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions
79
pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPointInstancer/pi_pi_xform.usda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#usda 1.0 | ||
( | ||
upAxis = "Y" | ||
) | ||
|
||
def Xform "World" | ||
{ | ||
def PointInstancer "Outer" | ||
{ | ||
int[] ids = [0] | ||
point3f[] positions = [(0, 0, 0)] | ||
int[] protoIndices = [0] | ||
rel prototypes = </World/Outer/OuterXform> | ||
|
||
def Xform "OuterXform" | ||
{ | ||
float3 xformOp:translate = (-1, -1, 0) | ||
uniform token[] xformOpOrder = ["xformOp:translate"] | ||
|
||
def Mesh "Yellow" | ||
{ | ||
int[] faceVertexCounts = [4] | ||
int[] faceVertexIndices = [0, 1, 2, 3] | ||
point3f[] points = [(0, 0, 1),(2, 0, 1),(2, 2, 1),(0, 2, 1)] | ||
uniform token subdivisionScheme = "none" | ||
color3f[] primvars:displayColor = [(1, 1, 0)] | ||
} | ||
|
||
def Xform "MiddleXform" | ||
{ | ||
float3 xformOp:translate = (-9, -9, 0) | ||
uniform token[] xformOpOrder = ["xformOp:translate"] | ||
|
||
def Mesh "Blue" | ||
{ | ||
int[] faceVertexCounts = [4] | ||
int[] faceVertexIndices = [0, 1, 2, 3] | ||
point3f[] points = [(0, 0, 0), (10, 0, 0), (10, 10, 0), (0, 20, 0)] | ||
uniform token subdivisionScheme = "none" | ||
color3f[] primvars:displayColor = [(0, 0, 1)] | ||
} | ||
|
||
def PointInstancer "Inner" | ||
{ | ||
int[] ids = [0] | ||
point3f[] positions = [(0, 0, 0)] | ||
int[] protoIndices = [0] | ||
rel prototypes = </World/Outer/OuterXform/MiddleXform/Inner/InnerXform> | ||
|
||
def Xform "InnerXform" | ||
{ | ||
float3 xformOp:translate = (10, 0, 0) | ||
uniform token[] xformOpOrder = ["xformOp:translate"] | ||
|
||
def Mesh "Green" | ||
{ | ||
int[] faceVertexCounts = [4] | ||
int[] faceVertexIndices = [0, 1, 2, 3] | ||
point3f[] points = [(0, 0, 0), (10, 0, 0), (10, 20, 0), (0, 10, 0)] | ||
uniform token subdivisionScheme = "none" | ||
color3f[] primvars:displayColor = [(0, 1, 0)] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
def Mesh "Red" | ||
{ | ||
int[] faceVertexCounts = [3] | ||
int[] faceVertexIndices = [2, 1, 0] | ||
point3f[] points = [(0, 0, 0), (10, 10, 0), (-10, 10, 0)] | ||
uniform token subdivisionScheme = "none" | ||
color3f[] primvars:displayColor = [(1, 0, 0)] | ||
} | ||
} | ||
|
||
def DomeLight "Light" | ||
{ } |