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

SceneAlgo : Add findAll() method #5452

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

johnhaddon
Copy link
Member

This does a parallel traversal of the scene, returning a PathMatcher containing all paths for which a predicate returns true.

@johnhaddon johnhaddon self-assigned this Aug 31, 2023
I did spend a while thinking about the possibility of promoting the existing private `findAttributes()` function
from SceneAlgo.cpp instead. But that's a fairly esoteric thing that runs a predicate functor on the full attributes, and for `findAllWithAttribute()` my goal was to provide something simpler which could be used from Python without the overhead of a Python functor.
@johnhaddon
Copy link
Member Author

Pushed one more commit to add a findAllWithAttribute() method.

Copy link
Collaborator

@ericmehl ericmehl left a comment

Choose a reason for hiding this comment

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

Very nice! I can see this being useful for a variety of things.

Code here looks good to me.

I get the Windows build working locally if I change

GAFFER_NODE_DEFINE_TYPE( DeleteObject );

to
GAFFER_NODE_DEFINE_TYPE( GafferScene::DeleteObject );

SceneAlgo.inl added an include of tbb/enumerable_thread_specific.h in this PR. On Windows, that includes the Windows api, which I believe is a C api. So, no namespaces for us. DeleteObject is a function in wingdi.h (the Windows graphics API, gah!) so we need to be specific here.

@johnhaddon
Copy link
Member Author

Thanks for tracking down that Windows problem @ericmehl - I've added your fix in ec13814.

@ericmehl ericmehl merged commit e019569 into GafferHQ:1.3_maintenance Sep 11, 2023
4 checks passed
@johnhaddon johnhaddon deleted the sceneAlgoFind branch September 27, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants