From 1750db5fd6eda930d98ffdc2c9e9da475bec61e0 Mon Sep 17 00:00:00 2001 From: psiberx Date: Sun, 4 Aug 2024 12:36:40 +0300 Subject: [PATCH] Disable imports when patching part ent --- src/App/Extensions/ResourcePatch/Module.cpp | 6 ++++-- src/App/Extensions/ResourcePatch/Module.hpp | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/App/Extensions/ResourcePatch/Module.cpp b/src/App/Extensions/ResourcePatch/Module.cpp index bf4d9b2..bfb18db 100644 --- a/src/App/Extensions/ResourcePatch/Module.cpp +++ b/src/App/Extensions/ResourcePatch/Module.cpp @@ -383,7 +383,7 @@ void App::ResourcePatchModule::OnPartPackageExtract( Red::DynArray>& aResultObjects, const Red::SharedPtr>& aPartToken) { - PatchPackageExtractorResults(aPartToken->resource, aResultObjects); + PatchPackageExtractorResults(aPartToken->resource, aResultObjects, true); } void App::ResourcePatchModule::OnGarmentPackageExtract(Red::GarmentComponentParams* aParams, @@ -411,7 +411,8 @@ void App::ResourcePatchModule::OnGarmentPackageExtract(Red::GarmentComponentPara void App::ResourcePatchModule::PatchPackageExtractorResults( const Red::Handle& aTemplate, - Red::DynArray>& aResultObjects) + Red::DynArray>& aResultObjects, + bool aDisableImports) { if (!aTemplate) return; @@ -434,6 +435,7 @@ void App::ResourcePatchModule::PatchPackageExtractorResults( continue; auto patchExtractor = Red::ObjectPackageExtractor(patchHeader); + patchExtractor.disableImports = aDisableImports; patchExtractor.disablePreInitialization = true; patchExtractor.ExtractSync(); diff --git a/src/App/Extensions/ResourcePatch/Module.hpp b/src/App/Extensions/ResourcePatch/Module.hpp index 06b0168..8a1bc6d 100644 --- a/src/App/Extensions/ResourcePatch/Module.hpp +++ b/src/App/Extensions/ResourcePatch/Module.hpp @@ -34,10 +34,11 @@ class ResourcePatchModule : public ConfigurableModuleImpl static void OnGarmentPackageExtract(Red::GarmentComponentParams* aParams, const Red::JobGroup& aJobGroup); static void PatchPackageExtractorResults(const Red::Handle& aTemplate, - Red::DynArray>& aResultObjects); + Red::DynArray>& aResultObjects, + bool aDisableImports = false); static void PatchPackageExtractorResults(const Red::Handle& aResource, - const Red::Handle& aDefinition, - Red::DynArray>& aResultObjects); + const Red::Handle& aDefinition, + Red::DynArray>& aResultObjects); static void PatchResultEntity(Red::DynArray>& aResultObjects, Red::DynArray>& aPatchObjects, int16_t aEntityIndex); static void PatchResultComponents(Red::DynArray>& aResultObjects,