Files
UnrealEngineUWP/Engine/Source/Editor/Sequencer/Private/SequencerSettings.cpp
aurel cordonnier 25a11deeac Merge from Release-Engine-Staging @ 16579919
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16581170 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-07 20:09:45 -04:00

763 lines
17 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SequencerSettings.h"
#include "KeyParams.h"
#include "ISequencer.h"
#include "SSequencer.h"
USequencerSettings::USequencerSettings( const FObjectInitializer& ObjectInitializer )
: Super( ObjectInitializer )
{
AutoChangeMode = EAutoChangeMode::None;
AllowEditsMode = EAllowEditsMode::AllEdits;
KeyGroupMode = EKeyGroupMode::KeyChanged;
KeyInterpolation = EMovieSceneKeyInterpolation::Auto;
bAutoSetTrackDefaults = false;
SpawnPosition = SSP_Origin;
bCreateSpawnableCameras = true;
bShowRangeSlider = false;
bIsSnapEnabled = true;
bSnapKeyTimesToInterval = true;
bSnapKeyTimesToKeys = true;
bSnapSectionTimesToInterval = true;
bSnapSectionTimesToSections = true;
bSnapPlayTimeToKeys = false;
bSnapPlayTimeToInterval = true;
bSnapPlayTimeToPressedKey = true;
bSnapPlayTimeToDraggedKey = true;
CurveValueSnapInterval = 0.1f;
GridSpacing = TOptional<float>();
bSnapCurveValueToInterval = true;
bShowSelectedNodesOnly = false;
bRewindOnRecord = true;
ZoomPosition = ESequencerZoomPosition::SZP_CurrentTime;
bAutoScrollEnabled = false;
bLinkCurveEditorTimeRange = false;
bSynchronizeCurveEditorSelection = true;
bIsolateCurveEditorToSelection = true;
LoopMode = ESequencerLoopMode::SLM_NoLoop;
bSnapKeysAndSectionsToPlayRange = false;
bKeepCursorInPlayRangeWhileScrubbing = false;
bKeepPlayRangeInSectionBounds = true;
bCompileDirectorOnEvaluate = true;
ZeroPadFrames = 0;
JumpFrameIncrement = FFrameNumber(5);
bShowCombinedKeyframes = true;
bInfiniteKeyAreas = false;
bShowChannelColors = false;
ReduceKeysTolerance = KINDA_SMALL_NUMBER;
KeyAreaHeightWithCurves = SequencerLayoutConstants::KeyAreaHeight;
bDeleteKeysWhenTrimming = true;
bDisableSectionsAfterBaking = true;
bCleanPlaybackMode = true;
bActivateRealtimeViewports = true;
bEvaluateSubSequencesInIsolation = false;
bRerunConstructionScripts = true;
bVisualizePreAndPostRoll = true;
TrajectoryPathCap = 250;
bShowOutlinerInfoColumn = true;
FrameNumberDisplayFormat = EFrameNumberDisplayFormats::Seconds;
}
void USequencerSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
}
EAutoChangeMode USequencerSettings::GetAutoChangeMode() const
{
return AutoChangeMode;
}
void USequencerSettings::SetAutoChangeMode(EAutoChangeMode InAutoChangeMode)
{
if ( AutoChangeMode != InAutoChangeMode )
{
AutoChangeMode = InAutoChangeMode;
SaveConfig();
}
}
EAllowEditsMode USequencerSettings::GetAllowEditsMode() const
{
return AllowEditsMode;
}
void USequencerSettings::SetAllowEditsMode(EAllowEditsMode InAllowEditsMode)
{
if ( AllowEditsMode != InAllowEditsMode )
{
AllowEditsMode = InAllowEditsMode;
SaveConfig();
OnAllowEditsModeChangedEvent.Broadcast(InAllowEditsMode);
}
}
EKeyGroupMode USequencerSettings::GetKeyGroupMode() const
{
return KeyGroupMode;
}
void USequencerSettings::SetKeyGroupMode(EKeyGroupMode InKeyGroupMode)
{
if (KeyGroupMode != InKeyGroupMode)
{
KeyGroupMode = InKeyGroupMode;
SaveConfig();
}
}
EMovieSceneKeyInterpolation USequencerSettings::GetKeyInterpolation() const
{
return KeyInterpolation;
}
void USequencerSettings::SetKeyInterpolation(EMovieSceneKeyInterpolation InKeyInterpolation)
{
if ( KeyInterpolation != InKeyInterpolation)
{
KeyInterpolation = InKeyInterpolation;
SaveConfig();
}
}
ESequencerSpawnPosition USequencerSettings::GetSpawnPosition() const
{
return SpawnPosition;
}
void USequencerSettings::SetSpawnPosition(ESequencerSpawnPosition InSpawnPosition)
{
if ( SpawnPosition != InSpawnPosition)
{
SpawnPosition = InSpawnPosition;
SaveConfig();
}
}
bool USequencerSettings::GetCreateSpawnableCameras() const
{
return bCreateSpawnableCameras;
}
void USequencerSettings::SetCreateSpawnableCameras(bool bInCreateSpawnableCameras)
{
if ( bCreateSpawnableCameras != bInCreateSpawnableCameras)
{
bCreateSpawnableCameras = bInCreateSpawnableCameras;
SaveConfig();
}
}
bool USequencerSettings::GetShowRangeSlider() const
{
return bShowRangeSlider;
}
void USequencerSettings::SetShowRangeSlider(bool InbShowRangeSlider)
{
if ( bShowRangeSlider != InbShowRangeSlider )
{
bShowRangeSlider = InbShowRangeSlider;
SaveConfig();
}
}
bool USequencerSettings::GetIsSnapEnabled() const
{
return bIsSnapEnabled;
}
void USequencerSettings::SetIsSnapEnabled(bool InbIsSnapEnabled)
{
if ( bIsSnapEnabled != InbIsSnapEnabled )
{
bIsSnapEnabled = InbIsSnapEnabled;
SaveConfig();
}
}
bool USequencerSettings::GetSnapKeyTimesToInterval() const
{
return bSnapKeyTimesToInterval;
}
void USequencerSettings::SetSnapKeyTimesToInterval(bool InbSnapKeyTimesToInterval)
{
if ( bSnapKeyTimesToInterval != InbSnapKeyTimesToInterval )
{
bSnapKeyTimesToInterval = InbSnapKeyTimesToInterval;
SaveConfig();
}
}
bool USequencerSettings::GetSnapKeyTimesToKeys() const
{
return bSnapKeyTimesToKeys;
}
void USequencerSettings::SetSnapKeyTimesToKeys(bool InbSnapKeyTimesToKeys)
{
if ( bSnapKeyTimesToKeys != InbSnapKeyTimesToKeys )
{
bSnapKeyTimesToKeys = InbSnapKeyTimesToKeys;
SaveConfig();
}
}
bool USequencerSettings::GetSnapSectionTimesToInterval() const
{
return bSnapSectionTimesToInterval;
}
void USequencerSettings::SetSnapSectionTimesToInterval(bool InbSnapSectionTimesToInterval)
{
if ( bSnapSectionTimesToInterval != InbSnapSectionTimesToInterval )
{
bSnapSectionTimesToInterval = InbSnapSectionTimesToInterval;
SaveConfig();
}
}
bool USequencerSettings::GetSnapSectionTimesToSections() const
{
return bSnapSectionTimesToSections;
}
void USequencerSettings::SetSnapSectionTimesToSections( bool InbSnapSectionTimesToSections )
{
if ( bSnapSectionTimesToSections != InbSnapSectionTimesToSections )
{
bSnapSectionTimesToSections = InbSnapSectionTimesToSections;
SaveConfig();
}
}
bool USequencerSettings::GetSnapKeysAndSectionsToPlayRange() const
{
return bSnapKeysAndSectionsToPlayRange;
}
void USequencerSettings::SetSnapKeysAndSectionsToPlayRange(bool bInSnapKeysAndSectionsToPlayRange)
{
if (bSnapKeysAndSectionsToPlayRange != bInSnapKeysAndSectionsToPlayRange)
{
bSnapKeysAndSectionsToPlayRange = bInSnapKeysAndSectionsToPlayRange;
SaveConfig();
}
}
bool USequencerSettings::GetSnapPlayTimeToKeys() const
{
return bSnapPlayTimeToKeys;
}
void USequencerSettings::SetSnapPlayTimeToKeys(bool InbSnapPlayTimeToKeys)
{
if ( bSnapPlayTimeToKeys != InbSnapPlayTimeToKeys )
{
bSnapPlayTimeToKeys = InbSnapPlayTimeToKeys;
SaveConfig();
}
}
bool USequencerSettings::GetSnapPlayTimeToInterval() const
{
return bSnapPlayTimeToInterval;
}
void USequencerSettings::SetSnapPlayTimeToInterval(bool InbSnapPlayTimeToInterval)
{
if ( bSnapPlayTimeToInterval != InbSnapPlayTimeToInterval )
{
bSnapPlayTimeToInterval = InbSnapPlayTimeToInterval;
SaveConfig();
}
}
bool USequencerSettings::GetSnapPlayTimeToPressedKey() const
{
return bSnapPlayTimeToPressedKey;
}
void USequencerSettings::SetSnapPlayTimeToPressedKey(bool InbSnapPlayTimeToPressedKey)
{
if ( bSnapPlayTimeToPressedKey != InbSnapPlayTimeToPressedKey )
{
bSnapPlayTimeToPressedKey = InbSnapPlayTimeToPressedKey;
SaveConfig();
}
}
bool USequencerSettings::GetSnapPlayTimeToDraggedKey() const
{
return bSnapPlayTimeToDraggedKey;
}
void USequencerSettings::SetSnapPlayTimeToDraggedKey(bool InbSnapPlayTimeToDraggedKey)
{
if ( bSnapPlayTimeToDraggedKey != InbSnapPlayTimeToDraggedKey )
{
bSnapPlayTimeToDraggedKey = InbSnapPlayTimeToDraggedKey;
SaveConfig();
}
}
float USequencerSettings::GetCurveValueSnapInterval() const
{
return CurveValueSnapInterval;
}
void USequencerSettings::SetCurveValueSnapInterval( float InCurveValueSnapInterval )
{
if ( CurveValueSnapInterval != InCurveValueSnapInterval )
{
CurveValueSnapInterval = InCurveValueSnapInterval;
SaveConfig();
}
}
TOptional<float> USequencerSettings::GetGridSpacing() const
{
return GridSpacing;
}
void USequencerSettings::SetGridSpacing(TOptional<float> InGridSpacing)
{
if (InGridSpacing != GridSpacing)
{
GridSpacing = InGridSpacing;
SaveConfig();
}
}
bool USequencerSettings::GetSnapCurveValueToInterval() const
{
return bSnapCurveValueToInterval;
}
void USequencerSettings::SetSnapCurveValueToInterval( bool InbSnapCurveValueToInterval )
{
if ( bSnapCurveValueToInterval != InbSnapCurveValueToInterval )
{
bSnapCurveValueToInterval = InbSnapCurveValueToInterval;
SaveConfig();
}
}
bool USequencerSettings::GetShowSelectedNodesOnly() const
{
return bShowSelectedNodesOnly;
}
void USequencerSettings::SetShowSelectedNodesOnly(bool Visible)
{
if (bShowSelectedNodesOnly != Visible)
{
bShowSelectedNodesOnly = Visible;
SaveConfig();
OnShowSelectedNodesOnlyChangedEvent.Broadcast();
}
}
bool USequencerSettings::ShouldRewindOnRecord() const
{
return bRewindOnRecord;
}
void USequencerSettings::SetRewindOnRecord(bool bInRewindOnRecord)
{
if (bInRewindOnRecord != bRewindOnRecord)
{
bRewindOnRecord = bInRewindOnRecord;
SaveConfig();
}
}
ESequencerZoomPosition USequencerSettings::GetZoomPosition() const
{
return ZoomPosition;
}
void USequencerSettings::SetZoomPosition(ESequencerZoomPosition InZoomPosition)
{
if ( ZoomPosition != InZoomPosition)
{
ZoomPosition = InZoomPosition;
SaveConfig();
}
}
bool USequencerSettings::GetAutoScrollEnabled() const
{
return bAutoScrollEnabled;
}
void USequencerSettings::SetAutoScrollEnabled(bool bInAutoScrollEnabled)
{
if (bAutoScrollEnabled != bInAutoScrollEnabled)
{
bAutoScrollEnabled = bInAutoScrollEnabled;
SaveConfig();
}
}
ESequencerLoopMode USequencerSettings::GetLoopMode() const
{
return LoopMode;
}
void USequencerSettings::SetLoopMode(ESequencerLoopMode InLoopMode)
{
if (LoopMode != InLoopMode)
{
LoopMode = InLoopMode;
OnLoopStateChangedEvent.Broadcast();
SaveConfig();
}
}
bool USequencerSettings::ShouldKeepCursorInPlayRangeWhileScrubbing() const
{
return bKeepCursorInPlayRangeWhileScrubbing;
}
void USequencerSettings::SetKeepCursorInPlayRangeWhileScrubbing(bool bInKeepCursorInPlayRangeWhileScrubbing)
{
if (bKeepCursorInPlayRangeWhileScrubbing != bInKeepCursorInPlayRangeWhileScrubbing)
{
bKeepCursorInPlayRangeWhileScrubbing = bInKeepCursorInPlayRangeWhileScrubbing;
SaveConfig();
}
}
bool USequencerSettings::ShouldKeepPlayRangeInSectionBounds() const
{
return bKeepPlayRangeInSectionBounds;
}
void USequencerSettings::SetKeepPlayRangeInSectionBounds(bool bInKeepPlayRangeInSectionBounds)
{
if (bKeepPlayRangeInSectionBounds != bInKeepPlayRangeInSectionBounds)
{
bKeepPlayRangeInSectionBounds = bInKeepPlayRangeInSectionBounds;
SaveConfig();
}
}
bool USequencerSettings::GetLinkCurveEditorTimeRange() const
{
return bLinkCurveEditorTimeRange;
}
void USequencerSettings::SetLinkCurveEditorTimeRange(bool InbLinkCurveEditorTimeRange)
{
if (bLinkCurveEditorTimeRange != InbLinkCurveEditorTimeRange)
{
bLinkCurveEditorTimeRange = InbLinkCurveEditorTimeRange;
SaveConfig();
}
}
void USequencerSettings::SyncCurveEditorSelection(bool bInSynchronizeCurveEditorSelection)
{
if (bSynchronizeCurveEditorSelection != bInSynchronizeCurveEditorSelection)
{
bSynchronizeCurveEditorSelection = bInSynchronizeCurveEditorSelection;
SaveConfig();
}
}
void USequencerSettings::IsolateCurveEditorToSelection(bool bInIsolateCurveEditorToSelection)
{
if (bIsolateCurveEditorToSelection != bInIsolateCurveEditorToSelection)
{
bIsolateCurveEditorToSelection = bInIsolateCurveEditorToSelection;
SaveConfig();
}
}
uint8 USequencerSettings::GetZeroPadFrames() const
{
return ZeroPadFrames;
}
void USequencerSettings::SetZeroPadFrames(uint8 InZeroPadFrames)
{
if (ZeroPadFrames != InZeroPadFrames)
{
ZeroPadFrames = InZeroPadFrames;
SaveConfig();
}
}
FFrameNumber USequencerSettings::GetJumpFrameIncrement() const
{
return JumpFrameIncrement;
}
void USequencerSettings::SetJumpFrameIncrement(FFrameNumber InJumpFrameIncrement)
{
if (JumpFrameIncrement != InJumpFrameIncrement)
{
JumpFrameIncrement = InJumpFrameIncrement;
SaveConfig();
}
}
bool USequencerSettings::GetShowCombinedKeyframes() const
{
return bShowCombinedKeyframes;
}
void USequencerSettings::SetShowCombinedKeyframes(bool InbShowCombinedKeyframes)
{
if (bShowCombinedKeyframes != InbShowCombinedKeyframes)
{
bShowCombinedKeyframes = InbShowCombinedKeyframes;
SaveConfig();
}
}
bool USequencerSettings::GetInfiniteKeyAreas() const
{
return bInfiniteKeyAreas;
}
void USequencerSettings::SetInfiniteKeyAreas(bool InbInfiniteKeyAreas)
{
if (bInfiniteKeyAreas != InbInfiniteKeyAreas)
{
bInfiniteKeyAreas = InbInfiniteKeyAreas;
SaveConfig();
}
}
bool USequencerSettings::GetShowChannelColors() const
{
return bShowChannelColors;
}
void USequencerSettings::SetShowChannelColors(bool InbShowChannelColors)
{
if (bShowChannelColors != InbShowChannelColors)
{
bShowChannelColors = InbShowChannelColors;
SaveConfig();
}
}
float USequencerSettings::GetKeyAreaHeightWithCurves() const
{
return KeyAreaHeightWithCurves;
}
void USequencerSettings::SetKeyAreaHeightWithCurves(float InKeyAreaHeightWithCurves)
{
if (KeyAreaHeightWithCurves != InKeyAreaHeightWithCurves)
{
KeyAreaHeightWithCurves = InKeyAreaHeightWithCurves;
SaveConfig();
}
}
float USequencerSettings::GetReduceKeysTolerance() const
{
return ReduceKeysTolerance;
}
void USequencerSettings::SetReduceKeysTolerance(float InReduceKeysTolerance)
{
if (ReduceKeysTolerance != InReduceKeysTolerance)
{
ReduceKeysTolerance = InReduceKeysTolerance;
SaveConfig();
}
}
bool USequencerSettings::GetDeleteKeysWhenTrimming() const
{
return bDeleteKeysWhenTrimming;
}
void USequencerSettings::SetDeleteKeysWhenTrimming(bool bInDeleteKeysWhenTrimming)
{
if (bDeleteKeysWhenTrimming != bInDeleteKeysWhenTrimming)
{
bDeleteKeysWhenTrimming = bInDeleteKeysWhenTrimming;
SaveConfig();
}
}
bool USequencerSettings::GetDisableSectionsAfterBaking() const
{
return bDisableSectionsAfterBaking;
}
void USequencerSettings::SetDisableSectionsAfterBaking(bool bInDisableSectionsAfterBaking)
{
if (bDisableSectionsAfterBaking != bInDisableSectionsAfterBaking)
{
bDisableSectionsAfterBaking = bInDisableSectionsAfterBaking;
SaveConfig();
}
}
bool USequencerSettings::GetCleanPlaybackMode() const
{
return bCleanPlaybackMode;
}
void USequencerSettings::SetCleanPlaybackMode(bool bInCleanPlaybackMode)
{
if (bInCleanPlaybackMode != bCleanPlaybackMode)
{
bCleanPlaybackMode = bInCleanPlaybackMode;
SaveConfig();
}
}
bool USequencerSettings::ShouldActivateRealtimeViewports() const
{
return bActivateRealtimeViewports;
}
void USequencerSettings::SetActivateRealtimeViewports(bool bInActivateRealtimeViewports)
{
if (bInActivateRealtimeViewports != bActivateRealtimeViewports)
{
bActivateRealtimeViewports = bInActivateRealtimeViewports;
SaveConfig();
}
}
bool USequencerSettings::GetAutoSetTrackDefaults() const
{
return bAutoSetTrackDefaults;
}
void USequencerSettings::SetAutoSetTrackDefaults(bool bInAutoSetTrackDefaults)
{
if (bInAutoSetTrackDefaults != bAutoSetTrackDefaults)
{
bAutoSetTrackDefaults = bInAutoSetTrackDefaults;
SaveConfig();
}
}
bool USequencerSettings::ShouldShowDebugVisualization() const
{
return bShowDebugVisualization;
}
void USequencerSettings::SetShowDebugVisualization(bool bInShowDebugVisualization)
{
if (bShowDebugVisualization != bInShowDebugVisualization)
{
bShowDebugVisualization = bInShowDebugVisualization;
SaveConfig();
}
}
bool USequencerSettings::ShouldEvaluateSubSequencesInIsolation() const
{
return bEvaluateSubSequencesInIsolation;
}
void USequencerSettings::SetEvaluateSubSequencesInIsolation(bool bInEvaluateSubSequencesInIsolation)
{
if (bEvaluateSubSequencesInIsolation != bInEvaluateSubSequencesInIsolation)
{
bEvaluateSubSequencesInIsolation = bInEvaluateSubSequencesInIsolation;
SaveConfig();
OnEvaluateSubSequencesInIsolationChangedEvent.Broadcast();
}
}
bool USequencerSettings::ShouldRerunConstructionScripts() const
{
return bRerunConstructionScripts;
}
void USequencerSettings::SetRerunConstructionScripts(bool bInRerunConstructionScripts)
{
if (bRerunConstructionScripts != bInRerunConstructionScripts)
{
bRerunConstructionScripts = bInRerunConstructionScripts;
SaveConfig();
}
}
bool USequencerSettings::ShouldShowPrePostRoll() const
{
return bVisualizePreAndPostRoll;
}
void USequencerSettings::SetShouldShowPrePostRoll(bool bInVisualizePreAndPostRoll)
{
if (bInVisualizePreAndPostRoll != bVisualizePreAndPostRoll)
{
bVisualizePreAndPostRoll = bInVisualizePreAndPostRoll;
SaveConfig();
}
}
bool USequencerSettings::ShouldCompileDirectorOnEvaluate() const
{
return bCompileDirectorOnEvaluate;
}
void USequencerSettings::SetCompileDirectorOnEvaluate(bool bInCompileDirectorOnEvaluate)
{
if (bInCompileDirectorOnEvaluate != bCompileDirectorOnEvaluate)
{
bCompileDirectorOnEvaluate = bInCompileDirectorOnEvaluate;
SaveConfig();
}
}
bool USequencerSettings::GetShowOutlinerInfoColumn() const
{
return bShowOutlinerInfoColumn;
}
void USequencerSettings::SetShowOutlinerInfoColumn(bool bInShowOutlinerInfoColumn)
{
if (bInShowOutlinerInfoColumn != bShowOutlinerInfoColumn)
{
bShowOutlinerInfoColumn = bInShowOutlinerInfoColumn;
SaveConfig();
}
}
USequencerSettings::FOnLoopStateChanged& USequencerSettings::GetOnLoopStateChanged()
{
return OnLoopStateChangedEvent;
}
void USequencerSettings::SetTimeDisplayFormat(EFrameNumberDisplayFormats InFormat)
{
if (InFormat != FrameNumberDisplayFormat)
{
FrameNumberDisplayFormat = InFormat;
SaveConfig();
}
}
void USequencerSettings::SetMovieRendererName(const FString& InMovieRendererName)
{
if (InMovieRendererName != MovieRendererName)
{
MovieRendererName = InMovieRendererName;
SaveConfig();
}
}