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
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// VRM4U Copyright (c) 2021-2024 Haruyoshi Yamamoto. This software is released under the MIT License.
|
||||
|
||||
#pragma once
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Engine/EngineTypes.h"
|
||||
#include "Engine/TextureRenderTarget2D.h"
|
||||
#include "Misc/EngineVersionComparison.h"
|
||||
|
||||
#include "VrmEditorBPFunctionLibrary.generated.h"
|
||||
|
||||
class UTextureRenderTarget2D;
|
||||
class UMaterialInstanceConstant;
|
||||
class UAnimationAsset;
|
||||
class USkeleton;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class VRM4UEDITOR_API UVrmEditorBPFunctionLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
//UFUNCTION(BlueprintCallable,Category="VRM4U", meta = (DevelopmentOnly))
|
||||
//static bool VRMBakeAnim(const USkeletalMeshComponent *skc, const FString &FilePath, const FString &AssetFileName);
|
||||
|
||||
|
||||
//UFUNCTION(BlueprintCallable,Category="VRM4U")
|
||||
//static void VRMTransMatrix(const FTransform &transform, TArray<FLinearColor> &matrix, TArray<FLinearColor> &matrix_inv);
|
||||
|
||||
//UFUNCTION(BlueprintPure, Category = "VRM4U")
|
||||
//static void VRMGetMorphTargetList(const USkeletalMesh *target, TArray<FString> &morphTargetList);
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
static int EvaluateCurvesFromSequence(const UMovieSceneSequence* Seq, float FrameNo, TArray<FString>& names, TArray<float>& curves);
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
// VRM4U Copyright (c) 2021-2024 Haruyoshi Yamamoto. This software is released under the MIT License.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class VRM4UEditor : ModuleRules
|
||||
{
|
||||
public VRM4UEditor(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[] {
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"InputCore",
|
||||
"EditorStyle",
|
||||
"Engine",
|
||||
"UnrealEd",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
|
||||
"MovieSceneCapture",
|
||||
|
||||
"MovieScene",
|
||||
"MovieSceneTracks",
|
||||
|
||||
//"ControlRigEditor",
|
||||
|
||||
"VRM4U",
|
||||
});
|
||||
|
||||
PrivateIncludePathModuleNames.AddRange(
|
||||
new string[] {
|
||||
"AssetTools",
|
||||
"AssetRegistry",
|
||||
});
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[] {
|
||||
"AssetTools",
|
||||
"AssetRegistry"
|
||||
});
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
//"../Runtime/Renderer/Private",
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user