19 virtual void NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
float TotalDuration,
const FAnimNotifyEventReference& EventReference)
override;
20 virtual void NotifyTick(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
float FrameDeltaTime,
const FAnimNotifyEventReference& EventReference)
override;
21 virtual void NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
const FAnimNotifyEventReference& EventReference)
override;
24 UPROPERTY(EditAnywhere, Category =
"Material", meta = (GetOptions =
"GetMaterialSlotOptions"))
25 FName MaterialSlotName;
27 UPROPERTY(EditAnywhere, Category = "Material", meta = (TitleProperty = "ParameterName"))
30 UPROPERTY(EditAnywhere, Category = "Material", meta = (TitleProperty = "ParameterName"))
35 struct FPreviewMaterialState
37 TWeakObjectPtr<UMaterialInstanceDynamic> Material;
38 TMap<FName, float> ScalarInitialValues;
39 TMap<FName, FLinearColor> VectorInitialValues;
40 TMap<FName, float> ScalarStartValues;
41 TMap<FName, FLinearColor> VectorStartValues;
45 TWeakObjectPtr<UAnimSequenceBase> Animation;
46 float LastAnimationTime = 0.0f;
47 TMap<FName, FPreviewMaterialState> Materials;
50 static TMap<TWeakObjectPtr<USkeletalMeshComponent>, FPreviewState> PreviewStates;
52 FPreviewState* PrepareMaterialPreview(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
float AnimationTime);
53 void BeginMaterialPreview(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
float AnimationTime);
54 void UpdateMaterialPreview(USkeletalMeshComponent* MeshComp,
float Alpha);
56 USkeletalMesh* GetNotifyPreviewMesh()
const;
57 UMaterialInterface* GetNotifyPreviewMaterial()
const;
60 TArray<FString> GetMaterialSlotOptions() const;
63 TArray<FString> GetScalarParameterOptions() const;
66 TArray<FString> GetVectorParameterOptions() const;