diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc4c9729454..1079d396d95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,6 +109,7 @@ jobs: - name: Install toolchain (Windows) run: | python -m pip install scons + python -m pip install sphinx==4.3.1 sphinx_rtd_theme==1.0.0 myst-parser==0.15.2 docutils==0.17.1 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-serializinghtml==1.1.5 sphinxcontrib-qthelp==1.0.3 Invoke-WebRequest -Uri "https://inkscape.org/gallery/item/37363/inkscape-1.2.2_2022-12-09_732a01da63-x64.exe" -OutFile "inkscape.exe" Start-Process .\inkscape.exe /S -NoNewWindow -Wait shell: pwsh @@ -165,6 +166,8 @@ jobs: curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/22.3.1/mesa3d-22.3.1-release-msvc.7z & "C:\Program Files\7-Zip\7z.exe" x mesa.7z -omesa ./mesa/systemwidedeploy.cmd 1 + echo "GALLIUM_DRIVER=llvmpipe" >> $env:GITHUB_ENV + Set-DisplayResolution -Width 1280 -Height 1024 -Force shell: pwsh if: runner.os == 'Windows' diff --git a/.github/workflows/main/sconsOptions b/.github/workflows/main/sconsOptions index c6b108b28f1..61fbf0ff529 100644 --- a/.github/workflows/main/sconsOptions +++ b/.github/workflows/main/sconsOptions @@ -61,4 +61,5 @@ if sys.platform == "win32" : LOCATE_DEPENDENCY_PYTHONPATH=os.path.join(os.environ["GAFFER_BUILD_DIR"], "python") GLEW_LIB_SUFFIX = "32" INKSCAPE = "C:\\Program Files\\Inkscape\\bin\\inkscape.exe" - SPHINX = "noSphinxYet" + SPHINX = "sphinx-build.exe" + ENV_VARS_TO_IMPORT += " GALLIUM_DRIVER" diff --git a/.github/workflows/main/setBuildVars.py b/.github/workflows/main/setBuildVars.py index ec3ca8bd966..e498b0ba2d7 100755 --- a/.github/workflows/main/setBuildVars.py +++ b/.github/workflows/main/setBuildVars.py @@ -172,15 +172,6 @@ print( "Setting $GAFFER_GITHUB_RELEASEID to '%s'" % releaseId ) f.write( 'GAFFER_GITHUB_RELEASEID=%s\n' % releaseId ) - if os.name == "nt" : - packageExtension = "zip" - - # \todo Remove this when docs are ready to build - print( "Setting $GAFFER_VALIDATE_EXTRA_FLAGS to '--skipDocs'" ) - f.write( 'GAFFER_VALIDATE_EXTRA_FLAGS=--skipDocs\n' ) - - else : - packageExtension = "tar.gz" - + packageExtension = "zip" if os.name == "nt" else "tar.gz" print( "Setting $PACKAGE_EXTENSION to '%s'" %packageExtension ) f.write( 'PACKAGE_EXTENSION=%s\n' %packageExtension ) diff --git a/Changes.md b/Changes.md index dabd6953609..3cc76028e43 100644 --- a/Changes.md +++ b/Changes.md @@ -58,12 +58,39 @@ Breaking Changes - Loop : Removed `nextIterationContext()` method. - NodeGadget, ConnectionGadget : Removed `activeForFocusNode()` virtual methods. Override `updateFromContextTracker()` instead. -1.4.x.x (relative to 1.4.9.0) +1.4.x.x (relative to 1.4.10.0) ======= Improvements ------------ +- SetExpressions : Set Expressions containing only whitespace characters are now treated as empty rather than producing an error. +- ArnoldShader : Moved Arnold 7.3.3.0's new `standard_volume.scatter_diffusion` parameters to a "Scatter Diffusion" section of the UI. + +Fixes +----- + +- Arnold : Fixed bug preventing UI metadata for Imagers from being loaded for Arnold 7.3. +- WidgetAlgo : Fixed issue preventing `grab()` from capturing popup menus on Windows. +- ShowURL : Fixed opening of "file://" URLs on Windows (#5861). + +API +--- + +- PathListingWidget : Added `columnContextMenuSignal()`, allowing multiple clients to collaborate on the creation of a column-specific context menu. +- HierarchyView : Added `sceneListing()` method, to allow the context menu to be customised. + +Documentation +------------- + +- Windows : Documentation is now included in Windows release packages. + +1.4.10.0 (relative to 1.4.9.0) +======== + +Improvements +------------ + - LightEditor : - Values of inherited attributes are now displayed in the Light Editor. These are presented as dimmed "fallback" values. Values are inherited from an ancestor of the inspected location or from attributes created in the scene globals. - Default values are now displayed as dimmed "fallback" values for attributes that don't exist in the scene. diff --git a/SConstruct b/SConstruct index 957e43a7c00..fb6b36d5203 100644 --- a/SConstruct +++ b/SConstruct @@ -940,7 +940,7 @@ if env["ARNOLD_ROOT"] : shell = True ) - nodeDefRegex = re.compile( r"\s*([a-zA-Z0-9_]+)\s+(driver|color_manager|driver|filter|light|operator|options|override|shader|shape)" ) + nodeDefRegex = re.compile( r"\s*([a-zA-Z0-9_]+)\s+(driver|color_manager|driver|filter|imager|light|operator|options|override|shader|shape)" ) nodes = set() for line in kickOutput.split( "\n" ) : m = nodeDefRegex.match( line ) @@ -2162,13 +2162,17 @@ def generateDocs( target, source, env ) : localFile = os.path.basename( str(source[0]) ) ext = os.path.splitext( localFile )[1] + gafferCmd = shutil.which( "gaffer.cmd" if sys.platform == "win32" else "gaffer", path = env["ENV"]["PATH"] ) command = [] if localFile == "screengrab.py" : - command = [ "gaffer", "screengrab", "-commandFile", localFile ] + command = [ gafferCmd, "screengrab", "-commandFile", localFile ] elif ext == ".py" : - command = [ "gaffer", "env", "python", localFile ] + command = [ gafferCmd, "env", "python", localFile ] elif ext == ".sh" : - command = [ "gaffer", "env", "./" + localFile ] + if sys.platform == "win32" : + command = [ gafferCmd, "env", "sh", "./" + localFile ] + else : + command = [ gafferCmd, "env", "./" + localFile ] if command : sys.stdout.write( "Running {0}\n".format( os.path.join( root, localFile ) ) ) subprocess.check_call( command, cwd = root, env = env["ENV"] ) @@ -2237,7 +2241,7 @@ if haveSphinx and haveInkscape : # use host python to avoid needing a matrix of sphinx versions to match Gaffer's # bundled python version. docEnv = env.Clone() - docEnv["ENV"]["PYTHONPATH"] = ":".join( sys.path ) + docEnv["ENV"]["PYTHONPATH"] = os.path.pathsep.join( sys.path ) # Since we don't copy the docs reference scripts, the screengrab # scripts must read them from the source, so we use the reference @@ -2253,9 +2257,9 @@ if haveSphinx and haveInkscape : libraryPathEnvVar = "DYLD_LIBRARY_PATH" if docEnv["PLATFORM"]=="darwin" else "LD_LIBRARY_PATH" if docCommandEnv.subst( "$ARNOLD_ROOT" ) : - docCommandEnv["ENV"]["PATH"] += ":" + docCommandEnv.subst( "$ARNOLD_ROOT/bin" ) - docCommandEnv["ENV"]["PYTHONPATH"] += ":" + docCommandEnv.subst( "$ARNOLD_ROOT/python" ) - docCommandEnv["ENV"][libraryPathEnvVar] = docCommandEnv["ENV"].get( libraryPathEnvVar, "" ) + ":" + docCommandEnv.subst( "$ARNOLD_ROOT/bin" ) + docCommandEnv["ENV"]["PATH"] += os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/bin" ) + docCommandEnv["ENV"]["PYTHONPATH"] += os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/python" ) + docCommandEnv["ENV"][libraryPathEnvVar] = docCommandEnv["ENV"].get( libraryPathEnvVar, "" ) + os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/bin" ) # Docs graphics generation docGraphicsCommands = graphicsCommands( docEnv, "resources/docGraphics.svg", "$BUILD_DIR/doc/gaffer/graphics" ) diff --git a/arnoldPlugins/gaffer.mtd b/arnoldPlugins/gaffer.mtd index 9666716b3cc..3928c9b68a1 100644 --- a/arnoldPlugins/gaffer.mtd +++ b/arnoldPlugins/gaffer.mtd @@ -2684,26 +2684,59 @@ [attr density] gaffer.graphEditorLayout.visible BOOL true page STRING "Density" + gaffer.layout.index INT 0 [attr density_channel] page STRING "Density" + gaffer.layout.index INT 1 [attr scatter] gaffer.graphEditorLayout.visible BOOL true page STRING "Scatter" + gaffer.layout.index INT 2 [attr scatter_color] gaffer.graphEditorLayout.visible BOOL true page STRING "Scatter" + gaffer.layout.index INT 3 [attr scatter_color_channel] page STRING "Scatter" + gaffer.layout.index INT 4 [attr scatter_anisotropy] page STRING "Scatter" + gaffer.layout.index INT 5 [attr scatter_secondary_anisotropy] page STRING "Scatter" label STRING "Secondary Anisotropy" gaffer.layout.activator STRING "secondaryAnisotropyEnabled" + gaffer.layout.index INT 6 [attr scatter_secondary_anisotropy_mix] page STRING "Scatter" label STRING "Secondary Anisotropy Mix" + gaffer.layout.index INT 7 + + [attr scatter_diffusion] + page STRING "Scatter Diffusion" + label STRING "Diffusion" + gaffer.layout.index INT 8 + [attr scatter_diffusion_bias] + page STRING "Scatter Diffusion" + label STRING "Diffusion Bias" + gaffer.layout.index INT 9 + [attr scatter_diffusion_gain] + page STRING "Scatter Diffusion" + label STRING "Diffusion Gain" + gaffer.layout.index INT 10 + [attr scatter_diffusion_roughness] + page STRING "Scatter Diffusion" + label STRING "Diffusion Roughness" + gaffer.layout.index INT 11 + [attr scatter_diffusion_roughness_bias] + page STRING "Scatter Diffusion" + label STRING "Diffusion Roughness Bias" + gaffer.layout.index INT 12 + [attr scatter_diffusion_roughness_gain] + page STRING "Scatter Diffusion" + label STRING "Diffusion Roughness Gain" + gaffer.layout.index INT 13 [attr transparent] page STRING "Transparent" diff --git a/doc/source/Reference/CommandLineReference/generate.py b/doc/source/Reference/CommandLineReference/generate.py index d1d879546cf..2941c4253df 100644 --- a/doc/source/Reference/CommandLineReference/generate.py +++ b/doc/source/Reference/CommandLineReference/generate.py @@ -1,6 +1,7 @@ # BuildTarget: index.md # UndeclaredBuildTargets +import Gaffer import GafferUI GafferUI.DocumentationAlgo.exportCommandLineReference( "./", ignore = { "op" } ) diff --git a/doc/source/Reference/NodeReference/generate.py b/doc/source/Reference/NodeReference/generate.py index fa7f0fd6944..b5ff9089b91 100644 --- a/doc/source/Reference/NodeReference/generate.py +++ b/doc/source/Reference/NodeReference/generate.py @@ -1,6 +1,7 @@ # BuildTarget: index.md # UndeclaredBuildTargets +import Gaffer import GafferUI # GafferArnold isn't installed under the standard module path diff --git a/doc/source/WorkingWithScenes/AnatomyOfACamera/screengrab.py b/doc/source/WorkingWithScenes/AnatomyOfACamera/screengrab.py index ebc28d9eec5..29061c413a6 100644 --- a/doc/source/WorkingWithScenes/AnatomyOfACamera/screengrab.py +++ b/doc/source/WorkingWithScenes/AnatomyOfACamera/screengrab.py @@ -50,5 +50,6 @@ window.resizeToFitChild() window.setVisible( True ) + window.setPosition( imath.V2i( 0, 0 ) ) GafferUI.WidgetAlgo.grab( widget = sceneInspector, imagePath = "images/interfaceCamera" + imageName ) diff --git a/doc/source/WorkingWithScenes/AnatomyOfAScene/screengrab.py b/doc/source/WorkingWithScenes/AnatomyOfAScene/screengrab.py index 9b3c5f9e6d4..3b5cd4d75b8 100644 --- a/doc/source/WorkingWithScenes/AnatomyOfAScene/screengrab.py +++ b/doc/source/WorkingWithScenes/AnatomyOfAScene/screengrab.py @@ -83,5 +83,6 @@ def __delay( delay ) : window.resizeToFitChild() window.setVisible( True ) + __delay( 0.5 ) GafferUI.WidgetAlgo.grab( widget = sceneInspector, imagePath = "images/sceneInspector" + imageName ) diff --git a/doc/source/WorkingWithScenes/Camera/screengrab.py b/doc/source/WorkingWithScenes/Camera/screengrab.py index 17ad56da185..bb3d6152211 100644 --- a/doc/source/WorkingWithScenes/Camera/screengrab.py +++ b/doc/source/WorkingWithScenes/Camera/screengrab.py @@ -16,6 +16,7 @@ # BuildDependency: scripts/taskStandardOptionsDepthOfFieldPlug_edit.gfr import os +import pathlib import subprocess import tempfile import time @@ -39,20 +40,23 @@ def __delay( delay ) : GafferUI.EventLoop.waitForIdle( 1 ) # Create a random directory in `/tmp` for the dispatcher's `jobsDirectory`, so we don't clutter the user's `~gaffer` directory -__temporaryDirectory = tempfile.mkdtemp( prefix = "gafferDocs" ) +__temporaryDirectory = pathlib.Path( tempfile.mkdtemp( prefix = "gafferDocs" ) ) def __getTempFilePath( fileName, directory = __temporaryDirectory ) : - filePath = "/".join( ( directory, fileName ) ) - return filePath + return ( directory / fileName ).as_posix() + +def __outputImagePath( fileName ) : + + return pathlib.Path( "images/{}.png".format( fileName ) ).absolute().as_posix() def __dispatchScript( script, tasks, settings ) : command = "gaffer dispatch -script {} -tasks {} -dispatcher Local -settings {} -dispatcher.jobsDirectory '\"{}/dispatcher/local\"'".format( script, " ".join( tasks ), " ".join( settings ), - __temporaryDirectory - ) + __temporaryDirectory.as_posix() + ) subprocess.check_call( command, shell=True ) # Interface: a Camera node in the Graph Editor @@ -127,9 +131,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) # Task: the Aperture and Focal Length projection mode in the Node Editor __imageName = "taskCameraApertureFocalLengthPlugs" @@ -143,9 +147,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) # Task: the Custom aperture mode and aperture.x and aperture.y plugs in the Node Editor __imageName = "taskCameraCustomAperturePlugs" @@ -158,9 +162,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) # Task: animation of adjusting the Aperture Offset in the Node Editor, and the corresponding changes to the camera's frustrum in the Viewer ## TODO: Automate `images/taskApertureOffset.gif` when these tools become available: @@ -173,9 +177,9 @@ def __dispatchScript( script, tasks, settings ) : script = "scripts/{}.gfr".format( __imageName ), tasks = [ "Render" ], settings = [ - "-Outputs.outputs.output1.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-Outputs.outputs.output1.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) # Task: the Depth of Field tab, with settings, in the Node Editor script["Camera"]["focusDistance"].setValue( 22.0 ) @@ -202,9 +206,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) # Task: a Camera node's Render Overrides tab in the Node Editor script["Camera"]["renderSettingOverrides"]["resolution"]["value"].setValue( imath.V2i( 5120, 2160 ) ) @@ -236,15 +240,15 @@ def __dispatchScript( script, tasks, settings ) : # Example: Anamorphic Camera Setup __dispatchScript( - script = os.path.abspath( "../../../examples/rendering/anamorphicCameraSetup.gfr" ), + script = pathlib.Path( "../../../examples/rendering/anamorphicCameraSetup.gfr" ).absolute().as_posix(), tasks = [ "Render" ], settings = [ - "-StandardOptions.options.renderResolution.value.x '240'", - "-StandardOptions.options.renderResolution.value.y '270'", - "-Outputs.outputs.output1.fileName '\"{}\"'".format( os.path.abspath( "images/exampleAnamorphicCameraSetup.png" ) ), + "-StandardOptions.options.renderResolution.value.x 240", + "-StandardOptions.options.renderResolution.value.y 270", + "-Outputs.outputs.output1.fileName '\"{}\"'".format( __outputImagePath( "exampleAnamorphicCameraSetup" ) ), "-Outputs.outputs.output1.type '\"png\"'" - ] - ) + ] +) # Example: Spherical Camera Setup in Arnold # __dispatchScript( diff --git a/doc/source/WorkingWithScenes/Camera/scripts/taskCameraApertureFocalLengthPlugs_edit.gfr b/doc/source/WorkingWithScenes/Camera/scripts/taskCameraApertureFocalLengthPlugs_edit.gfr index add76da0748..c19e1f2f6ed 100644 --- a/doc/source/WorkingWithScenes/Camera/scripts/taskCameraApertureFocalLengthPlugs_edit.gfr +++ b/doc/source/WorkingWithScenes/Camera/scripts/taskCameraApertureFocalLengthPlugs_edit.gfr @@ -1,25 +1,19 @@ import Gaffer import GafferDispatch import GafferImage -import IECore +import GafferOSL import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 53, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 6, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "imageCataloguePort", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"].addChild( Gaffer.StringPlug( "name", defaultValue = 'image:catalogue:port', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"].addChild( Gaffer.IntPlug( "value", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "projectName", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectName"].addChild( Gaffer.StringPlug( "name", defaultValue = 'project:name', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectName"].addChild( Gaffer.StringPlug( "value", defaultValue = 'default', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "projectRootDirectory", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectRootDirectory"].addChild( Gaffer.StringPlug( "name", defaultValue = 'project:rootDirectory', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectRootDirectory"].addChild( Gaffer.StringPlug( "value", defaultValue = '$HOME/gaffer/projects/${project:name}', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +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["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["ImageReader"] = GafferImage.ImageReader( "ImageReader" ) @@ -31,16 +25,27 @@ __children["Rectangle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = __children["ImageWriter"] = GafferImage.ImageWriter( "ImageWriter" ) parent.addChild( __children["ImageWriter"] ) __children["ImageWriter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 39199 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 62365 ) 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["ImageReader"]["colorSpace"].setValue( 'raw' ) __children["ImageReader"]["__uiPosition"].setValue( imath.V2f( -22.6491661, 10.4499998 ) ) -__children["Rectangle"]["out"].setInput( __children["Rectangle"]["__merge"]["out"] ) __children["Rectangle"]["in"].setInput( __children["ImageReader"]["out"] ) __children["Rectangle"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.113700002, 1 ) ) -__children["Rectangle"]["area"].setValue( imath.Box2f( imath.V2f( 8, 165 ), imath.V2f( 446, 242 ) ) ) +__children["Rectangle"]["area"]["min"].setValue( imath.V2f( 8, 165 ) ) +__children["Rectangle"]["area"]["max"]["y"].setValue( 242.0 ) +__children["Rectangle"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p0"] ) __children["Rectangle"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle"]["__uiPosition"].setValue( imath.V2f( -22.6491661, 2.28593731 ) ) __children["ImageWriter"]["in"].setInput( __children["Rectangle"]["out"] ) @@ -49,6 +54,12 @@ Gaffer.Metadata.registerValue( __children["ImageWriter"]["channels"], 'channelMa __children["ImageWriter"]["colorSpace"].setValue( 'raw' ) __children["ImageWriter"]["png"]["compressionLevel"].setValue( 9 ) __children["ImageWriter"]["__uiPosition"].setValue( imath.V2f( -24.1491661, -5.87812519 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -6.3312459, 2.28593731 ) ) +__children["Expression"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( -14.8670864, 2.18593836 ) ) +__children["Expression"]["__engine"].setValue( 'OSL' ) +__children["Expression"]["__expression"].setValue( 'parent.__out.p0 = parent.__in.p0 - 7;' ) del __children diff --git a/doc/source/WorkingWithScenes/Camera/scripts/taskCameraFOVPlugs_edit.gfr b/doc/source/WorkingWithScenes/Camera/scripts/taskCameraFOVPlugs_edit.gfr index add76da0748..f77ff9dc7b0 100644 --- a/doc/source/WorkingWithScenes/Camera/scripts/taskCameraFOVPlugs_edit.gfr +++ b/doc/source/WorkingWithScenes/Camera/scripts/taskCameraFOVPlugs_edit.gfr @@ -1,25 +1,19 @@ import Gaffer import GafferDispatch import GafferImage -import IECore +import GafferOSL import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 53, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 6, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "imageCataloguePort", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"].addChild( Gaffer.StringPlug( "name", defaultValue = 'image:catalogue:port', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"].addChild( Gaffer.IntPlug( "value", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "projectName", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectName"].addChild( Gaffer.StringPlug( "name", defaultValue = 'project:name', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectName"].addChild( Gaffer.StringPlug( "value", defaultValue = 'default', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"].addChild( Gaffer.CompoundDataPlug.MemberPlug( "projectRootDirectory", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectRootDirectory"].addChild( Gaffer.StringPlug( "name", defaultValue = 'project:rootDirectory', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["projectRootDirectory"].addChild( Gaffer.StringPlug( "value", defaultValue = '$HOME/gaffer/projects/${project:name}', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +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["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["ImageReader"] = GafferImage.ImageReader( "ImageReader" ) @@ -31,16 +25,27 @@ __children["Rectangle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = __children["ImageWriter"] = GafferImage.ImageWriter( "ImageWriter" ) parent.addChild( __children["ImageWriter"] ) __children["ImageWriter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 39199 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 62365 ) 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["ImageReader"]["colorSpace"].setValue( 'raw' ) __children["ImageReader"]["__uiPosition"].setValue( imath.V2f( -22.6491661, 10.4499998 ) ) -__children["Rectangle"]["out"].setInput( __children["Rectangle"]["__merge"]["out"] ) __children["Rectangle"]["in"].setInput( __children["ImageReader"]["out"] ) __children["Rectangle"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.113700002, 1 ) ) -__children["Rectangle"]["area"].setValue( imath.Box2f( imath.V2f( 8, 165 ), imath.V2f( 446, 242 ) ) ) +__children["Rectangle"]["area"]["min"].setValue( imath.V2f( 8, 165 ) ) +__children["Rectangle"]["area"]["max"]["y"].setValue( 242.0 ) +__children["Rectangle"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p0"] ) __children["Rectangle"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle"]["__uiPosition"].setValue( imath.V2f( -22.6491661, 2.28593731 ) ) __children["ImageWriter"]["in"].setInput( __children["Rectangle"]["out"] ) @@ -49,6 +54,12 @@ Gaffer.Metadata.registerValue( __children["ImageWriter"]["channels"], 'channelMa __children["ImageWriter"]["colorSpace"].setValue( 'raw' ) __children["ImageWriter"]["png"]["compressionLevel"].setValue( 9 ) __children["ImageWriter"]["__uiPosition"].setValue( imath.V2f( -24.1491661, -5.87812519 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -6.14916611, 2.28593755 ) ) +__children["Expression"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( -14.6850061, 2.1859386 ) ) +__children["Expression"]["__engine"].setValue( 'OSL' ) +__children["Expression"]["__expression"].setValue( 'parent.__out.p0 = parent.__in.p0 - 7;' ) del __children diff --git a/doc/source/WorkingWithScenes/LightLinking/screengrab.py b/doc/source/WorkingWithScenes/LightLinking/screengrab.py index 2cd88d9686d..7f3102a167d 100644 --- a/doc/source/WorkingWithScenes/LightLinking/screengrab.py +++ b/doc/source/WorkingWithScenes/LightLinking/screengrab.py @@ -75,6 +75,9 @@ GafferUI.WidgetAlgo.grab( widget = sceneInspector, imagePath = "images/interface" + imageName ) + window.close() + del window + # Interface: a StandardAttributes node downstream of an object node script.selection().clear() graphEditor.frame( script.children( Gaffer.Node ) ) diff --git a/doc/source/WorkingWithTheNodeGraph/Contexts/screengrab.py b/doc/source/WorkingWithTheNodeGraph/Contexts/screengrab.py index 47f0c302606..eb4c4597cc6 100644 --- a/doc/source/WorkingWithTheNodeGraph/Contexts/screengrab.py +++ b/doc/source/WorkingWithTheNodeGraph/Contexts/screengrab.py @@ -72,6 +72,7 @@ def __delay( delay ) : # Concept: Context Variables in expressions (Node Editor) nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Expression"], floating = True ) nodeEditorWindow._qtWidget().setFocus() +nodeEditorWindow.parent()._qtWidget().resize( 408, 400 ) GafferUI.WidgetAlgo.grab( widget = nodeEditorWindow, imagePath = "images/conceptContextsContextVariablesInExpressionsNodeEditor.png" ) nodeEditorWindow.parent().close() del nodeEditorWindow @@ -152,6 +153,7 @@ def __delay( delay ) : script.load() nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Expression"], floating = True ) nodeEditorWindow._qtWidget().setFocus() +nodeEditorWindow.parent()._qtWidget().resize( 408, 400 ) GafferUI.WidgetAlgo.grab( widget = nodeEditorWindow, imagePath = "images/conceptContextsInParallelBranchesNodeEditor.png" ) nodeEditorWindow.parent().close() del nodeEditorWindow @@ -199,6 +201,7 @@ def __delay( delay ) : script.load() nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Expression"], floating = True ) nodeEditorWindow._qtWidget().setFocus() +nodeEditorWindow.parent()._qtWidget().resize( 408, 400 ) GafferUI.WidgetAlgo.grab( widget = nodeEditorWindow, imagePath = "images/conceptContextsInParallelBranchesDownstreamNodeEditor.png" ) nodeEditorWindow.parent().close() del nodeEditorWindow diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/screengrab.py b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/screengrab.py index dee69464dd2..d76ad9836e3 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/screengrab.py +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/screengrab.py @@ -43,7 +43,7 @@ import sys import os -import sys +import pathlib import subprocess import tempfile import time @@ -65,20 +65,23 @@ def __delay( delay ) : GafferUI.EventLoop.waitForIdle( 1 ) # Create a random directory in `/tmp` for the dispatcher's `jobsDirectory`, so we don't clutter the user's `~gaffer` directory -temporaryDirectory = tempfile.mkdtemp( prefix = "gafferDocs" ) +__temporaryDirectory = pathlib.Path( tempfile.mkdtemp( prefix = "gafferDocs" ) ) + +def __getTempFilePath( fileName, directory = __temporaryDirectory ) : -def __getTempFilePath( fileName, directory = temporaryDirectory ) : - filePath = "/".join( ( directory, fileName ) ) + return ( directory / fileName ).as_posix() - return filePath +def __outputImagePath( fileName ) : + + return pathlib.Path( "images/{}.png".format( fileName ) ).absolute().as_posix() def __dispatchScript( script, tasks, settings ) : command = "gaffer dispatch -script {} -tasks {} -dispatcher Local -settings {} -dispatcher.jobsDirectory '\"{}/dispatcher/local\"'".format( script, " ".join( tasks ), " ".join( settings ), - temporaryDirectory - ) + __temporaryDirectory.as_posix() + ) subprocess.check_call( command, shell = True ) # Create a plug context menu from a Node Editor @@ -112,18 +115,28 @@ def __selectPlugContextMenuAction( contextMenuWidget, targetActionName ) : # Screengrab a plug context menu and submenu def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menuPath, submenuPath ) : + + if not GafferUI.EventLoop.mainEventLoop().running() : + # This is a hack to try to give Qt time to + # finish processing any events needed to get + # the widget ready for capture. Really we need + # a rock solid way that _guarantees_ this, and which + # we can also use when the event loop is running. + GafferUI.EventLoop.waitForIdle() + screen = QtWidgets.QApplication.primaryScreen() windowHandle = plugWidget._qtWidget().windowHandle() if windowHandle : screen = windowHandle.screen() - qtVersion = [ int( x ) for x in Qt.__qt_version__.split( "." ) ] - pixmapMain = screen.grabWindow( mainWindow._qtWidget().winId() ) + # Windows requires grabbing the entire screen and cropping to + # reliably capture context menus and submenus. + pixmapMain = screen.grabWindow( 0 if sys.platform == "win32" else mainWindow._qtWidget().winId() ) ## Screengrab the context menu. The frame dimensions are too big by # one pixel on each axis. menuScreenPos = QtCore.QPoint( 0, 0 ) - if sys.platform == "darwin" : + if sys.platform in ( "darwin", "win32" ) : menuScreenPos = QtCore.QPoint( mainWindow._qtWidget().geometry().x(), mainWindow._qtWidget().geometry().y() @@ -131,19 +144,19 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu menuSize = QtCore.QSize( contextMenuWidget.frameGeometry().width() - 1, contextMenuWidget.frameGeometry().height() - 1 - ) + ) menuRect = QtCore.QRect( menuScreenPos, menuSize ) pixmap = pixmapMain.copy( menuRect ) pixmap.save( menuPath ) ## Screengrab the sub-menu submenuScreenPos = submenuWidget.pos() - if sys.platform != "darwin" : + if sys.platform not in ( "darwin", "win32" ) : submenuScreenPos = submenuScreenPos - contextMenuWidget.pos() submenuSize = QtCore.QSize( submenuWidget.frameGeometry().width() - 1, submenuWidget.frameGeometry().height() - 1 - ) + ) submenuRect = QtCore.QRect( submenuScreenPos, submenuSize ) pixmap = pixmapMain.copy( submenuRect ) @@ -160,7 +173,6 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu # Interface: A Spreadsheet node in the Graph Editor imageName = "interfaceSpreadsheetNode" -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["Spreadsheet"] = Gaffer.Spreadsheet() with GafferUI.Window() as window : graphEditorWindow = GafferUI.GraphEditor( script ) @@ -169,13 +181,12 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu __delay( 0.1 ) graphEditorWindow.frame( Gaffer.StandardSet( [ script["Spreadsheet"] ] ) ) __delay( 0.1 ) -GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = imagePath ) +GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = __outputImagePath( imageName ) ) graphEditorWindow.parent().close() del graphEditorWindow # Interface: Spreadsheet node with full name in Graph Editor imageName = "interfaceSpreadsheetNodeFullName" -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) Gaffer.Metadata.registerValue( script["Spreadsheet"], 'nodeGadget:type', 'GafferUI::StandardNodeGadget' ) with GafferUI.Window() as window : graphEditorWindow = GafferUI.GraphEditor( script ) @@ -184,13 +195,13 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu __delay( 0.1 ) graphEditorWindow.frame( Gaffer.StandardSet( [ script["Spreadsheet"] ] ) ) __delay( 0.1 ) -GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = imagePath ) +GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = __outputImagePath( imageName ) ) graphEditorWindow.parent().close() del graphEditorWindow # Interface: The Spreadsheet node's interface in a Node Editor imageName = "interfaceSpreadsheetNodeInterface" -imagePathInterface = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) +imagePathInterface = __outputImagePath( imageName ) script["fileName"].setValue( os.path.abspath( "scripts/{scriptName}.gfr".format( scriptName = imageName ) ) ) script.load() __delay( 0.1 ) @@ -204,7 +215,6 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu imageName = "interfaceSpreadsheetNodeRenderNetwork" tempImagePath1 = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Before" ) ) tempImagePath2 = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "After" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["fileName"].setValue( os.path.abspath( "scripts/{scriptName}.gfr".format( scriptName = imageName ) ) ) script.load() __delay( 0.1 ) @@ -226,26 +236,24 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu settings = [ "-ImageReader_Before.fileName '\"{tempPath}\"'".format( tempPath = tempImagePath1 ), "-ImageReader_After.fileName '\"{tempPath}\"'".format( tempPath = tempImagePath2 ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Breakdown of the Spreadsheet node's interface in a Node Editor imageName = "interfaceSpreadsheetNodeBreakdown" tempImagePath = imagePathInterface -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{imagePath}\"'".format( imagePath = tempImagePath ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Spreadsheet node's auxiliary connections imageName = "interfaceSpreadsheetNodeAuxiliaryConnections" -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["fileName"].setValue( os.path.abspath( "scripts/{scriptName}.gfr".format( scriptName = imageName ) ) ) script.load() __delay( 0.1 ) @@ -257,7 +265,7 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu graphEditorWindow.frame( Gaffer.StandardSet( [ script["Dot"] ] ) ) script.removeChild( script["Dot"] ) __delay( 0.1 ) -GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = imagePath ) +GafferUI.WidgetAlgo.grab( widget = graphEditorWindow, imagePath = __outputImagePath( imageName ) ) graphEditorWindow.parent().close() del graphEditorWindow @@ -266,7 +274,6 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu tempImagePathEditor = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Editor" ) ) tempImagePathMenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Menu" ) ) tempImagePathSubmenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Submenu" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["Sphere"] = GafferScene.Sphere() script["Spreadsheet"] = Gaffer.Spreadsheet() # Screengrab the Node Editor @@ -303,16 +310,15 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathEditor ), "-ImageReader_Menu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathMenu ), "-ImageReader_Submenu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSubmenu ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Add a vector plug (whole) imageName = "taskSpreadsheetNodeAddPlugVectorWhole" tempImagePathEditor = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Editor" ) ) tempImagePathMenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Menu" ) ) tempImagePathSubmenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Submenu" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) # Screengrab the Node Editor nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Sphere"], floating = True ) nodeEditorWindow._qtWidget().setFocus() @@ -347,16 +353,15 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathEditor ), "-ImageReader_Menu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathMenu ), "-ImageReader_Submenu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSubmenu ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Add a vector plug (single element) imageName = "taskSpreadsheetNodeAddPlugVectorSingle" tempImagePathEditor = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Editor" ) ) tempImagePathMenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Menu" ) ) tempImagePathSubmenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Submenu" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) # Screengrab the Node Editor nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Sphere"], floating = True ) nodeEditorWindow._qtWidget().setFocus() @@ -391,16 +396,15 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathEditor ), "-ImageReader_Menu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathMenu ), "-ImageReader_Submenu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSubmenu ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Add a compound plug imageName = "taskSpreadsheetNodeAddPlugCompound" tempImagePathEditor = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Editor" ) ) tempImagePathMenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Menu" ) ) tempImagePathSubmenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Submenu" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) # Screengrab the Node Editor nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Sphere"], floating = True ) nodeEditorWindow._qtWidget().setFocus() @@ -436,15 +440,14 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathEditor ), "-ImageReader_Menu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathMenu ), "-ImageReader_Submenu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSubmenu ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Compound plug with enabled switch imageName = "interfaceSpreadsheetNodeCompoundEnabledSwitch" tempImagePathSpreadsheet = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Spreadsheet" ) ) tempImagePathOptions = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Options" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["fileName"].setValue( os.path.abspath( "scripts/{scriptName}.gfr".format( scriptName = imageName ) ) ) script.load() # Screengrab the Node Editor (Spreadsheet node) @@ -468,29 +471,27 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu settings = [ "-ImageReader_Spreadsheet.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSpreadsheet ), "-ImageReader_Options.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathOptions ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Disabled cell imageName = "interfaceSpreadsheetNodeDisabledCell" tempImagePathEditor = tempImagePathSpreadsheet -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSpreadsheet ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Add a tweak plug imageName = "taskSpreadsheetNodeAddPlugTweak" tempImagePathEditor = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Editor" ) ) tempImagePathMenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Menu" ) ) tempImagePathSubmenu = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Submenu" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["CameraTweaks"] = GafferScene.CameraTweaks() script["CameraTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.V2iPlug( "value", defaultValue = imath.V2i( 1920, 1050 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "resolution", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) script["CameraTweaks"]["tweaks"]["resolution"]["name"].setValue( 'resolution' ) @@ -529,14 +530,13 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathEditor ), "-ImageReader_Menu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathMenu ), "-ImageReader_Submenu.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSubmenu ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Column sections in the Node Editor imageName = "interfaceSpreadsheetNodeColumnSections" tempImagePathColumns = __getTempFilePath( "{imageName}.png".format( imageName = imageName ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) script["fileName"].setValue( os.path.abspath( "scripts/{scriptName}.gfr".format( scriptName = imageName ) ) ) script.load() __delay( 0.1 ) @@ -552,68 +552,63 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathColumns ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Reordering a section imageName = "taskSpreadsheetNodeReorderSection" tempImagePath = tempImagePathColumns -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePath ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Reordering a column imageName = "taskSpreadsheetNodeReorderColumn" tempImagePath = tempImagePathColumns -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePath ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Automatically resizing a column imageName = "taskSpreadsheetNodeResizeColumnAutomatic" tempImagePath = tempImagePathColumns -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePath ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Task: Manually resizing a column imageName = "taskSpreadsheetNodeResizeColumnManual" tempImagePath = tempImagePathColumns -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) __dispatchScript( script = "scripts/{scriptName}_edit.gfr".format( scriptName = imageName ), tasks = [ "ImageWriter" ], settings = [ "-ImageReader_Editor.fileName '\"{imagePath}\"'".format( imagePath = tempImagePath ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Interface: Pattern widths imageName = "interfaceSpreadsheetNodePatternWidths" tempImagePathHalf = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Half" ) ) tempImagePathSingle = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Single" ) ) tempImagePathDouble = __getTempFilePath( "{tempName}.png".format( tempName = imageName + "Double" ) ) -imagePath = os.path.abspath( "images/{imageName}.png".format( imageName = imageName ) ) nodeEditorWindow = GafferUI.NodeEditor.acquire( script["Spreadsheet"], floating = True ) nodeEditorWindow._qtWidget().setFocus() __delay( 0.1 ) @@ -631,9 +626,9 @@ def __grabPlugContextSubmenu( plugWidget, contextMenuWidget, submenuWidget, menu "-ImageReader_Half.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathHalf ), "-ImageReader_Single.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathSingle ), "-ImageReader_Double.fileName '\"{imagePath}\"'".format( imagePath = tempImagePathDouble ), - "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = imagePath ) - ] - ) + "-ImageWriter.fileName '\"{imagePath}\"'".format( imagePath = __outputImagePath( imageName ) ) + ] +) # Example: Per-location Transform Spreadsheet exampleName = "PerLocationTransformSpreadsheet" diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugBasic_edit.gfr b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugBasic_edit.gfr index 2a9231be8e3..5f8db4dc84b 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugBasic_edit.gfr +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugBasic_edit.gfr @@ -1,12 +1,13 @@ import Gaffer import GafferDispatch import GafferImage +import GafferOSL import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} @@ -87,26 +88,40 @@ parent.addChild( __children["Constant"] ) __children["Constant"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"] = GafferImage.Shuffle( "Shuffle" ) parent.addChild( __children["Shuffle"] ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"] = GafferImage.Shuffle( "Shuffle1" ) parent.addChild( __children["Shuffle1"] ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"] = GafferImage.Shuffle( "Shuffle2" ) parent.addChild( __children["Shuffle2"] ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 51086 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 1910.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["FormatQuery1"] = GafferImage.FormatQuery( "FormatQuery1" ) +parent.addChild( __children["FormatQuery1"] ) +__children["FormatQuery1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 34165 ) 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 ) @@ -130,15 +145,15 @@ __children["ImageReader_Menu"]["colorSpace"].setValue( 'scene_linear' ) __children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 30.0519371, 50.1485367 ) ) __children["ImageReader_Submenu"]["refreshCount"].setValue( 1 ) __children["ImageReader_Submenu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 45.7823448, 49.8031654 ) ) +__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 54.1984787, 49.8031616 ) ) __children["Merge_Submenu"]["in"][0].setInput( __children["Shuffle1"]["out"] ) __children["Merge_Submenu"]["in"][1].setInput( __children["ImageTransform_Submenu"]["out"] ) __children["Merge_Submenu"]["operation"].setValue( 8 ) __children["Merge_Submenu"]["__uiPosition"].setValue( imath.V2f( 33.0519371, 25.6904488 ) ) __children["Dot"]["in"].setInput( __children["ImageTransform_Menu"]["out"] ) __children["Dot"]["__uiPosition"].setValue( imath.V2f( 33.0519371, 0.0709428787 ) ) -__children["Expression2"]["__in"]["p0"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) -__children["Expression2"]["__in"]["p1"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression2"]["__in"]["p0"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression2"]["__in"]["p1"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) __children["Expression2"]["__uiPosition"].setValue( imath.V2f( 22.9490776, 17.4014359 ) ) __children["Crop"]["in"].setInput( __children["Merge"]["out"] ) __children["Crop"]["areaSource"].setValue( 1 ) @@ -152,14 +167,14 @@ Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:e Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [ ] ) ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'description', 'Renders a dashed rectangle with adjustable line width, corner radius, drop shadow and transform.' ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'documentation:url', '' ) -__children["RectangleDashed_Target"]["out"].setInput( __children["RectangleDashed_Target"]["BoxOut"]["__out"] ) __children["RectangleDashed_Target"]["in"].setInput( __children["Shuffle"]["out"] ) __children["RectangleDashed_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["RectangleDashed_Target"]["dashLength"].setValue( 12.0 ) -__children["RectangleDashed_Target"]["area"].setValue( imath.Box2f( imath.V2f( 122, 220 ), imath.V2f( 439, 244 ) ) ) +__children["RectangleDashed_Target"]["area"]["min"].setValue( imath.V2f( 118, 220 ) ) +__children["RectangleDashed_Target"]["area"]["max"]["y"].setValue( 244.0 ) +__children["RectangleDashed_Target"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p0"] ) __children["RectangleDashed_Target"]["lineWidth"].setValue( 2.0 ) __children["RectangleDashed_Target"]["__uiPosition"].setValue( imath.V2f( -2.39859009, 33.7271919 ) ) -__children["Rectangle_LineTarget"]["out"].setInput( __children["Rectangle_LineTarget"]["__merge"]["out"] ) __children["Rectangle_LineTarget"]["in"].setInput( __children["RectangleDashed_Target"]["out"] ) __children["Rectangle_LineTarget"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["Rectangle_LineTarget"]["area"].setValue( imath.Box2f( imath.V2f( 0, 0 ), imath.V2f( 11, 0 ) ) ) @@ -167,7 +182,6 @@ __children["Rectangle_LineTarget"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_LineTarget"]["transform"]["translate"].setValue( imath.V2f( 110, 262 ) ) __children["Rectangle_LineTarget"]["transform"]["rotate"].setValue( -45.0 ) __children["Rectangle_LineTarget"]["__uiPosition"].setValue( imath.V2f( -2.39859009, 25.3951607 ) ) -__children["Text_Target"]["out"].setInput( __children["Text_Target"]["__merge"]["out"] ) __children["Text_Target"]["in"].setInput( __children["Rectangle_LineTarget"]["out"] ) __children["Text_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 1 ) ) __children["Text_Target"]["text"].setValue( 'Radius int plug' ) @@ -175,17 +189,17 @@ __children["Text_Target"]["size"].setValue( imath.V2i( 12, 12 ) ) __children["Text_Target"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 100, 100 ) ) ) __children["Text_Target"]["transform"]["translate"].setValue( imath.V2f( 20, 180 ) ) __children["Text_Target"]["__uiPosition"].setValue( imath.V2f( -2.39858913, 17.2310982 ) ) -__children["Rectangle_Label"]["out"].setInput( __children["Rectangle_Label"]["__merge"]["out"] ) __children["Rectangle_Label"]["in"].setInput( __children["Text_Target"]["out"] ) __children["Rectangle_Label"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_Label"]["area"].setValue( imath.Box2f( imath.V2f( 122, 224 ), imath.V2f( 162, 240 ) ) ) __children["Rectangle_Label"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_Label"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_Label"]["__uiPosition"].setValue( imath.V2f( -2.39858818, 9.06703568 ) ) -__children["Rectangle_Value"]["out"].setInput( __children["Rectangle_Value"]["__merge"]["out"] ) __children["Rectangle_Value"]["in"].setInput( __children["Rectangle_Label"]["out"] ) __children["Rectangle_Value"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) -__children["Rectangle_Value"]["area"].setValue( imath.Box2f( imath.V2f( 166, 224 ), imath.V2f( 440, 240 ) ) ) +__children["Rectangle_Value"]["area"]["min"].setValue( imath.V2f( 166, 224 ) ) +__children["Rectangle_Value"]["area"]["max"]["y"].setValue( 240.0 ) +__children["Rectangle_Value"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p1"] ) __children["Rectangle_Value"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_Value"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_Value"]["__uiPosition"].setValue( imath.V2f( -2.39858818, 0.902973413 ) ) @@ -193,12 +207,12 @@ __children["ImageTransform"]["in"].setInput( __children["Text_Mouse"]["out"] ) __children["ImageTransform"]["transform"]["translate"].setValue( imath.V2f( 200, 201 ) ) __children["ImageTransform"]["__uiPosition"].setValue( imath.V2f( 14.2327747, 25.7192726 ) ) __children["ImageTransform_Submenu"]["in"].setInput( __children["Shuffle2"]["out"] ) -__children["ImageTransform_Submenu"]["transform"]["translate"].setValue( imath.V2f( 179, 106 ) ) -__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 45.7823448, 33.8545151 ) ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["y"].setValue( 110.0 ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["x"].setInput( __children["FormatQuery1"]["size"]["x"] ) +__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 54.1984787, 33.8545113 ) ) __children["ImageTransform_Menu"]["in"].setInput( __children["Merge_Submenu"]["out"] ) __children["ImageTransform_Menu"]["transform"]["translate"].setInput( __children["Expression2"]["__out"]["p0"] ) __children["ImageTransform_Menu"]["__uiPosition"].setValue( imath.V2f( 33.0519371, 17.5263863 ) ) -__children["Text_Mouse"]["out"].setInput( __children["Text_Mouse"]["__merge"]["out"] ) __children["Text_Mouse"]["in"].setInput( __children["ImageReader_Mouse"]["out"] ) __children["Text_Mouse"]["shadow"].setValue( True ) __children["Text_Mouse"]["shadowOffset"].setValue( imath.V2f( 2, -2 ) ) @@ -213,37 +227,45 @@ Gaffer.Metadata.registerValue( __children["Constant"]["format"], 'formatPlugValu __children["Constant"]["color"].setValue( imath.Color4f( 0, 0, 0, 0 ) ) __children["Constant"]["__uiPosition"].setValue( imath.V2f( -18.1297245, 0.902973175 ) ) __children["Shuffle"]["in"].setInput( __children["ImageReader_Editor"]["out"] ) -__children["Shuffle"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle"]["channels"]["channel3"]["in"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) __children["Shuffle"]["__uiPosition"].setValue( imath.V2f( -2.39859009, 42.0824013 ) ) __children["Shuffle1"]["in"].setInput( __children["ImageReader_Menu"]["out"] ) -__children["Shuffle1"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle1"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 30.0519371, 39.1277962 ) ) +__children["Shuffle1"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle1"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 30.0519371, 33.8545113 ) ) __children["Shuffle2"]["in"].setInput( __children["ImageReader_Submenu"]["out"] ) -__children["Shuffle2"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle2"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 45.7826729, 42.0185776 ) ) +__children["Shuffle2"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle2"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 54.1988068, 42.0185738 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader_Editor"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -20.0044518, 42.0824013 ) ) +__children["Expression"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( -16.2277756, 33.7823677 ) ) +__children["FormatQuery1"]["image"].setInput( __children["ImageReader_Menu"]["out"] ) +__children["FormatQuery1"]["__uiPosition"].setValue( imath.V2f( 40.24683, 41.9844742 ) ) __children["Expression2"]["__engine"].setValue( 'python' ) -__children["Expression2"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p0"]\nfullDisplayWindow = parent["__in"]["p1"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression2"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p1"]\nfullDisplayWindow = parent["__in"]["p0"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression"]["__engine"].setValue( 'OSL' ) +__children["Expression"]["__expression"].setValue( 'int width = parent.__in.p0;\nparent.__out.p0 = width - 9;\nparent.__out.p1 = width - 13;' ) del __children diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugCompound_edit.gfr b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugCompound_edit.gfr index 7bb3d74852e..340463e75bf 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugCompound_edit.gfr +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugCompound_edit.gfr @@ -1,12 +1,13 @@ import Gaffer import GafferDispatch import GafferImage +import GafferOSL import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} @@ -80,26 +81,40 @@ parent.addChild( __children["Text_Mouse"] ) __children["Text_Mouse"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"] = GafferImage.Shuffle( "Shuffle" ) parent.addChild( __children["Shuffle"] ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"] = GafferImage.Shuffle( "Shuffle1" ) parent.addChild( __children["Shuffle1"] ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"] = GafferImage.Shuffle( "Shuffle2" ) parent.addChild( __children["Shuffle2"] ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 51086 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 1910.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["FormatQuery1"] = GafferImage.FormatQuery( "FormatQuery1" ) +parent.addChild( __children["FormatQuery1"] ) +__children["FormatQuery1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 34165 ) 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 ) @@ -121,7 +136,7 @@ __children["ImageReader_Menu"]["colorSpace"].setValue( 'scene_linear' ) __children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 23.4967594, 36.3876953 ) ) __children["ImageReader_Submenu"]["refreshCount"].setValue( 1 ) __children["ImageReader_Submenu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 39.6554451, 36.6297569 ) ) +__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 46.5901756, 36.6297569 ) ) __children["Merge_Submenu"]["in"][0].setInput( __children["Shuffle1"]["out"] ) __children["Merge_Submenu"]["in"][1].setInput( __children["ImageTransform"]["out"] ) __children["Merge_Submenu"]["operation"].setValue( 8 ) @@ -140,14 +155,14 @@ Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:e Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [ ] ) ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'description', 'Renders a dashed rectangle with adjustable line width, corner radius, drop shadow and transform.' ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'documentation:url', '' ) -__children["RectangleDashed_Target"]["out"].setInput( __children["RectangleDashed_Target"]["BoxOut"]["__out"] ) __children["RectangleDashed_Target"]["in"].setInput( __children["Shuffle"]["out"] ) __children["RectangleDashed_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["RectangleDashed_Target"]["dashLength"].setValue( 12.0 ) -__children["RectangleDashed_Target"]["area"].setValue( imath.Box2f( imath.V2f( 108, 218 ), imath.V2f( 447, 321 ) ) ) +__children["RectangleDashed_Target"]["area"]["min"].setValue( imath.V2f( 108, 218 ) ) +__children["RectangleDashed_Target"]["area"]["max"]["y"].setValue( 321.0 ) +__children["RectangleDashed_Target"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p0"] ) __children["RectangleDashed_Target"]["lineWidth"].setValue( 2.0 ) __children["RectangleDashed_Target"]["__uiPosition"].setValue( imath.V2f( -13.0549755, 20.8242264 ) ) -__children["Rectangle_LineTarget"]["out"].setInput( __children["Rectangle_LineTarget"]["__merge"]["out"] ) __children["Rectangle_LineTarget"]["in"].setInput( __children["RectangleDashed_Target"]["out"] ) __children["Rectangle_LineTarget"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["Rectangle_LineTarget"]["area"].setValue( imath.Box2f( imath.V2f( 0, 0 ), imath.V2f( 22, 0 ) ) ) @@ -155,7 +170,6 @@ __children["Rectangle_LineTarget"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_LineTarget"]["transform"]["translate"].setValue( imath.V2f( 87, 206 ) ) __children["Rectangle_LineTarget"]["transform"]["rotate"].setValue( 45.0 ) __children["Rectangle_LineTarget"]["__uiPosition"].setValue( imath.V2f( -13.0549755, 12.4921951 ) ) -__children["Text_Target"]["out"].setInput( __children["Text_Target"]["__merge"]["out"] ) __children["Text_Target"]["in"].setInput( __children["Rectangle_LineTarget"]["out"] ) __children["Text_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 1 ) ) __children["Text_Target"]["text"].setValue( 'Transform compound plug\n' ) @@ -163,10 +177,11 @@ __children["Text_Target"]["size"].setValue( imath.V2i( 12, 12 ) ) __children["Text_Target"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 200, 100 ) ) ) __children["Text_Target"]["transform"]["translate"].setValue( imath.V2f( 16, 105 ) ) __children["Text_Target"]["__uiPosition"].setValue( imath.V2f( -13.0549755, 4.32813263 ) ) -__children["Rectangle_Compound"]["out"].setInput( __children["Rectangle_Compound"]["__merge"]["out"] ) __children["Rectangle_Compound"]["in"].setInput( __children["Text_Target"]["out"] ) __children["Rectangle_Compound"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) -__children["Rectangle_Compound"]["area"].setValue( imath.Box2f( imath.V2f( 111, 221 ), imath.V2f( 444, 318 ) ) ) +__children["Rectangle_Compound"]["area"]["min"].setValue( imath.V2f( 111, 221 ) ) +__children["Rectangle_Compound"]["area"]["max"]["y"].setValue( 318.0 ) +__children["Rectangle_Compound"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p1"] ) __children["Rectangle_Compound"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_Compound"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_Compound"]["__uiPosition"].setValue( imath.V2f( -13.0549755, -3.83593011 ) ) @@ -174,15 +189,15 @@ __children["ImageTransform_Mouse"]["in"].setInput( __children["Text_Mouse"]["out __children["ImageTransform_Mouse"]["transform"]["translate"].setValue( imath.V2f( 254, 243 ) ) __children["ImageTransform_Mouse"]["__uiPosition"].setValue( imath.V2f( 6.00409698, 12.8537998 ) ) __children["ImageTransform"]["in"].setInput( __children["Shuffle2"]["out"] ) -__children["ImageTransform"]["transform"]["translate"].setValue( imath.V2f( 230, 138 ) ) -__children["ImageTransform"]["__uiPosition"].setValue( imath.V2f( 39.6554451, 20.9656887 ) ) -__children["Expression3"]["__in"]["p0"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) -__children["Expression3"]["__in"]["p1"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["ImageTransform"]["transform"]["translate"]["y"].setValue( 143.0 ) +__children["ImageTransform"]["transform"]["translate"]["x"].setInput( __children["FormatQuery1"]["size"]["x"] ) +__children["ImageTransform"]["__uiPosition"].setValue( imath.V2f( 46.5901756, 20.9656887 ) ) +__children["Expression3"]["__in"]["p0"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression3"]["__in"]["p1"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) __children["Expression3"]["__uiPosition"].setValue( imath.V2f( 15.2463684, 5.18437386 ) ) __children["ImageTransform_Menu"]["in"].setInput( __children["Merge_Submenu"]["out"] ) __children["ImageTransform_Menu"]["transform"]["translate"].setInput( __children["Expression3"]["__out"]["p0"] ) __children["ImageTransform_Menu"]["__uiPosition"].setValue( imath.V2f( 26.4967594, 4.63756275 ) ) -__children["Text_Mouse"]["out"].setInput( __children["Text_Mouse"]["__merge"]["out"] ) __children["Text_Mouse"]["in"].setInput( __children["ImageReader_Mouse"]["out"] ) __children["Text_Mouse"]["shadow"].setValue( True ) __children["Text_Mouse"]["shadowOffset"].setValue( imath.V2f( 2, -2 ) ) @@ -193,37 +208,45 @@ __children["Text_Mouse"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath __children["Text_Mouse"]["transform"]["translate"].setValue( imath.V2f( 34, -10 ) ) __children["Text_Mouse"]["__uiPosition"].setValue( imath.V2f( 6.00409651, 21.0178623 ) ) __children["Shuffle"]["in"].setInput( __children["ImageReader_Editor"]["out"] ) -__children["Shuffle"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle"]["channels"]["channel3"]["in"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) __children["Shuffle"]["__uiPosition"].setValue( imath.V2f( -13.0546217, 28.7921944 ) ) __children["Shuffle1"]["in"].setInput( __children["ImageReader_Menu"]["out"] ) -__children["Shuffle1"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle1"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 23.4966946, 24.5950451 ) ) +__children["Shuffle1"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle1"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 23.4967594, 20.9656887 ) ) __children["Shuffle2"]["in"].setInput( __children["ImageReader_Submenu"]["out"] ) -__children["Shuffle2"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle2"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 39.6551056, 29.1297512 ) ) +__children["Shuffle2"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle2"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 46.5898361, 29.1297512 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader_Editor"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -33.1251411, 28.7921944 ) ) +__children["Expression"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( -26.1466732, 21.1782207 ) ) +__children["FormatQuery1"]["image"].setInput( __children["ImageReader_Menu"]["out"] ) +__children["FormatQuery1"]["__uiPosition"].setValue( imath.V2f( 32.4851456, 28.2236347 ) ) __children["Expression3"]["__engine"].setValue( 'python' ) -__children["Expression3"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p0"]\nfullDisplayWindow = parent["__in"]["p1"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression3"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p1"]\nfullDisplayWindow = parent["__in"]["p0"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression"]["__engine"].setValue( 'OSL' ) +__children["Expression"]["__expression"].setValue( 'int width = parent.__in.p0;\nparent.__out.p0 = width - 6;\nparent.__out.p1 = width - 9;' ) del __children diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugTweak_edit.gfr b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugTweak_edit.gfr index 524105b7e18..07500cf33c0 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugTweak_edit.gfr +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugTweak_edit.gfr @@ -1,12 +1,13 @@ import Gaffer import GafferDispatch import GafferImage +import GafferOSL import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} @@ -110,26 +111,47 @@ parent.addChild( __children["Constant1"] ) __children["Constant1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"] = GafferImage.Shuffle( "Shuffle" ) parent.addChild( __children["Shuffle"] ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"] = GafferImage.Shuffle( "Shuffle1" ) parent.addChild( __children["Shuffle1"] ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"] = GafferImage.Shuffle( "Shuffle2" ) parent.addChild( __children["Shuffle2"] ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 51086 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 1910.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression3"] = Gaffer.Expression( "Expression3" ) +parent.addChild( __children["Expression3"] ) +__children["Expression3"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression3"]["__out"].addChild( Gaffer.FloatPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression3"]["__out"].addChild( Gaffer.FloatPlug( "p2", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression3"]["__out"].addChild( Gaffer.FloatPlug( "p3", direction = Gaffer.Plug.Direction.Out, defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression3"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["FormatQuery1"] = GafferImage.FormatQuery( "FormatQuery1" ) +parent.addChild( __children["FormatQuery1"] ) +__children["FormatQuery1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["frame"].setValue( 67.0 ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 34165 ) 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 ) @@ -171,14 +193,14 @@ Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:e Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [ ] ) ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'description', 'Renders a dashed rectangle with adjustable line width, corner radius, drop shadow and transform.' ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'documentation:url', '' ) -__children["RectangleDashed_Target"]["out"].setInput( __children["RectangleDashed_Target"]["BoxOut"]["__out"] ) __children["RectangleDashed_Target"]["in"].setInput( __children["Merge1"]["out"] ) __children["RectangleDashed_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["RectangleDashed_Target"]["dashLength"].setValue( 12.0 ) -__children["RectangleDashed_Target"]["area"].setValue( imath.Box2f( imath.V2f( 8, 292 ), imath.V2f( 490, 320 ) ) ) +__children["RectangleDashed_Target"]["area"]["min"].setValue( imath.V2f( 8, 292 ) ) +__children["RectangleDashed_Target"]["area"]["max"]["y"].setValue( 320.0 ) +__children["RectangleDashed_Target"]["area"]["max"]["x"].setInput( __children["Expression"]["__out"]["p0"] ) __children["RectangleDashed_Target"]["lineWidth"].setValue( 2.0 ) __children["RectangleDashed_Target"]["__uiPosition"].setValue( imath.V2f( -5.8894825, 21.732029 ) ) -__children["Rectangle_LineTarget"]["out"].setInput( __children["Rectangle_LineTarget"]["__merge"]["out"] ) __children["Rectangle_LineTarget"]["in"].setInput( __children["RectangleDashed_Target"]["out"] ) __children["Rectangle_LineTarget"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["Rectangle_LineTarget"]["area"].setValue( imath.Box2f( imath.V2f( 0, 0 ), imath.V2f( 57, 0 ) ) ) @@ -186,7 +208,6 @@ __children["Rectangle_LineTarget"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_LineTarget"]["transform"]["translate"].setValue( imath.V2f( 39, 237 ) ) __children["Rectangle_LineTarget"]["transform"]["rotate"].setValue( 120.0 ) __children["Rectangle_LineTarget"]["__uiPosition"].setValue( imath.V2f( -5.89711523, 13.3999977 ) ) -__children["Text_Target"]["out"].setInput( __children["Text_Target"]["__merge"]["out"] ) __children["Text_Target"]["in"].setInput( __children["Rectangle_LineTarget"]["out"] ) __children["Text_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 1 ) ) __children["Text_Target"]["text"].setValue( 'Resolution tweak plug' ) @@ -194,42 +215,42 @@ __children["Text_Target"]["size"].setValue( imath.V2i( 12, 12 ) ) __children["Text_Target"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 200, 100 ) ) ) __children["Text_Target"]["transform"]["translate"].setValue( imath.V2f( 36, 134 ) ) __children["Text_Target"]["__uiPosition"].setValue( imath.V2f( -5.89711571, 5.23593521 ) ) -__children["Rectangle_NamePlug"]["out"].setInput( __children["Rectangle_NamePlug"]["__merge"]["out"] ) __children["Rectangle_NamePlug"]["in"].setInput( __children["Text_Target"]["out"] ) __children["Rectangle_NamePlug"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_NamePlug"]["area"].setValue( imath.Box2f( imath.V2f( 10, 296 ), imath.V2f( 160, 315 ) ) ) __children["Rectangle_NamePlug"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_NamePlug"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_NamePlug"]["__uiPosition"].setValue( imath.V2f( -5.89711571, -2.92812729 ) ) -__children["Rectangle_SwitchPlug"]["out"].setInput( __children["Rectangle_SwitchPlug"]["__merge"]["out"] ) __children["Rectangle_SwitchPlug"]["in"].setInput( __children["Rectangle_NamePlug"]["out"] ) __children["Rectangle_SwitchPlug"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_SwitchPlug"]["area"].setValue( imath.Box2f( imath.V2f( 165, 294 ), imath.V2f( 186, 316 ) ) ) __children["Rectangle_SwitchPlug"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_SwitchPlug"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_SwitchPlug"]["__uiPosition"].setValue( imath.V2f( -5.89711666, -11.0921898 ) ) -__children["Rectangle_ModePlug"]["out"].setInput( __children["Rectangle_ModePlug"]["__merge"]["out"] ) __children["Rectangle_ModePlug"]["in"].setInput( __children["Rectangle_SwitchPlug"]["out"] ) __children["Rectangle_ModePlug"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_ModePlug"]["area"].setValue( imath.Box2f( imath.V2f( 195, 296 ), imath.V2f( 297, 315 ) ) ) __children["Rectangle_ModePlug"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_ModePlug"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_ModePlug"]["__uiPosition"].setValue( imath.V2f( -5.89711666, -19.2562523 ) ) -__children["Rectangle_xPlug"]["out"].setInput( __children["Rectangle_xPlug"]["__merge"]["out"] ) __children["Rectangle_xPlug"]["in"].setInput( __children["Rectangle_ModePlug"]["out"] ) __children["Rectangle_xPlug"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) -__children["Rectangle_xPlug"]["area"].setValue( imath.Box2f( imath.V2f( 303, 296 ), imath.V2f( 392, 315 ) ) ) +__children["Rectangle_xPlug"]["area"]["min"]["y"].setValue( 296.0 ) +__children["Rectangle_xPlug"]["area"]["max"]["y"].setValue( 315.0 ) +__children["Rectangle_xPlug"]["area"]["min"]["x"].setInput( __children["Expression3"]["__out"]["p1"] ) +__children["Rectangle_xPlug"]["area"]["max"]["x"].setInput( __children["Expression3"]["__out"]["p0"] ) __children["Rectangle_xPlug"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_xPlug"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_xPlug"]["__uiPosition"].setValue( imath.V2f( -5.89711475, -27.4203148 ) ) -__children["Rectangle_yPlug"]["out"].setInput( __children["Rectangle_yPlug"]["__merge"]["out"] ) __children["Rectangle_yPlug"]["in"].setInput( __children["Rectangle_xPlug"]["out"] ) __children["Rectangle_yPlug"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) -__children["Rectangle_yPlug"]["area"].setValue( imath.Box2f( imath.V2f( 397, 296 ), imath.V2f( 487, 315 ) ) ) +__children["Rectangle_yPlug"]["area"]["min"]["y"].setValue( 296.0 ) +__children["Rectangle_yPlug"]["area"]["max"]["y"].setValue( 315.0 ) +__children["Rectangle_yPlug"]["area"]["min"]["x"].setInput( __children["Expression3"]["__out"]["p3"] ) +__children["Rectangle_yPlug"]["area"]["max"]["x"].setInput( __children["Expression3"]["__out"]["p2"] ) __children["Rectangle_yPlug"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_yPlug"]["cornerRadius"].setValue( 4.0 ) __children["Rectangle_yPlug"]["__uiPosition"].setValue( imath.V2f( -5.89711571, -35.5843773 ) ) -__children["Text_Mouse"]["out"].setInput( __children["Text_Mouse"]["__merge"]["out"] ) __children["Text_Mouse"]["in"].setInput( __children["ImageReader_Mouse"]["out"] ) __children["Text_Mouse"]["shadow"].setValue( True ) __children["Text_Mouse"]["shadowOffset"].setValue( imath.V2f( 2, -2 ) ) @@ -246,19 +267,20 @@ __children["ImageReader_Menu"]["colorSpace"].setValue( 'scene_linear' ) __children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 37.2813721, 12.4466572 ) ) __children["ImageReader_Submenu"]["refreshCount"].setValue( 1 ) __children["ImageReader_Submenu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 53.0117874, 12.3976498 ) ) +__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 63.999649, 12.3976469 ) ) __children["Merge_Submenu"]["in"][0].setInput( __children["Shuffle1"]["out"] ) __children["Merge_Submenu"]["in"][1].setInput( __children["ImageTransform_Submenu"]["out"] ) __children["Merge_Submenu"]["operation"].setValue( 8 ) __children["Merge_Submenu"]["__uiPosition"].setValue( imath.V2f( 40.2813721, -13.148447 ) ) __children["Dot1"]["in"].setInput( __children["ImageTransform_Menu"]["out"] ) __children["Dot1"]["__uiPosition"].setValue( imath.V2f( 40.2813721, -38.7679443 ) ) -__children["Expression2"]["__in"]["p0"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) -__children["Expression2"]["__in"]["p1"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) -__children["Expression2"]["__uiPosition"].setValue( imath.V2f( 30.1785126, -21.4374619 ) ) +__children["Expression2"]["__in"]["p0"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression2"]["__in"]["p1"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) +__children["Expression2"]["__uiPosition"].setValue( imath.V2f( 30.2850246, -21.2244377 ) ) __children["ImageTransform_Submenu"]["in"].setInput( __children["Shuffle2"]["out"] ) -__children["ImageTransform_Submenu"]["transform"]["translate"].setValue( imath.V2f( 193, 138 ) ) -__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 53.0117874, -4.98438168 ) ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["y"].setValue( 176.0 ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["x"].setInput( __children["FormatQuery1"]["size"]["x"] ) +__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 63.999649, -4.98438454 ) ) __children["ImageTransform_Menu"]["in"].setInput( __children["Merge_Submenu"]["out"] ) __children["ImageTransform_Menu"]["transform"]["translate"].setInput( __children["Expression2"]["__out"]["p0"] ) __children["ImageTransform_Menu"]["__uiPosition"].setValue( imath.V2f( 40.2813721, -21.3125114 ) ) @@ -271,37 +293,48 @@ Gaffer.Metadata.registerValue( __children["Constant1"]["format"], 'formatPlugVal __children["Constant1"]["color"].setValue( imath.Color4f( 0, 0, 0, 0 ) ) __children["Constant1"]["__uiPosition"].setValue( imath.V2f( -27.1896305, -37.9359207 ) ) __children["Shuffle"]["in"].setInput( __children["ImageReader_Editor"]["out"] ) -__children["Shuffle"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle"]["channels"]["channel3"]["in"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) __children["Shuffle"]["__uiPosition"].setValue( imath.V2f( -8.88915348, 38.4461784 ) ) __children["Shuffle1"]["in"].setInput( __children["ImageReader_Menu"]["out"] ) -__children["Shuffle1"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle1"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 36.6099319, -0.350500822 ) ) +__children["Shuffle1"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle1"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 37.2813721, -4.98438454 ) ) __children["Shuffle2"]["in"].setInput( __children["ImageReader_Submenu"]["out"] ) -__children["Shuffle2"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle2"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 53.011425, 3.70668983 ) ) +__children["Shuffle2"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle2"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 63.9992867, 3.70668697 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader_Editor"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -23.0343342, 38.6640587 ) ) +__children["Expression"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( -19.5150433, 21.8856544 ) ) +__children["Expression3"]["__uiPosition"].setValue( imath.V2f( -16.9547501, -31.2469463 ) ) +__children["FormatQuery1"]["image"].setInput( __children["ImageReader_Menu"]["out"] ) +__children["FormatQuery1"]["__uiPosition"].setValue( imath.V2f( 47.2975578, 4.28259468 ) ) __children["Expression2"]["__engine"].setValue( 'python' ) -__children["Expression2"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p0"]\nfullDisplayWindow = parent["__in"]["p1"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression2"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p1"]\nfullDisplayWindow = parent["__in"]["p0"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression"]["__engine"].setValue( 'OSL' ) +__children["Expression"]["__expression"].setValue( 'int width = parent.__in.p0;\nparent.__out.p0 = width - 7;\n_disconnectedFloat = width - 11;' ) +__children["Expression3"]["__engine"].setValue( 'python' ) +__children["Expression3"]["__expression"].setValue( 'import sys\n\nplugWidth = 79 if sys.platform == "win32" else 89\nxPlugX = 303\nparent["__out"]["p1"] = xPlugX\nparent["__out"]["p0"] = xPlugX + plugWidth\n\nyPlugX = xPlugX + plugWidth + 5\nparent["__out"]["p3"] = yPlugX\nparent["__out"]["p2"] = yPlugX + plugWidth' ) del __children diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorSingle_edit.gfr b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorSingle_edit.gfr index e61c77bc32b..2ed87ba290a 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorSingle_edit.gfr +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorSingle_edit.gfr @@ -4,9 +4,9 @@ import GafferImage import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} @@ -80,26 +80,31 @@ parent.addChild( __children["Text_Mouse"] ) __children["Text_Mouse"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"] = GafferImage.Shuffle( "Shuffle" ) parent.addChild( __children["Shuffle"] ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"] = GafferImage.Shuffle( "Shuffle1" ) parent.addChild( __children["Shuffle1"] ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"] = GafferImage.Shuffle( "Shuffle2" ) parent.addChild( __children["Shuffle2"] ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 51086 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 34165 ) 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 ) @@ -121,7 +126,7 @@ __children["ImageReader_Menu"]["colorSpace"].setValue( 'scene_linear' ) __children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 23.8551826, 37.4895515 ) ) __children["ImageReader_Submenu"]["refreshCount"].setValue( 1 ) __children["ImageReader_Submenu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 39.9564896, 37.797287 ) ) +__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 46.2970352, 37.797287 ) ) __children["Merge_Submenu"]["in"][0].setInput( __children["Shuffle1"]["out"] ) __children["Merge_Submenu"]["in"][1].setInput( __children["ImageTransform_Submenu"]["out"] ) __children["Merge_Submenu"]["operation"].setValue( 8 ) @@ -140,14 +145,12 @@ Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:e Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [ ] ) ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'description', 'Renders a dashed rectangle with adjustable line width, corner radius, drop shadow and transform.' ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'documentation:url', '' ) -__children["RectangleDashed_Target"]["out"].setInput( __children["RectangleDashed_Target"]["BoxOut"]["__out"] ) __children["RectangleDashed_Target"]["in"].setInput( __children["Shuffle"]["out"] ) __children["RectangleDashed_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["RectangleDashed_Target"]["dashLength"].setValue( 12.0 ) __children["RectangleDashed_Target"]["area"].setValue( imath.Box2f( imath.V2f( 162, 269 ), imath.V2f( 256, 293 ) ) ) __children["RectangleDashed_Target"]["lineWidth"].setValue( 2.0 ) __children["RectangleDashed_Target"]["__uiPosition"].setValue( imath.V2f( -11.9664612, 19.5698967 ) ) -__children["Rectangle_LineTarget"]["out"].setInput( __children["Rectangle_LineTarget"]["__merge"]["out"] ) __children["Rectangle_LineTarget"]["in"].setInput( __children["RectangleDashed_Target"]["out"] ) __children["Rectangle_LineTarget"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["Rectangle_LineTarget"]["area"].setValue( imath.Box2f( imath.V2f( 0, 0 ), imath.V2f( 40, 0 ) ) ) @@ -155,7 +158,6 @@ __children["Rectangle_LineTarget"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_LineTarget"]["transform"]["translate"].setValue( imath.V2f( 118, 267 ) ) __children["Rectangle_LineTarget"]["transform"]["rotate"].setValue( 8.0 ) __children["Rectangle_LineTarget"]["__uiPosition"].setValue( imath.V2f( -11.9760628, 10.9019279 ) ) -__children["Text_Target"]["out"].setInput( __children["Text_Target"]["__merge"]["out"] ) __children["Text_Target"]["in"].setInput( __children["Rectangle_LineTarget"]["out"] ) __children["Text_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 1 ) ) __children["Text_Target"]["text"].setValue( 'Rotate.x element' ) @@ -163,7 +165,6 @@ __children["Text_Target"]["size"].setValue( imath.V2i( 12, 12 ) ) __children["Text_Target"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 200, 100 ) ) ) __children["Text_Target"]["transform"]["translate"].setValue( imath.V2f( 11, 175 ) ) __children["Text_Target"]["__uiPosition"].setValue( imath.V2f( -11.9760628, 2.73786569 ) ) -__children["Rectangle_Compound"]["out"].setInput( __children["Rectangle_Compound"]["__merge"]["out"] ) __children["Rectangle_Compound"]["in"].setInput( __children["Text_Target"]["out"] ) __children["Rectangle_Compound"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_Compound"]["area"].setValue( imath.Box2f( imath.V2f( 166, 273 ), imath.V2f( 252, 289 ) ) ) @@ -174,15 +175,15 @@ __children["ImageTransform_Mouse"]["in"].setInput( __children["Text_Mouse"]["out __children["ImageTransform_Mouse"]["transform"]["translate"].setValue( imath.V2f( 195, 255 ) ) __children["ImageTransform_Mouse"]["__uiPosition"].setValue( imath.V2f( 6.32653618, 11.5844727 ) ) __children["ImageTransform_Submenu"]["in"].setInput( __children["Shuffle2"]["out"] ) -__children["ImageTransform_Submenu"]["transform"]["translate"].setValue( imath.V2f( 230, 186 ) ) -__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 39.9564896, 19.8332214 ) ) -__children["Expression3"]["__in"]["p0"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) -__children["Expression3"]["__in"]["p1"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["y"].setValue( 193.0 ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["x"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 46.2970352, 19.8332214 ) ) +__children["Expression3"]["__in"]["p0"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression3"]["__in"]["p1"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) __children["Expression3"]["__uiPosition"].setValue( imath.V2f( 15.6051674, 4.05190659 ) ) __children["ImageTransform_Menu"]["in"].setInput( __children["Merge_Submenu"]["out"] ) __children["ImageTransform_Menu"]["transform"]["translate"].setInput( __children["Expression3"]["__out"]["p0"] ) __children["ImageTransform_Menu"]["__uiPosition"].setValue( imath.V2f( 26.8555565, 3.50509548 ) ) -__children["Text_Mouse"]["out"].setInput( __children["Text_Mouse"]["__merge"]["out"] ) __children["Text_Mouse"]["in"].setInput( __children["ImageReader_Mouse"]["out"] ) __children["Text_Mouse"]["shadow"].setValue( True ) __children["Text_Mouse"]["shadowOffset"].setValue( imath.V2f( 2, -2 ) ) @@ -193,37 +194,39 @@ __children["Text_Mouse"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath __children["Text_Mouse"]["transform"]["translate"].setValue( imath.V2f( 34, -10 ) ) __children["Text_Mouse"]["__uiPosition"].setValue( imath.V2f( 6.32653618, 19.7485352 ) ) __children["Shuffle"]["in"].setInput( __children["ImageReader_Editor"]["out"] ) -__children["Shuffle"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle"]["channels"]["channel3"]["in"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) __children["Shuffle"]["__uiPosition"].setValue( imath.V2f( -11.9668293, 28.519949 ) ) __children["Shuffle1"]["in"].setInput( __children["ImageReader_Menu"]["out"] ) -__children["Shuffle1"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle1"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 23.5546341, 24.5796795 ) ) +__children["Shuffle1"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle1"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 23.8551826, 19.8332214 ) ) __children["Shuffle2"]["in"].setInput( __children["ImageReader_Submenu"]["out"] ) -__children["Shuffle2"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle2"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 39.9561272, 28.8153419 ) ) +__children["Shuffle2"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle2"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 46.2966766, 28.8153419 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader_Menu"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( 32.7966843, 29.1486073 ) ) __children["Expression3"]["__engine"].setValue( 'python' ) -__children["Expression3"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p0"]\nfullDisplayWindow = parent["__in"]["p1"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression3"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p1"]\nfullDisplayWindow = parent["__in"]["p0"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) del __children diff --git a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorWhole_edit.gfr b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorWhole_edit.gfr index fd703aa1cb7..d572edf55a7 100644 --- a/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorWhole_edit.gfr +++ b/doc/source/WorkingWithTheNodeGraph/SpreadsheetNode/scripts/taskSpreadsheetNodeAddPlugVectorWhole_edit.gfr @@ -1,12 +1,13 @@ import Gaffer import GafferDispatch import GafferImage +import GafferOSL import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} @@ -80,26 +81,39 @@ parent.addChild( __children["Text_Mouse"] ) __children["Text_Mouse"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"] = GafferImage.Shuffle( "Shuffle" ) parent.addChild( __children["Shuffle"] ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"] = GafferImage.Shuffle( "Shuffle1" ) parent.addChild( __children["Shuffle1"] ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle1"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle1"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"] = GafferImage.Shuffle( "Shuffle2" ) parent.addChild( __children["Shuffle2"] ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -__children["Shuffle2"]["channels"].addChild( GafferImage.Shuffle.ChannelPlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Shuffle2"]["shuffles"].addChild( Gaffer.ShufflePlug( "channel3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Shuffle2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) -parent["variables"]["imageCataloguePort"]["value"].setValue( 51086 ) +__children["openColorIO"] = GafferImage.OpenColorIOConfigPlug( "openColorIO", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) +parent.addChild( __children["openColorIO"] ) +__children["FormatQuery"] = GafferImage.FormatQuery( "FormatQuery" ) +parent.addChild( __children["FormatQuery"] ) +__children["FormatQuery"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression5"] = Gaffer.Expression( "Expression5" ) +parent.addChild( __children["Expression5"] ) +__children["Expression5"]["__in"].addChild( Gaffer.IntPlug( "p0", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression5"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 1910.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression5"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["FormatQuery1"] = GafferImage.FormatQuery( "FormatQuery1" ) +parent.addChild( __children["FormatQuery1"] ) +__children["FormatQuery1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 34165 ) 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 ) @@ -118,10 +132,10 @@ __children["ImageWriter"]["in"].setInput( __children["Crop"]["out"] ) __children["ImageWriter"]["colorSpace"].setValue( 'scene_linear' ) __children["ImageWriter"]["__uiPosition"].setValue( imath.V2f( 7.05142498, -27.3066978 ) ) __children["ImageReader_Menu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 25.2165432, 37.9806137 ) ) +__children["ImageReader_Menu"]["__uiPosition"].setValue( imath.V2f( 25.2165432, 38.3117981 ) ) __children["ImageReader_Submenu"]["refreshCount"].setValue( 1 ) __children["ImageReader_Submenu"]["colorSpace"].setValue( 'scene_linear' ) -__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 41.7049255, 38.3055 ) ) +__children["ImageReader_Submenu"]["__uiPosition"].setValue( imath.V2f( 47.8653297, 38.4336243 ) ) __children["Merge_Submenu"]["in"][0].setInput( __children["Shuffle1"]["out"] ) __children["Merge_Submenu"]["in"][1].setInput( __children["ImageTransform_Submenu"]["out"] ) __children["Merge_Submenu"]["operation"].setValue( 8 ) @@ -140,14 +154,14 @@ Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:e Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [ ] ) ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'description', 'Renders a dashed rectangle with adjustable line width, corner radius, drop shadow and transform.' ) Gaffer.Metadata.registerValue( __children["RectangleDashed_Target"], 'documentation:url', '' ) -__children["RectangleDashed_Target"]["out"].setInput( __children["RectangleDashed_Target"]["BoxOut"]["__out"] ) __children["RectangleDashed_Target"]["in"].setInput( __children["Shuffle"]["out"] ) __children["RectangleDashed_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["RectangleDashed_Target"]["dashLength"].setValue( 12.0 ) -__children["RectangleDashed_Target"]["area"].setValue( imath.Box2f( imath.V2f( 120, 269 ), imath.V2f( 442, 293 ) ) ) +__children["RectangleDashed_Target"]["area"]["min"].setValue( imath.V2f( 120, 269 ) ) +__children["RectangleDashed_Target"]["area"]["max"]["y"].setValue( 293.0 ) +__children["RectangleDashed_Target"]["area"]["max"]["x"].setInput( __children["Expression5"]["__out"]["p0"] ) __children["RectangleDashed_Target"]["lineWidth"].setValue( 2.0 ) __children["RectangleDashed_Target"]["__uiPosition"].setValue( imath.V2f( -11.1858482, 22.1815834 ) ) -__children["Rectangle_LineTarget"]["out"].setInput( __children["Rectangle_LineTarget"]["__merge"]["out"] ) __children["Rectangle_LineTarget"]["in"].setInput( __children["RectangleDashed_Target"]["out"] ) __children["Rectangle_LineTarget"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 0.5 ) ) __children["Rectangle_LineTarget"]["area"].setValue( imath.Box2f( imath.V2f( 0, 0 ), imath.V2f( 25, 0 ) ) ) @@ -155,7 +169,6 @@ __children["Rectangle_LineTarget"]["lineWidth"].setValue( 2.0 ) __children["Rectangle_LineTarget"]["transform"]["translate"].setValue( imath.V2f( 110, 246 ) ) __children["Rectangle_LineTarget"]["transform"]["rotate"].setValue( 65.0 ) __children["Rectangle_LineTarget"]["__uiPosition"].setValue( imath.V2f( -11.1954498, 13.5136147 ) ) -__children["Text_Target"]["out"].setInput( __children["Text_Target"]["__merge"]["out"] ) __children["Text_Target"]["in"].setInput( __children["Rectangle_LineTarget"]["out"] ) __children["Text_Target"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.114, 1 ) ) __children["Text_Target"]["text"].setValue( 'Rotate vector plug' ) @@ -163,7 +176,6 @@ __children["Text_Target"]["size"].setValue( imath.V2i( 12, 12 ) ) __children["Text_Target"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 200, 100 ) ) ) __children["Text_Target"]["transform"]["translate"].setValue( imath.V2f( 10, 145 ) ) __children["Text_Target"]["__uiPosition"].setValue( imath.V2f( -11.1954498, 5.34955311 ) ) -__children["Rectangle_Compound"]["out"].setInput( __children["Rectangle_Compound"]["__merge"]["out"] ) __children["Rectangle_Compound"]["in"].setInput( __children["Text_Target"]["out"] ) __children["Rectangle_Compound"]["color"].setValue( imath.Color4f( 0, 0.862699986, 0, 1 ) ) __children["Rectangle_Compound"]["area"].setValue( imath.Box2f( imath.V2f( 124, 273 ), imath.V2f( 163, 289 ) ) ) @@ -174,15 +186,15 @@ __children["ImageTransform_Mouse"]["in"].setInput( __children["Text_Mouse"]["out __children["ImageTransform_Mouse"]["transform"]["translate"].setValue( imath.V2f( 150, 248 ) ) __children["ImageTransform_Mouse"]["__uiPosition"].setValue( imath.V2f( 7.05142498, 14.1481361 ) ) __children["ImageTransform_Submenu"]["in"].setInput( __children["Shuffle2"]["out"] ) -__children["ImageTransform_Submenu"]["transform"]["translate"].setValue( imath.V2f( 230, 186 ) ) -__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 41.7049255, 22.1054993 ) ) -__children["Expression4"]["__in"]["p0"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) -__children["Expression4"]["__in"]["p1"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["y"].setValue( 193.0 ) +__children["ImageTransform_Submenu"]["transform"]["translate"]["x"].setInput( __children["FormatQuery1"]["size"]["x"] ) +__children["ImageTransform_Submenu"]["__uiPosition"].setValue( imath.V2f( 47.8649559, 22.1054993 ) ) +__children["Expression4"]["__in"]["p0"].setInput( __children["ImageReader_Editor"]["out"]["format"] ) +__children["Expression4"]["__in"]["p1"].setInput( __children["ImageTransform_Menu"]["in"]["format"] ) __children["Expression4"]["__uiPosition"].setValue( imath.V2f( 16.9665279, 6.32418489 ) ) __children["ImageTransform_Menu"]["in"].setInput( __children["Merge_Submenu"]["out"] ) __children["ImageTransform_Menu"]["transform"]["translate"].setInput( __children["Expression4"]["__out"]["p0"] ) __children["ImageTransform_Menu"]["__uiPosition"].setValue( imath.V2f( 28.216917, 5.77737379 ) ) -__children["Text_Mouse"]["out"].setInput( __children["Text_Mouse"]["__merge"]["out"] ) __children["Text_Mouse"]["in"].setInput( __children["ImageReader_Mouse"]["out"] ) __children["Text_Mouse"]["shadow"].setValue( True ) __children["Text_Mouse"]["shadowOffset"].setValue( imath.V2f( 2, -2 ) ) @@ -193,37 +205,45 @@ __children["Text_Mouse"]["area"].setValue( imath.Box2i( imath.V2i( 0, 0 ), imath __children["Text_Mouse"]["transform"]["translate"].setValue( imath.V2f( 34, -10 ) ) __children["Text_Mouse"]["__uiPosition"].setValue( imath.V2f( 7.05142498, 22.3121986 ) ) __children["Shuffle"]["in"].setInput( __children["ImageReader_Editor"]["out"] ) -__children["Shuffle"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle"]["channels"]["channel3"]["in"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) __children["Shuffle"]["__uiPosition"].setValue( imath.V2f( -11.1855106, 30.5136147 ) ) __children["Shuffle1"]["in"].setInput( __children["ImageReader_Menu"]["out"] ) -__children["Shuffle1"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle1"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle1"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle1"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle1"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 25.2162914, 25.9613552 ) ) +__children["Shuffle1"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle1"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle1"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle1"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle1"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle1"]["__uiPosition"].setValue( imath.V2f( 25.2165432, 22.1054993 ) ) __children["Shuffle2"]["in"].setInput( __children["ImageReader_Submenu"]["out"] ) -__children["Shuffle2"]["channels"]["channel"]["out"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel"]["in"].setValue( 'R' ) -__children["Shuffle2"]["channels"]["channel1"]["out"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel1"]["in"].setValue( 'G' ) -__children["Shuffle2"]["channels"]["channel2"]["out"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel2"]["in"].setValue( 'B' ) -__children["Shuffle2"]["channels"]["channel3"]["out"].setValue( 'A' ) -__children["Shuffle2"]["channels"]["channel3"]["in"].setValue( '__white' ) -__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 41.7052994, 30.2695618 ) ) +__children["Shuffle2"]["shuffles"]["channel"]["source"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel"]["destination"].setValue( 'R' ) +__children["Shuffle2"]["shuffles"]["channel1"]["source"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel1"]["destination"].setValue( 'G' ) +__children["Shuffle2"]["shuffles"]["channel2"]["source"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel2"]["destination"].setValue( 'B' ) +__children["Shuffle2"]["shuffles"]["channel3"]["source"].setValue( '__white' ) +__children["Shuffle2"]["shuffles"]["channel3"]["destination"].setValue( 'A' ) +__children["Shuffle2"]["__uiPosition"].setValue( imath.V2f( 47.8653297, 30.2695618 ) ) +__children["FormatQuery"]["image"].setInput( __children["ImageReader_Editor"]["out"] ) +__children["FormatQuery"]["__uiPosition"].setValue( imath.V2f( -27.9006767, 29.8188457 ) ) +__children["Expression5"]["__in"]["p0"].setInput( __children["FormatQuery"]["size"]["x"] ) +__children["Expression5"]["__uiPosition"].setValue( imath.V2f( -24.0731964, 22.1895275 ) ) +__children["FormatQuery1"]["image"].setInput( __children["ImageReader_Menu"]["out"] ) +__children["FormatQuery1"]["__uiPosition"].setValue( imath.V2f( 32.9081192, 30.1477356 ) ) __children["Expression4"]["__engine"].setValue( 'python' ) -__children["Expression4"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p0"]\nfullDisplayWindow = parent["__in"]["p1"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression4"]["__expression"].setValue( 'import imath\n\ndisplayWindow = parent["__in"]["p1"]\nfullDisplayWindow = parent["__in"]["p0"]\n\noffset = 64\nx = ( fullDisplayWindow.width() ) + offset\ny = ( fullDisplayWindow.height() - displayWindow.height() ) / 2\n\nparent["__out"]["p0"] = imath.V2f( x, y )' ) +__children["Expression5"]["__engine"].setValue( 'OSL' ) +__children["Expression5"]["__expression"].setValue( 'parent.__out.p0 = parent.__in.p0 - 8;' ) del __children diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/screengrab.py b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/screengrab.py index a3f348ef446..e10d8fb857a 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/screengrab.py +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/screengrab.py @@ -4,7 +4,7 @@ # BuildTarget: images/tutorialVariableSubstitutionTest.png # BuildDependency: scripts/tutorialVariableSubstitutionInStringPlug_edit.gfr -import os +import pathlib import subprocess import tempfile import time @@ -27,20 +27,23 @@ def __delay( delay ) : GafferUI.EventLoop.waitForIdle( 1 ) # Create a random directory in `/tmp` for the dispatcher's `jobsDirectory`, so we don't clutter the user's `~gaffer` directory -__temporaryDirectory = tempfile.mkdtemp( prefix = "gafferDocs" ) +__temporaryDirectory = pathlib.Path( tempfile.mkdtemp( prefix = "gafferDocs" ) ) def __getTempFilePath( fileName, directory = __temporaryDirectory ) : - filePath = "/".join( ( directory, fileName ) ) - return filePath + return ( directory / fileName ).as_posix() + +def __outputImagePath( fileName ) : + + return pathlib.Path( "images/{}.png".format( fileName ) ).absolute().as_posix() def __dispatchScript( script, tasks, settings ) : command = "gaffer dispatch -script {} -tasks {} -dispatcher Local -settings {} -dispatcher.jobsDirectory '\"{}/dispatcher/local\"'".format( script, " ".join( tasks ), " ".join( settings ), - __temporaryDirectory - ) + __temporaryDirectory.as_posix() + ) subprocess.check_call( command, shell=True ) # Illustration: a `tree` command run on a custom startup config @@ -85,9 +88,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) script.selection().clear() __nodeEditorWindow.setVisible( False ) diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/screengrab.py b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/screengrab.py index b9cd4dd8bcf..5441c99d22a 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/screengrab.py +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/screengrab.py @@ -7,7 +7,9 @@ # BuildDependency: scripts/tutorialDefaultImageNodeBookmark_edit.gfr import os +import pathlib import subprocess +import sys import tempfile import time @@ -27,20 +29,23 @@ def __delay( delay ) : GafferUI.EventLoop.waitForIdle( 1 ) # Create a random directory in `/tmp` for the dispatcher's `jobsDirectory`, so we don't clutter the user's `~gaffer` directory -__temporaryDirectory = tempfile.mkdtemp( prefix = "gafferDocs" ) +__temporaryDirectory = pathlib.Path( tempfile.mkdtemp( prefix = "gafferDocs" ) ) def __getTempFilePath( fileName, directory = __temporaryDirectory ) : - filePath = "/".join( ( directory, fileName ) ) - return filePath + return ( directory / fileName ).as_posix() + +def __outputImagePath( fileName ) : + + return pathlib.Path( "images/{}.png".format( fileName ) ).absolute().as_posix() def __dispatchScript( script, tasks, settings ) : command = "gaffer dispatch -script {} -tasks {} -dispatcher Local -settings {} -dispatcher.jobsDirectory '\"{}/dispatcher/local\"'".format( script, " ".join( tasks ), " ".join( settings ), - __temporaryDirectory - ) + __temporaryDirectory.as_posix() + ) subprocess.check_call( command, shell=True ) # Tutorial: bookmarks in a file browser @@ -60,15 +65,16 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) __fileBrowser.setVisible( False ) +exampleBookmarkPath = "C:/" if sys.platform == "win32" else "/" # Tutorial: default bookmark in file browser __imageName = "tutorialDefaultBookmark" __tempImagePath = __getTempFilePath( "{}.png".format( __imageName ) ) -__bookmarks.add( "Resources", "/" ) +__bookmarks.add( "Resources", exampleBookmarkPath ) __fileBrowser = GafferUI.PathChooserDialogue( __rootPath, bookmarks = __bookmarks ) __fileBrowser.setVisible( True ) __delay( 0.1 ) @@ -81,16 +87,16 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) __fileBrowser.setVisible( False ) # Tutorial: default bookmark in image node file browser __imageName = "tutorialDefaultImageNodeBookmark" __tempImagePath = __getTempFilePath( "{}.png".format( __imageName ) ) __bookmarks = GafferUI.Bookmarks.acquire( application, Gaffer.FileSystemPath, "image" ) -__bookmarks.add( "Pictures", "/" ) +__bookmarks.add( "Pictures", exampleBookmarkPath ) __fileBrowser = GafferUI.PathChooserDialogue( __rootPath, bookmarks = __bookmarks ) __fileBrowser.setVisible( True ) __delay( 0.1 ) @@ -103,9 +109,9 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "ImageWriter" ], settings = [ "-ImageReader.fileName '\"{}\"'".format( __tempImagePath ), - "-ImageWriter.fileName '\"{}\"'".format( os.path.abspath( "images/{}.png".format( __imageName ) ) ) - ] - ) + "-ImageWriter.fileName '\"{}\"'".format( __outputImagePath( __imageName ) ) + ] +) __fileBrowser.setVisible( False ) # Tutorial: default path in image node file browser diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultBookmark_edit.gfr b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultBookmark_edit.gfr index bf6bf1c0817..4e4ea289636 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultBookmark_edit.gfr +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultBookmark_edit.gfr @@ -1,33 +1,60 @@ import Gaffer import GafferDispatch import GafferImage -import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 53, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, 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["ImageReader"] = GafferImage.ImageReader( "ImageReader" ) parent.addChild( __children["ImageReader"] ) +__children["ImageReader"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Rectangle"] = GafferImage.Rectangle( "Rectangle" ) parent.addChild( __children["Rectangle"] ) +__children["Rectangle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["ImageWriter"] = GafferImage.ImageWriter( "ImageWriter" ) parent.addChild( __children["ImageWriter"] ) +__children["ImageWriter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = 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["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 56106 ) +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["ImageReader"]["colorSpace"].setValue( 'raw' ) -__children["Rectangle"]["out"].setInput( __children["Rectangle"]["__merge"]["out"] ) +__children["ImageReader"]["__uiPosition"].setValue( imath.V2f( 0.498236239, 8.1640625 ) ) __children["Rectangle"]["in"].setInput( __children["ImageReader"]["out"] ) __children["Rectangle"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.113700002, 1 ) ) -__children["Rectangle"]["area"].setValue( imath.Box2f( imath.V2f( 32, 327 ), imath.V2f( 152, 344 ) ) ) +__children["Rectangle"]["area"]["min"]["x"].setValue( 36.0 ) +__children["Rectangle"]["area"]["max"]["x"].setValue( 146.0 ) +__children["Rectangle"]["area"]["min"]["y"].setInput( __children["Expression"]["__out"]["p1"] ) +__children["Rectangle"]["area"]["max"]["y"].setInput( __children["Expression"]["__out"]["p0"] ) __children["Rectangle"]["cornerRadius"].setValue( 4.0 ) +__children["Rectangle"]["__uiPosition"].setValue( imath.V2f( 0.5, -9.53673407e-08 ) ) __children["ImageWriter"]["in"].setInput( __children["Rectangle"]["out"] ) __children["ImageWriter"]["channels"].setValue( ' R G B' ) Gaffer.Metadata.registerValue( __children["ImageWriter"]["channels"], 'channelMaskPlugValueWidget:custom', True ) __children["ImageWriter"]["colorSpace"].setValue( 'raw' ) __children["ImageWriter"]["png"]["compressionLevel"].setValue( 9 ) +__children["ImageWriter"]["__uiPosition"].setValue( imath.V2f( -0.998236179, -8.1640625 ) ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( 9.39199066, 0.0868116617 ) ) +__children["Expression"]["__engine"].setValue( 'python' ) +__children["Expression"]["__expression"].setValue( 'import sys\n\nif sys.platform == "win32" :\n\tmaxY = 329\n\theight = 22\nelse :\n\tmaxY = 349\n\theight = 26\n\nparent["__out"]["p1"] = maxY - height\nparent["__out"]["p0"] = maxY' ) del __children + diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultImageNodeBookmark_edit.gfr b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultImageNodeBookmark_edit.gfr index ca51136d503..dc0fbc79066 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultImageNodeBookmark_edit.gfr +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/scripts/tutorialDefaultImageNodeBookmark_edit.gfr @@ -1,33 +1,60 @@ import Gaffer import GafferDispatch import GafferImage -import IECore import imath -Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 53, persistent=False ) -Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False ) +Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 7, 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["ImageReader"] = GafferImage.ImageReader( "ImageReader" ) parent.addChild( __children["ImageReader"] ) +__children["ImageReader"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Rectangle"] = GafferImage.Rectangle( "Rectangle" ) parent.addChild( __children["Rectangle"] ) +__children["Rectangle"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["ImageWriter"] = GafferImage.ImageWriter( "ImageWriter" ) parent.addChild( __children["ImageWriter"] ) +__children["ImageWriter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = 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["Expression"] = Gaffer.Expression( "Expression" ) +parent.addChild( __children["Expression"] ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 100.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"]["__out"].addChild( Gaffer.FloatPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +__children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) +parent["variables"]["imageCataloguePort"]["value"].setValue( 56106 ) +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["ImageReader"]["colorSpace"].setValue( 'raw' ) -__children["Rectangle"]["out"].setInput( __children["Rectangle"]["__merge"]["out"] ) +__children["ImageReader"]["__uiPosition"].setValue( imath.V2f( 0.498236239, 8.1640625 ) ) __children["Rectangle"]["in"].setInput( __children["ImageReader"]["out"] ) __children["Rectangle"]["color"].setValue( imath.Color4f( 0.964699984, 0.57249999, 0.113700002, 1 ) ) -__children["Rectangle"]["area"].setValue( imath.Box2f( imath.V2f( 32, 310 ), imath.V2f( 152, 327 ) ) ) +__children["Rectangle"]["area"]["min"]["x"].setValue( 36.0 ) +__children["Rectangle"]["area"]["max"]["x"].setValue( 146.0 ) +__children["Rectangle"]["area"]["min"]["y"].setInput( __children["Expression"]["__out"]["p1"] ) +__children["Rectangle"]["area"]["max"]["y"].setInput( __children["Expression"]["__out"]["p0"] ) __children["Rectangle"]["cornerRadius"].setValue( 4.0 ) +__children["Rectangle"]["__uiPosition"].setValue( imath.V2f( 0.5, 9.53673407e-08 ) ) __children["ImageWriter"]["in"].setInput( __children["Rectangle"]["out"] ) __children["ImageWriter"]["channels"].setValue( ' R G B' ) Gaffer.Metadata.registerValue( __children["ImageWriter"]["channels"], 'channelMaskPlugValueWidget:custom', True ) __children["ImageWriter"]["colorSpace"].setValue( 'raw' ) __children["ImageWriter"]["png"]["compressionLevel"].setValue( 9 ) +__children["ImageWriter"]["__uiPosition"].setValue( imath.V2f( -0.998236179, -8.1640625 ) ) +__children["Expression"]["__uiPosition"].setValue( imath.V2f( 9.01667786, -0.240479141 ) ) +__children["Expression"]["__engine"].setValue( 'python' ) +__children["Expression"]["__expression"].setValue( 'import sys\n\nif sys.platform == "win32" :\n\tmaxY = 313\n\theight = 22\nelse :\n\tmaxY = 333\n\theight = 26\n\nparent["__out"]["p1"] = maxY - height\nparent["__out"]["p0"] = maxY' ) del __children + diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig3/screengrab.py b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig3/screengrab.py index 36255d0a2e7..2856f779cb6 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig3/screengrab.py +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig3/screengrab.py @@ -1,6 +1,7 @@ # BuildTarget: images/exampleMacbethChart.png import os +import pathlib import tempfile import subprocess import imath @@ -10,15 +11,15 @@ import GafferUI # Create a random directory in `/tmp` for the dispatcher's `jobsDirectory`, so we don't clutter the user's `~gaffer` directory -__temporaryDirectory = tempfile.mkdtemp( prefix = "gafferDocs" ) +__temporaryDirectory = pathlib.Path( tempfile.mkdtemp( prefix = "gafferDocs" ) ) def __dispatchScript( script, tasks, settings ) : command = "gaffer dispatch -script {} -tasks {} -dispatcher Local -settings {} -dispatcher.jobsDirectory '\"{}/dispatcher/local\"'".format( script, " ".join( tasks ), " ".join( settings ), - __temporaryDirectory - ) + __temporaryDirectory.as_posix() + ) subprocess.check_call( command, shell=True ) # Example: Macbeth Chart @@ -27,11 +28,11 @@ def __dispatchScript( script, tasks, settings ) : tasks = [ "Render" ], settings = [ "-StandardOptions.options.renderResolution.enabled True", - "-StandardOptions.options.renderResolution.value.x '270'", - "-StandardOptions.options.renderResolution.value.y '240'", - "-background_light.parameters.exposure '1'", - "-Outputs.outputs.output2.fileName '\"{}\"'".format( os.path.abspath( "images/exampleMacbethChart.png" ) ), + "-StandardOptions.options.renderResolution.value.x 270", + "-StandardOptions.options.renderResolution.value.y 240", + "-background_light.parameters.exposure 1", + "-Outputs.outputs.output2.fileName '\"{}\"'".format( pathlib.Path( "images/exampleMacbethChart.png" ).absolute().as_posix() ), "-Outputs.outputs.output2.type '\"png\"'", "-Outputs.outputs.output1.active False" - ] - ) + ] +) diff --git a/python/GafferArnoldUI/ArnoldShaderUI.py b/python/GafferArnoldUI/ArnoldShaderUI.py index 2efd0196230..3720182d6e1 100644 --- a/python/GafferArnoldUI/ArnoldShaderUI.py +++ b/python/GafferArnoldUI/ArnoldShaderUI.py @@ -461,9 +461,14 @@ def addActivator( activator ) : if value is not None : __metadata[paramPath][gafferKey] = value +if [ int( x ) for x in arnold.AiGetVersion()[:3] ] < [ 7, 3, 1 ] : + __AI_NODE_IMAGER = arnold.AI_NODE_DRIVER +else : + __AI_NODE_IMAGER = arnold.AI_NODE_IMAGER + with IECoreArnold.UniverseBlock( writable = False ) : - nodeIt = arnold.AiUniverseGetNodeEntryIterator( arnold.AI_NODE_SHADER | arnold.AI_NODE_LIGHT | arnold.AI_NODE_COLOR_MANAGER | arnold.AI_NODE_DRIVER ) + nodeIt = arnold.AiUniverseGetNodeEntryIterator( arnold.AI_NODE_SHADER | arnold.AI_NODE_LIGHT | arnold.AI_NODE_COLOR_MANAGER | __AI_NODE_IMAGER ) while not arnold.AiNodeEntryIteratorFinished( nodeIt ) : __translateNodeMetadata( arnold.AiNodeEntryIteratorGetNext( nodeIt ) ) diff --git a/python/GafferArnoldUITest/ArnoldShaderUITest.py b/python/GafferArnoldUITest/ArnoldShaderUITest.py index 349a9420faa..04c6c9c5b58 100644 --- a/python/GafferArnoldUITest/ArnoldShaderUITest.py +++ b/python/GafferArnoldUITest/ArnoldShaderUITest.py @@ -127,6 +127,31 @@ def testLightMetadata( self ) : Gaffer.Metadata.value( light["parameters"]["format"], "presetNames" ), ) + def testImagerMetadata( self ) : + + shader = GafferArnold.ArnoldShader() + shader.loadShader( "imager_white_balance" ) + + self.assertEqual( + Gaffer.Metadata.value( shader["parameters"]["mode"], "nodule:type" ), + "" + ) + + self.assertEqual( + Gaffer.Metadata.value( shader["parameters"]["mode"], "plugValueWidget:type" ), + "GafferUI.PresetsPlugValueWidget" + ) + + self.assertEqual( + Gaffer.Metadata.value( shader["parameters"]["mode"], "presetNames" ), + IECore.StringVectorData( [ "illuminant", "temperature", "custom" ] ), + ) + + self.assertEqual( + Gaffer.Metadata.value( shader["parameters"]["mode"], "presetValues" ), + Gaffer.Metadata.value( shader["parameters"]["mode"], "presetNames" ), + ) + def testUserDefaultMetadata( self ) : cacheFilePath = self.temporaryDirectory() / "testShaderUserDefaults.scc" diff --git a/python/GafferSceneTest/SetAlgoTest.py b/python/GafferSceneTest/SetAlgoTest.py index 91ebec9e90e..8b5ecc6dc1f 100644 --- a/python/GafferSceneTest/SetAlgoTest.py +++ b/python/GafferSceneTest/SetAlgoTest.py @@ -134,6 +134,26 @@ def test( self ) : expressionCheck( '(setA - ((setC /group/group/sphere2) & setB))', [ '/group/group/sphere1' ] ) expressionCheck( 'setA - (/group/group/sphere1 /group/group/sphere2) | (setA setB setC) & setC', [ '/group/sphere3' ] ) + # Test a selection of the above expressions with tab and newline whitespace characters inserted + expressionCheck( 'setA\nsetC', [ '/group/group/sphere1', '/group/group/sphere2', '/group/sphere3' ] ) + expressionCheck( '\n\nsetA\tsetC\n\n\t', [ '/group/group/sphere1', '/group/group/sphere2', '/group/sphere3' ] ) + expressionCheck( 'setA\t-\tsetB\n|\nsetC', [ '/group/group/sphere1', '/group/sphere3' ] ) + expressionCheck( 'setA\n| setB\n& setC', [ '/group/group/sphere1', '/group/group/sphere2' ] ) + expressionCheck( '/group/light1\n/group/light2', [ '/group/light1', '/group/light2' ] ) + expressionCheck( '/group/light1\t/group/light2\n', [ '/group/light1', '/group/light2' ] ) + expressionCheck( '(\n\t/group/light1\n\t/group/light2\n)\n|\nsetA', [ '/group/light1', '/group/light2', '/group/group/sphere1', '/group/group/sphere2' ] ) + expressionCheck( '(\nsetA - \n(\n\t(\n\t\tsetC /group/group/sphere2\n\t)\n & setB)\n)\n', [ '/group/group/sphere1' ] ) + + # Test expressions containing only whitespace are treated as empty + expressionCheck( '', [] ) + expressionCheck( ' ', [] ) + expressionCheck( '\n', [] ) + expressionCheck( ' \n ', [] ) + expressionCheck( '\t', [] ) + expressionCheck( ' \t ', [] ) + expressionCheck( '\n \t', [] ) + expressionCheck( '\t\n\t \n \t\n', [] ) + # Test if proper exception is thrown for invalid expression with self.assertRaises( RuntimeError ) as e : # note the missing ) diff --git a/python/GafferSceneUI/HierarchyView.py b/python/GafferSceneUI/HierarchyView.py index 0eac5762ccd..ffdc96905ea 100644 --- a/python/GafferSceneUI/HierarchyView.py +++ b/python/GafferSceneUI/HierarchyView.py @@ -91,7 +91,7 @@ def __init__( self, scriptNode, **kw ) : self.__selectionChangedConnection = self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ), scoped = False ) self.__expansionChangedConnection = self.__pathListing.expansionChangedSignal().connect( Gaffer.WeakMethod( self.__expansionChanged ), scoped = False ) - self.__pathListing.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenuSignal ), scoped = False ) + self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ), scoped = False ) self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPressSignal ), scoped = False ) self._updateFromSet() @@ -103,6 +103,17 @@ def scene( self ) : return self.settings()["in"].getInput() + ## Returns the widget used for showing the main scene listing, with the + # intention that clients can add custom context menu items via + # `sceneListing.columnContextMenuSignal()`. + # + # > Caution : This currently returns a PathListingWidget, but in future + # > will probably return a more specialised widget with fewer privileges. + # > Please limit usage to `columnContextMenuSignal()`. + def sceneListing( self ) : + + return self.__pathListing + def __repr__( self ) : return "GafferSceneUI.HierarchyView( scriptNode )" @@ -167,11 +178,9 @@ def __keyPressSignal( self, widget, event ) : return False - def __contextMenuSignal( self, widget ) : - - menuDefinition = IECore.MenuDefinition() + def __columnContextMenuSignal( self, column, pathListing, menuDefinition ) : - selection = self.__pathListing.getSelection() + selection = pathListing.getSelection() menuDefinition.append( "Copy Path%s" % ( "" if selection.size() == 1 else "s" ), { @@ -189,11 +198,6 @@ def __contextMenuSignal( self, widget ) : } ) - self.__contextMenu = GafferUI.Menu( menuDefinition ) - self.__contextMenu.popup( widget ) - - return True - def __copySelectedPaths( self, *unused ) : if self.scene() is None : diff --git a/python/GafferUI/PathListingWidget.py b/python/GafferUI/PathListingWidget.py index ea5774c6c4e..03a25c23751 100644 --- a/python/GafferUI/PathListingWidget.py +++ b/python/GafferUI/PathListingWidget.py @@ -148,6 +148,7 @@ def __init__( self.__displayModeChangedSignal = GafferUI.WidgetSignal() self.__expansionChangedSignal = GafferUI.WidgetSignal() self.__updateFinishedSignal = GafferUI.WidgetSignal() + self.__columnContextMenuSignal = Gaffer.Signal3() # Connections for implementing selection and drag and drop. self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) @@ -157,6 +158,7 @@ def __init__( self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ), scoped = False ) self.__dragPointer = "paths" self.__path = None @@ -423,6 +425,19 @@ def pathSelectedSignal( self ) : return self.__pathSelectedSignal + ## Signal emitted to generate a context menu for a column. This allows + # multiple clients to collaborate in the construction of a menu, with each + # providing different items. It should be preferred to the generic + # `Widget.contextMenuSignal()`. + # + # Slots must have the following signature, with the `menuDefinition` being + # edited directly in place : + # + # `slot( column, pathListingWidget, menuDefinition )` + def columnContextMenuSignal( self ) : + + return self.__columnContextMenuSignal + def setDragPointer( self, dragPointer ) : self.__dragPointer = dragPointer @@ -749,6 +764,47 @@ def __dragEnd( self, widget, event ) : GafferUI.Pointer.setCurrent( None ) + def __contextMenu( self, widget ) : + + if not self.columnContextMenuSignal().numSlots() : + # Allow legacy clients connected to `Widget.contextMenuSignal()` to + # do their own thing instead. + return False + + # Select the path under the mouse, if it's not already selected. + # The user will expect to be operating on the thing under the mouse. + + mousePosition = GafferUI.Widget.mousePosition( relativeTo = self ) + column = self.columnAt( mousePosition ) + + path = self.pathAt( mousePosition ) + if path is not None : + path = str( path ) + selection = self.getSelection() + if isinstance( selection, IECore.PathMatcher ) : + # Row or Rows mode. + if not selection.match( path ) & IECore.PathMatcher.Result.ExactMatch : + selection = IECore.PathMatcher( [ path ] ) + self.setSelection( selection ) + else : + # Cell or Cells mode. + columnIndex = self.getColumns().index( column ) + if not selection[columnIndex].match( path ) & IECore.PathMatcher.Result.ExactMatch : + for i in range( 0, len( selection ) ) : + selection[i] = IECore.PathMatcher() if columnIndex != i else IECore.PathMatcher( [ path ] ) + self.setSelection( selection ) + + # Use signals to build menu and display it. + + menuDefinition = IECore.MenuDefinition() + self.columnContextMenuSignal()( column, self, menuDefinition ) + + if menuDefinition.size() : + self.__columnContextMenu = GafferUI.Menu( menuDefinition ) + self.__columnContextMenu.popup( self ) + + return True + def __indexAt( self, position ) : point = self._qtWidget().viewport().mapFrom( diff --git a/python/GafferUI/ShowURL.py b/python/GafferUI/ShowURL.py index 1b65d204cd5..f75249887d4 100644 --- a/python/GafferUI/ShowURL.py +++ b/python/GafferUI/ShowURL.py @@ -55,4 +55,11 @@ def showURL( url ) : if opener : os.system( "{0} \"{1}\"".format( opener, url ) ) else : + if sys.platform == "win32" and url.startswith( "file://" ) : + # Windows doesn't let us reliably open "file://" URLs but + # yet has no problem with opening the file itself. This + # means we can't support anchors in file URLs on Windows + # as we need to strip them to produce a valid file path. + url = url[7:].partition( "#" )[0] + QtGui.QDesktopServices.openUrl( QtCore.QUrl( url, QtCore.QUrl.TolerantMode ) ) diff --git a/python/GafferUI/WidgetAlgo.py b/python/GafferUI/WidgetAlgo.py index 1db57e5e169..7526aba43a9 100644 --- a/python/GafferUI/WidgetAlgo.py +++ b/python/GafferUI/WidgetAlgo.py @@ -103,11 +103,17 @@ def grab( widget, imagePath ) : if windowHandle : screen = windowHandle.screen() - pixmap = screen.grabWindow( widget._qtWidget().winId() ) - - if sys.platform == "darwin" and pixmap.size() == screen.size() * screen.devicePixelRatio() : - # A bug means that the entire screen will have been captured, - # not just the widget we requested. Copy out just the widget. + # On Windows the most reliable method of capturing a window with its + # popup menu is to capture the entire screen and crop to the widget. + pixmap = screen.grabWindow( 0 if sys.platform == "win32" else widget._qtWidget().winId() ) + + if ( + sys.platform == "win32" or + ( sys.platform == "darwin" and pixmap.size() == screen.size() * screen.devicePixelRatio() ) + ) : + # A bug on macOS or our above workaround on Windows means that + # the entire screen will have been captured, not just the + # widget we requested. Copy out just the widget. topLeft = widget._qtWidget().mapToGlobal( QtCore.QPoint( 0, 0 ) ) bottomRight = widget._qtWidget().mapToGlobal( QtCore.QPoint( widget._qtWidget().width(), widget._qtWidget().height() ) ) size = bottomRight - topLeft diff --git a/src/GafferScene/SetAlgo.cpp b/src/GafferScene/SetAlgo.cpp index 511b19def20..a2b16beaca6 100644 --- a/src/GafferScene/SetAlgo.cpp +++ b/src/GafferScene/SetAlgo.cpp @@ -439,7 +439,7 @@ struct ExpressionGrammar : qi::grammar