Cal3D bone orientation problem

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
kat
Posts: 0
Joined: Fri Oct 18, 2002 6:17 pm
Location: UK

Cal3D bone orientation problem

Post by kat » Sun Oct 07, 2007 10:05 pm

Just posting this to double check a bone rotation issue with the updated (??) Cal3D export script that's included with 2.45. There appears to still be a minor problem with bone rotation information along the negative (??) 'Y' axis when exporting armatures out; if a bone is rotated through 180 degrees it 'breaks' the rotation data gets exported incorrectly.

I'm in the process of trying to get Blender 3D fully supported for content creation for IMvu and this little problem is the final hurdle in that... (almost.... there... Scotty... we need.... more power!), most everythng works (after *a lot* of work) except for this issue - bones can lay flat and objects in IMVU will do that same, upright and they do the same *except* on the '-Y' axis, they get squewed. The good news is that they all get squewed by the same angle so they all appear in IMvu with the same rotation along this axis. Some shots below to clarify the above.


(below) The bones as they are orentated in Blender - 'Y' = up, 'Z' = pointing into the room
Image

(below) The orientation of the bones show in top down view in Blender.
Image

(below) The results in IMvu
Image


So the above shot shows the bones on the wall to the left ("2") behaving correctly, whereas the bones on the wall to the right ("1") do not, despite being correctly setup in Blender. If the bones are rotated to compensate it doesn't straighten the calander up (so it lies correctly against the wall as "2" does) but instead squews them at an odd angle.

I've been able to dublicate this problem in another Blender file and exported mesh/rig; same problem, same results (which *is* kind of encouraging as it means the root cause is the same thing in all instances).

NielsBlender

Post by NielsBlender » Tue Oct 09, 2007 4:58 pm

kat,

It seems the export is right, the 'weird' thing is the 'orientation/scaling' before exporting, can't say this too sure, but I recently noticed a weird phenomenon: rotating a bone changes(read scales) the bone(read mesh)...

I will look tonight if I 'doubled' something myself or it is a blender-problem...
If it is something with the 'constraint-combination' or a displaced-centre thats not centre or an axes gets divided or left behind....options, options, options... :)

Niels

ps.
I you want my guess... A displaced-centre, probably a dynamic(-moving)-centre-by-accident ;)

kat
Posts: 0
Joined: Fri Oct 18, 2002 6:17 pm
Location: UK

Post by kat » Tue Oct 09, 2007 6:11 pm

NielsBlender wrote:...can't say this too sure, but I recently noticed a weird phenomenon: rotating a bone changes(read scales) the bone(read mesh)...
Thank's for the responce. I wonder if it's a 'global' problem then? I've not thought to try roll on other bones becasue I only needed to do it in one particular place so I don't know if adding a "roll" value to any bone would break it? If you want to e-mail me whatever you come up with I'll test it and see what happens. *thumbsup*

NielsBlender

Post by NielsBlender » Wed Oct 10, 2007 5:40 pm

I checked like I said, I had to lookup an older file but it was 'simply double assigned'->same verts attached to same bones... I added(->repurposed) bones and the namegroups were already assigned, so I got stuck with two bones pulling the same verts... :)

Niels

kat
Posts: 0
Joined: Fri Oct 18, 2002 6:17 pm
Location: UK

Post by kat » Wed Oct 10, 2007 5:48 pm

So if I understand that correctly the script was basically doubling up the bones which then mixed up the exported data? (two references being combined together?). Good to know you didn't have to do a complete re-write of the code!

NielsBlender

Post by NielsBlender » Thu Oct 11, 2007 11:19 am

kat wrote:So if I understand that correctly the script was basically doubling up the bones which then mixed up the exported data? (two references being combined together?). Good to know you didn't have to do a complete re-write of the code!
Ja, nou breekt me klomp ;)

NielsBlender

Re: Cal3D bone orientation problem

Post by NielsBlender » Thu Oct 11, 2007 11:32 am

kat wrote:(below) The bones as they are orentated in Blender - 'Y' = up, 'Z' = pointing into the room
If you are refering to '2' and '1' to be 'the same' and the empty is 'direction-pointer' it seems to me the '2' situation is Y not -Y, although I don't think this is explaining the sqeeze...

If I were you, I would use less bones and a clear-situation to 'try-out' comparing A to B to C...

Niels

ps.
C=a+b != C=A+B

kat
Posts: 0
Joined: Fri Oct 18, 2002 6:17 pm
Location: UK

Post by kat » Thu Oct 11, 2007 2:37 pm

I can never remember which 'direction' is which 'orientation', so yes you're right the axis points 'up' along the 'positive' axis rather than 'down' along the negative. heh.

I did have another bone orietation issue elsewhere that exhibited the same squewed bones but that was fixed with rebuilding the bones correctly; adding a 180 roll to those seemed ok so I'm guessing the problem is just along that particular 'Y' axis. I'll see if I can get a test room done with fewer bones so you can better see what's going on. Would it be helpful to you to have the CAL output for the test room?

NielsBlender

Post by NielsBlender » Fri Oct 12, 2007 2:53 pm

kat wrote:Would it be helpful to you to have the CAL output for the test room?
You made earlier similar assumptions but... open the 'cal3d.py':
"Jean-Baptiste, Jiba, Lamy, Campbell Barton (Ideasman42)"


Niels

joeedh
Posts: 31
Joined: Wed Oct 16, 2002 10:30 pm
Contact:

Post by joeedh » Tue Oct 16, 2007 10:10 am

Hrm, could be an issue with how bone base orientations are calculated; in blender the orientation of the bone attempts to have the z axis point as close to global positive Z up as possible; I don't know how cal3d handles this.

Joe

Post Reply