CVS (2006-11-19) new bone calculations

There is a new bone calculation for armatures in CVS (2006-11-19).

According to the commit log :

From: brechtvanlommel at pandora.be (Brecht Van Lommel)
Date: Sun Nov 19 00:07:37 2006
Subject: [Bf-blender-cvs] CVS commit:
 blender/source/blender/blenkernel/intern armature.c
 blender/source/blender/blenlib
 BLI_arithb.h blender/source/blender/blenlib/intern arithb.c
 blender/source/blender/python/api2_2x Bone.c blender/source/blender/src
 editarmature.c
Message-ID: <[email protected]>

blendix (Brecht Van Lommel) 2006/11/19 00:07:32 CET

  Modified files:
    blender/source/blender/blenkernel/intern armature.c 
    blender/source/blender/blenlib BLI_arithb.h 
    blender/source/blender/blenlib/intern arithb.c 
    blender/source/blender/python/api2_2x Bone.c 
    blender/source/blender/src editarmature.c 
  
  Log:
  Fix for bug #5250: inaccurate conversion between edit and pose mode bones.
  
  Using acos(dot(u, v)) to find the angle between two vectors is quite
  inaccurate, and there's a better way to do it, as explained here:
  http://www.plunk.org/~hatch/rightway.php
  
  Also changed the use of atan for computing roll to atan2 in some places,
  the latter avoids accuracy and division by zero issues.

Unfortunately, there seems to be strange effects when editing an armature created in 2.42a (or any other CVS version prior to that commit).

I wrote in bug report #5264 :

This fix causes problems when editing armatures created with older Blender versions (2.42a).

(Is the internal data possibly not being updated correctly).

Something in the parenting mechansim ?

Load the included file into latest cvs,

go int edit mode, move some bones around, when changing to pose mode, the bones change their position, rotation. Seeming unrelated bones are affectd… i.e. change the position of an “arm” bone in EDIT mode, and when returning to POSE mode.

Selecting all bones in EDIT mode and doing a CTRL-N recalc bone angles, seems to make the problem even worse.

This is the test file
http://projects.blender.org/tracker/download.php/9/125/5264/3000/skel241_IK_skel.blend

I posted a bug report here
http://projects.blender.org/tracker/index.php?func=detail&aid=5264&group_id=9&atid=125

Mike

mike_s: I’ve had a look using one of my own rigs (since 2.42 or before), and the behaviour of going in and out of pose-mode to edit-mode (without making any changes to anything in either mode) alternates between two incorrect variations. So something is doesn’t seem quite right with the maths here.

Aligorith

Aligorith,

Thanks for looking at it. Maybe you could add your comments to the the bug tracker?

The math is way beyond my feeble math abilities. But maybe it’s not just the math, could be something else in that huge machine called Blender ! :slight_smile:

Emo ! … Emo ! :smiley:

Mike