[Closed] how to get pos from 'strange' bones
In my project, I want to read positions from bones. I can get positions of Bone nodes and Biped Nodes. But I found there is some special bones which I can not get position value from it.
For normal bone, I simply write codes like
pos = ABone.pos
For biped node, I get position via:
biped.getTransform ABone #pos
But for node ‘$Bone:Bone_Piston_Base_L’ in the attached max file (unzip the zip file), I can not get position. Max alway prompt me with error:
‘– Unknown property: “pos” in $Bone:Bone_Piston_Base_L @ [11.907418,-39.231331,69.575821]’
How can I get the information?
And how can I distinguish such a node from the other normal nodes?
Thanks a lot!
That Bone has an IK Controller as Transform controller and does NOT have any position, rotation or scale tracks (the IK Controller is a top-level controller that deals with figuring out the whole transformation matrix without sub-controllers).
So, in MAXScript:
–If you try to get the position, there is none:
$‘Bone_Piston_Base_L’.position.controller
– Unknown property: “position” in $Bone:Bone_Piston_Base_L @ [11.907418,-39.231331,69.575821]
–But you can see the transform track and its controller correctly:
$‘Bone_Piston_Base_L’.transform.controller
Controller:IK_Controller
–So you can just grab the resulting transformation matrix and read its 4th row
$‘Bone_Piston_Base_L’.transform.row4
[11.9074,-39.2313,69.5758]
–which is the same as
$‘Bone_Piston_Base_L’.transform.translationpart
[11.9074,-39.2313,69.5758]