# Set bone rotations for Poseable mesh in local space

**URL:** <https://forums.unrealengine.com/t/set-bone-rotations-for-poseable-mesh-in-local-space/391296>\
**Category:** Character & Animation\
**Tags:** poseable-mesh, unreal-engine, bone-rotation, question\
**Created:** [April 19, 2017, 7:43am UTC](https://forums.unrealengine.com/t/set-bone-rotations-for-poseable-mesh-in-local-space/391296 "2017-04-19T07:43:43Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tuatec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tuatec](https://forums.unrealengine.com/u/tuatec)\
**Post date:** [February 2, 2022, 12:19am UTC](https://forums.unrealengine.com/t/set-bone-rotations-for-poseable-mesh-in-local-space/391296/5 "2022-02-02T00:19:12Z")

</div>

@DarKMoonone  
Thanks a lot for the hint!!!  
I really wonder why this feature is not implemented in the stock component of Unreal Engine … it took me 1-2h to figure out what is going wrong when I tried to read bone transforms directly from a UAnimSequence.

This is how we solved the issue in our framework:

```auto
#pragma once

#include "CoreMinimal.h"
#include "Components/PoseableMeshComponent.h"
#include "TMPoseableMeshComponent.generated.h"

UCLASS(meta = (BlueprintSpawnableComponent))
class TTMOTION_API UTMPoseableMeshComponent : public UPoseableMeshComponent
{
	GENERATED_BODY()
public:
	UFUNCTION(BlueprintCallable, Category = "Components|PoseableMesh")
	void SetBoneLocalTransformByName(FName BoneName, const FTransform& InTransform);	
};

```

```auto
#include "TMotion/Components/TMPoseableMeshComponent.h"

void UTMPoseableMeshComponent::SetBoneLocalTransformByName(FName BoneName, const FTransform& InTransform)
{
  if (!SkeletalMesh || !RequiredBones.IsValid())
  {
    return;
  }

  int32 boneIndex = GetBoneIndex(BoneName);
  if (boneIndex >= 0 && boneIndex < BoneSpaceTransforms.Num())
  {
    BoneSpaceTransforms[boneIndex] = InTransform;
    MarkRefreshTransformDirty();
  }
}

```

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/7/98741ce7efa8cd465a2d7f8743e1bbc8d0416e1c.jpeg)

---

_[View the full topic](https://forums.unrealengine.com/t/set-bone-rotations-for-poseable-mesh-in-local-space/391296)._
