SkinLayerStudio API (Beta) / API Reference / Bone

set_trs()

Download Markdown

Writes this bone's translation, rotation, and scale, and shows it in the viewport immediately.

Rotation is in degrees. Child bones follow, the same way they do when you rotate with the gizmo. Each of the three values must be a list of three numbers.

space="local" is relative to the parent. No parent relationship raises SessionError. A bone that is not in the viewport raises BoneError.

Signature

bone.set_trs(translation, rotation_deg, scale, space="world") -> None
Argument Meaning
translation (x, y, z) translation.
rotation_deg (x, y, z) rotation, in degrees.
scale (x, y, z) scale.
space "world" or "local". World is the default.

Example

bone = api.bone("Bip001 Spine")
move, rot, scale = bone.trs()
# move 5 cm up in world space
bone.set_trs((move[0], move[1], move[2] + 5), rot, scale)

Read the values, change one axis, and write them back. If you need the matrix, read world_matrix.

💬

Need help with the API?

Open a support ticket or join the community discussion.

Contact Support