Skip to content

Commit

Permalink
HYDRA-600 : more modifications from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Nov 30, 2023
1 parent eb760fd commit d1b79a3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit d1b79a3

Please sign in to comment.