advanced example
This commit is contained in:
1 parent
8c0a639fba
commit
6fe57915e8
99 files changed
+1329
-56
No files matched your search
@@ -0,0 +1,35 @@
|
||||
"""Zadanie: stworz ciekawa 15-sekundowa scene. Punkt wyjscia: jedna postac i dwa klipy.
|
||||
|
||||
Uruchom w UE: File > Execute Python Script. Zrob wlasna kopie pliku przed edycja.
|
||||
"""
|
||||
from ue_workshop import Scene, Sequence, Renderer, camera, lighting, materials
|
||||
from ue_workshop.characters import CREATURE_MODEL, _clips
|
||||
|
||||
REIMPORT = False # True: ponowny import modelu i klipow; False: istniejace assety UE
|
||||
|
||||
scene = Scene("AnimationStarter")
|
||||
clips = _clips(CREATURE_MODEL)
|
||||
character = scene.skeletal_model(
|
||||
CREATURE_MODEL, name="Creature", height=200, rotation=(0, 0, 180), reimport=REIMPORT,
|
||||
animations={name: clips[name] for name in ("mutant_idle", "mutant_swiping")},
|
||||
)
|
||||
floor = materials.color("Floor", (0.07, 0.08, 0.11))
|
||||
scene.primitive("Cube", name="Floor", location=(0, 0, -10), scale=(20, 20, 0.2), material=floor)
|
||||
lighting.studio(scene)
|
||||
cam = camera.create(scene, location=(450, -550, 300), fov=45)
|
||||
|
||||
# 360 klatek przy 24 FPS = 15 sekund. Koniec zakresu jest wylaczny.
|
||||
shot = Sequence(scene, fps=24, frames=360)
|
||||
shot.camera(cam)
|
||||
# 12 wspolnych klatek = plynne przejscie przez 0.5 sekundy.
|
||||
shot.animation(character, "mutant_idle", start=0, end=132)
|
||||
shot.animation(character, "mutant_swiping", start=120, end=360)
|
||||
|
||||
# Dodaj ruch postaci, kamery, kolejne klipy lub druga postac.
|
||||
# shot.transform_key(character, 120, location=(0, 0, 0))
|
||||
# shot.transform_key(character, 239, location=(150, 0, 0))
|
||||
# Wszystkie klipy: docs/animations.md. Usun animations=... powyzej, aby udostepnic wszystkie.
|
||||
shot.save()
|
||||
|
||||
renderer = Renderer(width=1280, height=720, samples=4, warmup=16, mp4=True)
|
||||
# renderer.render(shot)
|
||||
Reference in new issue
Block a user