Create BSP and convert to StaticMesh in C++

I need some editable object in editor what converts in StaticMesh in game. I want to convert it automatically.
I try to use UBrushComponent but I can’t found any documentation how use it. And even how convert ABrush to StaticMesh. Can someone help me?


I need to know:

  1. How create simple BSP shape (for example box or plane) when Actor (who own UBrushComponent) just created.
  2. How convert it to StaticMesh.
1 Like

You create BSP by dragging it into the map:

36323-screenshot421.jpg

Next you select your new BSP brush and you can click to “Geometry edititing” to change your brush:

36324-screenshot422.jpg

With your BSP brush selected you go to “File->ExportSelected” and save it out as .fbx.

Note that pivot point of your exported mesh will be placed at 0,0,0 location in the map,
so you’d first have to move BSP brush on to 0,0,0 before exporting , to make it more convenient.
Also after you export it should automatically open the import dialog for static mesh.
Note that creating static meshes like this, creates meshes without smoothing groups.
If you want to do this in-game I am not sure how well it would work, probably better to use Static Meshes exported from a 3D package.

Thank you for reply. But I need do it from C++. It is way not suitable.

Yeah I noticed that, I just wanted to help with what I know, what you’re after is how the UE4 editor BSP system is made, and you have all that in the source code, I’m sure it can be done, however that seems like a pretty big thing to me, and how would you solve the no Smoothing Groups problem… May be a good idea to post this on forum and see if you get some good suggestions.

Maybe a good idea to provide an answer to the question because this question pops up first in the google search results…

1 Like

If anyone has an answer or any info about modeling with c++, I would be so so so thankfull for that