Skip to content

Commit

Permalink
PopcornFX Gem 2.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PopcornFX Bot committed Sep 13, 2024
1 parent 5ca9967 commit 8fc9708
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://www.popcornfx.com/terms-and-conditions/
#----------------------------------------------------------------------------

set(POPCORNFX_VERSION 2.20.0)
set(POPCORNFX_VERSION 2.20.1)
set(POPCORNFX_LICENSE O3DE)

o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_name}")
Expand Down
8 changes: 4 additions & 4 deletions Code/Platform/Linux/PAL_linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-linux)
set(pk_package_hash ac6f32f010c4673e836195891eec2b6c7d0eda319028f83c47d3e2f183bc5bab)
set(pk_package_id ULXePOUoS6FLJFVq)
set(pk_package_hash 37caeb9bd6fa8b89820dfd3f27fb91207834b169c3ed6942f9fb9c0b65683838)
set(pk_package_id UsqgOwkkPIotbGLE)
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-linux-aarch64)
set(pk_package_hash ac6f32f010c4673e836195891eec2b6c7d0eda319028f83c47d3e2f183bc5bab_ARM64)
set(pk_package_id ULXePOUoS6FLJFVq_ARM64)
set(pk_package_hash 37caeb9bd6fa8b89820dfd3f27fb91207834b169c3ed6942f9fb9c0b65683838_ARM64)
set(pk_package_id UsqgOwkkPIotbGLE_ARM64)
else()
message(FATAL_ERROR "Unsupported linux architecture ${CMAKE_SYSTEM_PROCESSOR}")
endif()
Expand Down
4 changes: 2 additions & 2 deletions Code/Platform/Mac/PAL_mac.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 e66f6aceb7a5e19d77a1138f9175c0be96f3689166a3e224ab8550e9380448d8)
set(pk_package_id 81pLLJxsVi4w3k7w)
set(pk_package_hash 269f82977c7bc3cf5c113627ecd8c26b2a1548f72e2b27734a84f531cafa082e)
set(pk_package_id or2If26Gt6FboQ5x)

ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash})
pk_download_package_ifn(${package_name} ${pk_package_id})
Expand Down
4 changes: 2 additions & 2 deletions Code/Platform/Windows/PAL_windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ac6800c08e7f5809bbe49c779e91d91ae238471f6db293b99a45034fd49ef51d)
set(pk_package_id m70mDawO2bZQXsWK)
set(pk_package_hash 3a9c25da7fe7c58f7cbfb278c63e9806faba5f5cbbd8e25337235e4de1c3ddad)
set(pk_package_id bzoBrc2Rvgs8eSMs)

ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash})
pk_download_package_ifn(${package_name} ${pk_package_id})
Expand Down
70 changes: 49 additions & 21 deletions Code/Source/Integration/Editor/PackLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,21 @@ namespace PopcornFX
return false;
}

AZStd::string FindMatchingPkproj(const AZStd::string &assetPath)
bool IsRelativeTo(const AZStd::string &path, const AZStd::string &base)
{
AZ::IO::FixedMaxPath projectPath = AZ::Utils::GetProjectPath();

AZStd::string folderPath = assetPath;
AZ::StringFunc::Path::StripFullName(folderPath);
AZ::StringFunc::Path::Normalize(folderPath);
AZStd::string pathLower = path;
AZStd::string baseLower = base;

AZ::Outcome<AZStd::list<AZStd::string>, AZStd::string> searchResult = AzFramework::FileFunc::FindFilesInPath(projectPath.c_str(), "*", true);
// Fix for linux
AZStd::to_lower(pathLower.begin(), pathLower.end());
AZStd::to_lower(baseLower.begin(), baseLower.end());

if (!searchResult.IsSuccess())
return "";

const AZStd::list<AZStd::string> &pkprojList = searchResult.GetValue();
return AZ::IO::PathView(pathLower).IsRelativeTo(AZ::IO::PathView(baseLower));
}

AZStd::string pkProjPath;
for (const auto& path : pkprojList)
AZStd::string GetMatchingPkprojInList(const AZStd::string &assetFolderPath, const AZStd::list<AZStd::string> &fileList)
{
for (const auto& path : fileList)
{
if (path.ends_with(".pkproj"))
{
Expand All @@ -102,15 +100,48 @@ namespace PopcornFX
if (!GetProjectSettings(path, rootPath, dummy))
return "";

AZStd::to_lower(rootPath.begin(), rootPath.end());
AZStd::to_lower(folderPath.begin(), folderPath.end());
const AZ::IO::PathView pathView(folderPath);
if (pathView.IsRelativeTo(AZ::IO::PathView(rootPath)))
if (IsRelativeTo(assetFolderPath, rootPath))
return path;
}
}
return "";
}

