From d1b79a3e97af06f9c01d7b7c4d0d8f959216d6fb Mon Sep 17 00:00:00 2001 From: David Lanier Date: Thu, 30 Nov 2023 10:38:14 +0100 Subject: [PATCH] HYDRA-600 : more modifications from code review. --- ...ayaHydraMayaDataProducerSceneIndexData.cpp | 4 ++-- .../mayaHydraMayaDataProducerSceneIndexData.h | 21 +++++++++++-------- .../mayaHydraMayaFilteringSceneIndexData.cpp | 4 ++-- .../mayaHydraMayaFilteringSceneIndexData.h | 8 ++++--- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.cpp b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.cpp index 940af1d07b..44d84fadf0 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.cpp +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.cpp @@ -61,7 +61,7 @@ namespace //this is how we identify which object we need to deal with. PXR_NS::MayaDataProducerSceneIndexData* mayaDataProducerSceneIndexData = (PXR_NS::MayaDataProducerSceneIndexData*)data; const MObjectHandle objHandle(obj); - if(mayaDataProducerSceneIndexData && mayaDataProducerSceneIndexData->_mObjHandle.isValid() && objHandle.hashCode() == mayaDataProducerSceneIndexData->_mObjHandle.hashCode()){ + if(mayaDataProducerSceneIndexData && mayaDataProducerSceneIndexData->getObjHandle().isValid() && objHandle.hashCode() == mayaDataProducerSceneIndexData->getObjHandle().hashCode()){ mayaDataProducerSceneIndexData->UpdateVisibilityFromDCCNode(true); } } @@ -73,7 +73,7 @@ namespace //this is how we identify which object we need to deal with. PXR_NS::MayaDataProducerSceneIndexData* mayaDataProducerSceneIndexData = (PXR_NS::MayaDataProducerSceneIndexData*)data; const MObjectHandle objHandle(obj); - if(mayaDataProducerSceneIndexData && mayaDataProducerSceneIndexData->_mObjHandle.isValid() && objHandle.hashCode() == mayaDataProducerSceneIndexData->_mObjHandle.hashCode()){ + if(mayaDataProducerSceneIndexData && mayaDataProducerSceneIndexData->getObjHandle().isValid() && objHandle.hashCode() == mayaDataProducerSceneIndexData->getObjHandle().hashCode()){ mayaDataProducerSceneIndexData->UpdateVisibilityFromDCCNode(false); } } diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.h b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.h index 217fca5e5c..801ec927ed 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.h +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaDataProducerSceneIndexData.h @@ -45,6 +45,18 @@ TF_DECLARE_WEAK_AND_REF_PTRS(MayaDataProducerSceneIndexData);//Be able to use Re ///Destructor ~MayaDataProducerSceneIndexData() override; + /// Get the MObject handle + const MObjectHandle& getObjHandle()const {return _mObjHandle;} + + /// Provide the node name from maya + std::string GetDCCNodeName() const override; + + ///Update transform from maya node + void UpdateTransformFromMayaNode(); + +private: + MayaDataProducerSceneIndexData(const FVP_NS_DEF::DataProducerSceneIndexDataBase::CreationParameters& params); + //The following members are optional and used only when a dccNode was passed in the constructor of DataProducerSceneIndexDataBase /// Is the MObjectHandle of the maya node shape, it may be invalid if no maya node MObject pointer was passed. @@ -55,15 +67,6 @@ TF_DECLARE_WEAK_AND_REF_PTRS(MayaDataProducerSceneIndexData);//Be able to use Re MCallbackIdArray _nodeMessageCallbackIds; /// Are the callbacks Ids set in maya to handle delete and deletion undo/redo MCallbackIdArray _dGMessageCallbackIds; - - /// Provide the node name from maya - std::string GetDCCNodeName() const override; - - ///Update transform from maya node - void UpdateTransformFromMayaNode(); - -private: - MayaDataProducerSceneIndexData(const FVP_NS_DEF::DataProducerSceneIndexDataBase::CreationParameters& params); }; PXR_NAMESPACE_CLOSE_SCOPE diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.cpp b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.cpp index db72519cee..6658494e85 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.cpp +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.cpp @@ -53,7 +53,7 @@ namespace //this is how we identify which object we need to deal with. PXR_NS::MayaFilteringSceneIndexData* mayaFilteringSceneIndexData = (PXR_NS::MayaFilteringSceneIndexData*)data; const MObjectHandle objHandle(obj); - if(mayaFilteringSceneIndexData&& mayaFilteringSceneIndexData->_mObjHandle.isValid() && objHandle.hashCode() == mayaFilteringSceneIndexData->_mObjHandle.hashCode()){ + if(mayaFilteringSceneIndexData&& mayaFilteringSceneIndexData->getObjHandle().isValid() && objHandle.hashCode() == mayaFilteringSceneIndexData->getObjHandle().hashCode()){ mayaFilteringSceneIndexData->updateVisibilityFromDCCNode(true); } } @@ -65,7 +65,7 @@ namespace //this is how we identify which object we need to deal with. PXR_NS::MayaFilteringSceneIndexData* mayaFilteringSceneIndexData = (PXR_NS::MayaFilteringSceneIndexData*)data; const MObjectHandle objHandle(obj); - if(mayaFilteringSceneIndexData&& mayaFilteringSceneIndexData->_mObjHandle.isValid() && objHandle.hashCode() == mayaFilteringSceneIndexData->_mObjHandle.hashCode()){ + if(mayaFilteringSceneIndexData&& mayaFilteringSceneIndexData->getObjHandle().isValid() && objHandle.hashCode() == mayaFilteringSceneIndexData->getObjHandle().hashCode()){ mayaFilteringSceneIndexData->updateVisibilityFromDCCNode(false); } } diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.h b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.h index 7de2ed571c..435aecfb21 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.h +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraMayaFilteringSceneIndexData.h @@ -42,7 +42,12 @@ TF_DECLARE_REF_PTRS(MayaFilteringSceneIndexData);//Be able to use Ref counting p } ~MayaFilteringSceneIndexData() override; + + const MObjectHandle& getObjHandle()const {return _mObjHandle;} +private: + MayaFilteringSceneIndexData(const std::shared_ptr<::FVP_NS_DEF::FilteringSceneIndexClient>& client); + ///The following members are optional and used only when a dccNode was passed in the FilteringSceneIndexClient /// Is the MObjectHandle of the maya node shape, it may be invalid if no maya node MObject pointer was passed in the FilteringSceneIndexClient. @@ -53,9 +58,6 @@ TF_DECLARE_REF_PTRS(MayaFilteringSceneIndexData);//Be able to use Ref counting p /// Are the callbacks Ids set in maya to handle delete and deletion undo/redo MCallbackIdArray _dGMessageCallbackIds; - -private: - MayaFilteringSceneIndexData(const std::shared_ptr<::FVP_NS_DEF::FilteringSceneIndexClient>& client); }; PXR_NAMESPACE_CLOSE_SCOPE