-
Notifications
You must be signed in to change notification settings - Fork 5
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
Disconnected Fvp::PathInterface in code base, replaced with path mapper #212
Disconnected Fvp::PathInterface in code base, replaced with path mapper #212
Conversation
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.
Thanks for doing this huge change.
@@ -71,7 +71,11 @@ class BlockPrimRemovalPropagationSceneIndex : public PXR_NS::HdSingleInputFilter | |||
//from PathInterface | |||
FVP_API | |||
PrimSelections UfePathToPrimSelections(const Ufe::Path& appPath) const override{ | |||
return _pathInterface->UfePathToPrimSelections(appPath); | |||
PXR_NAMESPACE_USING_DIRECTIVE |
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.
Why are you not removing it directly ?
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.
The work has been split into 2 tasks, one to disconnect (HYDRA-1313) and one to fully remove (HYDRA-1314).
} | ||
} | ||
|
||
return primSelections; | ||
} | ||
|
||
bool PathMapperRegistry::HasMapper(const Ufe::Path& path) const | ||
{ | ||
return _GetMapper(path) != 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.
I would add a :
if (path.empty()) {
return nullptr;
}
As if path is empty it will crash in _GetMapper with TF_AXIOM.
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.
Great catch!
|
||
private: | ||
|
||
//! Calls _GetMapper(). If no path mapper is found, returns the | ||
//! fallback path mapper. |
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 think it returns nullptr instead of the fallback path mapper now.
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.
No, it does return the fallback path mapper, see fvpPathMapperRegistry.cpp:125.
@@ -475,6 +477,8 @@ class MayaPathMapper : public Fvp::PathMapper | |||
|
|||
Fvp::PrimSelections | |||
UfePathToPrimSelections(const Ufe::Path& appPath) const override { | |||
std::cout << "PPT: in MayaPathMapper::UfePathToPrimSelections(" |
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.
This is debugging info that should be removed
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 catch!
@@ -528,4 +528,9 @@ bool visibility(const HdSceneIndexBasePtr& sceneIndex, const SdfPath& primPath) | |||
return (handle ? handle->GetTypedValue(0.0f) : true); | |||
} | |||
|
|||
bool contains(const PXR_NS::SdfPathVector& paths, const PXR_NS::SdfPath& path) | |||
{ | |||
return std::count(paths.begin(), paths.end(), path) > 0; |
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.
Why not using :
std::find(paths.begin(), paths.end(), path) != paths.end())
As count will not stop at the first occurence since std::find will, so I expect it to be faster.
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 catch!
Needs merge with latest dev, rebasing. |
Fvp::PathInterface was clunky to maintain and required new scene indices to adapt to it. The path mapper framework is much less invasive. This pull request disconnects the PathInterface, such that it is no longer used. Removal from the code base will be done in a later pull request.