vault backup: 2024-05-17 22:15:18
This commit is contained in:
parent
895adfbb89
commit
4e5d33e88c
@ -6,6 +6,8 @@ tags:
|
|||||||
rating: ⭐
|
rating: ⭐
|
||||||
---
|
---
|
||||||
# 前言
|
# 前言
|
||||||
|
***MovieSceneTextTrack ***引擎插件可以作为参考。
|
||||||
|
|
||||||
参考:
|
参考:
|
||||||
1. [sequencer mute tracks at runtime from c](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/3)
|
1. [sequencer mute tracks at runtime from c](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/3)
|
||||||
|
|
||||||
@ -154,6 +156,83 @@ TArray<FGuid> FSequencerUtilities::AddActors(TSharedRef<ISequencer> Sequencer, c
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
其他参考
|
||||||
|
```c++
|
||||||
|
const FGuid PossessableGuid = OwnerMovieScene->AddPossessable(InName, InObject.GetClass());
|
||||||
|
|
||||||
|
if (!OwnerMovieScene->FindPossessable(PossessableGuid)->BindSpawnableObject(Sequencer->GetFocusedTemplateID(), &InObject, &Sequencer.Get()))
|
||||||
|
{
|
||||||
|
OwnerSequence->BindPossessableObject(PossessableGuid, InObject, BindingContext);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```c++
|
||||||
|
FGuid FSequencerUtilities::CreateBinding(TSharedRef<ISequencer> Sequencer, UObject& InObject, const FString& InName)
|
||||||
|
{
|
||||||
|
const FScopedTransaction Transaction(LOCTEXT("CreateBinding", "Create New Binding"));
|
||||||
|
|
||||||
|
UMovieSceneSequence* OwnerSequence = Sequencer->GetFocusedMovieSceneSequence();
|
||||||
|
UMovieScene* OwnerMovieScene = OwnerSequence->GetMovieScene();
|
||||||
|
|
||||||
|
OwnerSequence->Modify();
|
||||||
|
OwnerMovieScene->Modify();
|
||||||
|
|
||||||
|
const FGuid PossessableGuid = OwnerMovieScene->AddPossessable(InName, InObject.GetClass());
|
||||||
|
|
||||||
|
// Attempt to use the parent as a context if necessary
|
||||||
|
UObject* ParentObject = OwnerSequence->GetParentObject(&InObject);
|
||||||
|
UObject* BindingContext = Sequencer->GetPlaybackContext();
|
||||||
|
|
||||||
|
AActor* ParentActorAdded = nullptr;
|
||||||
|
FGuid ParentGuid;
|
||||||
|
|
||||||
|
if (ParentObject)
|
||||||
|
{
|
||||||
|
// Ensure we have possessed the outer object, if necessary
|
||||||
|
ParentGuid = Sequencer->GetHandleToObject(ParentObject, false);
|
||||||
|
if (!ParentGuid.IsValid())
|
||||||
|
{
|
||||||
|
ParentGuid = Sequencer->GetHandleToObject(ParentObject);
|
||||||
|
ParentActorAdded = Cast<AActor>(ParentObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OwnerSequence->AreParentContextsSignificant())
|
||||||
|
{
|
||||||
|
BindingContext = ParentObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up parent/child guids for possessables within spawnables
|
||||||
|
if (ParentGuid.IsValid())
|
||||||
|
{
|
||||||
|
FMovieScenePossessable* ChildPossessable = OwnerMovieScene->FindPossessable(PossessableGuid);
|
||||||
|
if (ensure(ChildPossessable))
|
||||||
|
{
|
||||||
|
ChildPossessable->SetParent(ParentGuid, OwnerMovieScene);
|
||||||
|
}
|
||||||
|
|
||||||
|
FMovieSceneSpawnable* ParentSpawnable = OwnerMovieScene->FindSpawnable(ParentGuid);
|
||||||
|
if (ParentSpawnable)
|
||||||
|
{
|
||||||
|
ParentSpawnable->AddChildPossessable(PossessableGuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!OwnerMovieScene->FindPossessable(PossessableGuid)->BindSpawnableObject(Sequencer->GetFocusedTemplateID(), &InObject, &Sequencer.Get()))
|
||||||
|
{
|
||||||
|
OwnerSequence->BindPossessableObject(PossessableGuid, InObject, BindingContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Broadcast if a parent actor was added as a result of adding this object
|
||||||
|
if (ParentActorAdded && ParentGuid.IsValid())
|
||||||
|
{
|
||||||
|
Sequencer->OnActorAddedToSequencer().Broadcast(ParentActorAdded, ParentGuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PossessableGuid;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### FAudioTrackEditor
|
### FAudioTrackEditor
|
||||||
FAudioTrackEditor::HandleAssetAdded(UObject* Asset, const FGuid& TargetObjectGuid) => FAudioTrackEditor::AddNewSound() => UMovieSceneAudioTrack::AddNewSoundOnRow(USoundBase* Sound, FFrameNumber Time, int32 RowIndex)
|
FAudioTrackEditor::HandleAssetAdded(UObject* Asset, const FGuid& TargetObjectGuid) => FAudioTrackEditor::AddNewSound() => UMovieSceneAudioTrack::AddNewSoundOnRow(USoundBase* Sound, FFrameNumber Time, int32 RowIndex)
|
||||||
|
|
||||||
@ -162,6 +241,7 @@ FAudioTrackEditor::HandleAssetAdded(UObject* Asset, const FGuid& TargetObjectGui
|
|||||||
- UMovieSceneSkeletalAnimationSection
|
- UMovieSceneSkeletalAnimationSection
|
||||||
- FSkeletalAnimationTrackEditor
|
- FSkeletalAnimationTrackEditor
|
||||||
- UMovieSceneSkeletalAnimationSystem
|
- UMovieSceneSkeletalAnimationSystem
|
||||||
|
- 里面有介绍System相关的逻辑 https://zhuanlan.zhihu.com/p/413151867
|
||||||
- FSkeletalAnimationTrackEditMode
|
- FSkeletalAnimationTrackEditMode
|
||||||
|
|
||||||
Track的编辑器注册位于MovieSceneToolsModule.cpp:
|
Track的编辑器注册位于MovieSceneToolsModule.cpp:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user