Skip to content

Expose global bone transforms to Lua - #832

Merged
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:#830
Sep 2, 2026
Merged

Expose global bone transforms to Lua#832
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:#830

Conversation

@Gopmyc

@Gopmyc Gopmyc commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds read-only access to the accumulated pose of a skinned mesh bone through CSkinnedMeshRenderer and Lua:

  • GetBoneGlobalPosition
  • GetBoneGlobalRotation
  • GetBoneGlobalScale

The getters resolve a bone index to its skeleton node and decompose the matrix already computed in m_globalPose. Invalid indices return std::nullopt in C++ and nil in Lua, consistently with the existing local bone getters.

Related Issue(s)

Fixes #831

Review Guidance

Please focus on:

  • the distinction between local, skeleton-global/model-space, and world-space transforms;
  • consistency with the existing GetBoneLocalPosition, GetBoneLocalRotation, and GetBoneLocalScale API;
  • invalid bone-index handling in both C++ and Lua;
  • the Lua API names and annotations.

The getters read m_globalPose before applying the bone offset matrix, which makes the returned transforms suitable for runtime bone attachments.

Screenshots/GIFs

1.mp4
image

AI Usage Disclosure

N/A

Checklist

  • My code follows the project's code style guidelines
  • When applicable, I have commented my code, particularly in hard-to-understand areas
  • When applicable, I have updated the documentation accordingly
  • My changes don't generate new warnings or errors
  • I have reviewed and take responsibility for all code in this PR (including any AI-assisted contributions)

@adriengivry adriengivry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test but the code looks good!

@adriengivry
adriengivry merged commit 73ae710 into Overload-Technologies:main Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Expose global bone transforms to Lua

2 participants