Add Games File
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
|
||||
#include "VRM4UEditor.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "VRM4UEditorLog.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "Internationalization/Internationalization.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "VRM4UEditor"
|
||||
|
||||
DEFINE_LOG_CATEGORY(LogVRM4UEditor);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// FSpriterImporterModule
|
||||
|
||||
class FVRM4UEditorModule : public FDefaultModuleImpl
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ShutdownModule() override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IMPLEMENT_MODULE(FVRM4UEditorModule, VRM4UEditor);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
//#include "VRMImporterModule.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(LogVRM4UEditor, Verbose, All);
|
||||
|
||||
#define SPRITER_IMPORT_ERROR(FormatString, ...) \
|
||||
if (!bSilent) { UE_LOG(LogVRM4UEditor, Warning, FormatString, __VA_ARGS__); }
|
||||
#define SPRITER_IMPORT_WARNING(FormatString, ...) \
|
||||
if (!bSilent) { UE_LOG(LogVRM4UEditor, Warning, FormatString, __VA_ARGS__); }
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
//#include "VRMImporterModule.h"
|
||||
|
||||
//DECLARE_LOG_CATEGORY_EXTERN(LogVRM4UEditor, Verbose, All);
|
||||
|
||||
//#define SPRITER_IMPORT_ERROR(FormatString, ...) \
|
||||
// if (!bSilent) { UE_LOG(LogVRM4UEditor, Warning, FormatString, __VA_ARGS__); }
|
||||
//#define SPRITER_IMPORT_WARNING(FormatString, ...) \
|
||||
// if (!bSilent) { UE_LOG(LogVRM4UEditor, Warning, FormatString, __VA_ARGS__); }
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// VRM4U Copyright (c) 2021-2024 Haruyoshi Yamamoto. This software is released under the MIT License.
|
||||
|
||||
#include "VrmEditorBPFunctionLibrary.h"
|
||||
|
||||
#include "Engine/Engine.h"
|
||||
#include "Logging/MessageLog.h"
|
||||
#include "Engine/Canvas.h"
|
||||
#if UE_VERSION_OLDER_THAN(4,26,0)
|
||||
#include "AssetRegistryModule.h"
|
||||
#else
|
||||
#include "AssetRegistry/AssetRegistryModule.h"
|
||||
#endif
|
||||
|
||||
#include "MovieScene.h"
|
||||
#include "MovieSceneSequence.h"
|
||||
#include "Sections/MovieSceneFloatSection.h"
|
||||
|
||||
//#include "VRM4U.h"
|
||||
|
||||
//OnGlobalTimeChanged
|
||||
|
||||
int UVrmEditorBPFunctionLibrary::EvaluateCurvesFromSequence(const UMovieSceneSequence* Seq, float FrameNo, TArray<FString>& names, TArray<float> &curves) {
|
||||
names.Empty();
|
||||
curves.Empty();
|
||||
|
||||
#if UE_VERSION_OLDER_THAN(4,26,0)
|
||||
return 0;
|
||||
#else
|
||||
|
||||
//if (Track == nullptr) return 0;
|
||||
|
||||
if (Seq == nullptr) return 0;
|
||||
if (Seq->GetMovieScene() == nullptr) return 0;
|
||||
|
||||
TArray<UMovieSceneSection*> Sections = Seq->GetMovieScene()->GetAllSections();
|
||||
//const auto &Sections = Track->GetAllSections();
|
||||
for (UMovieSceneSection* Section : Sections){
|
||||
UMovieSceneFloatSection* FloatSection = Cast<UMovieSceneFloatSection>(Section);
|
||||
//UMovieSceneControlRigParameterSection* s = Cast<UMovieSceneControlRigParameterSection>(Section);
|
||||
|
||||
if (FloatSection == nullptr) {
|
||||
continue;
|
||||
}
|
||||
const FMovieSceneFloatChannel& Channel = FloatSection->GetChannel();
|
||||
float Value;
|
||||
FFrameTime Time((int)(FMath::Floor(FrameNo)), FMath::Frac(FrameNo));
|
||||
bool Success = Channel.Evaluate(Time, Value);
|
||||
if (Success) {
|
||||
curves.Add(Value);
|
||||
names.Add(FloatSection->GetName());
|
||||
}
|
||||
}
|
||||
return curves.Num();
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user