What makes creating skeletal meshes at runtime difficult?


I have a somewhat contrived yet conceptually relevant problem statement, and it is as follows:
I would like to import FBX scenes at runtime with animations. Think of viewer app where user plop in their models.

Now, this is quite ironic, because it’s almost exactly what the Unreal Editor is. The most sane thing to do is perhaps just modify and strip down the engine to be just that. But suppose for the sake of argument, we do not do that, but instead insist on creating/importing skeletal meshes at runtime… would it even be possible?

It might be have been easier if you could just include the Fbx import headers, but they reside in the editor module, and so should not be used in runtime. You can easily overcome this by using a third party library such as Assimp. Ok, now you have all the imported mesh information … but how do you construct the animated skeletal mesh?

  • There is no constructor or method that lets you set the geometry and bone/animation data.
  • The creation of the skeletal mesh seem to occur deep in the editor module as part of the import process.

How does the game then instantiate the skeletal mesh at runtime, and can we do something similar to create dynamic skeletal meshes?