Files
workinf_Blender_Wasm/tools/web/generated/M16-GAP-00280.py
mes123456 a081c68c87
Some checks are pending
M6 deployable RC / quick (push) Waiting to run
M6 deployable RC / chromium (push) Blocked by required conditions
M6 deployable RC / release (push) Blocked by required conditions
Reorganize Blender Web execution around capabilities
2026-08-24 18:37:46 -04:00

36 lines
1.1 KiB
Python

#!/usr/bin/env python3
import pathlib
import sys
import bpy
OBJECT_NAME = "WebGapAssetMarkSingleObject"
MESH_NAME = "WebGapAssetMarkSingleMesh"
def main():
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit(
"usage: blender -b --factory-startup --python M16-GAP-00280.py -- OUTPUT"
)
output = pathlib.Path(arguments[0]).resolve()
bpy.ops.wm.read_factory_settings(use_empty=True)
mesh = bpy.data.meshes.new(MESH_NAME)
mesh.from_pydata(((-1.0, 0.0, 0.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)), (), ((0, 1, 2),))
obj = bpy.data.objects.new(OBJECT_NAME, mesh)
bpy.context.scene.collection.objects.link(obj)
# Background mode has no editor ID context; seed the persisted single-asset record.
obj.asset_mark()
obj.asset_data.author = "M16 Fixture"
obj.asset_data.description = "Asset mark single operator fixture"
obj.asset_data.tags.new("operator-mark-single")
bpy.ops.wm.save_as_mainfile(filepath=str(output), check_existing=False, compress=True)
if __name__ == "__main__":
main()