Reorganize Blender Web execution around capabilities
This commit is contained in:
35
tools/web/generated/M16-GAP-00280.py
Normal file
35
tools/web/generated/M16-GAP-00280.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user