Files
UnrealEngineUWP/Engine/Source/Editor/AnimationModifiers/Private/AnimationModifiersModule.h
Jurre deBaare a5305f76a3 Contributed by Yupeng.Zhang from The Coalition:
Animation Modifier : Fix Modifier on Skeleton
Transfered the ownership of 'PreviouslyAppliedModifier' from an animation modifier instance to the animation sequence being applied.
This solved the following issue:
- Modifier on Skeleton cause USkeleton dirtied everytime the modifier is applied to an animation sequence.
- Modifier on Skeleton cannot be re-apply or reverted correctly.
- CanRevert & OutOfDate status for Modifier on Skeleton was not reflect the true status of all animation sequences referencing that skeleton.

- CurrentAnimSequence/CurrentSkeleton was not set on OnRevert()
- IAnimationDataController::FScopedBracket was not open on OnRevert() before re-apply modifier
- Stateful animation modifier can now be reverted correctly (Applied modifier instance is nolonger reverted after OnApply call)

#preflight 63775e0ff514e1ded99ef095

[CL 23191977 by Jurre deBaare in ue5-main branch]
2022-11-18 05:35:47 -05:00

47 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
#include "IAnimationModifiersModule.h"
#include "Templates/SharedPointer.h"
#include "UObject/NameTypes.h"
#include "WorkflowOrientedApp/WorkflowCentricApplication.h"
#include "AnimationModifier.h"
class FApplicationMode;
class UAnimSequence;
class UFactory;
class UObject;
/** Animation modifiers module, handles injecting of the AnimationModifiersTab into animation and skeleton editor modes */
class FAnimationModifiersModule : public IAnimationModifiersModule
{
public:
/** Called right after the module DLL has been loaded and the module object has been created */
virtual void StartupModule() override;
/** Called before the module is unloaded, right before the module object is destroyed */
virtual void ShutdownModule() override;
/** Begin IAnimationModifiersModule overrides */
virtual void ShowAddAnimationModifierWindow(const TArray<UAnimSequence*>& InSequences) override;
virtual void ApplyAnimationModifiers(const TArray<UAnimSequence*>& InSequences, bool bForceApply = true) override;
/** End IAnimationModifiersModule overrides */
protected:
/** Callback for extending an application mode */
TSharedRef<FApplicationMode> ExtendApplicationMode(const FName ModeName, TSharedRef<FApplicationMode> InMode);
/** Weak list of application modes for which a tab factory was registered */
TArray<TWeakPtr<FApplicationMode>> RegisteredApplicationModes;
FWorkflowApplicationModeExtender Extender;
FDelegateHandle OnGetExtraObjectTagsHandle;
/** Callbacks used to add and apply default animation modifier classes */
void OnAssetPostImport(UFactory* ImportFactory, UObject* ImportedObject);
void OnAssetPostReimport(UObject* ReimportedObject);
};