Files
UnrealEngineUWP/Engine/Source/Editor/MovieSceneTools/Private/MovieSceneToolsModule.cpp
Max Chen d36eb2a2ba Copying //UE4/Dev-Sequencer to //UE4/Dev-Main (Source: //UE4/Dev-Sequencer @ 3003857)
==========================
MAJOR FEATURES + CHANGES
==========================

Change 2945755 on 2016/04/15 by Frank.Fella

	Sequencer - Fix issues with level visibility.
	+ Don't mark sub-levels as dirty when the track evaluates.
	+ Fix an issue where sequencer gets into a refresh loop because drawing thumbnails causes levels to be added which was rebuilding the tree, which was redrawing thumbnails.
	+ Null check for when an objects world is null but the track is still evaluating.
	+ Remove UnrealEd references.

Change 2947197 on 2016/04/18 by Max.Chen

	Sequencer: Expose settings sequencer settings in the Editor Preferences page. Note, UMG and Niagara have separate sequencer settings pages.

	#jira UE-29516

Change 2948468 on 2016/04/19 by Max.Chen

	Sequencer: Fix particles not firing on loop.

	#jira UE-27881

Change 2948590 on 2016/04/19 by Max.Chen

	Sequencer: Fix spawnables not getting default tracks.

	#jira UE-29644

Change 2955993 on 2016/04/26 by Max.Chen

	Sequencer: Refresh instances when done recording. This fixes a bug where spawned recorded actors aren't visible when done recording.

	#jira UE-29841

Change 2958567 on 2016/04/27 by Max.Preussner

	RHI: Made SetReferencedTexture public, so that the referenced texture can be set

Change 2958718 on 2016/04/28 by Max.Chen

	Sequencer: Folder colors. Right click on a folder and choose "Set Color"

	#jira UE-28669

Change 2960172 on 2016/04/28 by Max.Preussner

	Slate: Slate Remote Server (for the iOS touch input app) is now disabled by default, so we don't open up the socket unless desired by the user

Change 2960411 on 2016/04/28 by Max.Chen

	Sequencer: Don't remove label if it's not being used.

	#jira UE-24283

Change 2960414 on 2016/04/28 by Max.Chen

	Matinee: Don't automatically turn frustums on/off when entering and exiting Matinee.

	#jira UE-1020

Change 2962784 on 2016/05/02 by Max.Chen

	Sequencer: Add master sequence

	#jira UE-29799

Change 2964399 on 2016/05/03 by Andrew.Rodham

	Sequencer: Added ability to apply cook-time optimization to tracks and objects
	  - For now, if a spawnable has a spawn track that is disabled, or will never spawn, the entire spawnable object will be removed from a cooked package.
	  - Possessables also afford the same optimization, although none is currently implemented
	  - We could, in future, also remove any tracks that are completely disabled
	  - Deprecated UMovieSceneBoolSection::DefaultValue in favor of the default stored on FIntegralCurve

Change 2967549 on 2016/05/05 by Max.Chen

	Sequencer: Fix crash converting possessable to spawnable when the possessable doesn't exist.

	#jira UE-30360

Change 2967670 on 2016/05/05 by Max.Chen

	Sequencer: Set ui min/max for sequencer settings

	#jira UE-30344

Change 2978969 on 2016/05/16 by Max.Chen

	Sequencer: Restore state when focusing on a shot level sequence. This fixes issues where tracks in the movie scene that are active before switching to the new movie scene need to return to
their initial state. For example, setting a fade track in the master sequence and switching into a shot should disable the effects of the fade track in the master sequence.

	#jira UE-30798

Change 2983237 on 2016/05/19 by Andrew.Rodham

	Protocol settings for movie captures are now set up correctly when a capture type is specified on the command line

	Thanks to original github author, yuhe00

	#pr
	#2257

Change 2991115 on 2016/05/26 by Andrew.Rodham

	Sequencer: Added {shot} and {shot_frame} format args for movie captures

	  - Additionally, rendering out movie scenes as videos will now generate a new video for each unique filename it encounters. This allows us to render out a video per shot by using {shot} as
the output format.
	  - Frame numbers are now zero-padded as per the sequencer setting.

Change 2991920 on 2016/05/26 by Max.Chen

	Sequencer: Fix movie scene getting dirtied unnecessarily when the fixed frame interval changes.

	#jira UE-31343

Change 2992387 on 2016/05/26 by Max.Chen

	Sequencer: Fix crash when getting the color key properties of a collapsed key that doesn't have all channels keyed.

	#jira UE-31392

