Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stefan.werner@tangent-animation.com>2021-08-21 23:03:31 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2021-08-21 23:03:31 +0300
commitc5b56a525cd6113caa2bd3ec7bfb91fe4a04513a (patch)
tree77dae5ae2fbeccf6703034c94ad3e1f3aa81140b /release/datafiles/blender_icons_update.py
parent34e8d79c3edbc58fd242cec0c1f2bed4e43855af (diff)
parent67c29bc5a273b66e278bd20c18187b425acf1869 (diff)
Merge branch 'master' into cycles_texture_cachecycles_texture_cache
Diffstat (limited to 'release/datafiles/blender_icons_update.py')
-rwxr-xr-xrelease/datafiles/blender_icons_update.py42
1 files changed, 36 insertions, 6 deletions
diff --git a/release/datafiles/blender_icons_update.py b/release/datafiles/blender_icons_update.py
index 8167b8b25e6..524cc512f29 100755
--- a/release/datafiles/blender_icons_update.py
+++ b/release/datafiles/blender_icons_update.py
@@ -1,18 +1,48 @@
#!/usr/bin/env python3
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
# This script updates icons from the SVG file
import os
import subprocess
import sys
-def run(cmd):
+def run(cmd, *, env=None):
print(" ", " ".join(cmd))
- subprocess.check_call(cmd)
+ subprocess.check_call(cmd, env=env)
BASEDIR = os.path.abspath(os.path.dirname(__file__))
+env = {}
+# Developers may have ASAN enabled, avoid non-zero exit codes.
+env["ASAN_OPTIONS"] = "exitcode=0:" + os.environ.get("ASAN_OPTIONS", "")
+
+# These NEED to be set on windows for python to initialize properly.
+if sys.platform[:3] == "win":
+ env["PATHEXT"] = os.environ.get("PATHEXT", "")
+ env["SystemDrive"] = os.environ.get("SystemDrive", "")
+ env["SystemRoot"] = os.environ.get("SystemRoot", "")
+
inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
blender_bin = os.environ.get("BLENDER_BIN", "blender")
@@ -32,7 +62,7 @@ cmd = (
"--export-type=png",
"--export-filename=" + os.path.join(BASEDIR, "blender_icons16.png"),
)
-run(cmd)
+run(cmd, env=env)
cmd = (
inkscape_bin,
@@ -42,7 +72,7 @@ cmd = (
"--export-type=png",
"--export-filename=" + os.path.join(BASEDIR, "blender_icons32.png"),
)
-run(cmd)
+run(cmd, env=env)
# For testing it can be good to clear all old
@@ -64,7 +94,7 @@ cmd = (
"--minx_icon", "2", "--maxx_icon", "2", "--miny_icon", "2", "--maxy_icon", "2",
"--spacex_icon", "1", "--spacey_icon", "1",
)
-run(cmd)
+run(cmd, env=env)
cmd = (
blender_bin, "--background", "--factory-startup", "-noaudio",
@@ -78,7 +108,7 @@ cmd = (
"--minx_icon", "4", "--maxx_icon", "4", "--miny_icon", "4", "--maxy_icon", "4",
"--spacex_icon", "2", "--spacey_icon", "2",
)
-run(cmd)
+run(cmd, env=env)
os.remove(os.path.join(BASEDIR, "blender_icons16.png"))
os.remove(os.path.join(BASEDIR, "blender_icons32.png"))