Skeleton export problem...

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
LFO
Posts: 0
Joined: Tue Apr 20, 2004 6:01 pm

Skeleton export problem...

Post by LFO »

Hi everybody !

I'm working on a export script for my own 3D engine, and i'm experiencing some weird issue with the skeleton export. My export script is heavily based on the Cal3D script, with the only modifications needed to handle my file format. Note that I'm using a pre-2.33 compiled version of blender, because of the buggy IPO curvenames in 2.32.

As far as I know, the Cal3D script generates the bone loc and rot in parent space, as expected by my own engine. But the rotations seem very buggy. For example, I have done a little test mesh (a vertical cylinder centered on the origin) with a vertical bone that affect it. I expect that the rest-state rotation of the bone is something like pi/2, because the bone is vertical. But in fact, when I compute the bone rest-state quaternion back to axis/angle notation, the rotation is on axis (1, 0, 0) with angle 3pi/4. This is a bit strange... It's like there is an extra-rotation added by Cal3D computations, but I can't find where the problem is, as I completely agree with these calculations... And this is really a big problem, since it results in a very very bad behaviour in my engine (blender animations are completely buggy).

The blender API documentation is not very helpfull to know what needs to be done to have the bones in the correct space. In addition, I'm not so familiar with quaternion math... So what is the issue with skeleton export ? How am I supposed to compute the bones location and rotation to get it in parent space ?

Oh and I've read on this forum that blender 2.33 will have improved armature API. Maybe something needs to be changed in my script ? If necessary, I will post some piece of code, but it's the same as the Cal3D script...

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

buggy IPO curvenames in 2.32.
Maybe I haven't had enough coffee yet today, but I do not remember seeing anything in the Bug Tracker about this.

LFO
Posts: 0
Joined: Tue Apr 20, 2004 6:01 pm

Post by LFO »

I've had some troubles with IPO curvenames. The problem is discussed here : http://www.blender.org/modules.php?op=m ... pic&t=2911
In the CVS build I'm using, the problem seems to have vanished.

breakin
Posts: 0
Joined: Fri Aug 22, 2003 3:33 am

Post by breakin »

IpoCurve.getName() action ipos is implemented so it should work now. Also now one can do, for an armature,

action=object.getAction()
ipos=action.getAllChannelIpos()

to obtain a dictionary with all (bonename,ipo) so one no longer have to guess ipo-names for bone ipos. This should be covered in the upcoming blender 2.33 documation.

Post Reply