Govern task context and advance execution pointer
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-20 06:02:43 -04:00
parent 380cbed4ff
commit 10640aeb3c
984 changed files with 543475 additions and 327 deletions

View File

@@ -0,0 +1,36 @@
#!/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)
lattice = bpy.data.lattices.new("WebGapLattice")
lattice.points_u = 3
lattice.points_v = 2
lattice.points_w = 2
lattice.interpolation_type_u = "KEY_LINEAR"
lattice.interpolation_type_v = "KEY_CARDINAL"
lattice.interpolation_type_w = "KEY_BSPLINE"
lattice.use_outside = True
lattice.vertex_group = "WebGapInfluence"
lattice_object = bpy.data.objects.new("WebGapLatticeObject", lattice)
bpy.context.collection.objects.link(lattice_object)
for index, point in enumerate(lattice.points):
point.co_deform = (
point.co.x + 0.125 * (index % 3),
point.co.y - 0.0625 * (index % 2),
point.co.z + 0.25 * (index // 6),
)
point.weight_softbody = 0.5 + index * 0.125
point.select = index in {0, len(lattice.points) - 1}
bpy.ops.wm.save_as_mainfile(filepath=str(output), compress=True)
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00010.py -- OUTPUT")
main(pathlib.Path(arguments[0]).resolve())

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
LIBRARY_NAME = "WebGapLibrary.blend"
OBJECT_NAME = "WebGapLibraryObject"
def reset() -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
def create_source(path: pathlib.Path) -> None:
reset()
mesh = bpy.data.meshes.new("WebGapLibraryMesh")
mesh.from_pydata([(-1.0, 0.0, 0.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)], [], [(0, 1, 2)])
obj = bpy.data.objects.new(OBJECT_NAME, mesh)
bpy.context.scene.collection.objects.link(obj)
bpy.ops.wm.save_as_mainfile(filepath=str(path), check_existing=False, compress=True)
def create_fixture(output: pathlib.Path) -> None:
source = output.with_name(LIBRARY_NAME)
create_source(source)
reset()
with bpy.data.libraries.load(str(source), link=True) as (data_from, data_to):
if OBJECT_NAME not in data_from.objects:
raise RuntimeError("source object is missing")
data_to.objects = [OBJECT_NAME]
linked = data_to.objects[0]
if linked is None:
raise RuntimeError("linked object is missing")
bpy.context.scene.collection.objects.link(linked)
bpy.ops.wm.save_as_mainfile(filepath=str(output), check_existing=False, compress=True)
def main(output: pathlib.Path) -> None:
output.parent.mkdir(parents=True, exist_ok=True)
create_fixture(output.resolve())
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00011.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,31 @@
#!/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)
light = bpy.data.lights.new("WebGapLight", type="AREA")
light.color = (0.25, 0.5, 0.75)
light.energy = 400.0
light.exposure = 1.0
light.temperature = 5000.0
light.use_temperature = True
light.use_shadow = False
light.shadow_soft_size = 0.3
light.shape = "RECTANGLE"
light.size = 3.0
light.size_y = 2.0
light.spread = 2.4
light_object = bpy.data.objects.new("WebGapLightObject", light)
bpy.context.collection.objects.link(light_object)
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-00012.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,50 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
def set_socket(node, name, value):
socket = node.inputs.get(name)
if socket is not None:
socket.default_value = value
def main(output: pathlib.Path) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
material = bpy.data.materials.new("WebGapMaterial")
material.use_nodes = True
material.diffuse_color = (0.2, 0.4, 0.8, 0.9)
nodes = material.node_tree.nodes
links = material.node_tree.links
principled = nodes.get("Principled BSDF")
output_node = nodes.get("Material Output")
if principled is None or output_node is None:
raise RuntimeError("default Principled/Output nodes are missing")
set_socket(principled, "Base Color", (0.2, 0.4, 0.8, 0.9))
set_socket(principled, "Metallic", 0.35)
set_socket(principled, "Roughness", 0.6)
set_socket(principled, "IOR", 1.6)
set_socket(principled, "Specular IOR Level", 0.35)
set_socket(principled, "Transmission Weight", 0.27)
set_socket(principled, "Coat Weight", 0.64)
set_socket(principled, "Coat Roughness", 0.12)
set_socket(principled, "Emission Color", (0.05, 0.1, 0.2, 1.0))
set_socket(principled, "Emission Strength", 3.5)
set_socket(principled, "Alpha", 0.9)
if not any(link.from_node == principled and link.to_node == output_node for link in links):
links.new(principled.outputs["BSDF"], output_node.inputs["Surface"])
mesh = bpy.data.meshes.new("WebGapMaterialMesh")
mesh.from_pydata([(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (0.0, 1.0, 0.0)], [], [(0, 1, 2)])
mesh.materials.append(material)
obj = bpy.data.objects.new("WebGapMaterialObject", mesh)
bpy.context.collection.objects.link(obj)
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-00013.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,29 @@
#!/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("WebGapMesh")
mesh.from_pydata(
[(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (1.0, 1.0, 0.25), (-1.0, 1.0, 0.25)],
[],
[(0, 1, 2, 3)],
)
uv_layer = mesh.uv_layers.new(name="WebGapUV")
for loop, uv in zip(uv_layer.data, [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]):
loop.uv = uv
mesh.update()
mesh_object = bpy.data.objects.new("WebGapMeshObject", mesh)
bpy.context.collection.objects.link(mesh_object)
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-00014.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View 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)
data = bpy.data.metaballs.new("WebGapMetaBall")
data.resolution = 0.2
data.render_resolution = 0.1
first = data.elements.new()
first.co = (-0.65, 0.0, 0.4)
first.radius = 0.75
first.size_x = 1.1
first.size_y = 0.9
first.size_z = 1.2
second = data.elements.new()
second.co = (0.65, 0.0, 0.4)
second.radius = 0.55
second.size_x = 0.8
second.size_y = 1.05
second.size_z = 0.95
obj = bpy.data.objects.new("WebGapMetaBallObject", data)
bpy.context.collection.objects.link(obj)
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-00015.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,35 @@
#!/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)
material = bpy.data.materials.new("WebGapNodeTreeMaterial")
material.use_nodes = True
nodes = material.node_tree.nodes
links = material.node_tree.links
principled = nodes.get("Principled BSDF")
output_node = nodes.get("Material Output")
if principled is None or output_node is None:
raise RuntimeError("default shader nodes are missing")
rgb = nodes.new("ShaderNodeRGB")
rgb.name = "WebGapRGB"
rgb.outputs["Color"].default_value = (0.1, 0.3, 0.7, 1.0)
links.new(rgb.outputs["Color"], principled.inputs["Base Color"])
links.new(principled.outputs["BSDF"], output_node.inputs["Surface"])
mesh = bpy.data.meshes.new("WebGapNodeTreeMesh")
mesh.from_pydata([(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (0.0, 1.0, 0.0)], [], [(0, 1, 2)])
mesh.materials.append(material)
obj = bpy.data.objects.new("WebGapNodeTreeObject", mesh)
bpy.context.collection.objects.link(obj)
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-00016.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,26 @@
#!/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)
obj = bpy.data.objects.new("WebGapObject", None)
obj.location = (1.25, -2.5, 3.75)
obj.rotation_mode = "XYZ"
obj.rotation_euler = (0.2, -0.35, 0.5)
obj.scale = (1.5, 0.75, 2.0)
obj.hide_viewport = False
obj.hide_render = False
obj.hide_set(False)
bpy.context.collection.objects.link(obj)
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-00017.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,29 @@
#!/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)
settings = bpy.data.particles.new("WebGapParticleSettings")
settings.use_fake_user = True
settings.type = "EMITTER"
settings.emit_from = "FACE"
settings.physics_type = "NEWTON"
settings.distribution = "JIT"
settings.count = 128
settings.frame_start = 4.0
settings.frame_end = 96.0
settings.lifetime = 32.0
settings.particle_size = 0.125
settings.display_size = 0.25
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-00018.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,28 @@
#!/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("WebGapPointCloudSeed")
mesh.from_pydata([(-1.0, 0.0, 0.0), (0.0, 1.0, 0.5), (1.0, 0.0, 1.0), (0.0, -1.0, 1.5)], [], [])
obj = bpy.data.objects.new("WebGapPointCloudObject", mesh)
bpy.context.collection.objects.link(obj)
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
bpy.ops.object.convert(target="POINTCLOUD")
data = obj.data
data.name = "WebGapPointCloud"
radius = data.attributes.new("radius", "FLOAT", "POINT")
radius.data.foreach_set("value", [0.25, 0.5, 0.75, 1.0])
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-00019.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,28 @@
#!/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)
scene = bpy.context.scene
scene.name = "WebGapScene"
scene.frame_start = 12
scene.frame_end = 180
scene.frame_set(48)
scene.render.fps = 30
scene.render.fps_base = 1.0
scene.unit_settings.system = "METRIC"
scene.unit_settings.scale_length = 0.25
scene.render.engine = "BLENDER_EEVEE"
scene.view_settings.look = "AgX - Medium High Contrast"
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-00020.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,21 @@
#!/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)
screen = bpy.context.screen
if screen is None:
raise RuntimeError("factory startup did not create a screen")
screen.name = "WebGapScreen"
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-00021.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,22 @@
#!/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)
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/media/sequencer-silence.wav"
sound = bpy.data.sounds.load(str(source), check_existing=False)
sound.name = "WebGapSound"
sound.filepath = "//WebGapSound.wav"
sound.use_fake_user = 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-00022.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View 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)
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/media/sequencer-silence.wav"
sound = bpy.data.sounds.load(str(source), check_existing=False)
sound.name = "WebGapSpeakerSound"
sound.use_fake_user = True
speaker = bpy.data.speakers.new("WebGapSpeaker")
speaker.sound = sound
speaker.volume_max = 0.85
speaker.volume_min = 0.15
speaker.distance_max = 12.5
speaker.distance_reference = 2.25
speaker.attenuation = 0.75
speaker.cone_angle_outer = 270.0
speaker.cone_angle_inner = 120.0
speaker.cone_volume_outer = 0.35
speaker.volume = 0.65
speaker.pitch = 1.1
speaker.use_fake_user = 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-00023.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,21 @@
#!/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)
text = bpy.data.texts.new("WebGapText")
text.write("Web Blender text datablock\nSecond line\n")
text.filepath = "//WebGapText.txt"
text.use_fake_user = 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-00024.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,24 @@
#!/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)
texture = bpy.data.textures.new("WebGapTexture", type="CLOUDS")
texture.noise_scale = 0.42
texture.noise_depth = 4
texture.intensity = 0.72
texture.contrast = 1.25
texture.saturation = 0.8
texture.use_fake_user = 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-00025.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,23 @@
#!/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)
volume = bpy.data.volumes.new("WebGapVolume")
volume.filepath = "//WebGapVolume.vdb"
volume.display.density = 2.5
volume.display.interpolation_method = "CLOSEST"
volume.render.step_size = 0.125
volume.use_fake_user = 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-00026.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,18 @@
#!/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)
bpy.context.window_manager.preset_name = "WebGapWindowManager"
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-00027.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,20 @@
#!/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)
workspace = bpy.data.workspaces.get("Layout")
if workspace is not None:
workspace.name = "WebGapWorkspace"
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 --factory-startup --python M16-GAP-00028.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,20 @@
#!/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)
world = bpy.data.worlds.new("WebGapWorld")
world.color = (0.12, 0.2, 0.35)
world.use_fake_user = True
world.mist_settings.use_mist = True
world.mist_settings.start = 3.0
world.mist_settings.depth = 18.0
world.mist_settings.intensity = 0.4
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-00029.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,52 @@
#!/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("WebGapArmatureMesh")
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), (0, 2, 3)],
)
mesh.update()
mesh_object = bpy.data.objects.new("WebGapArmatureMeshObject", mesh)
bpy.context.collection.objects.link(mesh_object)
armature = bpy.data.armatures.new("WebGapArmature")
armature_object = bpy.data.objects.new("WebGapArmatureObject", armature)
bpy.context.collection.objects.link(armature_object)
bpy.context.view_layer.objects.active = armature_object
armature_object.select_set(True)
bpy.ops.object.mode_set(mode="EDIT")
root = armature.edit_bones.new("Root")
root.head = (0.0, 0.0, 0.0)
root.tail = (0.0, 0.0, 1.0)
bpy.ops.object.mode_set(mode="OBJECT")
armature_object.select_set(False)
vertex_group = mesh_object.vertex_groups.new(name="Root")
vertex_group.add([0, 1, 2, 3], 1.0, "REPLACE")
modifier = mesh_object.modifiers.new(name="WebGapArmature", type="ARMATURE")
modifier.object = armature_object
modifier.vertex_group = "Root"
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = True
modifier.show_on_cage = False
bpy.context.view_layer.objects.active = mesh_object
mesh_object.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-00030.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
def mesh_object(name: str, vertices, faces):
mesh = bpy.data.meshes.new(name + "Mesh")
mesh.from_pydata(vertices, [], faces)
mesh.update()
obj = bpy.data.objects.new(name, mesh)
bpy.context.collection.objects.link(obj)
return obj
def main(output: pathlib.Path) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
source = mesh_object(
"WebGapArrayObject",
[(-0.5, -0.5, 0.0), (0.5, -0.5, 0.0), (0.5, 0.5, 0.0), (-0.5, 0.5, 0.0)],
[(0, 1, 2, 3)],
)
start_cap = mesh_object(
"WebGapArrayStartCap",
[(-0.4, -0.4, 0.0), (0.4, -0.4, 0.0), (0.0, 0.4, 0.0)],
[(0, 1, 2)],
)
end_cap = mesh_object(
"WebGapArrayEndCap",
[(-0.4, -0.4, 0.0), (0.4, -0.4, 0.0), (0.0, 0.4, 0.0)],
[(0, 1, 2)],
)
start_cap.location.x = -2.0
end_cap.location.x = 5.0
modifier = source.modifiers.new(name="WebGapArray", type="ARRAY")
modifier.count = 4
modifier.relative_offset_displace = (1.25, 0.0, 0.0)
modifier.start_cap = start_cap
modifier.end_cap = end_cap
modifier.show_viewport = True
modifier.show_render = False
modifier.show_in_editmode = True
modifier.show_on_cage = False
bpy.context.view_layer.objects.active = source
source.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-00031.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,39 @@
#!/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("WebGapBevelMesh")
mesh.from_pydata(
[(-1.0, -1.0, -1.0), (1.0, -1.0, -1.0), (1.0, 1.0, -1.0), (-1.0, 1.0, -1.0),
(-1.0, -1.0, 1.0), (1.0, -1.0, 1.0), (1.0, 1.0, 1.0), (-1.0, 1.0, 1.0)],
[],
[(0, 1, 2, 3), (4, 7, 6, 5), (0, 4, 5, 1), (1, 5, 6, 2), (2, 6, 7, 3), (4, 0, 3, 7)],
)
mesh.update()
obj = bpy.data.objects.new("WebGapBevelObject", mesh)
bpy.context.collection.objects.link(obj)
modifier = obj.modifiers.new(name="WebGapBevel", type="BEVEL")
modifier.width = 0.2
modifier.segments = 3
modifier.profile = 0.35
modifier.limit_method = "ANGLE"
modifier.angle_limit = 0.5
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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-00032.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
def cube(name: str, location, scale=1.0):
mesh = bpy.data.meshes.new(name + "Mesh")
vertices = [(-1, -1, -1), (1, -1, -1), (1, 1, -1), (-1, 1, -1), (-1, -1, 1), (1, -1, 1), (1, 1, 1), (-1, 1, 1)]
faces = [(0, 1, 2, 3), (4, 7, 6, 5), (0, 4, 5, 1), (1, 5, 6, 2), (2, 6, 7, 3), (4, 0, 3, 7)]
mesh.from_pydata(vertices, [], faces)
mesh.update()
obj = bpy.data.objects.new(name, mesh)
bpy.context.collection.objects.link(obj)
obj.location = location
obj.scale = (scale, scale, scale)
return obj
def main(output: pathlib.Path) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
source = cube("WebGapBooleanObject", (0.0, 0.0, 0.0), 1.0)
cutter = cube("WebGapBooleanCutter", (0.75, 0.0, 0.0), 0.65)
cutter.display_type = "WIRE"
modifier = source.modifiers.new(name="WebGapBoolean", type="BOOLEAN")
modifier.operation = "DIFFERENCE"
modifier.solver = "EXACT"
modifier.object = cutter
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
modifier.show_on_cage = False
bpy.context.view_layer.objects.active = source
source.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-00033.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View 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]))

