CAL3D to Ogre converter v0.8.2

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

CAL3D to Ogre converter v0.8.2

Post by Lord LoriK »

Grab it from ogreaddons/cal3d2ogre.

Features:
* converts geometry, skeletons, animations and materials from binary and XML CAL3D files (cmf, csf, caf, crf, xmf, xsf, xaf, xrf)
* parses CAL3D config files (cfg)
* outputs binary or XML files
* keeps UV mapping
* converts normals
* option to keep +Z axis as up (default behavior swaps Y and Z axes, so +Y is up)
* manual scaling factor for the resulting mesh
* selectable triangle winding for output
* converts LODs

TODO:
* process spring data. I'd really love to hear ideas on this, because I have none
* write better documentation
* a bit of code cleaning

Suggestions and contributions are welcome, of course.

Disclaimer: no Linux/Mac makefiles. I think the code compiles as is on both, but haven't tested. Only a VS8 solution is included. The source borrows from OgreXMLConverter and includes files from it. Future releases might not. My code is released under the ZLib license.

Usage: just run the program from the command line followed by the file names of the mesh, the skeleton, and animations. To produce binary output files, add the -b switch before the file names. For additional help, run the program without arguments.

Refer to the included readme file for additional information.
Last edited by Lord LoriK on Sun Feb 24, 2008 5:14 pm, edited 3 times in total.
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

Sorry if I bump my own thread, but I'd really like to know if somebody found this remotely useful at least. Beside that, I haven't done the spring conversion, so I'm hoping somebody gives me an idea to do it.

Comments welcome.
User avatar
Azatoth
Gnome
Posts: 327
Joined: Sat Jul 10, 2004 6:46 pm
Location: Sweden
x 4
Contact:

Post by Azatoth »

I haven't seen this before, I'll certainly take it for a test since Worldforge contains quite a lot of CAL3D files (as CAL3D started out as a Worldforge project and all).
Ember, GPL virtual world client.
Development blog
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

If people find it useful and you want a more permanent home for it, we can find a spot in ogreaddons, drop me an email if you want to take it up.
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

That's what I'm trying to find out, sinbad. I won't bother you to add my stuff to ogreaddons just to clutter the server with something nobody uses, but as Azatoth implied, many users could benefit from this when looking for models to use in their projects. After all, that was my motivation to write this in the first place...
User avatar
SiENcE
Goblin
Posts: 231
Joined: Thu May 11, 2006 3:07 pm
Location: Berlin
Contact:

Post by SiENcE »

I want to take a look into it, because i really like Cal3D possibilities.

My time is limited, but if you can support it for a while i like to see it in Ogre Addons.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Provided it works I think it's a useful addon, even if only a few people use it, it's served a purpose.
Whystler
Gnoblar
Posts: 5
Joined: Fri Feb 29, 2008 5:20 am

Post by Whystler »

This tool is exactly what I need! I can't wait to try it! I need to convert to ogre format for use in the Blink3D platform. I have geometry, material, skeleton and animation files all in cal3d format (xmf, xrf, xsf, and xaf respectively).

The only problem is getting the tool. I'm not quite sure I understand how to get the program.

It seems I need to get into some kind of repository (please forgive me for my ignorance!) using cygwin. I tried this, because for some reason I have cygwin on my computer but never used it. I typed in the commands as dictated by the ogre wiki, and alas I was faced with a "do not understand this command".

Your help would be very very appreciated.

-Whystler
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You will probably find it easier to use TortoiseCVS.
Whystler
Gnoblar
Posts: 5
Joined: Fri Feb 29, 2008 5:20 am

Post by Whystler »

By people who know where my experience is and isn't , I've been told to ask for a binary version of this tool. Is there one?

Thanks for the TortoiseCVS link. I'll check it out.

-Whystler
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

Whystler wrote:By people who know where my experience is and isn't , I've been told to ask for a binary version of this tool. Is there one?

Thanks for the TortoiseCVS link. I'll check it out.

-Whystler
I could make one available if you *really* need it, but remember: Windows only, compiled with VC++ 2005 SP1 (you would need to get the needed libraries) and with Ogre::Real typedef'd to double, not float. (so I would have to send you the version of ogremain.dll that I'm using) I'll do it tomorow because it 1:58 am here and I *need* some sleep badly.

Edit: here it is. Remeber no much testing has gone into this, so if you find a bug, report it in this thread.

http://rapidshare.de/files/38715320/cal ... 2.zip.html
xrenmilay
Gnoblar
Posts: 7
Joined: Tue Jun 08, 2004 2:10 am
Location: Seattle Washington
Contact:

