forked from bartvdbraak/blender
Icons: Update script to generate icons from SVGs for Inkscape 1.0
The command line syntax for Inkscape changed quite a bit for the 1.0 release, see https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line. Think it's reasonable to expect Inkscape 1.0 or later be installed if you want to generate the icons with the script. It's easy to get via the website, if the distribution doesn't provide new enough packages. Only few people would use the script anyway. I also had to change the path for command line access on macOS which apparently changed (https://stackoverflow.com/a/60068607). Although I didn't find a mention of this change in the Inkscape release notes.
This commit is contained in:
parent
c66f00dc26
commit
c549d736cf
@ -17,7 +17,7 @@ inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
|
|||||||
blender_bin = os.environ.get("BLENDER_BIN", "blender")
|
blender_bin = os.environ.get("BLENDER_BIN", "blender")
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
inkscape_app_path = '/Applications/Inkscape.app/Contents/Resources/script'
|
inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
|
||||||
if os.path.exists(inkscape_app_path):
|
if os.path.exists(inkscape_app_path):
|
||||||
inkscape_bin = inkscape_app_path
|
inkscape_bin = inkscape_app_path
|
||||||
blender_app_path = '/Applications/Blender.app/Contents/MacOS/Blender'
|
blender_app_path = '/Applications/Blender.app/Contents/MacOS/Blender'
|
||||||
@ -29,8 +29,8 @@ cmd = (
|
|||||||
os.path.join(BASEDIR, "blender_icons.svg"),
|
os.path.join(BASEDIR, "blender_icons.svg"),
|
||||||
"--export-width=602",
|
"--export-width=602",
|
||||||
"--export-height=640",
|
"--export-height=640",
|
||||||
"--without-gui",
|
"--export-type=png",
|
||||||
"--export-png=" + os.path.join(BASEDIR, "blender_icons16.png"),
|
"--export-filename=" + os.path.join(BASEDIR, "blender_icons16.png"),
|
||||||
)
|
)
|
||||||
run(cmd)
|
run(cmd)
|
||||||
|
|
||||||
@ -39,8 +39,8 @@ cmd = (
|
|||||||
os.path.join(BASEDIR, "blender_icons.svg"),
|
os.path.join(BASEDIR, "blender_icons.svg"),
|
||||||
"--export-width=1204",
|
"--export-width=1204",
|
||||||
"--export-height=1280",
|
"--export-height=1280",
|
||||||
"--without-gui",
|
"--export-type=png",
|
||||||
"--export-png=" + os.path.join(BASEDIR, "blender_icons32.png"),
|
"--export-filename=" + os.path.join(BASEDIR, "blender_icons32.png"),
|
||||||
)
|
)
|
||||||
run(cmd)
|
run(cmd)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
|||||||
inkscape_path = 'inkscape'
|
inkscape_path = 'inkscape'
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
inkscape_app_path = '/Applications/Inkscape.app/Contents/Resources/script'
|
inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
|
||||||
if os.path.exists(inkscape_app_path):
|
if os.path.exists(inkscape_app_path):
|
||||||
inkscape_path = inkscape_app_path
|
inkscape_path = inkscape_app_path
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ cmd = (
|
|||||||
os.path.join(BASEDIR, "prvicons.svg"),
|
os.path.join(BASEDIR, "prvicons.svg"),
|
||||||
"--export-width=1792",
|
"--export-width=1792",
|
||||||
"--export-height=256",
|
"--export-height=256",
|
||||||
"--without-gui",
|
"--export-type=png",
|
||||||
"--export-png=" + os.path.join(BASEDIR, "prvicons.png"),
|
"--export-filename=" + os.path.join(BASEDIR, "prvicons.png"),
|
||||||
)
|
)
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user