My goal is to drive bones connected to a skeletal mesh in real time using information coming in from a custom input device using C++ only ( not interested in blueprints). I have a project that is very simple right now:
A class derived from APawn with the following component hierarchy: USceneComponent -> USkeletalMeshComponent -> UCameraComponent
The skeletal mesh is loaded into USkeletalMeshComponent just fine and the project displays as expected when run.
The next thing I need to do in essence is:
Iterate through the bone hierarchy of the relevant skeleton so I can extract bone IDs/pointers.
Use said IDs/pointers to construct whatever UE4 class(es) needed in order to apply translations and rotations.
I’ve gone over the Code Wiki and API docs and founds bits that seem relevant ( or might be anyway ), however, I still don’t how to put it together. I don’t think I’ve even identified all the pieces that I need in order to make an attempt at putting it together. Again, I really just need an example of how to do this for a single bone to affect the mesh and from there I should be good to go.
Looks like a Poseable Mesh allows for straightforward bone manipulation, however, it cannot be mixed with animation data. This works for my purposes, however, I still think in principle there must be some way to manipulate a SkeletalMesh purely in C++ with resorting to any editor blueprint setup. After all, blueprints are really just C++ with some kind of annotations.
I’m still new to UE4 ( only really a month of actually delving into it ) so perhaps with more time I’ll figure out the nuances.
ive asked this twice and got no response, cant work it out for code.
the only example is in blueprints in 1 of the example downloads, and it only applies to a poseable mesh and not a generic skeletal mesh.
Bump
Just a clue you may find useful. There is a family of classes that are used in animation blueprint - AnimNode_*. You can subcalss FAnimNode_SkeletalControlBase to implement your own skeletal controllers and then use it inside your model’s animation blueprint. I haven’t tried that yet, but I think it’s a good place to start research.