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

blender_icons_geom_update.py « datafiles « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1671067664edc7c7e54b644b719dc5aaddb47c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3

# This script updates icons from the BLEND file
import os
import subprocess

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 geometry (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"),
        "--",
        "--group", "Export",
        "--output-dir", os.path.join(BASEDIR, "icons"),
    )
    run(cmd)