forked from bartvdbraak/blender
Add "make icons_geom" convenience target
Generates icons from the blend file in lib.
This commit is contained in:
parent
67f23cff53
commit
24bde1ca43
11
GNUmakefile
11
GNUmakefile
@ -236,9 +236,10 @@ help: .FORCE
|
|||||||
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Utilities (not associated with building blender)"
|
@echo "Utilities (not associated with building blender)"
|
||||||
@echo " * icons - updates PNG icons from SVG files."
|
@echo " * icons - updates PNG icons from SVG files."
|
||||||
@echo " * tgz - create a compressed archive of the source code."
|
@echo " * icons_geom - updates Geometry icons from BLEND file."
|
||||||
@echo " * update - updates git and all submodules"
|
@echo " * tgz - create a compressed archive of the source code."
|
||||||
|
@echo " * update - updates git and all submodules"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Environment Variables"
|
@echo "Environment Variables"
|
||||||
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
|
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
|
||||||
@ -423,6 +424,10 @@ icons: .FORCE
|
|||||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||||
|
|
||||||
|
icons_geom: .FORCE
|
||||||
|
BLENDER_BIN="$(BUILD_DIR)/bin/blender" \
|
||||||
|
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
|
||||||
|
|
||||||
update: .FORCE
|
update: .FORCE
|
||||||
if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
||||||
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
||||||
|
32
release/datafiles/blender_icons_geom_update.py
Executable file
32
release/datafiles/blender_icons_geom_update.py
Executable file
@ -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)
|
Loading…
Reference in New Issue
Block a user