You should not need to convert from UMaterial* to UMaterialinstance* since UMaterial inherits from MaterialInstance. If for some reason the code is complaintning simply cast to it Cast(YourMaterialPointer).
Material interface is an interface that allows you to pass any material type into functions that use materials as arguments (like in your case), since there are several material types (UMaterialInstance, UMaterialConstantDynamic, UMaterialInstanceDynamic, etc).
The function takes Material Interface as a value for the reason stated above (so it can receive any material type).
Hope this information helps you. If this is the information you needed please remember to mark this answer as the correct one so other people can find it. Make it a great day!
I want to apply material to my Static mesh using C++, now i know that there is “StaticMesh->SetMaterial()” function, but the problem is this function is taking UMaterialInterface as a parameter and i could not find any way to convert my UMaterial UnrealMaterial* to UMaterialInterface ?
Another problem is, what is the difference between UMaterialInterface and UMaterial ?? And why instead of taking UMaterial in StaticMesh->SetMaterial() it is taking UMaterialInterface ?
Thanks for the answer i can set the material using StaticMesh->SetMaterial(),
do have any idea on how to set the color for that material which i can set to red or something which will update in editor?