Created
January 7, 2021 05:33
-
-
Save kezzardrix/8514eda83691efb348c3ab0a1ffef9ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unreal | |
| # シーケンサーを取得 | |
| LevelSequence = unreal.find_asset('/Game/Sequence/testSeq') | |
| # Camera Cuts等以外のトラックはbindingsと呼ばれる | |
| bindings = LevelSequence.get_bindings() | |
| for b in bindings: | |
| if b.get_display_name() == 'CubeTest': | |
| # bindingsの中のトラック。Transformとか | |
| tracks = b.get_tracks() | |
| for t in tracks: | |
| # 例 : Transformの中のメンバー | |
| sections = t.get_sections() | |
| for s in sections: | |
| # 例 : Transformの中のチャンネル。物によって型が違う | |
| channels = s.get_channels() | |
| for c in channels: | |
| keys = c.get_keys() | |
| for k in keys: | |
| c.remove_key(k) | |
| for i in range(0, 5): | |
| FNumber = unreal.FrameNumber(30 * i) | |
| Event = unreal.MovieSceneEvent() | |
| #loc x にキーを追加 | |
| channels[0].add_key(FNumber, 1) | |
| # マスタートラックを取得 | |
| MasterTracks = LevelSequence.get_master_tracks() | |
| for MasterTrack in MasterTracks: | |
| print(MasterTrack.get_display_name()) | |
| Sections = MasterTrack.get_sections() | |
| # セクションを取得 | |
| for Section in Sections: | |
| Channels = Section.get_channels() | |
| # チャンネルを取得 | |
| for Channel in Channels: | |
| # キーを取得し、全削除 | |
| Keys = Channel.get_keys() | |
| for Key in Keys: | |
| Channel.remove_key(Key) | |
| # 30フレーム刻みで5つのキーを追加 | |
| for i in range(0, 5): | |
| FNumber = unreal.FrameNumber(30 * i) | |
| # カスタムイベントとか | |
| Event = unreal.MovieSceneEvent() | |
| Channel.add_key(FNumber, Event) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment