Files
mes123456 c2c65d3a09
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
Rebuild local Blender WASM environment and recovery evidence
2026-08-27 20:22:15 +08:00

54 lines
1.8 KiB
Python

#!/usr/bin/env python3
import pathlib
import sys
import bpy
def main(output):
bpy.ops.wm.read_factory_settings(use_empty=True)
scene = bpy.context.scene
scene.name = "WBV2P4001ModifierScene"
mesh = bpy.data.meshes.new("WBV2P4001ModifierMesh")
mesh.from_pydata(
[(-1, -1, -1), (1, -1, -1), (1, 1, -1), (-1, 1, -1),
(-1, -1, 1), (1, -1, 1), (1, 1, 1), (-1, 1, 1)],
[],
[(0, 1, 2), (0, 2, 3), (4, 6, 5), (4, 7, 6),
(0, 4, 5), (0, 5, 1), (1, 5, 6), (1, 6, 2),
(2, 6, 7), (2, 7, 3), (4, 0, 3), (4, 3, 7)],
)
mesh.update()
obj = bpy.data.objects.new("WBV2P4001ModifierObject", mesh)
bpy.context.collection.objects.link(obj)
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
bevel = obj.modifiers.new("WBV2P4001Bevel", "BEVEL")
bevel.width = 0.12
bevel.segments = 2
bevel.profile = 0.5
bevel.show_viewport = True
bevel.show_render = True
decimate = obj.modifiers.new("WBV2P4001Decimate", "DECIMATE")
decimate.ratio = 0.75
decimate.iterations = 1
decimate.show_viewport = True
decimate.show_render = False
bpy.ops.object.particle_system_add()
particle_modifier = obj.modifiers[-1]
particle_modifier.name = "WBV2P4001UnsupportedParticle"
particle_modifier.show_viewport = True
particle_modifier.show_render = False
scene.frame_start = 1
scene.frame_end = 10
scene.frame_set(1)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(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 --factory-startup --python WBV2-P4-001.py -- OUTPUT")
main(arguments[0])