feat: Enhance IK handling in Model and IKInstance components with improved data structure and validation

This commit is contained in:
2025-07-09 13:38:06 +05:30
parent 8c69aa52db
commit 65ef6839a0
3 changed files with 40 additions and 32 deletions

View File

@@ -81,7 +81,8 @@ function Model({ asset }: { readonly asset: Asset }) {
if (!ikData && asset.eventData && asset.eventData.type === 'ArmBot') {
getAssetIksApi(asset.assetId).then((data) => {
if (data.iks) {
setIkData(data.iks);
const iks: IK[] = data.iks;
setIkData(iks);
}
})
}
@@ -463,7 +464,7 @@ function Model({ asset }: { readonly asset: Asset }) {
position={asset.position}
rotation={asset.rotation}
visible={asset.isVisible}
userData={asset}
userData={{ ...asset, iks: ikData }}
onDoubleClick={(e) => {
e.stopPropagation();
if (!toggleView) {