ID 499328 - Importing USD PointInstancers that reference the parent path of meshes does not create the instance source location

Follow

Problem summary
Importing a USD PointInstancer with a prototype relationship set to a parent prim of meshes does not create the instance source location correctly, if the parent prim is located within the PointInstancer location and there are no other nested prims.

Customer reported version
katana.4.0v5

Customer reported platform
centos7

Steps to reproduce

1) In the Python tab, run:
from fnpxr import Usd, UsdGeom, Gf#https://github.com/PixarAnimationStudios/USD/wiki/PointInstancer-Object-Modelstage = Usd.Stage.CreateInMemory()instancer = UsdGeom.PointInstancer.Define(stage, "/root/points")xformPrim = UsdGeom.Xform.Define(stage, "/root/points/two_items")cubeGeo = UsdGeom.Cube.Define(stage, "/root/points/two_items/cube")sphereGeo = UsdGeom.Sphere.Define(stage, "/root/points/two_items/sphere")instancer.CreatePrototypesRel().SetTargets([xformPrim.GetPath()])positions = [Gf.Vec3f(5,0,0), Gf.Vec3f(10,0,0)]indices = [0,0]instancer.CreatePositionsAttr(positions)instancer.CreateProtoIndicesAttr(indices)instancer.CreateIdsAttr([0,0,0])print(stage.ExportToString())stage.Export("/tmp/instances.usda")
2) Create a UsdIn node and set the fileName parameter to "/tmp/instances.usda".

3) Expand All the scene graph.

Expected behavior
The /root/world/geo/root/points/two_items location is of "instance source" type and contains the cube and sphere child locations.


Actual behavior
The /root/world/geo/root/points/two_items location is of "group" type and has no children.


Workaround
1) Move the location of the meshes outside the USD PointInstancer:
stage = Usd.Stage.CreateInMemory()instancer = UsdGeom.PointInstancer.Define(stage, "/root/points")xformPrim = UsdGeom.Xform.Define(stage, "/root/geo/two_items")cubeGeo = UsdGeom.Cube.Define(stage, "/root/geo/two_items/cube")sphereGeo = UsdGeom.Sphere.Define(stage, "/root/geo/two_items/sphere")instancer.CreatePrototypesRel().SetTargets([xformPrim.GetPath()])
2) Add an additional nested location for the Xform prim:
stage = Usd.Stage.CreateInMemory()instancer = UsdGeom.PointInstancer.Define(stage, "/root/points")xformPrim = UsdGeom.Xform.Define(stage, "/root/points/foo/two_items")cubeGeo = UsdGeom.Cube.Define(stage, "/root/points/foo/two_items/cube")sphereGeo = UsdGeom.Sphere.Define(stage, "/root/points/foo/two_items/sphere")instancer.CreatePrototypesRel().SetTargets([xformPrim.GetPath()])

Reproduced by support
This bug has been reproduced in:
Katana 5.0v1 - CentOS 7, Windows 10
Katana 4.5v1 - CentOS 7, Windows 10
Katana 4.0v5 - CentOS 7, Windows 10
Katana 4.0v1 - CentOS 7, Windows 10
Katana 3.6v1 - CentOS 7, Windows 10
Katana 3.5v1 - CentOS 7, Windows 10

Earliest version tested
Katana 3.5v1 - KatanaUsdPlugins does not exist before this version
 

    We're sorry to hear that

    Please tell us why