|
@@ -9,7 +9,23 @@
|
|
This example script prints info of all TrackView sequences
|
|
This example script prints info of all TrackView sequences
|
|
'''
|
|
'''
|
|
|
|
|
|
-numTracks = trackview.get_num_sequences()
|
|
|
|
|
|
+import azlmbr.bus as bus
|
|
|
|
+import azlmbr.track_view as track_view
|
|
|
|
|
|
-for i in range(numTracks):
|
|
|
|
- print(f"Sequence '{trackview.get_sequence_name(i)}':")
|
|
|
|
|
|
+test_sequence_name = 'Test Sequence 01'
|
|
|
|
+
|
|
|
|
+num_sequences = track_view.EditorLayerTrackViewRequestBus(bus.Broadcast, 'GetNumSequences')
|
|
|
|
+
|
|
|
|
+if num_sequences > 0:
|
|
|
|
+ print(f"Found {num_sequences} sequences")
|
|
|
|
+else:
|
|
|
|
+ track_view.EditorLayerTrackViewRequestBus(bus.Broadcast, 'NewSequence', test_sequence_name, 1)
|
|
|
|
+ print(f"Created new sequence {test_sequence_name}")
|
|
|
|
+
|
|
|
|
+num_sequences = track_view.EditorLayerTrackViewRequestBus(bus.Broadcast, 'GetNumSequences')
|
|
|
|
+print(f"Number of Sequences: {num_sequences}")
|
|
|
|
+
|
|
|
|
+for i in range(0, num_sequences):
|
|
|
|
+ returned_name = track_view.EditorLayerTrackViewRequestBus(bus.Broadcast, 'GetSequenceName', i)
|
|
|
|
+ time_range = track_view.EditorLayerTrackViewRequestBus(bus.Broadcast, 'GetSequenceTimeRange', returned_name)
|
|
|
|
+ print(f"Sequence {i}: {returned_name} | Start: {time_range.start} End: {time_range.end}")
|