Skip to content

Commit

Permalink
Disable imports when patching part ent
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Aug 4, 2024
1 parent 9e77ea8 commit 1750db5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/App/Extensions/ResourcePatch/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void App::ResourcePatchModule::OnPartPackageExtract(
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects,
const Red::SharedPtr<Red::ResourceToken<Red::EntityTemplate>>& aPartToken)
{
PatchPackageExtractorResults(aPartToken->resource, aResultObjects);
PatchPackageExtractorResults(aPartToken->resource, aResultObjects, true);
}

void App::ResourcePatchModule::OnGarmentPackageExtract(Red::GarmentComponentParams* aParams,
Expand Down Expand Up @@ -411,7 +411,8 @@ void App::ResourcePatchModule::OnGarmentPackageExtract(Red::GarmentComponentPara

void App::ResourcePatchModule::PatchPackageExtractorResults(
const Red::Handle<Red::EntityTemplate>& aTemplate,
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects)
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects,
bool aDisableImports)
{
if (!aTemplate)
return;
Expand All @@ -434,6 +435,7 @@ void App::ResourcePatchModule::PatchPackageExtractorResults(
continue;

auto patchExtractor = Red::ObjectPackageExtractor(patchHeader);
patchExtractor.disableImports = aDisableImports;
patchExtractor.disablePreInitialization = true;
patchExtractor.ExtractSync();

Expand Down
7 changes: 4 additions & 3 deletions src/App/Extensions/ResourcePatch/Module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ class ResourcePatchModule : public ConfigurableModuleImpl<ResourcePatchConfig>
static void OnGarmentPackageExtract(Red::GarmentComponentParams* aParams, const Red::JobGroup& aJobGroup);

static void PatchPackageExtractorResults(const Red::Handle<Red::EntityTemplate>& aTemplate,
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects);
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects,
bool aDisableImports = false);
static void PatchPackageExtractorResults(const Red::Handle<Red::AppearanceResource>& aResource,
const Red::Handle<Red::AppearanceDefinition>& aDefinition,
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects);
const Red::Handle<Red::AppearanceDefinition>& aDefinition,
Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects);
static void PatchResultEntity(Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects,
Red::DynArray<Red::Handle<Red::ISerializable>>& aPatchObjects, int16_t aEntityIndex);
static void PatchResultComponents(Red::DynArray<Red::Handle<Red::ISerializable>>& aResultObjects,
Expand Down

0 comments on commit 1750db5

Please sign in to comment.