Post by xrenmilay »

the latest build seemed to work okay. Problems with paladin having inverted faces when the conversion occurred. The inverted faces were seen in lexiviewer. However when the skeleton was converted it worked out fine. I used cygwin and plopped the build (exe and dll) in to urs/local/bin so that cygwin could find the files. Other way you can create a bin dir in you home directory and plop all the files there. Then you have to append to your $PATH variable.

It would be nice to have the converter read the cfg file and convert everything in that cfg file by traversing through it and convert them for you.

Hope this feedback helps
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

xrenmilay wrote:the latest build seemed to work okay.
Glad to hear that!
xrenmilay wrote:Problems with paladin having inverted faces when the conversion occurred. The inverted faces were seen in lexiviewer.

That's what "invert triangle winding" fixes, precisely. Did you try that?
xrenmilay wrote:It would be nice to have the converter read the cfg file and convert everything in that cfg file by traversing through it and convert them for you.
It does. If you provide the name of the cfg file, it converts all the files in it. Or at least it should. I rushed to make a cleaner distribution before uploading it to the CVS, so I might have slipped in a new bug, but AFAIK, it worked fine.
xrenmilay wrote:Hope this feedback helps
Thanks, it's good to know somebody actually used this... If you test these two things, let me know the results. Good luck!
samhodge
Gnoblar
Posts: 4
Joined: Thu Jul 17, 2008 4:47 am

Linux Make files for an artist?

Post by samhodge »

Hey Guys

I have a heap of animation files from an abandoned game that are in cal3d format

I would like to convert them to OGRE so i can play in python with them

Im not familar enough with Makefile to be able to get this to compile on linux.

I guess I can try harder or you can throw me a bone

Sam
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Re: Linux Make files for an artist?

Post by Lord LoriK »

samhodge wrote:Hey Guys

I have a heap of animation files from an abandoned game that are in cal3d format

I would like to convert them to OGRE so i can play in python with them

Im not familar enough with Makefile to be able to get this to compile on linux.

I guess I can try harder or you can throw me a bone

Sam
I'm sorry, but I have no Linux working environment for development, and nobody contributed a makefile yet. In fact, I don't even know if this compiles in Linux. (it should, but who knows)

All I can do is wish you luck, but please, if you manage to compile it, send me the instructions or the makefile. I'll add it ASAP.
samhodge
Gnoblar
Posts: 4
Joined: Thu Jul 17, 2008 4:47 am

It compiles

Post by samhodge »

OGRE_PATH = /usr/include/OGRE/

CAL3D2OGRE_PATH = /media/ogre/cal3d2ogre

TINYXML_USE_STL := NO



tinyxmlparser.o: tinyxmlparser.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o tinyxmlparser.o tinyxmlparser.cpp



tinyxmlerror.o: tinyxmlerror.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o tinyxmlerror.o tinyxmlerror.cpp



tinyxml.o: tinyxml.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o tinyxml.o tinyxml.cpp



tinystr.o: tinystr.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o tinystr.o tinystr.cpp



OgreXMLSkeletonSerializer.o: OgreXMLSkeletonSerializer.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o OgreXMLSkeletonSerializer.o OgreXMLSkeletonSerializer.cpp



OgreXMLMeshSerializer.o: OgreXMLMeshSerializer.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o OgreXMLMeshSerializer.o OgreXMLMeshSerializer.cpp



CAL3DParser.o: CAL3DParser.cpp

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -c -DTIXML_USE_STL -o CAL3DParser.o CAL3DParser.cpp



main.o: main.cpp

g++ -I${OGRE_PATH} -I${CAL3D2OGRE_PATH}/include -c -DTIXML_USE_STL -o main.o main.cpp



all: main.o CAL3DParser.o OgreXMLMeshSerializer.o OgreXMLSkeletonSerializer.o tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o

g++ -I${CAL3D2OGRE_PATH}/include -I${OGRE_PATH} -DTIXML_USE_STL -L/usr/lib -lOgreMain -lboost_thread -lboost_thread-mt -o cal3d2ogre main.o CAL3DParser.o OgreXMLMeshSeriali

zer.o OgreXMLSkeletonSerializer.o tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o



clean:

rm *.o
samhodge
Gnoblar
Posts: 4
Joined: Thu Jul 17, 2008 4:47 am

pasted above is the makefile

Post by samhodge »

but when I try to give it a cal3d .cfg file it segfaults, so maybe it still needs a little more work

