Skip to content

Commit c53376f

Browse files
author
rdeioris
authored
Update sequencer_API.md
1 parent 66b8924 commit c53376f

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

‎docs/sequencer_API.md‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,78 @@ from unreal_engine.classes import LevelSequenceFactoryNew
1616
factory = LevelSequenceFactoryNew()
1717
seq = factory.factory_create_new('/Game/MovieMaster')
1818
```
19+
20+
Adding a master track to a Level Sequence
21+
-----------------------------------------
22+
23+
In the following example we add a MovieSceneAudioTrack as a master track
24+
25+
```python
26+
from unreal_engine.classes import MovieSceneAudioTrack
27+
28+
audio_track = seq.sequencer_add_master_track(MovieSceneAudioTrack)
29+
```
30+
31+
Getting the list of master tracks
32+
---------------------------------
33+
34+
```python
35+
tracks = seq.sequencer_master_tracks()
36+
```
37+
38+
Possessables and Spawnables
39+
---------------------------
40+
41+
Adding tracks
42+
-------------
43+
44+
Adding a section to a track
45+
---------------------------
46+
47+
This is a pretty complex example, we add a skeletal animation track and then we add a bunch of sections (each of them should point to an animation asset using the AnimSequence field)
48+
49+
```python
50+
from unreal_engine.classes import MovieSceneSkeletalAnimationTrack
51+
52+
# add an animation track mapped to the just added actor
53+
anim = seq.sequencer_add_track(MovieSceneSkeletalAnimationTrack, guid)
54+
55+
# create 3 animations sections (assign AnimSequence field to set the animation to play)
56+
anim_sequence = anim.sequencer_track_add_section()
57+
anim_sequence.StartTime = 1
58+
anim_sequence.EndTime = 3
59+
anim_sequence.RowIndex = 0
60+
61+
anim_sequence2 = anim.sequencer_track_add_section()
62+
anim_sequence2.RowIndex = 1
63+
anim_sequence2.StartTime = 2
64+
anim_sequence2.EndTime = 5
65+
66+
anim_sequence3 = anim.sequencer_track_add_section()
67+
anim_sequence3.RowIndex = 1
68+
anim_sequence3.SlotName = 'Hello'
69+
anim_sequence3.StartTIme = 0
70+
anim_sequence3.EndTime = 30
71+
```
72+
73+
Adding keyframes to sections
74+
----------------------------
75+
76+
Managing the camera cut track
77+
-----------------------------
78+
79+
Notify changes to the editor
80+
----------------------------
81+
82+
Some of the sequencer api operations do not update the editor, if you need to force an update you can use
83+
84+
```python
85+
seq.sequencer_changed(True)
86+
```
87+
88+
the boolean argument (if true) move the editor focus to the sequencer
89+
90+
Example
91+
-------
92+
93+
Check it here: https://github.com/20tab/UnrealEnginePython/blob/master/examples/sequencer_scripting.py

0 commit comments

Comments
 (0)