diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index 500712b..250f7a7 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -3,7 +3,7 @@ # https://www.popcornfx.com/terms-and-conditions/ #---------------------------------------------------------------------------- -set(POPCORNFX_VERSION 2.15.3) +set(POPCORNFX_VERSION 2.15.4) set(POPCORNFX_LICENSE O3DE) if (PK_O3DE_MAJOR_VERSION GREATER_EQUAL 2205) diff --git a/Code/Include/PopcornFX/PopcornFXBus.h b/Code/Include/PopcornFX/PopcornFXBus.h index 489a4de..797aaff 100644 --- a/Code/Include/PopcornFX/PopcornFXBus.h +++ b/Code/Include/PopcornFX/PopcornFXBus.h @@ -20,12 +20,21 @@ namespace PopcornFX { - class PopcornFXEmitterRuntime; } namespace PopcornFX { - class CFilePack; +#if PK_O3DE_MAJOR_VERSION > 2210 + static constexpr AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); + static constexpr AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); + static constexpr AZ::Uuid AssetTypeId = AZ::Uuid("{45047C35-64F7-43BA-B463-000081B587C3}"); +#else + static const AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); + static const AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); + static const AZ::Uuid AssetTypeId = AZ::Uuid("{45047C35-64F7-43BA-B463-000081B587C3}"); +#endif + + class PopcornFXEmitterRuntime; struct StandaloneEmitter { @@ -430,14 +439,6 @@ namespace PopcornFX }; using PopcornFXEmitterEditorComponentEventsBus = AZ::EBus ; -#if PK_O3DE_MAJOR_VERSION > 2210 - static constexpr AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); - static constexpr AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); -#else - static const AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); - static const AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); -#endif - class PopcornFXProfilerRequests : public AZ::EBusTraits { diff --git a/Code/Platform/Linux/PAL_linux.cmake b/Code/Platform/Linux/PAL_linux.cmake index ee1e817..d317867 100644 --- a/Code/Platform/Linux/PAL_linux.cmake +++ b/Code/Platform/Linux/PAL_linux.cmake @@ -5,8 +5,8 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-linux) -set(pk_package_hash 92cdd0675546d56ae30511da7e689f179b62e91064bc9f8f9b86c9f34ec72a52) -set(pk_package_id WAyVE9npfW6LezRL) +set(pk_package_hash d3977d4c24474376ca3058b57524502349a22468eb4f96e422c577ac4e9443b8) +set(pk_package_id SyfMKMHrQk9KKwZS) ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash}) pk_download_package_ifn(${package_name} ${pk_package_id}) diff --git a/Code/Platform/Mac/PAL_mac.cmake b/Code/Platform/Mac/PAL_mac.cmake index 727a434..a81f9d2 100644 --- a/Code/Platform/Mac/PAL_mac.cmake +++ b/Code/Platform/Mac/PAL_mac.cmake @@ -5,8 +5,8 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-mac) -set(pk_package_hash 3b86f2a24940622897a51bc54875a0cc88f4d653ac6738357fba9d98b71b0c35) -set(pk_package_id Dx8Bumnv6JMPHTyx) +set(pk_package_hash 504df01b29bf59cfe3c1ec22b29641e728c411ff60bae79a0468e3136174964b) +set(pk_package_id 5cheqdwMvyaaSn98) ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash}) pk_download_package_ifn(${package_name} ${pk_package_id}) diff --git a/Code/Platform/Windows/PAL_windows.cmake b/Code/Platform/Windows/PAL_windows.cmake index 7354784..ff59c03 100644 --- a/Code/Platform/Windows/PAL_windows.cmake +++ b/Code/Platform/Windows/PAL_windows.cmake @@ -5,8 +5,8 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-windows) -set(pk_package_hash 52ae35d50236bce4f18c68ff25f7a666bb5c3dfdf7171255316738ecf0eea8e8) -set(pk_package_id Fy4x9kVx86NYPu8Y) +set(pk_package_hash 2c33dc945512cb1a3f8bce22e140d6747ba90e0ee0d7a2674ae13af01797b407) +set(pk_package_id hBPWpXze4nNvB36C) ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash}) pk_download_package_ifn(${package_name} ${pk_package_id}) diff --git a/Code/Source/Asset/PopcornFXAsset.h b/Code/Source/Asset/PopcornFXAsset.h index 27e6894..a134455 100644 --- a/Code/Source/Asset/PopcornFXAsset.h +++ b/Code/Source/Asset/PopcornFXAsset.h @@ -7,6 +7,7 @@ #include #include +#include #if defined(O3DE_USE_PK) #include @@ -32,7 +33,7 @@ namespace PopcornFX { { public: - AZ_RTTI(PopcornFXAsset, "{45047C35-64F7-43BA-B463-000081B587C3}", AZ::Data::AssetData); + AZ_RTTI(PopcornFXAsset, PopcornFX::AssetTypeId, AZ::Data::AssetData); AZ_CLASS_ALLOCATOR(PopcornFXAsset, AZ::SystemAllocator, 0); PParticleEffect m_Effect = null; diff --git a/Code/Source/Components/Emitter/PopcornFXEmitterEditorComponent.h b/Code/Source/Components/Emitter/PopcornFXEmitterEditorComponent.h index 3db440e..9698501 100644 --- a/Code/Source/Components/Emitter/PopcornFXEmitterEditorComponent.h +++ b/Code/Source/Components/Emitter/PopcornFXEmitterEditorComponent.h @@ -29,7 +29,7 @@ namespace PopcornFX { { public: - AZ_EDITOR_COMPONENT(PopcornFXEmitterEditorComponent, "{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); + AZ_EDITOR_COMPONENT(PopcornFXEmitterEditorComponent, EditorEmitterComponentTypeId); PopcornFXEmitterEditorComponent(); diff --git a/Code/Source/Integration/Preloader/PopcornFXRendererLoader.cpp b/Code/Source/Integration/Preloader/PopcornFXRendererLoader.cpp index 190f779..1cfea76 100644 --- a/Code/Source/Integration/Preloader/PopcornFXRendererLoader.cpp +++ b/Code/Source/Integration/Preloader/PopcornFXRendererLoader.cpp @@ -782,10 +782,19 @@ bool PopcornFXRendererLoader::_AddTextureToLoad( const char *texturePath, return false; //Load Texture - AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; - EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, texturePath); - if (status != AzFramework::AssetSystem::AssetStatus_Compiled) - CLog::Log(PK_ERROR, "Could not compile image at '%s'", texturePath); + bool apConnected = false; + AzFramework::AssetSystemRequestBus::BroadcastResult( + apConnected, &AzFramework::AssetSystemRequestBus::Events::ConnectedWithAssetProcessor); + if (apConnected) + { + // If the Asset Processor is available, make sure the assets are compiled. + AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; + EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, texturePath); + if (status != AzFramework::AssetSystem::AssetStatus_Compiled) + { + CLog::Log(PK_ERROR, "Could not compile image at '%s'", texturePath); + } + } AZ::Data::AssetId streamingImageAssetId; EBUS_EVENT_RESULT(streamingImageAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, texturePath, azrtti_typeid(), false); if (!streamingImageAssetId.IsValid()) @@ -841,13 +850,20 @@ bool PopcornFXRendererLoader::_AddGeometryToLoad(const char *geometryPath, { AZ::Data::AssetId assetId; - AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; - EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, geometryPath); - if (status != AzFramework::AssetSystem::AssetStatus_Compiled) + bool apConnected = false; + AzFramework::AssetSystemRequestBus::BroadcastResult( + apConnected, &AzFramework::AssetSystemRequestBus::Events::ConnectedWithAssetProcessor); + if (apConnected) { - CLog::Log(PK_ERROR, "Could not compile model at '%s'", geometryPath); - return false; + // If the Asset Processor is available, make sure the assets are compiled. + AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; + EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, geometryPath); + if (status != AzFramework::AssetSystem::AssetStatus_Compiled) + { + CLog::Log(PK_ERROR, "Could not compile model at '%s'", geometryPath); + } } + EBUS_EVENT_RESULT(assetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, geometryPath, azrtti_typeid(), false); if (!assetId.IsValid()) { @@ -872,10 +888,19 @@ bool PopcornFXRendererLoader::_AddGeometryToLoad(const char *geometryPath, AZ::Data::AssetId PopcornFXRendererLoader::_LoadTexture(const CString &path) { - AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; - EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, path.Data()); - if (status != AzFramework::AssetSystem::AssetStatus_Compiled) - CLog::Log(PK_ERROR, "Could not compile image at '%s'", path.Data()); + bool apConnected = false; + AzFramework::AssetSystemRequestBus::BroadcastResult( + apConnected, &AzFramework::AssetSystemRequestBus::Events::ConnectedWithAssetProcessor); + if (apConnected) + { + // If the Asset Processor is available, make sure the assets are compiled. + AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown; + EBUS_EVENT_RESULT(status, AzFramework::AssetSystemRequestBus, CompileAssetSync, path.Data()); + if (status != AzFramework::AssetSystem::AssetStatus_Compiled) + { + CLog::Log(PK_ERROR, "Could not compile image at '%s'", path.Data()); + } + } AZ::Data::AssetId streamingImageAssetId; EBUS_EVENT_RESULT(streamingImageAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, path.Data(), azrtti_typeid(), false); diff --git a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h index 70b2382..3ea9236 100644 --- a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h +++ b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h @@ -25,6 +25,7 @@ class CPopcornFXFeatureProcessor : public CPopcornFXFeatureProcessorInterface { public: AZ_RTTI(CPopcornFXFeatureProcessor, "{D86216E4-92A8-43BE-123F-883489C75BA1}", CPopcornFXFeatureProcessorInterface); + AZ_CLASS_ALLOCATOR(CPopcornFXFeatureProcessor, AZ::SystemAllocator, 0); CPopcornFXFeatureProcessor(); virtual ~CPopcornFXFeatureProcessor() = default; diff --git a/README.md b/README.md index 8fccf64..a64dabe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # O3DE PopcornFX Plugin Integrates the **PopcornFX Runtime SDK** into **O3DE** as a Gem. -* **Version:** `v2.15.3` +* **Version:** `v2.15.4` * **O3DE:** `21.11`, `21.11.2`, `22.05.0`, `22.10.0` * **Supported platforms:** `Windows`, `MacOS`, `Linux`, `iOS`, `Android` diff --git a/gem.json b/gem.json index 637b5fa..8ed481e 100644 --- a/gem.json +++ b/gem.json @@ -1,13 +1,13 @@ { "gem_name": "PopcornFX", - "display_name": "PopcornFX 2.15.3", + "display_name": "PopcornFX 2.15.4", "license": "Community", "license_url": "https://www.popcornfx.com/popcornfx-community-license", "origin": "Persistant Studios - popcornfx.com", "repo_uri": "https://downloads.popcornfx.com/o3de-repo", - "origin_uri": "https://downloads.popcornfx.com/o3de-repo/PopcornFX-2.15/O3DE_PopcornFXGem_v2.15.3_Win64_Linux64_Mac64.zip", - "version": "2.15.3", - "last_updated": "2023-02-23", + "origin_uri": "https://downloads.popcornfx.com/o3de-repo/PopcornFX-2.15/O3DE_PopcornFXGem_v2.15.4_Win64_Linux64_Mac64.zip", + "version": "2.15.4", + "last_updated": "2023-03-09", "type": "Code", "summary": "The PopcornFX Gem provides real-time FX solution for particle effects.", "canonical_tags": [