it seems to be heavily linked against boost
samhodge
Gnoblar
Posts: 4
Joined: Thu Jul 17, 2008 4:47 am

how embarassing

Post by samhodge »

after I RTFM about how autotools is meant to work its all quite simple


adding the following files

$(cal3d2ogre)/bootstrap

Code: Select all

#!/bin/sh

rm -rf autom4te.cache

libtoolize --force --copy && \

aclocal && \

autoheader && \

automake --add-missing --force-missing --copy --foreign && \

autoconf

$(cal3d2ogre)/configure.ac

Code: Select all

AC_INIT(configure.ac)

AM_INIT_AUTOMAKE(cal3d2ogre, 0.82)

AM_CONFIG_HEADER(config.h)



AC_LANG_CPLUSPLUS

AC_PROG_CXX

AM_PROG_LIBTOOL



PKG_CHECK_MODULES(OGRE, [OGRE >= 1.2])

AC_SUBST(OGRE_CFLAGS)

AC_SUBST(OGRE_LIBS)



AC_CONFIG_FILES(Makefile src/Makefile include/Makefile)

AC_OUTPUT
$(cal3d2ogre)/include/Makefile.am

Code: Select all

noinst_HEADERS=CAL3DParser.h OgreXMLMeshSerializer.h OgreXMLPrerequisites.h OgreXMLSkeletonSerializer.h tinystr.h tinyxml.h

$(cal3d2ogre)/src/Makefile.am

Code: Select all

bin_PROGRAMS= cal3d2ogre

cal3d2ogre_CPPFLAGS=-I$(top_srcdir)/include -DTIXML_USE_STL

cal3d2ogre_SOURCES= CAL3DParser.cpp OgreXMLMeshSerializer.cpp  OgreXMLSkeletonSerializer.cpp  tinystr.cpp  tinyxml.cpp  tinyxmlerror.cpp  tinyxmlparser.cpp main.cpp

cal3d2ogre_CXXFLAGS=$(OGRE_CFLAGS)

cal3d2ogre_LDADD= $(OGRE_LIBS)

Then in the root dir type

Code: Select all

chmod +x bootstrap
./bootstrap
./configure
make
cd src
cal3d2ogre
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

Will do as soon as I can. Thank you very much for that.

Edit: sorry if I took this long to answer, but I have been incredibly busy with my two jobs and didn't check the forums for the last whole week. Now things are getting normal again, and I hope to have time for my projects.
Lord LoriK
Goblin
Posts: 254
Joined: Tue Feb 13, 2007 5:33 am

Post by Lord LoriK »

Linux makefiles commited. Thanks to samhodge for the contribution.

Still taking suggestions about the spring system and, of course, bug reports/patches.
MLegacy
Gnoblar
Posts: 10
Joined: Tue Feb 18, 2014 3:56 pm
Location: Montreal

Re: CAL3D to Ogre converter v0.8.2

Post by MLegacy »

Is there a link for download?
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: CAL3D to Ogre converter v0.8.2

Post by c6burns »

It's still there in the addons repo, though I haven't used it and can't say if it works with newer versions of Ogre:
https://svn.code.sf.net/p/ogreaddons/code/trunk
MLegacy
Gnoblar
Posts: 10
Joined: Tue Feb 18, 2014 3:56 pm
Location: Montreal

Re: CAL3D to Ogre converter v0.8.2

Post by MLegacy »

Thank you very much
MLegacy
Gnoblar
Posts: 10
Joined: Tue Feb 18, 2014 3:56 pm
Location: Montreal

Re: CAL3D to Ogre converter v0.8.2

Post by MLegacy »

Hello, Sorry for posting again but im having problems with CAL3D to Ogre converter v0.8.2 I don't know how to where to begin to setting it up as i new to the C++ world. Not even sure if it still works but its the only thing so far that says it can convert Mesh files which ive been looking for. Is it a script? Would anyone happen to have a working copy or could possible share with setting it up? Thanks
MeisterEder
Gnoblar
Posts: 2
Joined: Sun Mar 04, 2018 7:57 pm

Re: CAL3D to Ogre converter v0.8.2

Post by MeisterEder »

Sorry for reviving this dead post. We're in deep trouble.

We have deep trouble with cal3D. We need to find a way to import it into Unity. The best possibility we found until now is cal3D2ogre. The idea would be to import it into Ogre, export it into a format which either Unity can already read or for example blender and then to Unity. The problem is, the addon doesn't seem to be in the addon repo anymore. I really hope someone can help us, thanks for reading and kind regards!
Post Reply