28 lines
1001 B
Python
28 lines
1001 B
Python
#!/usr/bin/env python3
|
|
import pathlib
|
|
import sys
|
|
import bpy
|
|
|
|
|
|
if __name__ == "__main__":
|
|
arguments = sys.argv[sys.argv.index("--") + 1:]
|
|
if len(arguments) != 1:
|
|
raise SystemExit("usage: blender -b --python M16-GAP-00080.py -- OUTPUT")
|
|
bpy.ops.wm.read_factory_settings(use_empty=True)
|
|
mesh = bpy.data.meshes.new("WebGapMeshSequenceCacheMesh")
|
|
mesh.from_pydata(
|
|
[(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (1.0, 1.0, 0.0), (-1.0, 1.0, 0.0)],
|
|
[],
|
|
[(0, 1, 2, 3)],
|
|
)
|
|
obj = bpy.data.objects.new("WebGapMeshSequenceCacheObject", mesh)
|
|
bpy.context.scene.collection.objects.link(obj)
|
|
modifier = obj.modifiers.new(name="WebGapMeshSequenceCache", type="MESH_SEQUENCE_CACHE")
|
|
modifier.show_viewport = True
|
|
modifier.show_render = False
|
|
bpy.context.view_layer.objects.active = obj
|
|
obj.select_set(True)
|
|
bpy.ops.wm.save_as_mainfile(
|
|
filepath=str(pathlib.Path(arguments[0]).resolve()), check_existing=False, compress=True
|
|
)
|