When I import the FBX, all the static meshes in the content browser has material assigned to them, but when I clear the material slots inside the static mesh, it also removes and clears the material slots of the actors using that static mesh. How can I reset the material slots only in static mesh but it should not affect the actors referencing that static mesh?
Do I need to have some BP for this, if yes then how can I make one.
What do you want to do with the static mesh such that you don’t want materials in its slots, yet you want referents to keep the material?
You could duplicate the static mesh, and clear the materials on the copy.
In general, when you want to re-configure materials for a mesh, you end up creating “Material Instance Dynamic” (MID) clones of the materials on the instance of the mesh asset. This typically is done by the component that references the mesh – it will generally have a table of overridden material parameters (or even overridden materials.)
The standard StaticMeshComponent also allows you to override the materials as you wish, using this mechanism. You can also create a blueprint of the mesh, and clear the materials in this blueprint, and that will make a “standard” actor you can re-use that has the materials cleared.
So, if we get back to: Why do you want the mesh asset to have “cleared” materials, rather than just overriding it at the point where you are going to use it?
Thank you for your reply,
It is just part of our process at the firm I work at. We have to run the mod online and that kind of creates an issue if the materials are assigned inside the static mesh.
I am not very familiar with the blueprints and am not able to make a BP that could do this for me. I created one that resets the material slots of the selected static meshes but that also removes the materials from the actors therefore, I want a BP which, on clicking a button, resets the material inside all the static mesh but should not remove them from the actors referencing those static meshes. Can you please help me create a BP that can do this for me?
That cannot be done. That’s not how assets work.
What you COULD perhaps do, is go through all the assets that reference that mesh, and override the materials for those assets (you might be able to use “show references” to find them) and then clear the asset.
Or just make two copies, one with cleared materials, and one without.
I am not sure if you’re right about it. I think we can somehow use “get materials” before resetting the material inside the static mesh and applying them by using “set materials”. I am just not able to execute that logic into BP because I am not familiar with BP that much .
Also, I tried to make copies of the static mesh but when I replace the geometry in the actor by the one has no material assigned to them inside, that also removes material from the actor.