Change 2993553 on 2016/05/27 by Andrew.Rodham

	Sequencer: Added the ability to add burn-ins to level sequences

	  - A default burn-in is provided which hosts a great level of flexibility
	  - 6 regions (L/C/R + T/B) on a 30% black border allow positioning of a range of frame statistics such as shot name ({ShotName}), frame numbers ({MasterFrame}, {ShotFrame}), and other
information.
	  - Watermark is provided by default (currently no tiling is exposed)
	  - Users can use the default built in UMG widget as a guideline for their own custom implementations.

Change 2993554 on 2016/05/27 by Andrew.Rodham

	Sequencer: Default level sequence burn ins

	  - Also made a font asset out of our fixed width font shipped with the engine

Change 2993856 on 2016/05/30 by Max.Chen

	Sequencer: Import/Export EDL

	 - Added a new option in the render movie dialog to export an Edit Decision List (EDL) in cmx and rv formats if there is a shot track. The default is true.
	 - Added "Import EDL" to shot track right click menu which imports a cmx EDL and conforms the shot order and cut information to it.
	 - Added "Export EDL" to shot track right click menu which exports EDLs in cmx and rv formats.
	 - Added "Render Shot" to shot right click menu which loads up the render movie dialog with the start and end frames of the selected shot.

	#jira UETOOL-829, UETOOL-830

Change 2994761 on 2016/05/31 by Max.Chen

	Sequence Recorder: Add a setting to allow recording of actors that are spawned by sequencer itself.

Change 2995648 on 2016/06/01 by HaarmPieter.Duiker

	Sequencer EXR output gamut controls

Change 2996241 on 2016/06/01 by Frank.Fella

	Sequencer - Add a small epsilon when "force fixed frame interval" is enabled, to make sure we're in the start of the next frame.

Change 2996244 on 2016/06/01 by Frank.Fella

	Sequencer - Set the tick prerequisite for all components, not just the root.

Change 2997865 on 2016/06/02 by Max.Preussner

	Sequencer: Fixed Crash in Sequencer play rate track when setting negative play rate (UE-31431)

	#jira UE-31431

Change 2999631 on 2016/06/03 by Frank.Fella

	Sequencer - At runtime, make sure to stop playing skeletal animations to prevent them from being double updated each frame, once by sequencer, and then again by tick.

Change 3000820 on 2016/06/03 by Max.Chen

	Sequencer: Add hotkey (ctrl-T) to toggle between showing frame numbers and time.

	#jira UE-31497

Change 3001056 on 2016/06/05 by Max.Chen

	Sequencer: Fix fade color section crash by using an inline color picker in the details panel instead of a popup color picker.

	#jira UE-31647

Change 3001057 on 2016/06/05 by Max.Chen

	Movie Capture: Fix audio getting disabled after recording a movie.

Change 3001690 on 2016/06/06 by Andrew.Rodham

	Sequencer: Fixed recording video sequences when not overwriting existing videos

Change 3001823 on 2016/06/06 by Max.Chen

	Sequencer: Fix filtered nodes in folders so that other unfiltered children aren't visible.

	#jira UE-31499

#lockdown Nick.Penwarden

[CL 3003974 by Max Chen in Main branch]
2016-06-07 11:03:52 -04:00

