Skip to content

Commit

Permalink
Merge branch '1.4_maintenance' into 1.5_maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Dec 13, 2024
2 parents 1dc7d84 + 97c574b commit 1c65f63
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,23 @@ Build
- Zstandard : Added version 1.5.0.
- Windows : Updated compiler to Visual Studio 2022 / MSVC 17.8 / Runtime library 14.3.

1.4.15.x (relative to 1.4.15.2)
1.4.15.x (relative to 1.4.15.3)
========



1.4.15.3 (relative to 1.4.15.2)
========

Fixes
-----

- ArrayPlug : Fixed loading of promoted plugs saved from Gaffer 1.5+.
- GraphEditor : Fixed errors when dragging an unknown file type into the GraphEditor.
- Widget : Fixed `event.sourceWidget` for DragDropEvents generated from a Qt native drag within the same Gaffer process. This will now reference the `GafferUI.Widget` that the Qt source widget belongs to, if any.
- Catalogue : Fixed bug which "stole" drags that crossed the image listing but which were destined elsewhere, for instance a drag from the HierarchyView to a PathFilter in the GraphEditor.
- GadgetWidget : Fixed signal handling bug in `setViewportGadget()`. This could cause the widget to attempt to redraw unnecessarily when the _old_ viewport requested a redraw.
- RandomChoice : Fixed errors right-clicking on non-value plugs in the NodeEditor.

1.4.15.2 (relative to 1.4.15.1)
========
Expand Down
13 changes: 13 additions & 0 deletions python/GafferSceneTest/ParentTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,19 @@ def testLoadPromotedChildrenPlug( self ) :
s2["b2"]["p"]["children"].getInput().fullName()
)

def testLoadPromotedChildrenPlugFrom1_5( self ) :

script = Gaffer.ScriptNode()
script["fileName"].setValue( pathlib.Path( __file__ ).parent / "scripts" / "promotedArrayPlug-1.5.1.0.gfr" )
script.load()

self.assertEqual( script["Box"]["children"][0].getInput(), script["Cube"]["out"] )
self.assertEqual( script["Box"]["Parent"]["children"].source(), script["Box"]["children"] )
self.assertEqual( script["Box"]["Parent"]["children"][0].source(), script["Cube"]["out"] )

self.assertSceneValid( script["Box"]["out"] )
self.assertEqual( script["Box"]["out"].childNames( "/" ), IECore.InternedStringVectorData( [ "sphere", "cube" ] ) )

def testSetPassThroughWhenNoParent( self ) :

sphere = GafferScene.Sphere()
Expand Down
76 changes: 76 additions & 0 deletions python/GafferSceneTest/scripts/promotedArrayPlug-1.5.1.0.gfr
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import Gaffer
import GafferImage
import GafferScene
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 5, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children = {}

