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,43 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
def frame_scene_range():
window = bpy.context.window
screen = window.screen
area = next((candidate for candidate in screen.areas if candidate.type == "DOPESHEET_EDITOR" and candidate.height >= 200), None)
if area is None:
area = next(candidate for candidate in screen.areas if candidate.type == "VIEW_3D" and candidate.height >= 200)
area.type = "DOPESHEET_EDITOR"
region = next(candidate for candidate in area.regions if candidate.type == "WINDOW")
with bpy.context.temp_override(window=window, screen=screen, area=area, region=region):
if not bpy.ops.anim.scene_range_frame.poll():
raise RuntimeError("ANIM_OT_scene_range_frame poll failed in animation editor context")
result = bpy.ops.anim.scene_range_frame()
if "FINISHED" not in result:
raise RuntimeError(f"ANIM_OT_scene_range_frame returned {result}")
def main():
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --factory-startup --python M16-GAP-00204.py -- OUTPUT")
bpy.ops.wm.read_factory_settings(use_empty=True)
scene = bpy.context.scene
scene.frame_start = 1
scene.frame_end = 48
scene.use_preview_range = True
scene.frame_preview_start = 12
scene.frame_preview_end = 24
bpy.context.preferences.view.smooth_view = 0
frame_scene_range()
bpy.ops.wm.save_as_mainfile(
filepath=str(pathlib.Path(arguments[0]).resolve()), check_existing=False, compress=True
)
if __name__ == "__main__":
main()