-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SConstruct : Export node definitions using ExtensionAlgo
And convert Anaglyph node to demonstrate this in action. There is a slight annoyance here in that the extensions depend on the whole of `buildCore`, because we need to be able to run Gaffer to export them. Which means they get re-exported when anything changes. This is pretty fast anyway, but it can be avoided around by using `scons buildCore` rather than `scons build` when you know extensions don't need to be exported again.
- Loading branch information
1 parent
e759040
commit 341cdff
Showing
6 changed files
with
184 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import Gaffer | ||
import GafferImage | ||
import imath | ||
|
||
Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) | ||
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) | ||
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 0, 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["Anaglyph"] = Gaffer.Box( "Anaglyph" ) | ||
parent.addChild( __children["Anaglyph"] ) | ||
__children["Anaglyph"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.SelectView( "__SelectLeft" ) ) | ||
__children["Anaglyph"]["__SelectLeft"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.DeleteChannels( "__DeleteChannelsLeft" ) ) | ||
__children["Anaglyph"]["__DeleteChannelsLeft"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.SelectView( "__SelectRight" ) ) | ||
__children["Anaglyph"]["__SelectRight"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.DeleteChannels( "__DeleteChannelsRight" ) ) | ||
__children["Anaglyph"]["__DeleteChannelsRight"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.Merge( "__Merge" ) ) | ||
__children["Anaglyph"]["__Merge"]["in"].addChild( GafferImage.ImagePlug( "in2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"]["__Merge"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( Gaffer.BoxIn( "BoxIn" ) ) | ||
__children["Anaglyph"]["BoxIn"].setup( GafferImage.ImagePlug( "out", ) ) | ||
__children["Anaglyph"]["BoxIn"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.ImagePlug( "in", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( Gaffer.BoolPlug( "enabled", defaultValue = True, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( Gaffer.BoxOut( "BoxOut" ) ) | ||
__children["Anaglyph"]["BoxOut"].setup( GafferImage.ImagePlug( "in", ) ) | ||
__children["Anaglyph"]["BoxOut"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( GafferImage.ImagePlug( "out", direction = Gaffer.Plug.Direction.Out, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( Gaffer.Dot( "Dot" ) ) | ||
__children["Anaglyph"]["Dot"].setup( GafferImage.ImagePlug( "in", ) ) | ||
__children["Anaglyph"]["Dot"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
__children["Anaglyph"].addChild( Gaffer.Dot( "Dot1" ) ) | ||
__children["Anaglyph"]["Dot1"].setup( GafferImage.ImagePlug( "in", ) ) | ||
__children["Anaglyph"]["Dot1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) | ||
parent["variables"]["imageCataloguePort"]["value"].setValue( 52733 ) | ||
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 ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"], 'description', 'Converts a multi-view image with "left" and "right" views into a single view image with the two views combined in different colors, suitable for viewing through red-blue anaglyph glasses.' ) | ||
__children["Anaglyph"]["__uiPosition"].setValue( imath.V2f( -6.14999914, -0.599999785 ) ) | ||
__children["Anaglyph"]["__SelectLeft"]["in"].setInput( __children["Anaglyph"]["BoxIn"]["out"] ) | ||
__children["Anaglyph"]["__SelectLeft"]["__uiPosition"].setValue( imath.V2f( -18.9706993, 9.24895382 ) ) | ||
__children["Anaglyph"]["__DeleteChannelsLeft"]["in"].setInput( __children["Anaglyph"]["__SelectLeft"]["out"] ) | ||
__children["Anaglyph"]["__DeleteChannelsLeft"]["channels"].setValue( '[GB] *.[GB]' ) | ||
__children["Anaglyph"]["__DeleteChannelsLeft"]["__uiPosition"].setValue( imath.V2f( -18.9708977, 1.08303797 ) ) | ||
__children["Anaglyph"]["__SelectRight"]["in"].setInput( __children["Anaglyph"]["BoxIn"]["out"] ) | ||
__children["Anaglyph"]["__SelectRight"]["view"].setValue( 'right' ) | ||
__children["Anaglyph"]["__SelectRight"]["__uiPosition"].setValue( imath.V2f( -1.52422142, 9.24435806 ) ) | ||
__children["Anaglyph"]["__DeleteChannelsRight"]["in"].setInput( __children["Anaglyph"]["__SelectRight"]["out"] ) | ||
__children["Anaglyph"]["__DeleteChannelsRight"]["channels"].setValue( '[R] *.[R]' ) | ||
__children["Anaglyph"]["__DeleteChannelsRight"]["__uiPosition"].setValue( imath.V2f( -1.52412033, 1.08029604 ) ) | ||
__children["Anaglyph"]["__Merge"]["in"][0].setInput( __children["Anaglyph"]["__DeleteChannelsLeft"]["out"] ) | ||
__children["Anaglyph"]["__Merge"]["in"][1].setInput( __children["Anaglyph"]["__DeleteChannelsRight"]["out"] ) | ||
__children["Anaglyph"]["__Merge"]["operation"].setValue( 13 ) | ||
__children["Anaglyph"]["__Merge"]["__uiPosition"].setValue( imath.V2f( -8.74757004, -7.08376598 ) ) | ||
__children["Anaglyph"]["BoxIn"]["__in"].setInput( __children["Anaglyph"]["in"] ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxIn"]["__in"], 'nodule:type', 'GafferUI::StandardNodule' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxIn"]["__in"], 'description', 'The input image' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxIn"]["__in"], 'plugValueWidget:type', '' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxIn"]["__in"], 'noduleLayout:spacing', 2.0 ) | ||
__children["Anaglyph"]["BoxIn"]["__uiPosition"].setValue( imath.V2f( -10.3432178, 25.673069 ) ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["in"], 'nodule:type', 'GafferUI::StandardNodule' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["in"], 'description', 'The input image' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["in"], 'plugValueWidget:type', '' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["in"], 'noduleLayout:spacing', 2.0 ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["enabled"], 'nodule:type', '' ) | ||
__children["Anaglyph"]["BoxOut"]["in"].setInput( __children["Anaglyph"]["__Merge"]["out"] ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxOut"]["__out"], 'nodule:type', 'GafferUI::StandardNodule' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["BoxOut"]["__out"], 'description', 'The output image generated by this node.' ) | ||
__children["Anaglyph"]["BoxOut"]["passThrough"].setInput( __children["Anaglyph"]["Dot"]["out"] ) | ||
__children["Anaglyph"]["BoxOut"]["enabled"].setInput( __children["Anaglyph"]["enabled"] ) | ||
__children["Anaglyph"]["BoxOut"]["__uiPosition"].setValue( imath.V2f( -7.24757004, -21.0223522 ) ) | ||
__children["Anaglyph"]["out"].setInput( __children["Anaglyph"]["BoxOut"]["__out"] ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["out"], 'nodule:type', 'GafferUI::StandardNodule' ) | ||
Gaffer.Metadata.registerValue( __children["Anaglyph"]["out"], 'description', 'The output image generated by this node.' ) | ||
__children["Anaglyph"]["Dot"]["in"].setInput( __children["Anaglyph"]["Dot1"]["out"] ) | ||
__children["Anaglyph"]["Dot"]["__uiPosition"].setValue( imath.V2f( 13.4827852, -13.5223522 ) ) | ||
__children["Anaglyph"]["Dot1"]["in"].setInput( __children["Anaglyph"]["BoxIn"]["out"] ) | ||
__children["Anaglyph"]["Dot1"]["__uiPosition"].setValue( imath.V2f( 13.4827852, 18.173069 ) ) | ||
|
||
|
||
del __children | ||
|
Oops, something went wrong.