parent["variables"].addChild( Gaffer.NameValuePlug( "image:catalogue:port", Gaffer.IntPlug( "value", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "imageCataloguePort", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
parent["variables"].addChild( Gaffer.NameValuePlug( "project:name", Gaffer.StringPlug( "value", defaultValue = 'default', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "projectName", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
parent["variables"].addChild( Gaffer.NameValuePlug( "project:rootDirectory", Gaffer.StringPlug( "value", defaultValue = '$HOME/gaffer/projects/${project:name}', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "projectRootDirectory", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, )
parent.addChild( __children["openColorIO"] )
__children["defaultFormat"] = GafferImage.FormatPlug( "defaultFormat", defaultValue = GafferImage.Format( 1920, 1080, 1.000 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, )
parent.addChild( __children["defaultFormat"] )
__children["Box"] = Gaffer.Box( "Box" )
parent.addChild( __children["Box"] )
__children["Box"].addChild( GafferScene.Parent( "Parent" ) )
__children["Box"]["Parent"]["children"].resize( 2 )
__children["Box"]["Parent"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( Gaffer.BoxIn( "BoxIn" ) )
__children["Box"]["BoxIn"].setup( Gaffer.ArrayPlug( "out", elementPrototype = GafferScene.ScenePlug( "child0", ), ) )
__children["Box"]["BoxIn"]["__in"].resize( 2 )
__children["Box"]["BoxIn"]["out"].resize( 2 )
__children["Box"]["BoxIn"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( Gaffer.ArrayPlug( "children", elementPrototype = GafferScene.ScenePlug( "child0", ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"]["children"].resize( 2 )
__children["Box"].addChild( GafferScene.Sphere( "Sphere" ) )
__children["Box"]["Sphere"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( Gaffer.BoxOut( "BoxOut" ) )
__children["Box"]["BoxOut"].setup( GafferScene.ScenePlug( "in", ) )
__children["Box"]["BoxOut"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( GafferScene.ScenePlug( "out", direction = Gaffer.Plug.Direction.Out, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Cube"] = GafferScene.Cube( "Cube" )
parent.addChild( __children["Cube"] )
__children["Cube"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
parent["variables"]["imageCataloguePort"]["value"].setValue( 39173 )
Gaffer.Metadata.registerValue( parent["variables"]["imageCataloguePort"], 'readOnly', True )
Gaffer.Metadata.registerValue( parent["variables"]["projectName"]["name"], 'readOnly', True )
Gaffer.Metadata.registerValue( parent["variables"]["projectRootDirectory"]["name"], 'readOnly', True )
__children["Box"]["Parent"]["in"].setInput( __children["Box"]["Sphere"]["out"] )
__children["Box"]["Parent"]["parent"].setValue( '/' )
__children["Box"]["Parent"]["children"].setInput( __children["Box"]["BoxIn"]["out"] )
Gaffer.Metadata.registerValue( __children["Box"]["Parent"]["children"], 'nodule:type', 'GafferUI::StandardNodule' )
__children["Box"]["Parent"]["__uiPosition"].setValue( imath.V2f( -9.90000057, 4.5 ) )
__children["Box"]["__uiPosition"].setValue( imath.V2f( -16.6000023, 1.09999955 ) )
__children["Box"]["BoxIn"]["name"].setValue( 'children' )
__children["Box"]["BoxIn"]["__in"].setInput( __children["Box"]["children"] )
Gaffer.Metadata.registerValue( __children["Box"]["BoxIn"]["__in"], 'nodule:type', 'GafferUI::CompoundNodule' )
Gaffer.Metadata.registerValue( __children["Box"]["BoxIn"]["__in"], 'description', 'The child hierarchies to be parented.' )
Gaffer.Metadata.registerValue( __children["Box"]["BoxIn"]["__in"], 'plugValueWidget:type', '' )
Gaffer.Metadata.registerValue( __children["Box"]["BoxIn"]["__in"], 'noduleLayout:spacing', 0.5 )
Gaffer.Metadata.registerValue( __children["Box"]["BoxIn"]["out"], 'nodule:type', 'GafferUI::StandardNodule' )
__children["Box"]["BoxIn"]["__uiPosition"].setValue( imath.V2f( -8.40068531, 12.8320312 ) )
Gaffer.Metadata.registerValue( __children["Box"]["children"], 'nodule:type', 'GafferUI::CompoundNodule' )
Gaffer.Metadata.registerValue( __children["Box"]["children"], 'description', 'The child hierarchies to be parented.' )
Gaffer.Metadata.registerValue( __children["Box"]["children"], 'plugValueWidget:type', '' )
Gaffer.Metadata.registerValue( __children["Box"]["children"], 'noduleLayout:spacing', 0.5 )
__children["Box"]["children"][0].setInput( __children["Cube"]["out"] )
__children["Box"]["Sphere"]["__uiPosition"].setValue( imath.V2f( -24.5000019, 11.3000002 ) )
__children["Box"]["BoxOut"]["in"].setInput( __children["Box"]["Parent"]["out"] )
Gaffer.Metadata.registerValue( __children["Box"]["BoxOut"]["__out"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["Box"]["BoxOut"]["__out"], 'nodule:type', 'GafferUI::StandardNodule' )
__children["Box"]["BoxOut"]["__uiPosition"].setValue( imath.V2f( -8.40068531, -3.83203101 ) )
__children["Box"]["out"].setInput( __children["Box"]["BoxOut"]["__out"] )
Gaffer.Metadata.registerValue( __children["Box"]["out"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["Box"]["out"], 'nodule:type', 'GafferUI::StandardNodule' )
__children["Cube"]["__uiPosition"].setValue( imath.V2f( -18.8500023, 9.43203068 ) )


del __children
13 changes: 12 additions & 1 deletion python/GafferTest/ArrayPlugTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#
##########################################################################

import unittest
import pathlib
import unittest
import imath

import IECore
Expand Down Expand Up @@ -628,5 +628,16 @@ def testResizeWithoutElementPrototype( self ) :
with self.assertRaisesRegex( RuntimeError, "ArrayPlug `p` was constructed without the required `elementPrototype`" ) :
p.resize( 1 )

def testLoadOutputPrototypeFrom1_5( self ) :

script = Gaffer.ScriptNode()
script["fileName"].setValue( pathlib.Path( __file__ ).parent / "scripts" / "arrayPlugWithOutputPrototype-1.5.1.0.gfr" )
script.load()

self.assertIsInstance( script["Node"]["user"]["array"], Gaffer.ArrayPlug )
self.assertEqual( script["Node"]["user"]["array"].direction(), Gaffer.Plug.Direction.In )
self.assertEqual( len( script["Node"]["user"]["array"] ), 1 )
self.assertIsInstance( script["Node"]["user"]["array"][0], Gaffer.IntPlug )

if __name__ == "__main__":
unittest.main()
31 changes: 31 additions & 0 deletions python/GafferTest/scripts/arrayPlugWithOutputPrototype-1.5.1.0.gfr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Gaffer
import GafferImage
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 5, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children = {}

parent["variables"].addChild( Gaffer.NameValuePlug( "image:catalogue:port", Gaffer.IntPlug( "value", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "imageCataloguePort", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
parent["variables"].addChild( Gaffer.NameValuePlug( "project:name", Gaffer.StringPlug( "value", defaultValue = 'default', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "projectName", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
parent["variables"].addChild( Gaffer.NameValuePlug( "project:rootDirectory", Gaffer.StringPlug( "value", defaultValue = '$HOME/gaffer/projects/${project:name}', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "projectRootDirectory", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, )
parent.addChild( __children["openColorIO"] )
__children["defaultFormat"] = GafferImage.FormatPlug( "defaultFormat", defaultValue = GafferImage.Format( 1920, 1080, 1.000 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, )
parent.addChild( __children["defaultFormat"] )
__children["Node"] = Gaffer.Node( "Node" )
parent.addChild( __children["Node"] )
__children["Node"]["user"].addChild( Gaffer.ArrayPlug( "array", elementPrototype = Gaffer.IntPlug( "IntPlug", direction = Gaffer.Plug.Direction.Out, defaultValue = 0, ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Node"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
parent["frame"].setValue( 100.0 )
parent["variables"]["imageCataloguePort"]["value"].setValue( 41733 )
Gaffer.Metadata.registerValue( parent["variables"]["imageCataloguePort"], 'readOnly', True )
Gaffer.Metadata.registerValue( parent["variables"]["projectName"]["name"], 'readOnly', True )
Gaffer.Metadata.registerValue( parent["variables"]["projectRootDirectory"]["name"], 'readOnly', True )
__children["Node"]["__uiPosition"].setValue( imath.V2f( -9.40000057, 0.100000001 ) )


del __children
2 changes: 2 additions & 0 deletions python/GafferUI/RandomChoiceUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def __popupMenu( menuDefinition, plugValueWidget ) :
return

for plug in plugValueWidget.getPlugs() :
if not isinstance( plug, Gaffer.ValuePlug ) :
return
if plug.getInput() is not None or Gaffer.MetadataAlgo.readOnly( plug ) :
return
if not Gaffer.RandomChoice.canSetup( plug ) :
Expand Down

0 comments on commit 1c65f63

Please sign in to comment.