I am trying to create and use dynamic material in my c++ code using this
static ConstructorHelpers::FObjectFinder materialAsset(TEXT(“MaterialInstanceConstant’/Game/PortalGame/PortalMat_Inst.PortalMat_Inst’”));
UMaterialInstance *BoxMaterialInstance;
if (materialAsset.Succeeded())
{
BoxMaterialInstance = materialAsset.Object;
dynamicTerrainMaterialInstance = UMaterialInstanceDynamic::Create(BoxMaterialInstance, NULL);
}
However it runs perfectly while running in the Editor but fails while packaging and the error I get this.
[2017.03.25-09.14.14:581][ 0]Can’t save G:/UnrealSource/UnrealProjects/GGTest/Saved/Cooked/WindowsNoEditor/GGTest/Content/Maps/ThirdPersonExampleMap.umap: Graph is linked to private object(s) in an external package.
External Object(s):
MaterialInstanceDynamic_18
But if I remove dynamic materials it packages successfully.
Have anyone faced this or any clue about this?
Hi Sameerrajsingh ,
There are a few trouble shooting steps to follow initially when having packaging issues:
1. Delete The following folders and then try repackaging
- Intermediate
- Saved (since your error is occurring in your project’s saved folder this may be the source)
- Config (deleting this folder will result in having to re-enter all values for your Editor and Project Settings. So make a copy somewhere safe!)
2. Disable Plugins
NEXT
Please provide the Log file by clearing your Ouput Log, package your project, then Cut and Paste from the newly generated Output Log into a text document and post.
Let me know if that helps,
Hi Ed,
I did exactly the same thing as mentioned in step 1 and 2 but still got the same errors.
I am attaching the fresh log and the CookLog from the Automation tool.
Sorry for late reply, I see that you mentioned removing certain assets fixes the issue. If fixing redirectors doesn’t help I would recommend making a copy of the bugged assets and deleting the original this method has helped users in the past.