blender customization

This commit is contained in:
Vysyr committed 2026-10-31 17:21:00 +01:00
1 parent fb39e290c0
commit 8c0a639fba
12 files changed
+264 -8

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ def main(argv=None):
command = [editor, str(ROOT / "ExampleProject.uproject"),
"-ExecutePythonScript=" + (ROOT / "tools/ue_bootstrap.py").as_posix(),
"-RenderOffscreen", "-unattended", "-nosplash", "-nosound", "-stdout",
"-FullStdOutLogOutput", "-NoLoadingScreen"]
"-FullStdOutLogOutput", "-NoLoadingScreen", "-nocef"]
if args.verbose:
# UE writes its own log when console output is streamed directly.
command.append("-abslog=" + log_path.as_posix())
+31
View File
@@ -0,0 +1,31 @@
"""Check local FBX characters, automatic fitting, stable pivots and MRQ."""
import unreal
from ue_workshop import Scene, Sequence, Renderer, camera, lighting
from ue_workshop.paths import PROJECT
scene = Scene("ImportedModelsSmoke")
characters = []
for name, file in (("RobotSmoke", "DemoAssets/RobotPolice/RobotPolice.fbx"),
("PilotSmoke", "DemoAssets/pilot/pilot.fbx")):
root = scene.model(PROJECT / file, name=name, height=200)
child = root.get_attached_actors()[0]
origin, extent = child.get_actor_bounds(False)
assert abs(2 * extent.z - 200) < 0.1, (name, origin, extent)
assert abs(origin.z - extent.z) < 0.1, (name, origin, extent)
assert abs(origin.x) < 0.1 and abs(origin.y) < 0.1
mesh = child.static_mesh_component.static_mesh
assert len(mesh.static_materials) > 0
assert all(slot.material_interface for slot in mesh.static_materials)
assert all(slot.material_interface.get_name() == "M_" + name + "Imported" for slot in mesh.static_materials)
characters.append(root)
characters[1].set_actor_location(unreal.Vector(0, 160, 0), False, False)
scene.primitive("Cube", name="Floor", location=(0, 0, -10), scale=(20, 20, 0.2))
lighting.studio(scene)
cam = camera.create(scene, location=(600, -850, 400), target=(0, 70, 100))
shot = Sequence(scene, frames=2)
shot.camera(cam)
for character in characters:
shot.transform_key(character, 0, rotation=(0, 0, 0))
shot.transform_key(character, 1, rotation=(0, 0, 45))
Renderer(width=640, height=360, samples=2, warmup=8).render(shot)