CAL3D Loader and Viewer

This is a pre-alpha attempt to load Cal3d models in JME. The loader is compatible whith the latest version of Cal3d (0.10).

Cal3D can perform animation blending.

Currenttly the loader loads and displays cal3d models and their animations supporting animation blending.

Work needs to be done for texturing since in the latest version of cal3d there is some support for shaders etc.

You can find online a webstart demo(only windows :stuck_out_tongue: sorry space requirements and only JDK1.5+)  where you can play with cal3d animation features.

The main cal3d loader code is based on Dave Lloyd’s Fuze3d.

I’m developing this loader for use in a RPG i’developing at this moment.

Stay put for source code and binaries of the library.

Screenshot:http://myjavaserver.com/~kman/cal3d/scr.jpg

Webstart DEMO:http://myjavaserver.com/~kman/cal3d/cal3d-loader.jnlp

basic textures and uv's are ok at this time, but cal3d supports some more advanced features check the paladin model shiped in their distribution,

at the moment the cal3d material file is totally ignored and there exists only an assignment of a texture per mesh or submesh.

As for the cal3d loader for blender i believe that the cvs version of ca3d contains an updated one. Some work need to be done for animation,

supporting animation callbacks and other stuff.

As for releasing the library, i wait Dave Looyd's response for the licensing of his Fuze3d library since a modified version is used for the loading of the data.

An i also need to replace the javax.vecmath package used in fuze3d with JME's math.

As i see there is some interest in this so i think i'm going to setup a sourceforge project.

Looks like it works well!

When you mean work on textures, is only extra shaders FX? cause I don't mind that, only basic texture and UVs.(well, and unrelated, but also vertex normals, I mean, smooth shading )



Is it far to reach the moment of loader get released for jme 0.9 ?





seen the examples. Looks very good. Seems is respecting the smoothing normals, the interpolation curves, the bone weights. Also textures and UVs are there. And yup, animation blending allowed, though Initially I don't need it much, yet though is a time saver, usually.

Once released, for sure I'll dig it.

Blender only seem to work with old version :

http://www.elysiun.com/forum/viewtopic.php?t=63778


I think is Blender 2.35, but surely works in one of my favourite versions: 2.37a.

Today's 2.41 is way better for animation, but I am afraid animation internals have changed a lot for it to be compatible.


No, wait. there IS a version patched for Blender 2.41. Just not in the oficial sites… check here :



http://blender.org/forum/viewtopic.php?t=7884&start=30



I have downloaded which I think is the latest in that thread… 2.41 compliant, it seems. I thought it could be of interest here.


I can understand people's interest…I'm digging the site and forum, and looks like is the only bones and weights format available for the lastest stable jme…

@kman Yes, this is really interesting. I know some people using Cal3D and we failed to find a compatible format to get the models in jME.

That would just be great- a proper skeletal animation system in jME! Last time I tried to use cal3d, however, it was quite cpu-heavy. But that might have been my fault, I didn't really dog into it that deep. And there is a cal3d plugin for blender!

If this works out, I can stop working on skelanim support for the blender to jme-xml exporter, concentrating on morph- and object animation, provided that xml support can be continued at all in jME. Mojos latest posts give me an uncomfortable feeling about that:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=2886.msg22949#msg22949

Yes I love MD5 too. But I have not such strong reason for that, just appeal 8) .



But, as I saw, Cal3D have an interesting subdivision of data that can be usefull if you have particular need or simply you want to optimize data loading and memory by reusing some data, like skeleton or animation.

I have both working at kmans and chaos I prefer chaos' loader for now, kman had fixed it and after a jme update I fixed it some myself.  the loader from chaos has a weird issue where translations on bones have flipped in that if your model physically moves forward in an animation the loader translates it right, still trying to pinpoint that but it work mostly I can send u both. give me your e-mail or a link to a stress free uploader and you can have it when I get home

Thanks I just sent you my email within a personal message.

Actually, I rather prefer the md5 exporter, in Blender…Imo, way less problematic…No to put down the other, of course.As anyways, those problems you mention are usual in bones and weights format. So, the rare thingie is I had simply no probs with md5. No need to bake, either. As far as I saw, it took well the spline interpolation, the curves interpolation info.



