Files
PythonInUnreal/tools/smoke_lights.py
T
2026-10-31 23:11:57 +01:00

24 lines
1.2 KiB
Python

"""Check every light type and render keyed color and intensity (frames 0 and 47)."""
from ue_workshop import Scene, Sequence, Renderer, camera, lighting, materials
scene = Scene("LightsSmoke")
floor = materials.color("LightsFloor", rgb=(0.5, 0.5, 0.5))
scene.primitive("Cube", name="Floor", location=(0, 0, -10), scale=(20, 20, 0.2), material=floor)
scene.primitive("Sphere", name="Ball", location=(0, 0, 50), material=floor)
sun = lighting.sun(scene, color=(1, 0.9, 0.8))
point = lighting.point(scene, location=(-300, 200, 200), color=(0, 1, 0))
spot = lighting.spot(scene, location=(0, -300, 400), target=(0, 0, 0))
cam = camera.create(scene, location=(450, -550, 300), target=(0, 0, 50))
shot = Sequence(scene, fps=24, frames=48)
shot.camera(cam)
shot.light_key(spot, 0, color=(1, 0, 0), intensity=5000)
shot.light_key(spot, 47, color=(0, 0, 1), intensity=40000, interpolation="auto")
shot.light_key(point, 0, intensity=0)
shot.light_key(point, 47, intensity=20000)
shot.light_key(sun, 0, intensity=0)
shot.light_key(sun, 24, intensity=500)
shot.light_key(sun, 25, intensity=0, interpolation="constant")
shot.save(open_editor=False)
assert len(shot.asset.get_bindings()) >= 2
renderer = Renderer(width=640, height=360, samples=1, warmup=8, mp4=False)