Static mesh parameter greyed, and then the static mesh disappears .... why?

HI ,

I’m struggling with a blueprint , it’s an actor that has a static mesh. In my app, i want ( in editor, not in runtime) right click on a mesh, and replace it with that actor. Instead adding the mesh to the actor manually , i made something in the CONSTRUCTION SCRIPT of the actor, to assign the mesh and even apply a material, and it works :slight_smile:

The problem is, whenever i make any change to that actor (if i move it, or change material …) the mesh disappears instantly !! I know that in Construction Script it’s special … whenever you make a change, the whole script is executed again, but i can’t figure out how to solve that, i tried with some variables , but it’s still the same problem.

And before the mesh disappears, there is also something i don’t understand ! If i add an empty actor to the level, and then add manually a mesh to the actor, well … there is absolutely no problem ! It doesn’t disappears if i make a change, and it looks like this :


But, if i replace a mesh with an actor and assign automatically the mesh to it (and it works), the parameter will looks like this in the editor:


IT’S GREYED !!! i really don’t get it !

Well maybe i know what’s happening here … the first time the construction script is executed, it founds the mesh in the level and use it in SET STATIC MESH , but the next time the script is executed, the mesh is no longer available as it has been replaced by the acotr !!! The problem is that i don’t know how to get the mesh from the content browser , the only way i found is to list all the meshes of the level … but that’s not what i need …

any help please? :slight_smile:

what are you actually trying to accomplish? what you have now is a mess, getting all static mesh actors and setting them to be the same seems a but crazy to me. to top things off your doing all of this on the construction script which just complicates things even more.

so i ask this what is the end goal? if we know that you want to do maybe we can overhaul your system to function properly.

It’s not a game, it’s just an architectural app !! The goal of the app is to be able to visit apartments and houses . But also to edit materials for some objects (furniture, ground, walls …), so those objects are not simple meshes, but Actors with a static mesh component (i had to do that, because i needed to add some variables to the actor to know what kind of object or furniture it is) .

The app works just fine, my only problem now is with the construction script !!

The way i define a new editable object is simple, i just right click on a mesh, and press REPLACE BY (and select the editable object blueprint) . The mesh disappears from the level, i manually assign it to the new actor (from the meshes list of the editor) , so a new one appears instead of the old one at the same position, and that’s exactly what i want.

But as you may guess, in a big house there is a lot of editable objects and i needed a solution to replace all my object at the same time, and i wanted it to be automatic (I press REPLACE BY , and it automatically assign the mesh to the actor, instead of just deleting from the level).

Now … the problem is that if i want to assign a mesh to the actor, i needed to have it somewhere … but i didn’t know how ! That’s why i first tried to get the mesh from the level, but to find the one i want, i had to get all the meshes and compare their name to the actor’s. And it worked…once !! I thought it was a success, but once i tried to move the actor or change anything, the mesh disappeared, and that’s normal, because the second time the script is executed, it won’t find the mesh in the level.

That’s why now i’m looking for a solution to access the meshes outside of the level (if it’s possible) to assign it to the actor with SET STATIC MESH , that’s all i need !

I hope i was clear enough this time :slight_smile: