PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.56k stars 1.16k forks source link

USDView[Hydra] Not Rendering PointInstancer Instances Immediately After Creation #2670

Open nick-0 opened 9 months ago

nick-0 commented 9 months ago

Description of Issue

After configuring a new PointInstancer prim, I noticed that the instances aren’t immediately visible in the viewer.

Steps to Reproduce

  1. Using UsdView python interpreter:
    
    from pxr import Usd, UsdGeom, Gf

Get the current stage from usdview

stage = usdviewApi.stage

Create a new PointInstancer at the root of the stage

pointInstancer = UsdGeom.PointInstancer.Define(stage, '/myPointInstancer')

Create a new Sphere as the prototype for the PointInstancer

sphereProto = UsdGeom.Sphere.Define(stage, '/myPointInstancer/sphereProto')

Set the prototypes relationship on the PointInstancer to point to the Sphere

pointInstancer.GetPrototypesRel().AddTarget(sphereProto.GetPath())

Set the positions for three instances of the sphere

positions = [ Gf.Vec3f(0, 0, 0), Gf.Vec3f(2, 0, 0), Gf.Vec3f(4, 0, 0) ] pointInstancer.GetPositionsAttr().Set(positions)

Set the protoIndices for the three instances (all pointing to the single sphere prototype)

protoIndices = [0, 0, 0] pointInstancer.GetProtoIndicesAttr().Set(protoIndices)



In order to trigger the rendering as a workaround it has been suggested to deactivate/activate the pointinstancer prim.
Conversation here:
https://forum.aousd.org/t/usdview-not-rendering-pointinstancer-instances-immediately-after-creation

### System Information (OS, Hardware)

### Package Versions
usd 23.02
python 3.10

### Build Flags
jesschimein commented 9 months ago

Filed as internal issue #USD-8681