-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding GetAll
method to the codegenTemplates
for multiple-apply schemas
#1773
Conversation
…chemas, both for C++ and Python. This enables a workflow such as: ``` from pxr import Usd stage = Usd.Stage.CreateInMemory() prim = stage.DefinePrim('/test') MyMultipleApplySchema.Apply(prim, 'banana') MyMultipleApplySchema.Apply(prim, 'apple') MyMultipleApplySchema.Apply(prim, 'pear') for api in MyMultipleApplySchema.GetAll(prim): api.GetAwesomenessAttr().Set(1.0) ```
@robpieke, could you please also rerun usdGenSchema in pxr/usd/usd to pick up the changes to UsdCollectionAPI, and also augment the doc for GetAllCollections() to to say that it is equivalent to GetAll()... and if SideFx is OK with updating some code eventually, maybe "\deprecate" GetAllCollections() ? |
Done! Thanks for the speedy feedback! |
…sdGenSchema`) and deprecate the manually-crafted `GetAllCollections`.
…ted via `usdGenSchema`).
@robpieke , AFAICT, Pixar has three internal uses of GetAllCollections() that we'll be on the hook to update, but otherwise the HUSD is the only other place I see it in use. And thanks for updating UsdPhysics - I forgot that has multi-apply schemas! |
@spiffmon Yeah, we have about ten usages split between C++ and Python that we'll swap over. |
Filed as internal issue #USD-7221 |
Just checking to make sure this isn't waiting on me for anything :) |
Hi @robpieke , no it's not. We have a backlog of internal and external issues/PR's we're working our way through, and just haven't even gotten to this one yet. |
could lead to invalid memory access. (Internal change: 2228809)
(Internal change: 2230317) (Internal change: 2230746)
Fixes PixarAnimationStudios#1901 (Internal change: 2237347)
(Internal change: 2237514)
Hi @robpieke |
Hi @crevilla ... sorry it took so long to return to this, but I've taken a stab at centralising the logic as requested. |
Adding `GetAll` method to the `codegenTemplates` for multiple-apply schemas (Internal change: 2246433) (Internal change: 2246516)
This PR was just merged into the dev branch, not sure why this PR didn't auto close. Closing this out. |
Description of Change(s)
Adding
GetAll
method to thecodegenTemplates
for multiple-apply schemas, both for C++ and Python.This should enable a workflow such as:
This has been tested by rerunning
usdGenSchema
in the USD codebase and comparing the results ofUsdCollectionAPI.GetAll(prim)
toUsdCollectionAPI.GetAllCollections(prim)
and verifying the entries in the resulting lists are the same.Fixes Issue(s)
#1772
Note
I might not yet be covered by a CLA, but that should be addressed shortly :)