228 lines
12 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "MovieSceneToolsPrivatePCH.h"
#include "ModuleManager.h"
#include "ISequencerModule.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "MovieSceneSection.h"
#include "ISequencerSection.h"
#include "ScopedTransaction.h"
#include "MovieScene.h"
#include "MovieSceneTrackEditor.h"
#include "MovieSceneToolsProjectSettingsCustomization.h"
#include "BoolPropertyTrackEditor.h"
#include "BytePropertyTrackEditor.h"
#include "ColorPropertyTrackEditor.h"
#include "FloatPropertyTrackEditor.h"
#include "VectorPropertyTrackEditor.h"
#include "VisibilityPropertyTrackEditor.h"
#include "ActorReferencePropertyTrackEditor.h"
#include "TransformTrackEditor.h"
#include "CameraCutTrackEditor.h"
#include "CinematicShotTrackEditor.h"
#include "SlomoTrackEditor.h"
#include "SubTrackEditor.h"
#include "AudioTrackEditor.h"
#include "SkeletalAnimationTrackEditor.h"
#include "ParticleTrackEditor.h"
#include "ParticleParameterTrackEditor.h"
#include "AttachTrackEditor.h"
#include "EventTrackEditor.h"
#include "PathTrackEditor.h"
#include "MaterialTrackEditor.h"
#include "FadeTrackEditor.h"
#include "SpawnTrackEditor.h"
#include "LevelVisibilityTrackEditor.h"
#include "CameraAnimTrackEditor.h"
#include "CameraShakeTrackEditor.h"
#include "MovieSceneClipboard.h"
#include "SequencerClipboardReconciler.h"
#include "ClipboardTypes.h"
#include "Curves/CurveBase.h"
#include "ISettingsModule.h"
#include "PropertyEditorModule.h"
#define LOCTEXT_NAMESPACE "FMovieSceneToolsModule"
/**
* Implements the MovieSceneTools module.
*/
class FMovieSceneToolsModule
: public IMovieSceneTools
{
public:
// IModuleInterface interface
virtual void StartupModule() override
{
if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings"))
{
SettingsModule->RegisterSettings("Project", "Editor", "Level Sequences",
LOCTEXT("RuntimeSettingsName", "Level Sequences"),
LOCTEXT("RuntimeSettingsDescription", "Configure project settings relating to Level Sequences"),
GetMutableDefault<UMovieSceneToolsProjectSettings>()
);
}
ISequencerModule& SequencerModule = FModuleManager::Get().LoadModuleChecked<ISequencerModule>( "Sequencer" );
// register property track editors
BoolPropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FBoolPropertyTrackEditor::CreateTrackEditor ) );
BytePropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FBytePropertyTrackEditor::CreateTrackEditor ) );
ColorPropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FColorPropertyTrackEditor::CreateTrackEditor ) );
FloatPropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FFloatPropertyTrackEditor::CreateTrackEditor ) );
VectorPropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FVectorPropertyTrackEditor::CreateTrackEditor ) );
VisibilityPropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FVisibilityPropertyTrackEditor::CreateTrackEditor ) );
ActorReferencePropertyTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle(FOnCreateTrackEditor::CreateStatic( &FActorReferencePropertyTrackEditor::CreateTrackEditor ) );
// register specialty track editors
AnimationTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FSkeletalAnimationTrackEditor::CreateTrackEditor ) );
AttachTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &F3DAttachTrackEditor::CreateTrackEditor ) );
AudioTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FAudioTrackEditor::CreateTrackEditor ) );
EventTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FEventTrackEditor::CreateTrackEditor ) );
ParticleTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FParticleTrackEditor::CreateTrackEditor ) );
ParticleParameterTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FParticleParameterTrackEditor::CreateTrackEditor ) );
PathTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &F3DPathTrackEditor::CreateTrackEditor ) );
CameraCutTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FCameraCutTrackEditor::CreateTrackEditor ) );
CinematicShotTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FCinematicShotTrackEditor::CreateTrackEditor ) );
SlomoTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FSlomoTrackEditor::CreateTrackEditor ) );
SubTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FSubTrackEditor::CreateTrackEditor ) );
TransformTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &F3DTransformTrackEditor::CreateTrackEditor ) );
ComponentMaterialTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FComponentMaterialTrackEditor::CreateTrackEditor ) );
FadeTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FFadeTrackEditor::CreateTrackEditor ) );
SpawnTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FSpawnTrackEditor::CreateTrackEditor ) );
LevelVisibilityTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle( FOnCreateTrackEditor::CreateStatic( &FLevelVisibilityTrackEditor::CreateTrackEditor ) );
CameraAnimTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle(FOnCreateTrackEditor::CreateStatic(&FCameraAnimTrackEditor::CreateTrackEditor));
CameraShakeTrackCreateEditorHandle = SequencerModule.RegisterTrackEditor_Handle(FOnCreateTrackEditor::CreateStatic(&FCameraShakeTrackEditor::CreateTrackEditor));
RegisterClipboardConversions();
// register details customization
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomClassLayout("MovieSceneToolsProjectSettings", FOnGetDetailCustomizationInstance::CreateStatic(&FMovieSceneToolsProjectSettingsCustomization::MakeInstance));
}
virtual void ShutdownModule() override
{
if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings"))
{
SettingsModule->UnregisterSettings("Project", "Editor", "Level Sequences");
}
if (!FModuleManager::Get().IsModuleLoaded("Sequencer"))
{
return;
}
ISequencerModule& SequencerModule = FModuleManager::Get().GetModuleChecked<ISequencerModule>( "Sequencer" );
// unregister property track editors
SequencerModule.UnRegisterTrackEditor_Handle( BoolPropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( BytePropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( ColorPropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( FloatPropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( VectorPropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( VisibilityPropertyTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( ActorReferencePropertyTrackCreateEditorHandle );
// unregister specialty track editors
SequencerModule.UnRegisterTrackEditor_Handle( AnimationTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( AttachTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( AudioTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( EventTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( ParticleTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( ParticleParameterTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( PathTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( CameraCutTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( CinematicShotTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( SlomoTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( SubTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( TransformTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( ComponentMaterialTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( FadeTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( SpawnTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( CameraAnimTrackCreateEditorHandle );
SequencerModule.UnRegisterTrackEditor_Handle( CameraShakeTrackCreateEditorHandle );
if (FModuleManager::Get().IsModuleLoaded("PropertyEditor"))
{
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.UnregisterCustomClassLayout("MovieSceneToolsProjectSettings");
}
}
void RegisterClipboardConversions()
{
using namespace MovieSceneClipboard;
DefineImplicitConversion<int32, uint8>();
DefineImplicitConversion<int32, bool>();
DefineImplicitConversion<uint8, int32>();
DefineImplicitConversion<uint8, bool>();
DefineExplicitConversion<int32, FRichCurveKey>([](const int32& In) -> FRichCurveKey { return FRichCurveKey(0.f, In); });
DefineExplicitConversion<uint8, FRichCurveKey>([](const uint8& In) -> FRichCurveKey { return FRichCurveKey(0.f, In); });
DefineExplicitConversion<FRichCurveKey, int32>([](const FRichCurveKey& In) -> int32 { return In.Value; });
DefineExplicitConversion<FRichCurveKey, uint8>([](const FRichCurveKey& In) -> uint8 { return In.Value; });
DefineExplicitConversion<FRichCurveKey, bool>([](const FRichCurveKey& In) -> bool { return !!In.Value; });
FSequencerClipboardReconciler::AddTrackAlias("Location.X", "R");
FSequencerClipboardReconciler::AddTrackAlias("Location.Y", "G");
FSequencerClipboardReconciler::AddTrackAlias("Location.Z", "B");
FSequencerClipboardReconciler::AddTrackAlias("Rotation.X", "R");
FSequencerClipboardReconciler::AddTrackAlias("Rotation.Y", "G");
FSequencerClipboardReconciler::AddTrackAlias("Rotation.Z", "B");
FSequencerClipboardReconciler::AddTrackAlias("Scale.X", "R");
FSequencerClipboardReconciler::AddTrackAlias("Scale.Y", "G");
FSequencerClipboardReconciler::AddTrackAlias("Scale.Z", "B");
FSequencerClipboardReconciler::AddTrackAlias("X", "R");
FSequencerClipboardReconciler::AddTrackAlias("Y", "G");
FSequencerClipboardReconciler::AddTrackAlias("Z", "B");
FSequencerClipboardReconciler::AddTrackAlias("W", "A");
}
private:
/** Registered delegate handles */
FDelegateHandle BoolPropertyTrackCreateEditorHandle;
FDelegateHandle BytePropertyTrackCreateEditorHandle;
FDelegateHandle ColorPropertyTrackCreateEditorHandle;
FDelegateHandle FloatPropertyTrackCreateEditorHandle;
FDelegateHandle VectorPropertyTrackCreateEditorHandle;
FDelegateHandle VisibilityPropertyTrackCreateEditorHandle;
FDelegateHandle ActorReferencePropertyTrackCreateEditorHandle;
FDelegateHandle AnimationTrackCreateEditorHandle;
FDelegateHandle AttachTrackCreateEditorHandle;
FDelegateHandle AudioTrackCreateEditorHandle;
FDelegateHandle EventTrackCreateEditorHandle;
FDelegateHandle ParticleTrackCreateEditorHandle;
FDelegateHandle ParticleParameterTrackCreateEditorHandle;
FDelegateHandle PathTrackCreateEditorHandle;
FDelegateHandle CameraCutTrackCreateEditorHandle;
FDelegateHandle CinematicShotTrackCreateEditorHandle;
FDelegateHandle SlomoTrackCreateEditorHandle;
FDelegateHandle SubTrackCreateEditorHandle;
FDelegateHandle TransformTrackCreateEditorHandle;
FDelegateHandle ComponentMaterialTrackCreateEditorHandle;
FDelegateHandle FadeTrackCreateEditorHandle;
FDelegateHandle SpawnTrackCreateEditorHandle;
FDelegateHandle LevelVisibilityTrackCreateEditorHandle;
FDelegateHandle CameraAnimTrackCreateEditorHandle;
FDelegateHandle CameraShakeTrackCreateEditorHandle;
};
IMPLEMENT_MODULE( FMovieSceneToolsModule, MovieSceneTools );
#undef LOCTEXT_NAMESPACE