I can't export or merge procedural mesh

Procedural meshes that are created in Construction Script of a blueprint are not exported through ‘Export FBX’ and ‘Merge Actors’. For example if I choose some objects then click ‘Export FBX’, procedural meshes are not exported with others. Engin is only saving static meshes and BSP’s to the exported file.

I must do this to provide static lighting for my procedural meshes.

Hey SalihBalkan,

Could you provide me with some screenshots and simple steps to reproduce this issue?

Procedural meshes are being generated and created procedurally, which means they do not exist as a prefabricated asset. Therefore exporting it does not make sense to me, but perhaps I am missing an option.

Static Meshes and BSP’s are physical assets that can be replicated elsewhere, where as procedural meshes are generate at runtime and cannot be exported.

Let me know if you have further questions.

Cheers,

I create them in the construction script. I don’t need to create them dynamically in runtime. So that I want to provide more performance by turning them into static meshes.

To reproduce this:

  1. Create an actor blueprint

  2. Create a procedural mesh within the construction script

  3. Use ‘Export FBX’ or ‘Merge Actors’

Output is an empty mesh. However if you apply the same steps with static meshes that are created in construction script, there is no problem. Also if you use Spline Mesh, there is no problem too. Only problem is with procedural meshes.

I appreciate the steps, but I need a bit more elaboration on how you are creating your procedural mesh. A few screenshots of your Construction Script and simple steps will suffice.

If this is working for all other meshes and actor types, the assumption is that it is not intended to work with procedural meshes.

Let me know if you have further questions.

Cheers,

Apply this at the beginning of the construction script:


For Vertices array, you can enter these values:

0,0,0 -
100,0,0 -
0,100,0

For Triangles array, you can enter the values:

0 -
1 -
2

You can left UV0 input blank. This will create a triangle. Finally export it, then import the exported file. You will see that it doesn’t export anything.

Hi Andrew. We are working on voxel implementation using procedural mesh component as well. The main feature for us would be to save the static data on disc so editor won’t generate the meshes every time someone open level.

We will have lot of voxel props (custom file format) in content browser and regenerate them in run time when needed.

Do you have any tips how this can be achieved? For now we can’t simply save this data as static mesh is doing because procedural mesh component isn’t extending from static mesh.

The steps that I followed to export and merge the procedural mesh are:

To export, select the triangle then click:

  1. File > Export Selected

  2. Open up the exported fbx with Maya(or another program), you will see that it is empty.

To merge:

  1. Go to Edit > Editor Prefences > General > Experimental > Tools > Tick: Actor Merging

  2. Select the triangle, then go to Window > Click: Merge Actors

  3. Save the file to somewhere in your project folder

  4. You will see that it doesn’t save, it even doesn’t give an error message.

I have the triangle in front of me using the instructions you have provided, but I am unfamiliar with the process of exporting a procedural mesh. Could you show me this process on your end so I can get to the correct point.

Thanks,

Hi ,

Unfortunately, at present, the workflow you propose is not supported because a UProceduralMeshComponent is derived from UMeshComponent, rather than UStaticMeshComponent, and doesn’t contain a UStaticMesh asset which can be exported or merged.

In order to support this, we would need to create new tools to export or merge UProceduralMeshComponents. This doesn’t appear to be on the roadmap at the moment, but I will ask the Framework team if it is likely to be supported in the future.

All the best,

Is there any news on this?

Sorry, there is still no plan to support UProceduralMeshComponents in this way. Without an underlying UStaticMesh, none of the export/merge tools work, and it’d be a large undertaking to support this in the future.

If you want to export procedural meshes, I’d contend that there’s probably a better way to do what you want to do, maybe building the meshes procedurally in your content creation software and importing that into UE4. In general though, I can’t think of a really useful reason to be able to export procedurally generated meshes to FBX.

Just to add, we have code to convert BSP to static mesh so it can then be exported or merged. You might like to try applying the same principle to your procedural mesh - no idea how much work that would be though.

You can export as OBJ by printing your vertex, triangle and UV arrays as plain text.

Lines of the obj file should be like these:

vertex coordinate:

v 300 400 500

uv:

vt 0.0 1.0

dear richard:
we are working on a vr painting app similar to tiltbrush.
the meshes are procedually generated, driven from the controller movements.
in this example. an export feature is really critical to us.
because we need to implement an “save painting” and “export painting” feature.

dear dalih:
this sounds very clever to me. a simple and beautiful solution.
one question: If I use different materials in one mesh, how can I define those “material-slots” in OBJ Format?

Hi ,

In which case I would recommend going with 's approach as it’s a simple format to output and can be implemented fairly easily.

Even if we had the facility to export procedural meshes, this would be in a UE4 Editor module, and you wouldn’t be able to include it in a released product as it would be in breach of our EULA (specifically 1a - “The Product must not contain any Engine Tools”). So it sounds to me as if a home-grown solution such as 's is probably your best approach.

All the best,

Hi , you can divide your obj model into sections by using g parameter:

g -_0
v ...
v ...
v ...
f ...
vt ...
vt ...
vt ...

g -_1
v ...
v ...
v ...
f ...
vt ...
vt ...
vt ...

I think your vr painting app must provide vertex paint feature.

Obj file format officially does’t support vertex colors, but many applications are using it by adding colors as R G B A after vertex coordinates. But Epic Games didn’t implement this feature into engine, which means you should use another file format like FBX if you want to import exported files with Unreal Editor’s importer, or another app that doesn’t support vertex colors from OBJ. FBX is harder to implement but it is better than OBJ.

You can represent your interest into this issue if you want. I created a request topic for this:

https://answers.unrealengine.com/questions/491053/request-import-obj-files-with-vertex-colors.html

Hi ,
I can’t find a way to export SplineMeshes created using the construction script and googling for it brought me to this thread. Could you explain to me how you did it?

You can’t export spline mesh data. I scripted my own ProceduralSplineMesh blueprint for this. If you want, I can send it but it is not user friendly at all. It may take several days to learn to use it. I suggest you to find another way to achieve what is in your mind.