Hello!
I have during the last weeks been trying out Babylon and it is quite fun. I have managed to do a few simple scenes and also imported stuff from Blender, including Animations.
My latest project is to try to get the BoneIKController to work but can´t get it to work.
I have made a simple model in Blender consisting of two meshes and a two bones in a armature. Each mesh is parented to a bone using Automatic Weights.
I have also applied all transformations on my objects.
The model was then exported as .babylon format.
In Babylon I then import the model as well as adding two new meshes, a target and a poletarget, for my IKController.
The Cube on top is called Cube2 and the lower cube is called Cube1.
They are not parented to the corresponding Bone, I don´t understand how to do it. I saw the function attachToBone but it takes two arguments, the bone and a Mesh. I have only one mesh per bone so the code would be something like Cube1.attachToBone(Bone, Cube1), this of course does not work…
Is there a better way to to this?
My IK controller looks accordingly,
ikCtrl = new BABYLON.BoneIKController(Cube2, SecondBone, { targetMesh: target, poleTargetMesh: poleTarget, poleAngle: Math.PI });
This does not work at all. It looks like the Bone is tracking the target without bending any bones.
If i look in the documentation the “characterMesh” seems to be one big mesh with several bones so i am guessing I need to do some adjustment in some way.
What is wrong here? I have tested many different variations of this can´t get it to work.
As a total beginner with everything regarding 3D stuff, I feel a bit lost at the moment. If anyone have any suggestions I would appreciate it =)
Best regards
Nessie