Skip to content

Commit

Permalink
NodeMenu/NodeEditor : Scope a valid context for evaling user defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldresser-ie committed Jan 3, 2024
1 parent 1c9c3e3 commit edb395b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Fixes
- Stopped failed jobs jumping to the end of the Local Jobs UI.
- Fixed message log update.
- Fixed `Job.statistics()` errors on Windows, ensuring that a `pid` is always returned when available.
- NodeMenu/NodeEditor : `userDefault` metadata is now evaluated in the script context, so it can depend on script variables.


API
---
Expand Down
3 changes: 2 additions & 1 deletion python/GafferUI/NodeEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ def applyDefaults( graphComponent ) :
node = self.nodeUI().node()
with Gaffer.UndoScope( node.ancestor( Gaffer.ScriptNode ) ) :
applyDefaults( node )
Gaffer.NodeAlgo.applyUserDefaults( node )
with node.ancestor( Gaffer.ScriptNode ).context():
Gaffer.NodeAlgo.applyUserDefaults( node )

def __applyReadOnly( self, readOnly ) :

Expand Down
3 changes: 2 additions & 1 deletion python/GafferUI/NodeMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def f( menu ) :
if node is None :
return

Gaffer.NodeAlgo.applyUserDefaults( node )
with script.context():
Gaffer.NodeAlgo.applyUserDefaults( node )

for plugName, plugValue in plugValues.items() :
node.descendant( plugName ).setValue( plugValue )
Expand Down

0 comments on commit edb395b

Please sign in to comment.