# PointInstancer update issue with prototypes are instanceable

**URL:** <https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038>\
**Category:** Hydra\
**Created:** [December 9, 2023, 9:33pm UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038 "2023-12-09T21:33:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![paoloemilioselva](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/paoloemilioselva/32/267_2.png) [@paoloemilioselva](https://forum.aousd.org/u/paoloemilioselva)\
**Post date:** [December 9, 2023, 9:33pm UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/1 "2023-12-09T21:33:17Z")

</div>

Hi,  
I have a scene with a class to define the asset (made of 1 cube for now), like this

```
class "_class_"
{
    def Xform "assetCubes" (
        kind = "component"
    )
    {
        def Cube "cube_0"
        {
            matrix4d xformOp:transform = (
                (1, 0, 0, 0), 
                (0, 1, 0, 0), 
                (0, 0, 1, 0), 
                (0, 0, 0, 1) )
            uniform token[] xformOpOrder = ["xformOp:transform"]
        }
    }
}

```

and I also have a class to drive instanceability

```
class "_class_instanceable" (
    instanceable = true
)
{
}

```

Then in the scene I’ve got 3 elements referencing the `assetCubes` and inheriting the `_class_instanceable` and I’ve got 3 PointInstancers (with 2 instances each) with their internal prototypes doing something similar to the 3 elements.

With instanceable enabled, updating the main `assetCubes` only updates the individual elements (or better, their HdInstancer basically), but the PointInstancers (or their HdInstancers) aren’t updated.

I’ve tested this in Solaris and also in usdview, if you load the attached file, you can then run the following in the python interpreter:

```
from pxr import UsdGeom, Gf
stage = usdviewApi.stage
c = UsdGeom.Cube.Define(stage,"/_class_/assetCubes/cube_1")
op = c.AddTransformOp()
op.Set( Gf.Matrix4d(1,0,0,0, 0,1,0,0, 0,0,1,0, -3,0,0,1 ) )

```

which is going to create a new cube under assetCubes, and you can see the elements updating, but not the PointInstancers, which you have to update manually for example toggleing their visibility.

NOTE: I’d like to discuss this in the next usd-wg meeting, as there is a Hydra-behaviour I’d like to review with you guys, to understand how we can handle it moving forward (shared prototypes).

 ![Screenshot 2023-12-10 102731](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/7d64ff60ae511885db8c0353b8c860f2f44fa620.png)

 ![Screenshot 2023-12-10 102826](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/443181f211adf63916a8a1ff7a67673a16193708.png)

![Screenshot 2023-12-10 102839](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/2b966be162e22eff9c2e70bac5cb5d660a386499.png)

 ![Screenshot 2023-12-10 102901](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/e451b5f583f29b718b7b3c65da879961facdf6bf.png)

[instancing\_v01.usda](https://forum.aousd.org/uploads/short-url/zZAnjhYUe34vwEtD7nnBbhCPDOm.usda) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![paoloemilioselva](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/paoloemilioselva/32/267_2.png) [@paoloemilioselva](https://forum.aousd.org/u/paoloemilioselva)\
**Post date:** [December 9, 2023, 9:33pm UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/2 "2023-12-09T21:33:48Z")

</div>

NOTE that disabling instanceable on the `_class_instanceable` prim, this works as expected.

---

<div class="post-metadata">

**Author:** ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://forum.aousd.org/u/tomc)\
**Post date:** [January 10, 2024, 11:29pm UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/3 "2024-01-10T23:29:53Z")

</div>

Hi Paolo,

This sounds like a bug in our point instancer handling code. When UsdImaging 2.0 is rolled out, I expect this to be fixed (you can try yourself by setting “USDIMAGINGGL\_ENGINE\_ENABLE\_SCENE\_INDEX” to 1 in env before running usdview). If you want to file a github issue with your repro steps, we can look at fixing it in UsdImagingDelegate as well.

Our semantic goal is for behavior to be the same whether or not “instanceable” is true or not. “instanceable” will de-duplicate the data at the USD level, and it’s a hint for hydra to de-duplicate the data as well, if it can do so in a way that doesn’t break the USD evaluation semantics. (Of course, sometimes this is a challenging goal to achieve 🙂 ).

I missed this in December, but do let me know if I should drop into one of the upcoming WG-USD meetings to talk USD evaluation semantics.

Hope that helps,  
Tom

---

<div class="post-metadata">

**Author:** ![paoloemilioselva](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/paoloemilioselva/32/267_2.png) [@paoloemilioselva](https://forum.aousd.org/u/paoloemilioselva)\
**Post date:** [January 11, 2024, 4:06am UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/4 "2024-01-11T04:06:12Z")

</div>

Hi Tom,

First of all, Happy new year! 🙂

and thanks for your reply.  
Yes, I think I wanted to bring this up (with the example) and a couple of other related things, to the next usd-wg meeting.  
There is packed agenda for next usd-wg meeting, so not sure if I can do it the 18th of Jan, and if not, I’ll def do it on the 1st of Feb usd-wg meeting.

Cheers,  
Paolo

---

<div class="post-metadata">

**Author:** ![nporcino](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nporcino](https://forum.aousd.org/u/nporcino)\
**Post date:** [February 1, 2024, 7:07am UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/5 "2024-02-01T07:07:01Z")

</div>

Paolo, thanks for demonstrating this today. I can’t recall if you mentioned it in the meeting, did you try the 2.0 scene indexing flag to check if the behavior is fixed there?

---

<div class="post-metadata">

**Author:** ![paoloemilioselva](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/paoloemilioselva/32/267_2.png) [@paoloemilioselva](https://forum.aousd.org/u/paoloemilioselva)\
**Post date:** [February 2, 2024, 5:16am UTC](https://forum.aousd.org/t/pointinstancer-update-issue-with-prototypes-are-instanceable/1038/6 "2024-02-02T05:16:22Z")

</div>

Hey Nick,  
I haven’t specifically tried with SceneIndex enabled. It could very well be fixed there.  
In the presentation I’ve mentioned that we can’t enable SceneIndex in Solaris, so we are gonna stay with Hydra 1.0 for the next movie probably, but we’ll see.  
I will confirm whether this works with Hydra 2.0 though or not, and I’ll let you know 🙂  
cheers!
