diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b42b573649c..addc373ff0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: - name: Install toolchain (Windows) run: | python -m pip install scons - Invoke-WebRequest -Uri "https://inkscape.org/gallery/item/18067/inkscape-0.92.5-x64.exe" -OutFile "inkscape.exe" + 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 if: runner.os == 'Windows' diff --git a/.github/workflows/main/sconsOptions b/.github/workflows/main/sconsOptions index 96fbb62a5e0..d830d6e0bc8 100644 --- a/.github/workflows/main/sconsOptions +++ b/.github/workflows/main/sconsOptions @@ -60,7 +60,7 @@ if sys.platform == "win32" : LOCATE_DEPENDENCY_LIBPATH=os.path.join(os.environ["GAFFER_BUILD_DIR"], "lib") LOCATE_DEPENDENCY_PYTHONPATH=os.path.join(os.environ["GAFFER_BUILD_DIR"], "python") GLEW_LIB_SUFFIX = "32" - INKSCAPE = "C:\\Program Files\\Inkscape\\inkscape.com" + INKSCAPE = "C:\\Program Files\\Inkscape\\bin\\inkscape.exe" WARNINGS_AS_ERRORS = False APPLESEED_ROOT = None SPHINX = "noSphinxYet" diff --git a/Changes.md b/Changes.md index cc573886f24..a7ddb757d6e 100644 --- a/Changes.md +++ b/Changes.md @@ -6,6 +6,11 @@ Documentation - Added more Python examples to the Scripting Reference "Common Operations" article. +Build +----- + +- Added support for Inkscape versions greater than 1.0. + 1.2.0.2 (relative to 1.2.0.1) ======= diff --git a/SConstruct b/SConstruct index acfd876cb6d..04e53806992 100644 --- a/SConstruct +++ b/SConstruct @@ -677,6 +677,9 @@ if not haveInkscape and env["INKSCAPE"] != "disableGraphics" : sys.stderr.write( "ERROR : Inkscape not found. Check INKSCAPE build variable.\n" ) Exit( 1 ) +inkscapeHelp = subprocess.check_output( [ env["INKSCAPE"], "--help" ], universal_newlines=True ) +env["INKSCAPE_USE_EXPORT_FILENAME"] = True if "--export-filename" in inkscapeHelp else False + haveSphinx = conf.checkSphinx() if not conf.checkQtVersion() : @@ -1739,14 +1742,22 @@ def buildImageCommand( source, target, env ) : os.makedirs( outputDirectory ) args = [ - "--export-png={}".format( os.path.abspath( filename ) ), + env["INKSCAPE"], "--export-id={}".format( substitutions["id"] ), "--export-width={:d}".format( substitutions["width"] ), "--export-height={:d}".format( substitutions["height"] ), - "--export-background-opacity=0", - os.path.abspath( svgFilename ) + "--export-background-opacity=0" ] - subprocess.check_call( [ env["INKSCAPE"] ] + args ) + if env["INKSCAPE_USE_EXPORT_FILENAME"] : + args += [ + "--export-filename={}".format( os.path.abspath( filename ) ), + "--export-overwrite", + ] + else : + args.append( "--export-png={}".format( os.path.abspath( filename ) ) ) + args.append( os.path.abspath( svgFilename ) ) + + subprocess.check_call( args ) def validateAndFlattenImageOptions( imageOptions, svg ) : diff --git a/resources/graphics.svg b/resources/graphics.svg index d9b6311d01d..5e220d5aefd 100644 --- a/resources/graphics.svg +++ b/resources/graphics.svg @@ -2,22 +2,21 @@ + enable-background="new" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> Gaffer Icons + gradientTransform="translate(0)" + inkscape:swatch="solid"> + inkscape:swatch="solid"> + gradientTransform="matrix(0.75404204,0,0,0.75404204,1036.3646,556.73822)" + inkscape:swatch="solid"> + gradientTransform="matrix(1.4488738,0,0,1.25,538.46586,5059.4394)" + inkscape:swatch="solid"> + inkscape:swatch="solid"> + inkscape:swatch="solid"> + gradientTransform="translate(5.989806,2637.8795)" + inkscape:swatch="solid"> + inkscape:swatch="solid"> + gradientTransform="matrix(1.2290988,0,0,1.2291084,-132.4402,-34.51184)" + inkscape:swatch="solid"> + inkscape:swatch="solid"> + gradientTransform="matrix(2.4748712,0,0,2.4748712,306.23756,9040.4548)" + inkscape:swatch="solid"> + gradientTransform="matrix(0.99899272,0,0,0.99899272,-329.43339,-140.23037)" + inkscape:swatch="solid"> + inkscape:swatch="solid"> + id="filter2913" + x="-0.042472561" + y="-0.16729425" + width="1.0849494" + height="1.3192038"> + inkscape:bbox-nodes="true" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#4c4c4c" + showgrid="false" + inkscape:zoom="5.357041" + inkscape:cx="260.68496" + inkscape:cy="2570.2622" + inkscape:window-width="3747" + inkscape:window-height="2126" + inkscape:window-x="82" + inkscape:window-y="-11" + inkscape:window-maximized="1" + inkscape:current-layer="layer1"> + UI GRAPHICS UI GRAPHICS + + id="text2565" /> - The x,y coordinate of the pointer should be set to the coordinates of the pixel to be used when computing mouse/object intersection.- All exports should use the 'pointer' prefix. - All exports should use the 'pointer' prefix. + POINTERS POINTERS + - Odd sized images are valid if its assists center alignment, especially at small scales. - Use standard swatch fills/strokes where possible. - Use standard swatch fills/strokes where possible. + POINTERS - PathFilterUI POINTERS - PathFilterUI + ARROWS 10x10 ARROWS 10x10 + CATALOGUE STATUS CATALOGUE STATUS + SCENE VIEW SCENE VIEW + IMAGE VIEW IMAGE VIEW + TOOLS TOOLS + BROWSER ICONS BROWSER ICONS + + id="text3326" /> CONTROLS - checkBox CONTROLS - checkBox + CONTROLS - switch CONTROLS - switch + Editor Focus Menu Editor Focus Menu + Viewer 25x25 Viewer 25x25 + Notifications Notifications + Tab icons Tab icons + Color Inspector Icons Color Inspector Icons + GraphEditor GraphEditor + PlugValueWidgets PlugValueWidgets + LightEditor LightEditor + TweakModes TweakModes + Menus Menus + HierarchyView HierarchyView + + id="text8094" /> 2 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">2 3 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">3 4 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">4 1 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">1 2 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">2 4 + style="font-size:10.6667px;line-height:10%;fill:#ffffff;fill-opacity:1">4 A + style="fill:#aeaeae;fill-opacity:1;stroke-width:0.307102px">A B A + style="fill:url(#foreground);fill-opacity:1;stroke-width:0.307102px">A A B + style="fill:url(#foreground);fill-opacity:1;stroke-width:0.307102px">B A B + style="fill:url(#foreground);fill-opacity:1;stroke-width:0.179569px">B + + + transform="translate(0,66)" + style="display:inline"> - -