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

AnnotationsGadget binding : Fix GIL management bug #5951

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Fixes
- Cycles : Fixed bug preventing a background light from being added to a light group.
- LightEditor : Fixed regression (introduced in 1.4.8.0) causing the mute and solo icons to not show up for groups.
- Windows : Fixed conflicts with other software installations on `PATH`. The `PXR_USD_WINDOWS_DLL_PATH` environment variable is now set to an empty string if it is not already set, preventing USD from adding all entries from `PATH` to Python's DLL search paths.
- AnnotationsGadget : Fixed potential hang in `annotationText()` Python binding.

API
---
Expand Down
8 changes: 7 additions & 1 deletion src/GafferUIModule/GraphGadgetBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ tuple connectionAt( AuxiliaryConnectionsGadget &g, IECore::LineSegment3f positio
return make_tuple( nodeGadgets.first, nodeGadgets.second );
}

const std::string &annotationTextWrapper( const AnnotationsGadget &gadget, const Gaffer::Node &node, IECore::InternedString annotation )
{
IECorePython::ScopedGILRelease gilRelease;
return gadget.annotationText( &node, annotation );
}

bool connectNode( const GraphLayout &layout, GraphGadget &graph, Gaffer::Node &node, Gaffer::Set &potentialInputs )
{
IECorePython::ScopedGILRelease gilRelease;
Expand Down Expand Up @@ -298,7 +304,7 @@ void GafferUIModule::bindGraphGadget()
.def_readonly( "untemplatedAnnotations", &AnnotationsGadget::untemplatedAnnotations )
.def( "setVisibleAnnotations", &AnnotationsGadget::setVisibleAnnotations )
.def( "getVisibleAnnotations", &AnnotationsGadget::getVisibleAnnotations, return_value_policy<copy_const_reference>() )
.def( "annotationText", &AnnotationsGadget::annotationText, return_value_policy<copy_const_reference>(), ( arg( "node" ), arg( "annotation" ) = "user" ) )
.def( "annotationText", &annotationTextWrapper, return_value_policy<copy_const_reference>(), ( arg( "node" ), arg( "annotation" ) = "user" ) )
;

IECorePython::RunTimeTypedClass<GraphLayout>()
Expand Down
Loading