Govern task context and advance execution pointer
This commit is contained in:
34
tools/web/generated/M16-GAP-00034.py
Normal file
34
tools/web/generated/M16-GAP-00034.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
def main(output: pathlib.Path) -> None:
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
mesh = bpy.data.meshes.new("WebGapBuildMesh")
|
||||
mesh.from_pydata([(-1, -1, 0), (1, -1, 0), (1, 1, 0), (-1, 1, 0)], [], [(0, 1, 2, 3)])
|
||||
mesh.update()
|
||||
obj = bpy.data.objects.new("WebGapBuildObject", mesh)
|
||||
bpy.context.collection.objects.link(obj)
|
||||
modifier = obj.modifiers.new(name="WebGapBuild", type="BUILD")
|
||||
modifier.frame_start = 3
|
||||
modifier.frame_duration = 12
|
||||
modifier.use_reverse = True
|
||||
modifier.use_random_order = True
|
||||
modifier.seed = 17
|
||||
modifier.show_viewport = True
|
||||
modifier.show_render = False
|
||||
modifier.show_in_editmode = True
|
||||
modifier.show_on_cage = False
|
||||
bpy.context.view_layer.objects.active = obj
|
||||
obj.select_set(True)
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(output.resolve()), check_existing=False, compress=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
arguments = sys.argv[sys.argv.index("--") + 1 :]
|
||||
if len(arguments) != 1:
|
||||
raise SystemExit("usage: blender -b --python M16-GAP-00034.py -- OUTPUT")
|
||||
main(pathlib.Path(arguments[0]))
|
||||
Reference in New Issue
Block a user