Skip to content

Commit

Permalink
Merge pull request #5693 from johnhaddon/imageInspectorFix
Browse files Browse the repository at this point in the history
PlugValueWidget : Fix context used for plugs on `Editor.Settings`
  • Loading branch information
johnhaddon authored Mar 2, 2024
2 parents ef16af8 + f866c1e commit 277b0bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/GafferUI/PlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,14 @@ def __defaultContext( cls, graphComponent ) :
if view is not None :
return view.getContext()

# Special case for plugs that form the settings for an Editor.

settings = graphComponent if isinstance( graphComponent, GafferUI.Editor.Settings ) else graphComponent.ancestor( GafferUI.Editor.Settings )
if settings is not None :
scriptNode = settings["__scriptNode"].source().ancestor( Gaffer.ScriptNode )
if scriptNode is not None :
return scriptNode.context()

return cls.__fallbackContext

def __buttonPress( self, widget, event, buttonMask ) :
Expand Down

0 comments on commit 277b0bf

Please sign in to comment.