Transform skeletal bone in C++
Is there way to transform bone of ASkeletalMeshActor? I tried to do it following ways:
(SkeletalMeshComponent from actor instance)
1) by changing SpaceBases and LocalAtoms for required bone
2) by applying body transform using PhysX
So, what wrong I do?
asked Jun 20 '14 at 11:59 AM in C++ Programming
I don't think Rama's answer really addresses the question because it involves blueprints. That being said I'd still consider it still useful.
Transform Bones in C++ Only
ou'll have to inherit from UAnimInstance and override EvaluateAnimation. Once you've done that you can use USkeletalMeshComponent::SetAnimInstanceClass on a Skeletal Mesh Component to your new inherited anim instance.
EvaluateAnimation and FPoseContext is pretty undocumented at this point, but it's fairly simple to figure out.
Hope that helps! It sure helped me once I found it.
There is a UPoseableMeshComponent class that allow you to manually move any bone in the C++ code. You can use it instead of USkeletalMeshComponent and set any transformation to the LocalAtoms.
Worked perfectly for me, though I don't know is it possible to add an animation blueprint to it (if you need one).
answered Feb 06 '15 at 05:31 PM
Skeletal Controller Single Bone + Custom C++ Anim Instance
In your Anim BP
Make a Skeletal Controller for Single Bone
Extend your Anim BP class, making your own AnimInstance class that has your custom FTransform or FVector or FRotator Vars in it
Then set these vars any time from anywhere c++ after accessing your custom anim instance.
You can even implement custom logic in the tick of the animation instance itself!
My Wiki Tutorials
Custom Anim BP Vars in C++
Custom Logic in Anim BP Tick in C++
You can modify animations that are playing if the Skeletal Controller is applied after the animation blends / montages / Slots
It's easy to use
Can do it with multiple bones and handle each case separately without one interfering with the other, enabling/disabling each modification as per your C++ logic / gameplay flow
Could you explain how you converted class USkeletalMeshComponent to class UPoseableMeshComponent ? I am almost in the same situation as Numat, the only difference is that I work with the ACharacter class.
Follow this question
Once you sign in you will be able to subscribe for any updates here