Kman was going to update md5 when some free time available :slight_smile:



I think we could be near to have a working md5 in our project, but I have very little time next 2 -3 days.



I'm all for md5. besides, gmax export is available for this format(and yup, also importers for Blender and Max).


Sorry but which version of jME do you use to develop this importer?



Maybe do you use jME CVS? Or 0.9 or 0.10? And LWJGL?

The version Kman provides at his website (http://gamedev.kproject.gr/index.php?n=Main.Cal3dj) works fine for me with latest cvs jME, using the additional libraries included with jME.

Thanks.



I finally runned the JmeCalTest application, provided in the source of kman Cal3D importer, with a model exported from Blender 2.41 (and the original exporter for Cal3D). I created the definition file as explained in the site.



I got many errors. At the end I discovered that the cause is that I have no submesh in my exported model and kman cal3d importer was not agree with this :smiley: .



So I commented this code inside the KCal3dLoader class …


//            for(Cal3dubMeshDef subMesh : data.meshes ){
//                CalCoreMesh coreMesh = CalLoader.loadCoreMesh(subMesh.mesh);
//                coreMesh.skin=subMesh.skin;
//                if(subMesh.material!=null && !subMesh.material.equals("")){
//                    CalCoreMaterial calmat = CalLoader.loadCoreMaterial(data.material);
//                    coreMesh.material=data.material;
//                    coreModel.addCoreMaterial(data.material,calmat);
//                }
//                coreModel.addCoreMesh(subMesh.mesh, coreMesh);
//            }



And I got this image.



Of course, there is always the same problem with the ZY axes orientation. Blender Z is upward (maybe I can correct this, I already done with OBJ format).

Than I uncommented the line to launch the animation stored in my exported model. Obviously I change the animation name with that I setted on my original scene that is "Walk", not "walk".

But the result was a littel wrong :D . No anim and the mesh messed. Look!



I know that there are bossible errors in the export script from Blender 2.41 and I know that there are various modified versions of that file all around there (soya version, some in a thread in blender.org ...).

What about your experience?

Any that have tested exporters from Blender 2.40 2.41?

I am testing the Cal3D code here using the latest soya exporter, and it works partially provided you follow the instructions from the soya website, esp. don't create your Armature or Bones in any other view than front view (NumPad 1). This means, of course, that you'll probably have to throw away almost all your armatures/animations you created without bearing this in mind.

There's t least one one more problem using blender-exported cal3d models, you'll have to "bake" your animation (create keyframes for every bone/frame) or it won't work properly. I PM'd KMan about this, maybe he can help, though it is probably be a problem with the exporter I use, because the Paladin Model from the cally demo works ok, with animation blending, even.

Cal3d is nice but the setup is really complicated that why I use md5 and the blender exporter for that work very well and there's also an importer check out doom3world.org

@hevee



Mmmmm. Strange situation.

Also it is a little hard to work with Armatures using only one viewport.



But this rule make me think about something:



  • When you create an object in Blender its local axes are oriented this way: Z looking through viewport, X looking right and Y looking up.

  • Numpad 1 is the key for Front viewport: is this the relation for the instructions from soya?

  • I cannot see any other reason for that...



Anyway now I have downloaded all the modified versions of blender2cal3d script and I will try all of them.

@mcbeth

I know the MD5Reader from chaosdeathfish and also that from kman. But any of them still work for me :'( .
chaosdeathfish version is great but it is compatible only with jME 0.8, maybe 0.9 but not CVS.

I have tried a fix yesterday, but not enough. I do not know enough inner deep behavior of jME so I have been able to run the test app under jME CVS and probably load the mesh (as displayed by SimpleGame stats: "mesh(2)"), but it does not display nothing (black background). Maybe something have been broken with lights, render states or shaders. But this is an argument that currently is still beyond my knowledge.

First of all, i would like to thank you all for your interest.

At the current time the main effort is given at fixing the cal3d loader and make it fully working.

The blender exporter is a key point in this effort, so any help and feedback is appreciated.

Md5 is not in the top of the priority list at this time but i don't plan to leave it behind, so expect news soon.