From 328d2d16cb64d66092ac0806f59fafa6600c0987 Mon Sep 17 00:00:00 2001 From: rdeioris Date: Tue, 12 Nov 2024 08:15:41 +0100 Subject: [PATCH] added ReceiveOnStaticMeshComponentCreated and ReceiveOnSkeletalMeshComponentCreated --- .../Private/glTFRuntimeAssetActorAsync.cpp | 12 ++++++++++++ .../glTFRuntime/Public/glTFRuntimeAssetActorAsync.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/Source/glTFRuntime/Private/glTFRuntimeAssetActorAsync.cpp b/Source/glTFRuntime/Private/glTFRuntimeAssetActorAsync.cpp index 2daf382..88a10ab 100644 --- a/Source/glTFRuntime/Private/glTFRuntimeAssetActorAsync.cpp +++ b/Source/glTFRuntime/Private/glTFRuntimeAssetActorAsync.cpp @@ -92,6 +92,7 @@ void AglTFRuntimeAssetActorAsync::ProcessNode(USceneComponent* NodeParentCompone AddInstanceComponent(StaticMeshComponent); MeshesToLoad.Add(StaticMeshComponent, Node); NewComponent = StaticMeshComponent; + ReceiveOnStaticMeshComponentCreated(StaticMeshComponent, Node); } else { @@ -102,6 +103,7 @@ void AglTFRuntimeAssetActorAsync::ProcessNode(USceneComponent* NodeParentCompone AddInstanceComponent(SkeletalMeshComponent); MeshesToLoad.Add(SkeletalMeshComponent, Node); NewComponent = SkeletalMeshComponent; + ReceiveOnSkeletalMeshComponentCreated(SkeletalMeshComponent, Node); } } @@ -292,4 +294,14 @@ void AglTFRuntimeAssetActorAsync::ReceiveOnNodeProcessed_Implementation(const in FglTFRuntimeStaticMeshConfig AglTFRuntimeAssetActorAsync::OverrideStaticMeshConfig_Implementation(const int32 NodeIndex, UStaticMeshComponent* NodeStaticMeshComponent) { return StaticMeshConfig; +} + +void AglTFRuntimeAssetActorAsync::ReceiveOnStaticMeshComponentCreated_Implementation(UStaticMeshComponent* StaticMeshComponent, const FglTFRuntimeNode& Node) +{ + +} + +void AglTFRuntimeAssetActorAsync::ReceiveOnSkeletalMeshComponentCreated_Implementation(USkeletalMeshComponent* SkeletalMeshComponent, const FglTFRuntimeNode& Node) +{ + } \ No newline at end of file diff --git a/Source/glTFRuntime/Public/glTFRuntimeAssetActorAsync.h b/Source/glTFRuntime/Public/glTFRuntimeAssetActorAsync.h index 5c7cd9d..e5f8252 100644 --- a/Source/glTFRuntime/Public/glTFRuntimeAssetActorAsync.h +++ b/Source/glTFRuntime/Public/glTFRuntimeAssetActorAsync.h @@ -51,6 +51,12 @@ class GLTFRUNTIME_API AglTFRuntimeAssetActorAsync : public AActor UFUNCTION(BlueprintNativeEvent, Category = "glTFRuntime", meta = (DisplayName = "On Node Processed")) void ReceiveOnNodeProcessed(const int32 NodeIndex, USceneComponent* NodeSceneComponent); + UFUNCTION(BlueprintNativeEvent, Category = "glTFRuntime", meta = (DisplayName = "On StaticMeshComponent Created")) + void ReceiveOnStaticMeshComponentCreated(UStaticMeshComponent* StaticMeshComponent, const FglTFRuntimeNode& Node); + + UFUNCTION(BlueprintNativeEvent, Category = "glTFRuntime", meta = (DisplayName = "On SkeletalMeshComponent Created")) + void ReceiveOnSkeletalMeshComponentCreated(USkeletalMeshComponent* SkeletalMeshComponent, const FglTFRuntimeNode& Node); + UFUNCTION(BlueprintNativeEvent, Category = "glTFRuntime", meta = (DisplayName = "Override StaticMeshConfig")) FglTFRuntimeStaticMeshConfig OverrideStaticMeshConfig(const int32 NodeIndex, UStaticMeshComponent* NodeStaticMeshComponent);