Announcement

Collapse
No announcement yet.

How to obtain the "Default" bone transforms in Character or Controller class?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to obtain the "Default" bone transforms in Character or Controller class?

    Good day community!

    Newbie myself, and I'm using C++ with UE4.20.

    I started with "ThirdPerson" demo, and have managed to create my own Character and Controller class, then I created my own AnimGraphNode and AnimNode to achieve full body IK.
    In the AnimInstance I leave variables like HeadTag (Tag for target), TorsoTag, LftHandTag, RgtHandTag, LftFootTag, RgtFootTag and alpha values for my AnimNode.

    Everything works accordingly until... I try to do some real work, like raycastinig in-game.


    Question: How can I obtain Bone transforms in Character or Controller class?
    Not the transforms after "FinalAnimationPose" in AnimGraph. I need the one before all the IK modification and stuff, the "untouched bone transforms" before "Default", the StateMachine node.


    Here's something I've tried.

    Inside AnimNode::EvaluateSkeletalControl_AnyThread(), I learnt to extract bone transform from FBoneContainer, FComponentSpacePoseContext, FBoneReference and EBoneControlSpace.
    But EvaluateSkeletalControl_AnyThread and Controller::Tick, Controller::PrePhysicsTick, Controller::EndPhysicsTick are not in sync.
    They runs in different frequency. The data I obtained in EvaluateSkeletalControl_AnyThread is unusable.

    Then, 1st, I try to use Mesh->GetBoneLocation( boneName, EBoneSpaces::WorldSpace ) in my Character class.
    2nd, I tried to use USkeletalMeshComponent->BoneSpaceTransforms[bone_index] in my AnimInstance.
    Both methods gave me the "FinalAnimationPose" transforms.

    I then created a custom StateMachine node and read through the parent, grand parent classes but, no luck. Don't even know where to begin.

    I've searched around and... still took me to nowhere.

    Right now, I'm reading UAnimInstance::UpdateAnimation, but... it's no easy task, especially without breakpoint, stepping through the codes.

    If anyone knows how to obtain the "untouched bone transforms" in Character or Controller class, please help!

    Best,
    Last edited by Hirox.; 12-19-2018, 04:53 AM.

    #2
    Many use a dark theme in these forums and won't be able to read any of these red text you wrote.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      Originally posted by BrUnO XaVIeR View Post
      Many use a dark theme in these forums and won't be able to read any of these red text you wrote.
      I use Dark theme myself too, but thought the bright red look alright... but well... I've changed it to bold. Hope it can do a better job differentiating class / function name.
      Thank you for pointing that out.
      Last edited by Hirox.; 12-20-2018, 01:22 AM.

      Comment

      Working...
      X