-
Notifications
You must be signed in to change notification settings - Fork 202
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
List all registered Prim Types for Creation #1350
Conversation
@dgovil FYI. We will make a design review for this PR first before starting any code review. |
Hi @dgovil, Thanks for this contribution. I like your idea of grouping them by schema. We already do this in the Attribute Editor. I made a quick mockup of how this can look. I categorized them by non-concrete schema in order of inheritance with Def at the top. I also took out the Registered submenu altogether. Is it possible for you to organize them this way? Going forward on our end we can add the icons, prettify the names, and maybe group the non-concrete schemas with submenus. Great MVP of the feature, I agree. What do you think? Thanks, |
@womanyoyoyo-adsk Thanks. I'll see if it's possible to sort it that way. I had a couple questions before I start so I can set things up accordingly.
|
Also, can you change 'Registered' to 'All Registered'? |
… UFE>Add Prim menu
676e207
to
ce1c44b
Compare
@womanyoyoyo-adsk Renamed the sub menu (screenshot at the bottom). If you did want them grouped, would you like the inheritance based grouping from your mockup further up, or would you prefer they be grouped by the Schema plugin they belong to like in the text block below?
Some thoughts (though of course I'd defer to your judgement)
Happy to look into implementing any of them |
Hey @dgovil, I'm glad you brought up these points and questions. I mocked up some solutions to see what would be best of the user. Now that I think I have the final design I can address your points. See mockup below. I didn't know if I wanted grouping because I wasn't sure. Now that I've grouped them by schema plugin, the grouping makes sense and is user-friendly. I tried grouping them by inheritance but I've learned that it wasn't logical (is Cube in Geometric Prim or Imageable? Cube is in both) and not user-friendly. As for grouping by schema plugin, I'm very glad you brought it up. I think it's the right way to go. |
That looks good to me. I'll get started on putting this together. I don't believe the schema plugins actually store their nice names anywhere unfortunately. Though I'll check with Pixar if there's a way to do so. I can however create a mapping in the code so it maps from usdGeom -> Geometry etc... The upside there is that it's controllable , the downside is that any new schemas would come in under the schemas actual name till that list is updated. However I imagine, studios that add their own schemas could modify that list if need be internally to give their own schemas a nice name. |
Okay. I think nice names would benefit artists. Studios being able to add a schema nice name for their artists seems like a good addition. Thanks @dgovil! |
Okay, the latest version has the following setup based on the default plugin types to match your mockup. I do not have the Arnold schemas available here so I am unware of their plugin name to create the group. For code reviewers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Great job. Just a couple of minor things and one possible hickup with USD version.
@seando-adsk Thanks for the feedback. 555ebf0 should address all of them I hope. |
Thanks for fixing everything. I just have two new minor comments. |
555ebf0
to
1c1ea18
Compare
@seando-adsk thanks for catching those. I fixed those up. I've wrapped all my additions in the version checks so it should hopefully not cause any unused warnings now, and fixed up the namespacing. |
1c1ea18
to
f984375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Looks good.
@dgovil I've started the preflight build for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgovil Your change is failing with older versions of USD (our minimum supported version is 20.02). Here is a compilation error we are getting with USD 20.08
\maya-usd\lib\mayaUsd\ufe\UsdContextOps.cpp(473): error C2352: 'pxrInternal_v0_20__pxrReserved__::UsdSchemaRegistry::IsConcrete': illegal call of non-static member function
include\pxr/usd/usd/schemaRegistry.h(125): note: see declaration of 'pxrInternal_v0_20__pxrReserved__::UsdSchemaRegistry::IsConcrete'
@kxl-adsk Ah I see what the issue is. The USD api flip flopped between being static and not. I've adjusted the code to use a non static call, so it should now work with 20.08 as well. |
@dgovil So does that mean we can remove the if PXR_VERSION checks as our lowest supported version is v20.02 which has the method you need? |
@seando-adsk sorry i should have clarified that this was for |
@dgovil Ah right that makes sense. Thanks. FYI, Krystian re-started the preflight. |
In 0.25.0 Arnold types still show as I wonder if we should still add a (hardcoded?) mapping from Also, would it make sense to maybe for those that we do not have a nice name mapping for to strip off the first three characters if they are For what it's worth - here's a snippet doing similar logic as this PR but via the Python API for anyone who likes testing that way. |
For this context menu the schema nice names are contained in a hard-coded list in the .cpp here: https://github.com/Autodesk/maya-usd/blob/dev/lib/usdUfe/ufe/UsdContextOps.cpp#L698 and https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/ufe/MayaUsdContextOps.cpp#L816 Sean |
This PR adds the ability to list and create all registered concrete prim types for creation in the UFE > Add Prim menu.
Concrete Prim types are listed dynamically under a
Registered
sub-menu, allowing for listing of new types if they're loaded by USD plugins at a later point.I currently list them as a flat, sorted list. However I could group them by schema name if that is preferred, however I was unsure which would be more intuitive. I figure that this could be a mvp of the feature, and then could be refined as needed. I also do no filtering outside of listing only concrete types. For example, it may be desirable to filter the AL prim types, but I did not want to prematurely add filtering logic.
The motivation for this PR is that various teams we've spoken to have hit the issue of trying to populate a USD stage with a mix of vanilla and custom schema prim types. The base selection of prim types wasn't adequate in this situation, even though the dynamic AE templates provided for the USD prim types was sufficient to work with them.