diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-24 13:08:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-24 13:09:31 +0300 |
commit | 24bde1ca43f6b3d87fcc4603c218aa442b6af779 (patch) | |
tree | 218752b069f2ffb3f5f3052b9b7d60f2d6d833d1 /release/datafiles/blender_icons_geom_update.py | |
parent | 67f23cff53922561604920650a2025ba6771f2c1 (diff) |
Add "make icons_geom" convenience target
Generates icons from the blend file in lib.
Diffstat (limited to 'release/datafiles/blender_icons_geom_update.py')
-rwxr-xr-x | release/datafiles/blender_icons_geom_update.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/release/datafiles/blender_icons_geom_update.py b/release/datafiles/blender_icons_geom_update.py new file mode 100755 index 00000000000..df87ab4d444 --- /dev/null +++ b/release/datafiles/blender_icons_geom_update.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# This script updates icons from the SVG file +import os +import subprocess +import sys + +def run(cmd): + print(" ", " ".join(cmd)) + subprocess.check_call(cmd) + +BASEDIR = os.path.abspath(os.path.dirname(__file__)) +ROOTDIR = os.path.normpath(os.path.join(BASEDIR, "..", "..")) + +blender_bin = os.environ.get("BLENDER_BIN", "blender") +if not os.path.exists(blender_bin): + blender_bin = os.path.join(ROOTDIR, "blender.bin") + +icons_blend = ( + os.path.join(ROOTDIR, "..", "lib", "resources", "icon_geom.blend"), +) + +# create .dat pixmaps (which are stored in git) +for blend in icons_blend: + cmd = ( + blender_bin, "--background", "--factory-startup", "-noaudio", + blend, + "--python", os.path.join(BASEDIR, "blender_icons_geom.py"), + "--", + "--output-dir", os.path.join(BASEDIR, "icons"), + ) + run(cmd) |