AZStd::string FindMatchingPkproj(const AZStd::string &assetPath)
{
AZStd::string projectPath = AZ::Utils::GetProjectPath().c_str();
AZ::StringFunc::Path::Normalize(projectPath);

AZStd::string folderPath = assetPath;
AZ::StringFunc::Path::StripFullName(folderPath);
AZ::StringFunc::Path::Normalize(folderPath);

if (!IsRelativeTo(folderPath, projectPath))
return "";

// Search in parents folders first
AZStd::string currentPath = folderPath;
while (true)
{
AZ::Outcome<AZStd::list<AZStd::string>, AZStd::string> searchResult = AzFramework::FileFunc::FindFilesInPath(currentPath, "*.pkproj", false);
if (searchResult.IsSuccess())
{
AZStd::string pkprojPath = GetMatchingPkprojInList(folderPath, searchResult.GetValue());
if (!pkprojPath.empty())
return pkprojPath;
}
if (currentPath == projectPath)
break;
AZ::StringFunc::Path::StripFullName(currentPath);
}

// Not found in the parents folders, search in the whole project as backup
AZ::Outcome<AZStd::list<AZStd::string>, AZStd::string> searchResult = AzFramework::FileFunc::FindFilesInPath(projectPath, "*", true);
if (!searchResult.IsSuccess())
return "";

return GetMatchingPkprojInList(folderPath, searchResult.GetValue());
}

bool GetProjectSettingsThumbnailsPath(const AZStd::string &projectFilePath, AZStd::string &outRootDir, AZStd::string &outThumbnailsPath)
{
Expand Down Expand Up @@ -260,10 +291,7 @@ namespace PopcornFX
AZ::StringFunc::Path::Normalize(folderPath);
folderPath = CFilePath::Relativize(projectPath.c_str(), folderPath.c_str()).Data();

AZStd::to_lower(rootPath.begin(), rootPath.end());
AZStd::to_lower(folderPath.begin(), folderPath.end());
const AZ::IO::PathView pathView(folderPath);
if (pathView.IsRelativeTo(AZ::IO::PathView(rootPath)))
if (IsRelativeTo(folderPath, rootPath))
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void PopcornFXRendererLoader::_OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData>
SAssetDependencies *dependencies = m_Assets.Find(asset.GetId());
if (dependencies == null)
return;
dependencies->m_AssetRef = asset;

if (asset.GetType() == azrtti_typeid<AZ::RPI::ShaderAsset>())
{
Expand Down
12 changes: 8 additions & 4 deletions Code/Source/Previewer/PopcornFXEffectPreviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ void PopcornFXEffectPreviewer::Display(const AzToolsFramework::AssetBrowser::Ass
void PopcornFXEffectPreviewer::DisplayProduct(const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry *product)
{
AZStd::string thumbnailPath;
AZStd::string pkProjPathCache;
PopcornFX::PopcornFXIntegrationBus::BroadcastResult(pkProjPathCache, &PopcornFX::PopcornFXIntegrationBus::Handler::GetPkProjPathCache);
PopcornFX::PopcornFXIntegrationBus::Broadcast(&PopcornFX::PopcornFXIntegrationBus::Handler::GetThumbnailPathForAsset, product->GetFullPath(), thumbnailPath, pkProjPathCache);
PopcornFX::PopcornFXIntegrationBus::Broadcast(&PopcornFX::PopcornFXIntegrationBus::Handler::SetPkProjPathCache, pkProjPathCache);
AzToolsFramework::AssetBrowser::AssetBrowserEntry *parent = product->GetParent();
if (parent != nullptr)
{
AZStd::string pkProjPathCache;
PopcornFX::PopcornFXIntegrationBus::BroadcastResult(pkProjPathCache, &PopcornFX::PopcornFXIntegrationBus::Handler::GetPkProjPathCache);
PopcornFX::PopcornFXIntegrationBus::Broadcast(&PopcornFX::PopcornFXIntegrationBus::Handler::GetThumbnailPathForAsset, parent->GetFullPath(), thumbnailPath, pkProjPathCache);
PopcornFX::PopcornFXIntegrationBus::Broadcast(&PopcornFX::PopcornFXIntegrationBus::Handler::SetPkProjPathCache, pkProjPathCache);
}

CreateAndDisplayTextureItemAsync(
[thumbnailPath]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# O3DE PopcornFX Plugin

Integrates the **PopcornFX Runtime SDK** into **O3DE** as a Gem.
* **Version:** `v2.20.0`
* **Version:** `v2.20.1`
* **O3DE:** `23.05`, `23.10`
* **Supported platforms:** `Windows`, `MacOS`, `Linux`, `iOS`, `Android`

Expand Down
8 changes: 4 additions & 4 deletions gem.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"gem_name": "PopcornFX",
"display_name": "PopcornFX 2.20.0",
"display_name": "PopcornFX 2.20.1",
"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.20/O3DE_PopcornFXGem_v2.20.0_Win64_Linux64_LinuxARM64_Mac64.zip",
"version": "2.20.0",
"last_updated": "2024-08-30",
"origin_uri": "https://downloads.popcornfx.com/o3de-repo/PopcornFX-2.20/O3DE_PopcornFXGem_v2.20.1_Win64_Linux64_LinuxARM64_Mac64.zip",
"version": "2.20.1",
"last_updated": "2024-09-13",
"type": "Code",
"summary": "The PopcornFX Gem provides real-time FX solution for particle effects.",
"canonical_tags": [
Expand Down

0 comments on commit 8fc9708

Please sign in to comment.