-
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
add a way for pxrUsdProxyShape to disable subpath selection with the VP2.0 render delegate #315
add a way for pxrUsdProxyShape to disable subpath selection with the VP2.0 render delegate #315
Conversation
I think it makes sense...but I'm getting concerned where it will bring us if we continue to add virtual methods for things like this on the base class. Maybe it's a good time to introduce flags? |
Famous last words, I know, but I'm hoping that this is a fairly temporary thing, and that we're not going to have a huge proliferation of new virtuals we'll want to add. Or at least not for the purposes of the Pixar proxy shape anyway. Our current aim is to get feature (and performance) parity when using I'm not sure what you have in mind for flags, but for this particular issue it can't really be a build-time or env var thing. We'll want to be using |
eec231c
to
13bfe8b
Compare
@mattyjams I am not sure whether I understand what you mean by "temporary thing". Does it make sense to add a TODO to remove this code at some point? The other suggestion is, can you rename the new method to enableUfeSelection(), which is the term we usually use. |
I think what @kxl-adsk meant by flags is to introduce a flag in the ProxyRenderDelegate that can be checked in getInstancedSelectionPath(). And it makes sense to me. |
Actually, I was trying to find this pattern we use internally but didn't yet have time. What I had in mind is a simple bitfield which you can set during the construction of an object (either from a base class or derived). In this bitfield, you can encode information about different characteristics of your object, like disable_ufe_selection. This will remove the need for a virtual method. After writing this, I convinced myself that it's too early to do this. So ignore me. |
But the performance concern still makes sense. There seems to be no need to call into this virtual method for every selection hit. Thus I would suggest to query the flag here and use it in selection interpretation. |
Right, good point @HdC-adsk ! |
13bfe8b
to
5c8528e
Compare
Thanks @kxl-adsk and @HdC-adsk for the great feedback here. I just pushed a new version of this in commit 5c8528e1c38ec3771de42f1054990919a06fa6f6. I kept the virtual function, but I renamed it to And in terms of the temporary-ness of this, I think it is temporary insofar as the |
@mattyjams Makes sense. Thanks. |
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.
I can't convince myself that we want to go this way. There is nothing in the interface that prevents people from attempting implementation of runtime switch between UFE selection and proxy selection via this new virtual method. And then they will get surprised by the cache in VP2RenderDelegate.
The solution I would suggest: have derived class to configure this at the construction of base proxy shape (extra argument in the constructor?).
5c8528e
to
a879ac2
Compare
@kxl-adsk Ok, I just posted a new version of this in commit a879ac268c63d1e84b761db4e29c0583e56f537c that removes the virtual entirely and adds a parameter to the You can compare this to the previous iteration in commit 5c8528e1c38ec3771de42f1054990919a06fa6f6. |
@@ -196,6 +196,10 @@ ProxyRenderDelegate::ProxyRenderDelegate(const MObject& obj) | |||
|
|||
const MFnDependencyNode fnDepNode(obj); | |||
_proxyShape = static_cast<MayaUsdProxyShapeBase*>(fnDepNode.userNode()); | |||
|
|||
_isUfeSelectionEnabled = (_proxyShape != nullptr) ? |
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.
@mattyjams What's the remaining value of this member given that we have inline access to it on proxy shape?
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.
Good point. None really, I suppose. We can just rely on the compiler to inline away the function call.
Rebased and updated to remove this member variable in commit dab4b46.
…VP2.0 render delegate Most of the usage of pxrUsdProxyShape nodes is when they are brought in by activating the "Collapsed" representation of pxrUsdReferenceAssembly nodes. In that case, they are intended to be read-only proxies, and any edits to prims within the hierarchy should be represented as assembly edits. Other workflows that involve more direct USD authoring should favor one of the other proxy shape node types. This change ensures that the selection behavior of pxrUsdProxyShape nodes is consistent between Pixar's batch renderer and the VP2.0 render delegate.
a879ac2
to
dab4b46
Compare
I wanted to float this change as a possible solution to #262. As we're testing the VP2.0 render delegate internally at Pixar, we're trying to ensure that the selection behavior of our proxy shapes is consistent when switching back and forth with our current batch renderer viewport integration. Our pxrUsdProxyShape node (and pxrUsdReferenceAssembly nodes which are the primary way our proxies are introduced) aren't really designed to support subpatch selection, so workflows aiming to expose more of the guts of a USD stage should favor one of the other proxy shape types.