blender-motion-state-inspection
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
Automate Blender 5.3 at scale - headless CLI flags, batch convert/inventory/run-any-skill-script over folders of .blend/.fbx/.glb/.obj/.usd, sharding, bpy pip module, library linking, path management, render-farm and CI patterns. Use for batch jobs, format conversion, library maintenance and pipeline tooling.
The execution model is in blender-core (run_in_blender.py finds Blender and prints only the JSON results).
blender -b -P scripts/batch_process.py -- --in "assets/**/*.fbx" --op convert --to glb --out export/
blender -b -P scripts/batch_process.py -- --in library/ --op report # inventory JSON lines
blender -b -P scripts/batch_process.py -- --in "src/*.blend" --op script \
--script ../blender-asset-qa/scripts/qa_check.py --kwargs '{"profile":"game"}' # QA a whole library
blender -b -P scripts/batch_process.py -- --in src/ --op script --script ../blender-game-optimization/scripts/make_lods.py \
--kwargs '{"rename":true}' --save-to processed/ # LODs for every file
Each file is streamed as one JSON line with ok, timing and results. Failures don't stop the batch, and the summary lists them. Parallel: start N processes with --shard 0/N … --shard N-1/N (Blender uses one core for Python, so processes scale with CPU/GPU count).
| Flag | Meaning |
|---|---|
-b | background, no UI. Put it first |
file.blend | open before running scripts. Order matters: args run left to right |
-P script.py / --python-expr "..." | run Python |
--python-exit-code 1 | non-zero exit if the script raises (CI) |
--factory-startup | ignore user prefs/add-ons (reproducible). Bundled add-ons still load |
--addons rigify,io_scene_fbx | enable specific add-ons |
-E CYCLES -o //out/#### -F PNG -s 1 -e 10 -a / -f 5 | render (blender-rendering) |
--command extension build/validate/install-file | extension tooling (blender-addon-development) |
-- --my args | everything after -- goes to the script (sys.argv[sys.argv.index("--")+1:]) |
--log "*", --debug-python | debugging. 5.0 changed the log format, so don't regex progress lines |
Environment variables: BLENDER_USER_SCRIPTS, BLENDER_USER_EXTENSIONS, BLENDER_SYSTEM_PYTHON. Use OCIO for custom color configs. |
pip install bpy==5.3.* (or 5.2.* for the LTS) (Python 3.13, matching the Blender release) gives import bpy in plain Python, which is handy for pytest/CI/web services. It has no UI and no GPU module by default, and it's large (~300 MB). Version-lock it with the Blender you target. The bpy wheel and the CLI behave the same for data API work.
bpy.data.libraries.load(path, link=...) (see blender-core/references/bpy-patterns.md). 5.2: data_from.libraries exposes nested library paths when loading.bpy.data.libraries.write(path, {datablocks}, fake_user=True, path_remap="RELATIVE_ALL") builds asset/library files from a session.bpy.data.file_path_foreach(...) (5.2 flags: EXPAND_TOKENS for UDIMs, EXPAND_SEQUENCES, EXPAND_CACHES), and bpy.utils.blend_paths(absolute=True) lists every external path.bpy.ops.file.find_missing_files(directory=...), make_paths_relative, pack_all. Libraries: lib.filepath = new; lib.reload().bpy.data.all_ids (5.2; order isn't stable in 5.3, so sort by name if output must be deterministic), and bpy.data.orphans_purge(do_recursive=True) for cleanup.batch_process.py reuses the process but resets with read_factory_settings(use_empty=True) / open_mainfile.--out/--save-to, and write with copy=True.exist_ok).bpy.app.version_string + hash (bpy.app.build_hash) in the outputs.bpy.path.abspath("//x") is relative to the opened .blend. In headless batches use absolute paths, or set them after open_mainfile.Download the Linux tarball (https://download.blender.org/release/Blender5.3/blender-5.3.0-linux-x64.tar.xz), cache it, then blender -b --factory-startup --python-exit-code 1 -P tests/run_all.py. This repo's .github/workflows/ci.yml is a working example.
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
ANanthropics/skills203k近 7 天新增 3,265 个 star
HAharry0703/MoneyPrinterTurbo147k近 7 天新增 1,608 个 star
SHShubhamsaboo/awesome-llm-apps147k近 7 天新增 907 个 star
GAgarrytan/gstack143k近 7 天新增 598 个 star