diff --git a/CHANGELOG.md b/CHANGELOG.md index 27edb30..e7ab79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.2.1] 2024-10-18 + +### Fixed + +- Fixed issue where previously selected assets were not being removed + ## [0.2.0] 2024-10-05 ### Added diff --git a/Content/Samples/BasicLoader/Blueprints/BP_SampleRpmActor.uasset b/Content/Samples/BasicLoader/Blueprints/BP_SampleRpmActor.uasset index c4b2c17..bbe76f1 100644 Binary files a/Content/Samples/BasicLoader/Blueprints/BP_SampleRpmActor.uasset and b/Content/Samples/BasicLoader/Blueprints/BP_SampleRpmActor.uasset differ diff --git a/Content/Samples/BasicLoader/RpmBasicLoader.umap b/Content/Samples/BasicLoader/RpmBasicLoader.umap index 31f765f..f7da5c0 100644 Binary files a/Content/Samples/BasicLoader/RpmBasicLoader.umap and b/Content/Samples/BasicLoader/RpmBasicLoader.umap differ diff --git a/Source/RpmNextGen/Private/RpmActor.cpp b/Source/RpmNextGen/Private/RpmActor.cpp index 4aee3eb..c63853f 100644 --- a/Source/RpmNextGen/Private/RpmActor.cpp +++ b/Source/RpmNextGen/Private/RpmActor.cpp @@ -115,6 +115,7 @@ void ARpmActor::RemoveMeshComponentsOfType(const FString& AssetType) if (ComponentToRemove) { ComponentToRemove->DestroyComponent(); + ComponentToRemove = nullptr; } } LoadedMeshComponentsByAssetType.Remove(AssetType); @@ -132,6 +133,7 @@ void ARpmActor::RemoveAllMeshes() if (ComponentToRemove) { ComponentToRemove->DestroyComponent(); + ComponentToRemove = nullptr; } } } diff --git a/Source/RpmNextGen/Private/RpmLoaderComponent.cpp b/Source/RpmNextGen/Private/RpmLoaderComponent.cpp index 4d6ac76..9669c48 100644 --- a/Source/RpmNextGen/Private/RpmLoaderComponent.cpp +++ b/Source/RpmNextGen/Private/RpmLoaderComponent.cpp @@ -76,12 +76,12 @@ void URpmLoaderComponent::LoadGltfRuntimeAssetFromCache(const FAsset& Asset) { UE_LOG(LogReadyPlayerMe, Error, TEXT("Failed to load gltf asset")); } - OnNewAssetLoaded.Broadcast(Asset, GltfRuntimeAsset); + OnAssetLoaded.Broadcast(Asset, GltfRuntimeAsset); return; } } UE_LOG(LogReadyPlayerMe, Error, TEXT("Failed to load gltf asset from cache")); - OnNewAssetLoaded.Broadcast(Asset, nullptr); + OnAssetLoaded.Broadcast(Asset, nullptr); } void URpmLoaderComponent::LoadCharacterAssetsFromCache(TMap AssetMap) @@ -137,7 +137,7 @@ void URpmLoaderComponent::LoadAssetPreview(FAsset AssetData, bool bUseCache) PreviewRequest.Params.Assets = ParamAssets; const FString& Url = CharacterApi->GeneratePreviewUrl(PreviewRequest); - FileApi->LoadAssetFileFromUrl(Url, AssetData); + FileApi->LoadFileFromUrl(Url); } void URpmLoaderComponent::HandleAssetLoaded(const TArray* Data, const FAsset& Asset) @@ -152,7 +152,7 @@ void URpmLoaderComponent::HandleAssetLoaded(const TArray* Data, c { UE_LOG(LogReadyPlayerMe, Error, TEXT("Failed to load gltf asset")); } - OnNewAssetLoaded.Broadcast(Asset, GltfRuntimeAsset); + OnAssetLoaded.Broadcast(Asset, GltfRuntimeAsset); } void URpmLoaderComponent::HandleCharacterAssetLoaded(const TArray* Data, const FString& FileName) diff --git a/Source/RpmNextGen/Public/RpmLoaderComponent.h b/Source/RpmNextGen/Public/RpmLoaderComponent.h index 7a3fac2..167e394 100644 --- a/Source/RpmNextGen/Public/RpmLoaderComponent.h +++ b/Source/RpmNextGen/Public/RpmLoaderComponent.h @@ -22,7 +22,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCharacterCreated, FRpmCharacterDa DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCharacterUpdated, FRpmCharacterData, CharacterData); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCharacterFound, FRpmCharacterData, CharacterData); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnCharacterAssetLoaded, const FRpmCharacterData&, CharacterData, UglTFRuntimeAsset*, GltfRuntimeAsset); -DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnNewAssetLoaded, const FAsset&, Asset, UglTFRuntimeAsset*, GltfRuntimeAsset ); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnAssetLoaded, const FAsset&, Asset, UglTFRuntimeAsset*, GltfRuntimeAsset ); UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) class RPMNEXTGEN_API URpmLoaderComponent : public UActorComponent @@ -33,7 +33,7 @@ class RPMNEXTGEN_API URpmLoaderComponent : public UActorComponent UPROPERTY(BlueprintAssignable, Category = "Ready Player Me" ) FOnCharacterAssetLoaded OnCharacterAssetLoaded; UPROPERTY(BlueprintAssignable, Category = "Ready Player Me" ) - FOnNewAssetLoaded OnNewAssetLoaded; + FOnAssetLoaded OnAssetLoaded; UPROPERTY(BlueprintAssignable, Category = "Ready Player Me" ) FOnCharacterCreated OnCharacterCreated; UPROPERTY(BlueprintAssignable, Category = "Ready Player Me" )