Continue Blender Web parity task handoff
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

This commit is contained in:
mes123456
2026-08-23 05:47:21 -04:00
parent 0a22992a13
commit 9f43244982
962 changed files with 60772 additions and 297 deletions

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
ACTION_NAME = "WebGapAnimConstraintSlotAction"
OBJECT_NAME = "WebGapAnimConstraintSlotObject"
CONSTRAINT_NAME = "WebGapActionSlotConstraint"
SLOT_NAME = "WebGapConstraintSlot"
def main():
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --factory-startup --python M16-GAP-00208.py -- OUTPUT")
bpy.ops.wm.read_factory_settings(use_empty=True)
mesh = bpy.data.meshes.new(f"{OBJECT_NAME}Mesh")
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(OBJECT_NAME, mesh)
bpy.context.scene.collection.objects.link(obj)
action = bpy.data.actions.new(ACTION_NAME)
slot = action.slots.new("OBJECT", SLOT_NAME)
action.use_fake_user = True
constraint = obj.constraints.new(type="ACTION")
constraint.name = CONSTRAINT_NAME
constraint.target = obj
constraint.action = action
constraint.action_slot = slot
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
bpy.context.scene.frame_start = 1
bpy.context.scene.frame_end = 5
bpy.context.scene.frame_set(3)
bpy.ops.wm.save_as_mainfile(
filepath=str(pathlib.Path(arguments[0]).resolve()), check_existing=False, compress=True
)
if __name__ == "__main__":
main()