-
Notifications
You must be signed in to change notification settings - Fork 203
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
Implement viewport selection highlighting of point instances and point instances pick modes #1119
Implement viewport selection highlighting of point instances and point instances pick modes #1119
Conversation
@mattyjams Can you provide a video to demo your new proposed additions? I would like to loop in the design here before starting the code review process. |
@kxl-adsk: I'm not sure a video would demonstrate it all that clearly really. Like selection kind, the pick mode is only adjustable using an The scene is a single The default behavior when the Pick result in Selected UFE path:
Pick result in Selected UFE path:
Pick result in Selected UFE path:
Pick result in Selected UFE path:
Again, the goal with these pick modes was to mirror their counterparts in |
FWIW, my non-product design, single developer opinion is that this picking behavior seems reasonable to me. Of course, the people actually responsible for this kind of thing on our end will be weighing in with a real opinion :) Not sure about the use of "Kind" to label the pick mode where the prototype geometry is picked, but if that's the USD terminology for it then that's fine. |
Thanks @ppt-adsk! And I hear you about the |
9a01aa5
to
b8849da
Compare
Thank you @mattyjams, I started the review process. We also try to clean-up optionVars and make them use a consistent |
@mattyjams Thank you Matt. From first glance, USDView only has a single control on the selection behavior, its |
@kxl-adsk: Sounds good. I can move and rename the optionVars. Let me take care of that in a rebase before you all get too deep into the review though, since that will cascade across a bunch of the commits here. |
Please ignore this question. I just received the offline email thread which exactly answers my question. |
…tionKind" The new token is declared publicly in mayaUsd/base/tokens.h where all optionVar name tokens should be located.
…it in their values
…apeSelectionPerformance test
… render delegate This ensures that individual point instances are selected in Hydra when the UsdSceneItem represents a point instance.
…olving viewport picking of point instances This enum represents three options of behaviors to employ when resolving viewport picking of point instances: PointInstancer: The PointInstancer prim that generated the point instance is picked. If multiple nested PointInstancers are involved, the top-level PointInstancer is the one picked. If a selection kind is specified, the traversal up the hierarchy looking for a kind match will begin at that PointInstancer. Instances: The specific point instance is picked. In this mode, any setting for selection kind is ignored. Prototypes: The prototype being instanced by the point instance is picked. If a selection kind is specified, the traversal up the hierarchy looking for a kind match will begin at the prototype prim. A member variable of the new enum type was added to ProxyRenderDelegate and will be set and used in subsequent commits, along with the implementations of the pick modes.
… pick resolution method based on the "mayaUsd_PointInstancesPickMode" optionVar The default UsdPointInstancesPickMode if the optionVar is unspecified or invalid is "PointInstancer". Note that this is a departure from the current behavior when a point instance is selected, which is effectively "Prototypes".
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.
Some general notes:
-
Did you test the viewport selection performance for massive objects and instances? Does it have a major impact to non-point-instancer assets?
-
A question for @kxl-adsk How do we manage image data in the repo? Do we encourage use of
git lfs
?
@HdC-adsk There used to be some limitations around Git Large File Storage and the build infrastructure that we are using. As long as images are small, we should be ok without |
This avoids repeatedly converting the TfToken to an MString, and also cleans up some unfortunate formatting choices made by clang-format.
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 tests!
…evelPath is empty
At least in my testing so far, I haven't seen the pick mode handling incurring significant overhead and impacting performance, though I suppose it may depend on your definition of "massive". Do you have an asset handy that I should test with? I would guess that in the case of single selections, the overhead of any particular point instances pick mode would likely be dwarfed by the rest of the selection machinery. For large marquee selections that result in many scene items getting selected, it could possibly add up though? I'm happy to take a performance optimization pass on this later if we see this becoming a significant bottleneck. |
…USD 20.05 Point instance selection depends on getting the HdInstancerContext from Hydra which was only exposed in USD_IMAGING_API_VERSION version 14. As a result, we can only support point instance selection for core USD 20.08, not 20.05 as previously thought.
…legate tests This was accidentally introduced by Autodesk#1119 since that work spanned the transition from using VP2_RENDER_DELEGATE_PROXY to MAYAUSD_DISABLE_VP2_RENDER_DELEGATE.
…breakage_with_USD_2005 fix build breakage from PR #1119 due to missing Hydra API in USD 20.05
Building on #1027, this PR adds support for selection highlighting of individual point instances when using the Viewport 2.0 render delegate. It also implements all of the "Prims", "Models", "Instances", and "Prototypes" pick modes that are available in the "View -> Pick mode" menu in
usdview
. A "Kind" pick mode unique to the render delegate represents the existing behavior and is the default. Similar to selection kind, the pick mode can be changed using theUsdPickMode
optionVar
.