View 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("WebGapCastMesh")
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, 3), (4, 7, 6, 5), (0, 4, 5, 1), (1, 5, 6, 2), (2, 6, 7, 3), (4, 0, 3, 7)])
mesh.update()
obj = bpy.data.objects.new("WebGapCastObject", mesh)
bpy.context.collection.objects.link(obj)
modifier = obj.modifiers.new(name="WebGapCast", type="CAST")
modifier.cast_type = "CUBOID"
modifier.factor = 0.65
modifier.radius = 2.5
modifier.use_x = True
modifier.use_y = False
modifier.use_z = True
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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-00035.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python3
import pathlib, sys
import bpy
def main(output: pathlib.Path) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
mesh = bpy.data.meshes.new("WebGapClothMesh")
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("WebGapClothObject", mesh)
bpy.context.collection.objects.link(obj)
modifier = obj.modifiers.new(name="WebGapCloth", type="CLOTH")
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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-00036.py -- OUTPUT")
main(pathlib.Path(arguments[0]))

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import pathlib, sys
import bpy
def main(output: pathlib.Path) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
mesh = bpy.data.meshes.new("WebGapCollisionMesh")
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("WebGapCollisionObject", mesh); bpy.context.collection.objects.link(obj)
m = obj.modifiers.new(name="WebGapCollision", type="COLLISION")
m.show_viewport = True; m.show_render = True; m.show_in_editmode = False; m.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__":
args=sys.argv[sys.argv.index("--")+1:]
if len(args)!=1: raise SystemExit("usage: blender -b --python M16-GAP-00037.py -- OUTPUT")
main(pathlib.Path(args[0]))

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1 :]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00038.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "CORRECTIVE_SMOOTH", "WebGapCorrectiveSmooth")

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1: raise SystemExit("usage: blender -b --python M16-GAP-00039.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "CURVE", "WebGapCurveModifier")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00040.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "DATA_TRANSFER", "WebGapDataTransfer")

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import create_mesh_object
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00041.py -- OUTPUT")
output = pathlib.Path(arguments[0])
bpy.ops.wm.read_factory_settings(use_empty=True)
obj = create_mesh_object("WebGapDecimateObject")
modifier = obj.modifiers.new(name="WebGapDecimate", type="DECIMATE")
modifier.ratio = 0.65
modifier.iterations = 2
modifier.decimate_type = "COLLAPSE"
modifier.angle_limit = 0.4
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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)

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import create_mesh_object
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00042.py -- OUTPUT")
output = pathlib.Path(arguments[0])
bpy.ops.wm.read_factory_settings(use_empty=True)
obj = create_mesh_object("WebGapDisplaceObject")
modifier = obj.modifiers.new(name="WebGapDisplace", type="DISPLACE")
modifier.direction = "Z"
modifier.strength = 0.75
modifier.mid_level = 0.25
modifier.texture_coords = "GLOBAL"
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00043.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "DYNAMIC_PAINT", "WebGapDynamicPaint")

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import create_mesh_object
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00044.py -- OUTPUT")
output = pathlib.Path(arguments[0])
bpy.ops.wm.read_factory_settings(use_empty=True)
obj = create_mesh_object("WebGapEdgeSplitObject")
modifier = obj.modifiers.new(name="WebGapEdgeSplit", type="EDGE_SPLIT")
modifier.split_angle = 0.35
modifier.use_edge_angle = True
modifier.use_edge_sharp = False
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00045.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "EXPLODE", "WebGapExplode")

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
from modifier_gap_fixture import generate
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00046.py -- OUTPUT")
generate(pathlib.Path(arguments[0]), "FLUID", "WebGapFluid")

