Author Topic: Reimport removes references in material instances.  (Read 1256 times)

What the topic says, import a substance, create a material instance of something with a texture parameter and occupy it with a substance texture and reimport. It's magically gone!

What the topic says, import a substance, create a material instance of something with a texture parameter and occupy it with a substance texture and reimport. It's magically gone!

Hi @dukecg,
Thank you for the report. We were able to reproduce this and are currently working on fixing this issue. :D With the next release, this issue should magically disappear!

We are constantly working on improving the plugin and we love feedback so if you have any more tricks up your sleeve, please let us know!  ;)

Cheers!
Dan
Software Engineer, Integrations
daniel.stover@allegorithmic.com

An alternative way of finding where they're referenced, instead of explicitly finding materials is this:

      for (TObjectIterator<USubstanceTexture2D> TexItr; TexItr; ++TexItr)
      {
         USubstanceTexture2D* Tex = (*TexItr);
         if (Tex->OutputCopy && Tex->ParentInstance && Tex->ParentInstance->Instance && Tex->ParentInstance->Instance->mInstanceUid == GraphItr->Instance->mInstanceUid)
         {
            TArray<FName> Referencers;
            const FName SelectedPackageName = Tex->GetOutermost()->GetFName();
            FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
            AssetRegistryModule.Get().GetReferencers(SelectedPackageName, Referencers, EAssetRegistryDependencyType::Hard);
         }
      }

Then interrogate Referencers