diff --git a/python/GafferUI/PlugValueWidget.py b/python/GafferUI/PlugValueWidget.py index d8e58c4a2a7..880370fc291 100644 --- a/python/GafferUI/PlugValueWidget.py +++ b/python/GafferUI/PlugValueWidget.py @@ -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 ) :