View File

@@ -0,0 +1,14 @@
#!/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-00047.py -- OUTPUT")
output = pathlib.Path(arguments[0])
bpy.ops.wm.open_mainfile(filepath=str(pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(output.resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import bpy
if __name__ == "__main__":
arguments = bpy.app.driver_namespace.get("_unused")
args = __import__("sys").argv[__import__("sys").argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00048.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00049.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00050.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00051.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00052.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00053.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00054.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00055.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00056.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00057.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00058.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00059.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00060.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00061.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00062.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00063.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00064.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00065.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00066.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00067.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00068.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00069.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1:
raise SystemExit("usage: blender -b --python M16-GAP-00070.py -- OUTPUT")
source = pathlib.Path(__file__).resolve().parents[3] / "tests/files/web/modifier_grease_pencil_scene.blend"
bpy.ops.wm.open_mainfile(filepath=str(source), load_ui=False)
bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(args[0]).resolve()), check_existing=False, compress=True)

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python3
import pathlib
import bpy
def create_mesh_object(name: str):
mesh = bpy.data.meshes.new(name + "Mesh")
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, 3), (4, 7, 6, 5), (0, 4, 5, 1),
(1, 5, 6, 2), (2, 6, 7, 3), (4, 0, 3, 7)],
)
mesh.update()
obj = bpy.data.objects.new(name, mesh)
bpy.context.collection.objects.link(obj)
return obj
def generate(output: pathlib.Path, modifier_type: str, stem: str) -> None:
bpy.ops.wm.read_factory_settings(use_empty=True)
obj = create_mesh_object(stem + "Object")
modifier = obj.modifiers.new(name=stem, type=modifier_type)
modifier.show_viewport = True
modifier.show_render = True
modifier.show_in_editmode = False
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)