Skip to content

Conversation

@roggiezhang-nv
Copy link
Contributor

@roggiezhang-nv roggiezhang-nv commented Sep 29, 2025

Description of Change(s)

See #3829 for details as this PR is based on that to apply the new prim flags to filter prototypes.

Link to proposal (if applicable)

Fixes Issue(s)

Checklist

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-11483

(This is an automated message. See here for more information.)

@unhyperbolic
Copy link
Member

Some hopefully quick questions:

  1. Does this require an update to any of the scene indices in usdImaging as well?
  2. Is there a (simple) example of a usd file where we see an imaging difference for this change? I assume that the incorrect behavior is that we don't see some geometry in a native prototype and this change fixes it.

@roggiezhang-nv
Copy link
Contributor Author

Thanks for pointing that out. I'll see if I can add more test coverage.

Some hopefully quick questions:

  1. Does this require an update to any of the scene indices in usdImaging as well?
  2. Is there a (simple) example of a usd file where we see an imaging difference for this change? I assume that the incorrect behavior is that we don't see some geometry in a native prototype and this change fixes it.

@spiffmon
Copy link
Member

@roggiezhang-nv , would it also make sense to update the guidance in UsdGeomPointInstancer itself for situating prototypes? After all these years, and the troubles that folks run into in trying to use over as the protector, it seems like we might want to update the guidance on using class instead, while acknowledging that you can also use over ?

@nvmkuruc
Copy link
Collaborator

@spiffmon I agree with that suggestion-- with the caveat that we should alert users that over should be used when backwards compatibility with older versions of USD is needed.

@spiffmon
Copy link
Member

That's reasonable, @nvmkuruc , though tricky to interpret, since I don't think we want to be stamping USD versions into the core/dev documentation? Beyond time-boxing how long that warning remains in the documentation, any other things we might do, there?

@drwave
Copy link

drwave commented Sep 30, 2025 via email

@nvmkuruc
Copy link
Collaborator

nvmkuruc commented Oct 1, 2025

Hi @drwave! I can say that we did find some friction which is why we started exploring using class. We didn't see a principled reason why over would be supported and class wouldn't be. We determined it was likely just a limitation of the traversal predicate. Even without this update, the over pattern is not universally followed with some tooling preferring to use visibility attributes on a concretely defined Prototypes scope.

As far as whether or not the example should be updated, I'd be happy if we let the change land without changing the example until there's more consensus and less concerns about backwards compatibility.

@spiffmon
Copy link
Member

spiffmon commented Oct 1, 2025

@drwave , the "troubles" I was thinking of come from how UsdStage's DefinePrim() (which also gets used by the various schema API's) ensures that the prim you are creating is defined according to UsdPrim::IsDefined(), which requires that all of the prim's ancestors also have defining specifiers. So if you use the UsdStage API's to build your scene and create an over, then underneath it begin to define your prototypes, the ancestral over gets changed/overridden into a def, which is a gotcha and can cause the prototypes to be rendered themselves. So I imagine the Blender code needs to then go "fix" the def back to an over once done defining prototypes. That step would not be necessary if you started with a class instead of an over. The over remains a bit of a landmine for downstream editors of the scene - if anyone augments a prototype, the same thing will happen again!

@spiffmon
Copy link
Member

spiffmon commented Oct 1, 2025

Also, just wanted to note that creating concrete, defined prototypes and protecting them by making them invisible will incur both a performance and memory penalty in Hydra and some renderers - notable Storm, because we may then process the prototypes twice, and we do extra work and caching for invisible geometry to ensure that you can switch them to visible quickly in a viewport.

@drwave
Copy link

drwave commented Oct 2, 2025 via email

@roggiezhang-nv
Copy link
Contributor Author

roggiezhang-nv commented Oct 7, 2025

Some hopefully quick questions:
2. Is there a (simple) example of a usd file where we see an imaging difference for this change? I assume that the incorrect behavior is that we don't see some geometry in a native prototype and this change fixes it.

@unhyperbolic Btw. You can use the following example and you'll see the sphere with this PR, but you cannot see it without it.

#usda 1.0
(
    defaultPrim = "instancer"
)

def PointInstancer "instancer" {
    rel prototypes = <Prototypes/Prototype_1>
    int[] protoIndices = [0, 0]
    double3[] positions = [(10, 0, 0), (20, 0, 0)]
    class "Prototypes"{
        def Sphere "Prototype_1" {}
    }
}

@roggiezhang-nv
Copy link
Contributor Author

@roggiezhang-nv , would it also make sense to update the guidance in UsdGeomPointInstancer itself for situating prototypes? After all these years, and the troubles that folks run into in trying to use over as the protector, it seems like we might want to update the guidance on using class instead, while acknowledging that you can also use over ?

@spiffmon I have updated the guidance here: 826caef

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

Successfully merging this pull request may close these issues.

6 participants