I am recreating the new UEFN’s TextureData system.
I have it like 95% working the same as UEFN. Where I have a BuildingTextureData that contains UTexture2D* of Diffuse/Normal/Specular and a LinearColor TintColor. The PostEditProperty in C++ detects changes to the array and generates a MID if it needs to then updates the properties dynamically.
My base actors can accept an array of 4 of these, and they auto create a Material Instance Dynamic (MID).
It saves in the world and everything seems to be working fine. But I want to modify the original uasset defaults, and I can modify it and hit ‘Save’, it updates the thumbnail and saves it. But the moment I hit Compile
, it seems to garbage collect the MID or throws warning about EditorOnlyData or something and deletes the MID.
They are doing something ‘unusual’ in UEFN here and I’m not quite sure what the last trick is.
Anyone have any ideas or thoughts on this? It would be greatly appreciated.