No subject
Fri Aug 18 06:37:21 CEST 2017
right. But in fact the third bone is misplaced. The coordinates provided =
in the setHead() and setTail() functions for the third bone are =
interpreted as if they are in local coordinate space of the second bone. =
However, the second bone seems to be treated differently - although it =
has a parent as well.
Michael Schardt
------=_NextPart_001_004B_01C41033.00224940
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>With my tests of the new armature =
module i=20
found the following inconsistency in positioning =
the bones:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Adding the first bone (call it 'A') to =
an armature=20
(a rootbone) you have to provide global coordinates for the =
setHead() and=20
setTail() functions - ok.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When adding the second bone 'B' as a =
child of=20
'A' i would have expected to provide local coordinates - but in =
fact we=20
again have to give global coordinates to setHead() and setTail() -=20
well...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I was a bit surprised when i tried to =
add a 3rd=20
bone 'C' as a child of bone 'B': all of a sudden i have to give local=20
coordinates to the set...-functions!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Try my little test program =
"test_bones-4.py" to see=20
what i mean. See the inconsistency?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>From the code one would expect a linear =
chain of 3=20
bones from left to right. But in fact the third bone is misplaced. The=20
coordinates provided in the setHead() and setTail() functions for the =
third bone=20
are interpreted as if they are in local coordinate space of the second =
bone.=20
However, the second bone seems to be treated differently - although =
it has=20
a parent as well.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Michael Schardt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_001_004B_01C41033.00224940--
------=_NextPart_000_004A_01C41033.00224940
Content-Type: text/plain;
name="test_bones-4.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="test_bones-4.py"
#test bones script
import Blender
from Blender import *
armObj = Object.New('Armature', "Armature_obj")
armData = Armature.New()
bn1=Blender.Armature.Bone.New("bone1")
bn1.setHead(0.0,0.0,0.0)
bn1.setTail(2.0,0.0,0.0)
bn2=Blender.Armature.Bone.New("bone2")
bn2.setHead(2.0,0.0,0.0)
bn2.setTail(4.0,0.0,0.0)
bn2.setParent(bn1)
bn3=Blender.Armature.Bone.New("bone3")
bn3.setHead(4.0,0.0,0.0)
bn3.setTail(6.0,0.0,0.0)
bn3.setParent(bn2)
armData.addBone(bn1)
armData.addBone(bn2)
armData.addBone(bn3)
armObj.link(armData)
scn = Blender.Scene.getCurrent()
scn.link(armObj)
armObj.makeDisplayList()
Blender.Window.RedrawAll()
------=_NextPart_000_004A_01C41033.00224940--
More information about the Bf-python
mailing list