fixing BlenderToCal3D script to work with 2.4

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip »

Here is the location of the soya updated version of blender2cal3d

http://cvs.gna.org/cvsweb/soya/?cvsroot=soya

I asked him if he wants it committed - I didn't compare this threads version to the soya version, will have a look later.

LetterRip

Roja
Posts: 0
Joined: Tue May 04, 2004 4:36 pm

Post by Roja »

Hm, the one from Soya seems to be the script without the nice GUI. That's the one I never used :p

kostya_z
Posts: 0
Joined: Mon Oct 24, 2005 12:29 pm

Post by kostya_z »

I just tried this latest exporter on my model: it doesn't work. The hand doesn't turn, but translates aside when I want to do the simplest movement, where the model is waving his hand.
Any suggestions why this is the case?

Kostya

kostya_z
Posts: 0
Joined: Mon Oct 24, 2005 12:29 pm

Post by kostya_z »

OK, I tortured my application for a while and got the following results:
Because of some reasons skeleton and animations are rotated 90 degrees and translated [0, -0.1, -2.4] <- this much from the mesh. Manually correcting this, i.e. creating rotational matrix and multiplying it by the quaternion of skeleton's rootbone and the rootbone of each keyframe, plus translating these rootbones by the aforementioned vector solves this problem.
However, it's not a very nice way to solve it and I can't get 100% accurate translation.
Can anybody guess, please, what's the cause of this problem? And how to solve it in a better way?

Thank you.

Roja
Posts: 0
Joined: Tue May 04, 2004 4:36 pm

Post by Roja »

which exporter are you using kostya? The one I posted works just fine for me...I've had no problems so far. But the other ones did NOT work for me, yet worked for others...so it also probably depends on your game engine.

kostya_z
Posts: 0
Joined: Mon Oct 24, 2005 12:29 pm

Post by kostya_z »

I am using just your exporter, that you hosted at www.eternal-lands.com. That's why it's all so weird to me. In Blender everything looks just fine, but when I export it to Cal3D viewer, skeleton and animations turn out to be "shifted" away from the mesh as I said. Well, hopefully sometimes the secret will be revealed :)

Roja
Posts: 0
Joined: Tue May 04, 2004 4:36 pm

Post by Roja »

Try this one then:
http://purple.worldforge.org/cvs/forge/ ... cal3d_2.py

I had to modify it to get it to work for me(as you can see from reading previous posts). But it worked for those guys..might work for you.

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

I made a modified version of the blender2cal3d exporter I found on the Purple World Forge project site blender2cal3d_2.py.

I made this new one because all the version of blender2cal3d (there are many beyond the original shipped with Blender: Soya 3D, Eternal Lands, World Forge) I tested with Blender 2.42a were broken.

This fix, made "Export for Soya" button to work correctly and flipping coordinate system orientation with Y looking upward, to export characters for engines like Soya 3D or jME.

To download the exporter please visit http://endercg.altervista.org/.
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip »

ender could you contact the other authors and get together to finalize a definite version?

Ie one that all the projects can agree works? and then we can commit that to CVS?

Thanks,

LetterRip

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

LetterRip, I will try.

Unfortunatelly I already tryed to get some contact but the first attempt to find them some of them on the WorldForge forum or to get some information in the IRC channel available from purple.worldforge.org failed.

Now I will try by email if any available in the source code.
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

I just sent an email to all the authors I found in the comments of blender2cal3d.py version, included with Blender, and the World Forge version, the one I used.

The first response, from Matthias Braun, one of the authors of the version included with Blender, was negative. He is busy with other things, as he said, and then he is not interested in working on it anymore.

Now I hope to recive any response from other authors.

Thanks
Marco Frisan, Italy
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

Jiba answered me, that the blender to Cal3D exporter "has been completely rewritten by Palle, and it is now included in the Cal3D SVN."
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

As explained me here, it seems that Palle's export script does not export binary Cal3D format.
This means I will go on with my work on the fixed blender2cal3d.py script.

Any help is wellcome.
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

DonJasper
Posts: 0
Joined: Thu Dec 28, 2006 12:20 am

Post by DonJasper »

Still happy with your blender2cal3d.py script?

I've download it, and - well - I see the menu option in Blender! Good start huh? :D I'd like to use Blender to create models for Cal3D, but if there's too many problems with it, maybe I should consider Milkshape instead. ??? Please advise.

Sorry I can't be much help on the export script :-( I just don't know enough.

endersakagroup
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Trieste

Post by endersakagroup »

@DonJasper: please use the script that is here http://endercg.altervista.org/. It should work. I tested it succesfully with Blender 2.41, 2.42 and 2.42a, to export a file for the original Cal3D viewer and to jME kman's Cal3D importer.

As an advise, I can say that the format you use depends mainly on the 3D Engine you use for your games. If you engine supports MD5, der_toon's exporter is up to date, and more stable than blender2cal3d.py.

This fix anyway was to just making it working with the new BPY API and to correct the behavior of the "Export for Soya" button. Nothing more.

To have better support you should explain more preciselly which are your troubles using it. If any.

Thanks
[url=http://endercomics.blogspot.com/:3uckwchk]SketchBook[/url:3uckwchk]
[url=http://web.tiscali.it/marcocomx/:3uckwchk]Old Gallery[/url:3uckwchk]
[url=http://endercg.altervista.org/:3uckwchk]EnderCG[/url:3uckwchk]
[url=http://ilearncocoa.blogspot.com/:3uckwchk]iLearn Cocoa[/url:3uckwchk]

Post Reply