Skip to content
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

HYDRA-324: update proxy shape scene index to support interpret pick result #3028

Conversation

perrauo-adsk
Copy link
Contributor

@perrauo-adsk perrauo-adsk commented Apr 18, 2023

  • Update proxy shape scene index to support interpret pick result being developed internally.

return TfCreateRefPtr(new MayaUsdProxyShapeSceneIndex(
// Flatten transforms, visibility, purpose, model, and material
// bindings over hierarchies.
HdFlatteningSceneIndex::New(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concerned about this. The New() method is no longer a constructor of just a MayaUsdProxyShapeSceneIndex: it always has a HdFlatteningSceneIndex that comes along with it, and there is no way of doing otherwise. Separation of concerns should apply here.

@perrauo-adsk perrauo-adsk marked this pull request as draft April 19, 2023 15:32
Comment on lines 170 to 171
// Disable UfePath instances, passing in -1 to indicate this
MayaUsd::ufe::usdPathToUfePathSegment(path, -1) });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All instances is the default, please remove the -1 argument (especially if you're not using the proper defined constant).

MayaUsdProxyShapeBase* proxyShape)
: ParentClass(inputSceneIndex)
, _usdImagingStageSceneIndex(inputSceneIndex)
, _usdImagingStageSceneIndex(usdImagingStageSceneIndex)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this is passed in as a argument to support a temporary workaround, and init on first use of _usdImagingStageSceneIndex. However, why is it the responsibility of the MayaUsdProxyShapeSceneIndex to set the stage in Populate() of something that is arguably external to it? Can't we set the stage onto the _usdImagingStageSceneIndex upon its construction? A proxy shape node's stage won't change.

Copy link
Contributor Author

@perrauo-adsk perrauo-adsk Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the MayaUsdProxyShapeSceneIndex also listens for changes:

void MayaUsdProxyShapeSceneIndex::ObjectsChanged(
    const MayaUsdProxyStageObjectsChangedNotice& notice)
{
    _usdImagingStageSceneIndex->ApplyPendingUpdates();
}

Copy link
Contributor Author

@perrauo-adsk perrauo-adsk Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please note, that changing the inner working of MayaUsdProxySHapeSceneIndex is out of scope for these changes. The intent is simply to change data source involve, and implementing the interpretDataSource. Changing the ::New is already a bit of a stretch and came as a result of needing to expose the proxyshapesceneindex as top level scene index.

@@ -25,12 +25,19 @@
#include <mayaUsd/nodes/proxyShapeBase.h>

#include <pxr/base/tf/refPtr.h>
#include <pxr/imaging/hd/flatteningSceneIndex.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could forward declare HdFlatteningSceneIndex.

#include <pxr/imaging/hd/renderIndex.h>
#include <pxr/imaging/hd/sceneIndexPlugin.h>
#include <pxr/imaging/hd/sceneIndexPluginRegistry.h>
#include <pxr/usd/sdf/path.h>
#include <pxr/usdImaging/usdImaging/stageSceneIndex.h>

#if WANT_UFE_BUILD
#include <ufe/path.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be forward declared.

Comment on lines 37 to 38
#include <ufe/sceneItem.h>
#include <ufe/selectionNotification.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused.

@perrauo-adsk perrauo-adsk marked this pull request as ready for review April 19, 2023 20:14
…uo/HYDRA-324/revise-proxy-shape-scene-index-to-match-new-scene-index-api-2
@perrauo-adsk perrauo-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 25, 2023
@Autodesk Autodesk deleted a comment from perrauo-adsk Apr 25, 2023
@Autodesk Autodesk deleted a comment from perrauo-adsk Apr 25, 2023
@seando-adsk seando-adsk added the adsk Related to Autodesk plugin label Apr 25, 2023
@seando-adsk seando-adsk merged commit 120917a into dev Apr 25, 2023
@seando-adsk seando-adsk deleted the perrauo/HYDRA-324/revise-proxy-shape-scene-index-to-match-new-scene-index-api-2 branch April 25, 2023 14:42
@perrauo-adsk perrauo-adsk restored the perrauo/HYDRA-324/revise-proxy-shape-scene-index-to-match-new-scene-index-api-2 branch April 25, 2023 19:47
@seando-adsk seando-adsk deleted the perrauo/HYDRA-324/revise-proxy-shape-scene-index-to-match-new-scene-index-api-2 branch October 23, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants