Hm, actually let me amend that, .head and .tail are for the Edit mode bone data, not for Pose mode like you want. There's something here:- When you extrude a bone, even if you disconnect it, it still remains parented to the bone it was extruded from.This means that 'loc' vector would be interpreted as being in local-space…
Hi, I'm trying to make a world space to pose space converter. Ex: IK arm ctrl is in world space. I switch to hip space and the arm doesn't pop out but stays in the place it was before. I do this by spawning an empty at the bone location, switching space and moving the bone to the empty. But I can't move it back correctly.…
Hm, that's interesting. I had to look in the API docs to see any alternatives. It seems boy.types.PoseBone.matrix is the pose-space matrix with constraints already applied, so any changes happen after the contribution of any constraints. Try replacing the 'matrix' usage with 'matrix_channel', a different attribute:…
Have you tried the .head or .tail attributes of pose bones? https://docs.blender.org/api/2.79/bpy.types.PoseBone.html#bpy.types.PoseBone.head Get the pose-space 'offset' vector from head to tail, reposition the head to 'loc' and the tail to 'loc + offset', is what I'd try.
RN said: Thanks, This worked like a charm! However this doesn't work if the bone has a ChildOf contraint on it. Then it is moved to the empty but with an offset. How would I account for the offset and counter it?