Giving a static mesh actor blueprint functionality without replacing it?

Hi everybody,
I already asked a similar thing before, but maybe in a complicated way, so I got no answers?

What is the best practice for adding blueprint functionality to already placed, static mesh actors. Favorably without replacing them with blueprint actors.

For example I got some furniture as static mesh actors placed in my scene. And I got a blueprint that allows the player to change properties of a static mesh actor or sm_component via blueprint interface.

Right now I would need to replace any sm_actors with blueprintactors using the same static mesh as component which seams rather complicated? Only other solution I came up with was defining the already placed actors in a variable, but this way I wouldn’t know how to fire the blueprint when the sm_actor is hit by a raycast, since it isn’t really part of the blueprint and therefore has no ability to fire an event.

So is there any other way? Like creating a blueprint class I can drop on a static mesh as component. I tried this but I couldn’t get the blueprint_interface to receive any actions.

Thanks for any suggestions

In theory, you could probably achieve this Unity-esque functionality, but in the end it might be more complicated than adding a static mesh component to a blueprint actor and adding that to your scene.

One method would be to use a blueprint actor(which is kinda backwards to what you want, but bear with me) because blueprints can have things added to them and sort of have that drag and drop functionality. You could then add your child actor that would then reference the parent blueprint and enact upon it’s static mesh component. Really it would be easier to just make a blueprint with the functionality for its own static mesh components…

Another such method might be to create a blueprint actor that holds an array of static mesh actors, which it then attaches to itself as components on begin play… in editor you would add your meshes to the array and then have them componented at event begin play using Add Child Actor Component, then maybe add a box collision component or cast each child actor to something that has collision events. This is all hypothetical for me.

The only way to influence a static mesh after placing it without raycasting or overlapping it would be using the Level Blueprint. But all in all this is just a lazy workaround. Create your blueprint, add a staticmesh component and switch them with the meshs you already placed. This won’t take more time than you already spent writing this question. (:

Thanks for the quick reply Exi. Of course it is about being lazy :wink: The question comes from the need of fast and easy re-usability of certain reoccurring blueprint functionalities in different projects.
So to elaborate further why I’m believing that replacing would be rather tedious and not that fast at all:
My company comes from architectural visualization and therefore our default workflow is to assemble our scenes, furniture and all in 3ds Max, because we got a need for a high degree of precision building upon cad-data.
To transfer our max scenes to unreal we came up with a script exporting all object instances to fbx and writing a t3d-file with the locations of said objects.
So we already have a quite easy and elegant way to quickly get completely assembled scenes to unreal.
Only thing missing is to quickly assign functionality to certain objects in a drag and drop kind of way, since we are talking about a large number of objects already in the right positions, which might need to be interacted with and also there is the need to quickly reuse these functionalities in other projects.
For example how would you go about let us say an static mesh which is already placed in 10 exact locations in the scene, all of them needing the same functionality. Creating a blueprintactor of one of them and manually replacing the others, getting the locations right wouldn’t be that fast, I think.
Or am I missing some auto-replace all function?

Spiris thanks for the fast reply and you’re right I’m looking for this kind of unity-esque behaviour, at least I was told it works this way on unity. I elaborated a little bit in the comment to eXi what I’m aiming at.
I was thinking the blueprint script component introduced in Unreal 4.7 would do exactly what I was thinking of, since it can be added to static mesh actors, but right now I’m seeing no way to get any events firing in such a component except the events “tick” and “initialize”, which is a bit disappointing.

But I’m intrigued by your second recommendation since I already went that direction myself, but failed :-/. Somehow I couldn’t get the static mesh actor to be added as components to the blueprint, but maybe I just made some mistake.

Okay, just found this video by Zack on the Unreal Youtube Channel:

There he is explaining in his very entertaining way how these new blueprintable components in Unreal 4.7 work.
After watching it, it seems that besides the tick and initalize event also custom events at least will work. So this is something I can try out.

Only question left is are blueprintable components somehow limited in ways of blueprint communication? As I mentioned I tried using a blueprint Interface in a component but couldn’t get the event to fire. But maybe this was some kind of bug since it was a converted scene. I will try again in an fresh test scene and post my findings.

So your Static Mesh is not bound to the rest of the map? This mesh alone should have a location. If you create a BP with that mesh local, inside that BP at (0,0,0), then you can just place this BP inside your scene and set its location to the x,y,z location.

I know that this would take time, but referencing every mesh inside the LevelBlueprint would take the same time if not more.

I don’t know about the new component features. This really could solve your problem but you would still need to add this component to all meshs by hand.

Creating a blueprint that you just fill with your meshs and setting the x,y,z to the meshs ones would be the best. You can just migrate this blueprint into other projects if you wish to use it there.

Not sure what you mean by “not bound to the rest of the map”?
But of course each of the static meshes is present on the map as static mesh actor some of them multiple times with each of them having a unique transform.
So of course I could create a blueprint with each static mesh as component and than manually enter each location and also rotation and scale in the worst case. But imagine the margin of error and time doing that with lots and lots of objects, left alone that most people would go crazy doing those kind of repetitive tasks. :slight_smile:
I think some kind of automation would be nice here for rapidly replacing objects. In 3ds Max for example there is a script called object replacer which exactly replace all selected objects with another one while keeping certain properties like the transforms of the originals.
But as I’m still learning, maybe I just haven’t found it yet :wink: In that case I would be glad if somebody would tell me.

I actually havent done much research into this awesome new functionality. But with blueprintable components, you can get components of the parent actor. So if you were to have a collision component added to your static mesh You could get and use it to line trace and such. Hope to see your results soon!

Very similar questions from me (also creating architectural scenes) and I’m curious if you found any solution?

Thanks very much.

I know this is kinda old, but I too would like to know the answer for this problem. To be able to replace multiple already placed StaticMeshes with the blueprint I created for one of them. Did you find out how it can be done? :slight_smile:

Did you ever find a solution to this problem? I know its a real long time since it was posted, but I recently started looking into this and had the same questions!