Getting The Size of a Joint

Hey, I am working on a rag doll system for Panda, but am running into a problem; I can’t get the size of a joint.

I tried calling getScale(), but it returns (1,1,1) regardless of the joints size.

Is there anyway to do this?

If you mean length, a joint does not have a length. It is just a transform. The length that you see in a 3d modelling program is the distance from one joint to the other.

Actually it depends on the 3d modeller. In Blender for example a bone has a base and tip, and the lenght of the bone is the lenght between these two and you can access it with the Python API. When two bones are connected, the tip of one bone is “merged” with the base of the other. I think in Maya bones don’t have a base and tip and are just octahedrons. here the long pyramids are indeed just used to visualise bone connections.
All the game formats I’ve encountered don’t have any bone lenght info though. Think about it: in some 3d modellers it’s just used to make editing easier, but in a game you don’t need that info, it would just take up space. Bones in these formats do have scale, but are always (1,1,1) in rest pose and are just used for scaling animations.
This did confuse me before so I hope what I said made sense.

The Panda3d egg format stores bone parenting info, so you can just:

  1. get control of the joints (actor.controlJoint())
  2. get parenting info (joint.getChildren() ?)
  3. get the lenght between the “controlJoints” by using joint1.getDistance(joint2)

I’ve run into the same problem when visualizing bones on my models. The parent-child connection is no guarantee for connected joints.

Unless you don’t export that info within your egg (using a tag, comment or empty), you won’t have any different lengths than 1.

What I’m only wondering about: What if we animate a joint regarding its length? At least in Blender, the lengths of bones are all animatable.