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

„Disconnected Fvp::PathInterface in code base, replaced with path mapper #212

Closed

Conversation

ppt-adsk
Copy link
Collaborator

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.

@ppt-adsk ppt-adsk self-assigned this Nov 27, 2024
Copy link
Collaborator

@lanierd-adsk lanierd-adsk left a 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
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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. 

Copy link
Collaborator Author

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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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("
Copy link
Collaborator

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

Copy link
Collaborator Author

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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch!

@ppt-adsk ppt-adsk assigned ppt-adsk and unassigned ppt-adsk Nov 28, 2024
@ppt-adsk
Copy link
Collaborator Author

Needs merge with latest dev, rebasing.

@ppt-adsk ppt-adsk closed this Nov 29, 2024
@ppt-adsk ppt-adsk deleted the tremblp/HYDRA-1060/tech_debt_remove_path_interface_0 branch November 29, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants