Can you created meshes at runtime?

Is it possible to create meshes at run time from vertex arrays?

If not can you import .fbx files at run-time?

I was actually working on a ‘CustomMeshComponent’ plugin to show how you can implement functionality like this. This example will let you specify an array of triangles at runtime (via C++ or Blueprints). It is very basic at the moment, but I attached the source in case its helpful. Eventually you could either use this component directly (we will distribute it), or write you can write your own component now to do exactly what you need.

Hey thanks I had a look at your code and its exactly what I’m looking for! I’d love to poke around with this sort of functionality, trouble is your inheriting from the classes FVertexBuffer and FIndexBuffer which as far as I can see isn’t in Rockets external dependencies?

Ah I think I fixed that when I made this plugin, so you will probably get those changes in the next beta! Sorry about that.

Still pumped its in there, I’ll just have to work on other stuff while I eagerly wait for the next build

Hi Aidan,

What exactly are you trying to accomplish when runtime happens? We can help you figure it out, but we’ll need some more details.

Thanks,

Alexander

Hey no problem,

Its for an in-game level editor. The idea is that players can draw a line which represents a wall, it gets converted into a vector array, and then generated. Why generated instead of using wall segments? Allows for more variety and pleasing shapes like curved walls with varying angles. I’ve actually written something in Unity that does it but UDK didn’t have access to that code and I haven’t yet seen that Rocket has a component that store mesh details (vertex array and vertex order) outside of the graphics processors memory; so far. Curious if anyone knows of such a component or a way around it?

The second point is something I came up with to either work around or serialize the dynamic geometry. If you generate the mesh in code its not that hard to format it into the .fbx format for storage. If you can import meshes on the fly but not actually write directly to the vertex buffer that would be a way to do it otherwise its just one way to have persistence for what the player creates.

Hope that clarifies things,
Aidan