Permanently spawn a staticmesh in to the level Editor from a blueprint construction script

Hi guys and gals

Sorry if this has been asked elsewhere but i can’t seem to get my searching right on this one, I’m new to game development and I’m a bit short in the terminology.

So I stumbled upon the blueprint BP_Fence (1.2) in the advanced_blueprint level of the content examples and thought it would be a fun way to brush my non existing vector math skills.

Building from the logic of that blueprint I pulled together another little blueprint to place static meshes in a rectangular shape using a vector with a 3dWidget. Since Blueprints are so cool and easy i went on and added a floor and ceiling to it. After that a door and window mechanism that can be customized per bp instance. After hacking away at a couple of problems with collision i now have kind of procedural ugly house blueprint and a huge feeling of accomplishment :slight_smile: .

A pic. The vector widget used to generate the house is selected, all the houses where built using the tool.

(Some of the texts of the details panel are in Catalan sorry, but you can get the idea)

Any hows all above being great fun to make and use this bp has couple of limitations that i would like to overcome.

The one i would like to address right now is the meshes can’t be selected individually.

For this and some other reasons i would like to build in a “bake” or “place in level” functionality in the blueprint.

The work flow idea is to rapidly place the structure of the building using the blueprint then press a “button” made with an exposed bool in the details panel of the blueprint instance and get the blueprint to place each static mesh individually in the level as if it had been placed by hand dragging from the content browser, The blueprint is then deleted and each static mesh resulting from the bake can be manipulated (Materials etc) individually .

So basically what i’m looking for is an “add mesh to level” node or something that will allow me to permanently place static meshes in the Editor from the construction script graph of my blueprint.

Is this possible?

I’m a php programmer so i should be able to slug my way around a C++ approach if a blueprint solution is not possible.

Thanks a bunch :slight_smile:

P:D
Content Examples is the bestest sample project in my experience EPIC please keep adding to it.

It is not possible currently, but you may want to ask around in C++ section of the forum on how to make the engine allow that if you cant get an answer here.

Hey Jacky thanks for that. You are right, I have been checking the C++ section and i think i got something that might work. I’ll try and sketch out some code for that and post again there. Thanks :slight_smile:

Heya, did you ever find a solution to this? Doing something similar right now, hit the same wall with regards to saving procedurally created stuff to the scene. Let me know, thanks!

Hey Randomself, the answer is yes and no.
I found a thread in the forums, that describes a lopehole that can be used to spawn stuff from a construction script. It worked in 4.5 or 4.6 (can’t remember) but felt a bit to hacky for what i wanted to do so i dropped it.

Here is the thread : Spawn Actor from Construction Script (loophole) - Feedback for Unreal Engine team - Unreal Engine Forums

Check out the post by Nick Whiting, he explains the reasoning behind disabling spawning from a construction script.

Hope this helps!