Skip to content

Commit

Permalink
Minor improvement after the code review
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasovi committed Oct 12, 2022
1 parent bc0802c commit e7c3aec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/mayaUsd/fileio/primUpdaterContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class UsdMayaPrimUpdaterContext
MAYAUSD_CORE_PUBLIC
MDagPath MapSdfPathToDagPath(const SdfPath& sdfPath) const;

mutable MayaUsd::ufe::ReplicateExtrasFromUSD _pullExtras;
mutable MayaUsd::ufe::ReplicateExtrasToUSD _pushExtras;
const MayaUsd::ufe::ReplicateExtrasFromUSD _pullExtras;
const MayaUsd::ufe::ReplicateExtrasToUSD _pushExtras;

private:
const UsdTimeCode& _timeCode;
Expand Down
8 changes: 4 additions & 4 deletions lib/mayaUsd/ufe/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ std::vector<std::string> splitString(const std::string& str, const std::string&
return split;
}

void ReplicateExtrasFromUSD::initRecursive(Ufe::SceneItem::Ptr ufeItem)
void ReplicateExtrasFromUSD::initRecursive(Ufe::SceneItem::Ptr ufeItem) const
{
auto node = Ufe::Hierarchy::hierarchy(ufeItem);
if (!node) {
Expand Down Expand Up @@ -928,7 +928,7 @@ void ReplicateExtrasFromUSD::initRecursive(Ufe::SceneItem::Ptr ufeItem)
#endif
}

void ReplicateExtrasFromUSD::processItem(const Ufe::Path& path, const MObject& mayaObject)
void ReplicateExtrasFromUSD::processItem(const Ufe::Path& path, const MObject& mayaObject) const
{
#ifdef MAYA_HAS_DISPLAY_LAYER_API
// Replicate display layer membership
Expand All @@ -948,7 +948,7 @@ void ReplicateExtrasFromUSD::processItem(const Ufe::Path& path, const MObject& m
#endif
}

void ReplicateExtrasToUSD::processItem(const MDagPath& dagPath, const SdfPath& usdPath)
void ReplicateExtrasToUSD::processItem(const MDagPath& dagPath, const SdfPath& usdPath) const
{
#ifdef MAYA_HAS_DISPLAY_LAYER_API
// Populate display layer membership map
Expand All @@ -970,7 +970,7 @@ void ReplicateExtrasToUSD::processItem(const MDagPath& dagPath, const SdfPath& u
#endif
}

void ReplicateExtrasToUSD::finalize(const Ufe::Path& stagePath, const std::string* renameRoot)
void ReplicateExtrasToUSD::finalize(const Ufe::Path& stagePath, const std::string* renameRoot) const
{
#ifdef MAYA_HAS_DISPLAY_LAYER_API
// Replicate display layer membership
Expand Down
12 changes: 6 additions & 6 deletions lib/mayaUsd/ufe/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,26 +235,26 @@ class ReplicateExtrasFromUSD
{
public:
// Prepares the replication operation for the subtree starting with the given scene item
void initRecursive(Ufe::SceneItem::Ptr);
void initRecursive(Ufe::SceneItem::Ptr) const;
// Replicates extra features from the USD item defined by 'path' to the maya object
void processItem(const Ufe::Path& path, const MObject& mayaObject);
void processItem(const Ufe::Path& path, const MObject& mayaObject) const;

private:
std::unordered_map<Ufe::Path, MObject> _displayLayerMap;
mutable std::unordered_map<Ufe::Path, MObject> _displayLayerMap;
};

class ReplicateExtrasToUSD
{
public:
// Processes replication from a maya object defined by 'dagPath'
// to the usd item defined by 'usdPath'
void processItem(const MDagPath& dagPath, const PXR_NS::SdfPath& usdPath);
void processItem(const MDagPath& dagPath, const PXR_NS::SdfPath& usdPath) const;
// Finalizes the replication operation to the USD stage defined by 'stagePath'
// with a possibility to rename the usd root node name to 'renameRoot'
void finalize(const Ufe::Path& stagePath, const std::string* renameRoot = nullptr);
void finalize(const Ufe::Path& stagePath, const std::string* renameRoot = nullptr) const;

private:
std::map<PXR_NS::SdfPath, MObject> _primToLayerMap;
mutable std::map<PXR_NS::SdfPath, MObject> _primToLayerMap;
};

} // namespace ufe
Expand Down

0 comments on commit e7c3aec

Please sign in to comment.