[GSoC 2008 - Accepted] OgreCollada

Threads related to Google Summer of Code
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Update

Post by nanocell »

My apologies! I completely forgot to post after I fixed the rotation issues on Friday. I did some major code cleanup in the OgreCollada/ColladaAnimation.cpp file (most, if not all, of the old code have been replaced and some improvements in the newer code).

The unnamed animation clips also didn't work quite correctly so I just fixed that as well.

The scene node animation doesn't yet take into account translated object pivots (note I'm using Maya terminology here). I still have to figure out exactly how to implement this but this, IMHO, is quite important.
And now the code is ready for me to get started on skeletal animation.

I'm just going to spend a little more time tonight to figure out the object pivots and then tomorrow I'm going to actually start with skeletal animation.

CheerZ,
Van Aarde.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

It's that time again...

Post by nanocell »

Okay, I have ironed out the bugs and issues with regards to the COLLADA transformations. I wanted to post a screenshot but decided I'll do all the avid followers one better. Here is a video clip with scene node animations in action!
http://video.google.com/videoplay?docid ... 3176&hl=en

So, what exactly was the problem with the COLLADA transformations? Oh dear...where to begin? When an object is exported from Maya it doesn't just export the final the world transformation for the node, it exports the whole transformation stack, i.e., transformation operations that needs to be concatenated in order to achieve the final node position. Here is an example of the transformations from a COLLADA document:

Code: Select all

<translate sid="translate">0 2 -5.32707</translate>
<translate sid="rotatePivot">0 0 5.3271</translate>
<rotate sid="rotateZ">0 0 1 0</rotate>
<rotate sid="rotateY">0 1 0 0</rotate>
<rotate sid="rotateX">1 0 0 0</rotate>
<translate sid="rotatePivotInverse">0 0 -5.3271</translate>
<translate sid="scalePivot">0 0 5.3271</translate>
<translate sid="scalePivotInverse">0 0 -5.3271</translate>
It is relatively easy (in retrospect) to achieve this when the node is static (not animated). But, any one of those tranformations can be animated. Consider that 'rotateZ' is animated. Each keyframe of the 'rotateZ' transformation has to be concatenated to the 'translate' and 'rotatePivot' transformations. If 'rotateY' is animated, each keyframe of 'rotateY' has to be concatenated to any previous keyframes if there are any, etc, etc. It is a bit difficult to explain but the point of the matter is that it can get pretty messy.

[skipping all the details of all the erronous trials]

The final implementation / solution to displaying the animated transforms were as follows:
For each transformation on the stack I would create a new scene node, i.e., there would a scene node for 'translate', another for 'rotatePivot', another for 'rotateZ', another for 'rotateY', etc. The first reason why I'm creating a new scene node for each transformation is that it is the only way that I could figure out to display the animations correctly without baking them out frame by frame. Secondly, it is much more practical to create an animation track for each transformation and copy the keyframe directly from the COLLADA document. This seems a bit over the top to have 5-9 scene nodes simply to achieve the correct animated transformations but considering each transformation on the stack can be animated this is the easiest approach. Note that this approach also make parenting of scene nodes much easier.

An additional optimisation pass can be implemented to bake the animated scene nodes to world positions and remove the elaborate transformation hierarchy. But then it's a tradeoff between size (many keyframes) and speed (elaborate scene node structures).

And that's about it for now. I have moved my experimental branch over to the trunk for everyone to play with. New additions to the trunk:
* My patched FCollada 3.05B to compile on a 64bit linux system. The patch also allows retrieving FCollada animation clips from animation curves (very important addition!!!)
* The Cg and Devil windows binaries are no longer in the trunk. I have moved them to the third-party directory.
*Working scene node animation!!!

Note that I develop on linux so there *might* be some issues on windows. If you have any bugs to report or whatnot, please make use of the wonderful bug tracker and discussion boards on sourceforge to avoid flooding this thread with minor issues.

I think that's about it! I hope that you enjoy the first phase of OgreCollada. Now it is really time for skeletal animation!!!

CheerZ,
Van Aarde.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
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 »

Nice work - that's the trouble with conversion projects, there are always multiple ways to potentially deal with something and you have to build in coping strategies for a bunch of techniques you have no direct control of, which is often more difficult than just creating a new technique from scratch. Glad you nailed it.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Post by nanocell »

Nice work - that's the trouble with conversion projects, there are always multiple ways to potentially deal with something and you have to build in coping strategies for a bunch of techniques you have no direct control of, which is often more difficult than just creating a new technique from scratch. Glad you nailed it.
Thanks for the support. It is much appreciated :D

I do need some help from anybody that has access to 3DSMax. I need an animation similar to the Door Animation (http://video.google.com/videoplay?docid ... 3176&hl=en) but exported to Collada from 3DSMax with ColladaMax 3.05b because I need to implement that as well. Remember to triangulate the meshes!

Thanks!!
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Post by stenyak »

(not sure if i should open a new thread or what, feel free to split this post to another thread)

I'm having some problems when trying to load several collada files.
1- As mentioned on the wiki, i'm trying by creating a different ImpExp* for each collada file i want in the scene. However, this makes Ogre crash. The ogre log doesn't say much: http://pastebin.com/m695dfbb
2- So then i try to use the same ImpExp* for all collada files, but it also crashes. This is the log: http://pastebin.com/d13f906c2

Please note that the 2 collada files have different contents (i'm not trying to load the same file twice).

How should i do it? Thanks a lot!

Discussion moved to here: http://sourceforge.net/forum/message.php?msg_id=5081298
Last edited by stenyak on Tue Jul 08, 2008 11:13 am, edited 2 times in total.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Post by nanocell »

Hi Stenyak,
(not sure if i should open a new thread or what, feel free to split this post to another thread)
I would prefer issues like these to be discussed in the Open Discussions on the OgreCollada sourceforge page:
http://sourceforge.net/projects/ogrecollada
Unless we get a forum here on Ogre then we can always take it there. I don't how all the other folks feel about. Feel free to comment :).

As for your problem. I don't think there is anything wrong with your COLLADA loading techniques. OgreCollada does experience a crash, most likely the one you are experiencing, but I have not bothered to find it. I have had more pressing matters up till now. Maybe it's time to look for it. I'll post here if/when I found it.

CheerZ,
Van Aarde.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Post by stenyak »

User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Post by nanocell »

I may have found a fix for the issue and have uploaded it to the trunk. But this discussion and its future developments can be found here: http://sourceforge.net/forum/message.php?msg_id=5081298
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Scene node naming

Post by nanocell »

We're having an interesting discussion on when and how to name scene nodes before loading it into Ogre: http://sourceforge.net/forum/forum.php? ... _id=817249

It would be good if all you other OgreCollada followers could post on how you would like to handle naming your scene nodes.

I know it's not strictly within my OgreCollada GSoC scope, but if OgreCollada is not useful it's useless ;). So I would like to hear all your "How I want to use OgreCollada" comments.

CheerZ,
Van Aarde.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Skeletal Animation Update

Post by nanocell »

Ok, time to give an update on the skeletal animation...now that I know what is working and what is not.

I have basically completed the loading of skeletal animation clips into ogre (both named and unnamed). But before you all throw a party...there is a snag. I'm just going to give you what took me about a few days to figure out.

The skeletal animation that is loaded is local space animation for bones that is *not* binded to a mesh. So, technically the skeletal animation works. But when the skeleton is bound to mesh, things change a bit. The bones are given a Bind Pose and the Ogre keyframes are now interpreted as delta frames relative to the "bind pose" of the bones. So now the Inverse Bind Pose has to be applied to the existing skeletal animations of the skeleton bound to the mesh.

At the moment OgreCollada loads the skeleton and all the animation tracks for the bones. Later on when OgreCollada processes a COLLADA Controller (the thing that binds a skeleton to a mesh) then I can get access to the bind poses of the bones. But then this requires the 'back patching' of the Inverse Bind Poses. To complicate it even more is the transformation stack...aarg...

Anyways. I just wanted to let you everyone know that I *think* I have figured out how to correctly implement an 'alpha' draft of skeletal animation.

CheerZ!
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Finally

Post by nanocell »

And finally, after hours of blood, sweat and tears I have managed to load skeletal animation. Have quick peek:

http://video.google.com/videoplay?docid ... 6470&hl=en

(I accidently deleted the door animation...long story). I'll upload it again tonight.

The skeletal animation loading still has a few bugs, for instance when loading a named animation clip it works but when loaded a COLLADA doc that contains only an unnamed clip, it breaks.
Also, I still need to implement matrix transforms (exported by Max) but it shouldn't be too much of a hassle. I'll be working on this next and then I'll tackle the named/unnamed bug.

Thank you for watching and tune in next time for more exciting adventures! ;)

CheerZ,
Van Aarde.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

Awesome, great work!
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Post by stenyak »

Nice, thanks for your work!
ben81
Gnoblar
Posts: 12
Joined: Sat Jun 21, 2008 9:38 am

Post by ben81 »

Hello,
As a Softimage XSI user, I would like to know the current status of OgreCollada:
- what does it actually support : light, camera, animation (scale/translation/rotate), hierachy, pivot, multiple UV, materials, morph animation?
- about bones : does it support multiple bones chains for characters?
- about shaders : does it handle Collada FX shaders?
- about XSI : can it import XSI's Collada?
I'm just not very good at programming, so before making tests I would appreciate to know the status since there haven't been new posts for a few weeks.
Collada is very interesting in terms of workflow, so it would be very sad if this project was put on hold (like the GSOC 2006 Ogre viewer in XSI).
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Post by nanocell »

True, it has been a while since I have posted anything here...too long, in fact. But don't despair! I have spent my quiet time working and writing a manual and preparing a release for v0.1a of OgreCollada with lots of help from kex. Thanks kex!!

The source release is available for download from the sourceforge download page. For any further discussion / questions / problems / reading material, please use the wiki and forums at http://ogrecollada.sf.net. (I'll use the forum there for announcements and future development discussions). The wiki is not completely up to date, so refer to the manual for the latest info regarding v0.1a.

During this GSoC I have focused solely on animation (skeletal and scene node animation) and there are many known bugs that, sadly, crept in with materials and skinned meshes. See the manual for a more complete list of known bugs.

Some highlights in the release of v0.1a (Note that these features have only been tested for COLLADA files exported from Maya but should work with Max aswell. XSI have not been tested)
* Camera animation, light animation, scene node animation (scale, translation, rotation), hierarchy and pivot animation. (No morph animation has been implemented, yet)
* Bones: I debugged and tested as best I could using Maya but was unable to iron out all the bugs. Although skeletal animation works for normal test cases (that I could create), more advanced test cases like 3DSMax's biped controllers breaks.

I can't really comment on the shaders / materials status of the project as I didn't implement that part. This is Xavier's baby. It's a long story and I am not nearly knowledgeable enough with the materials / shaders implementation to make definitive comments.

Having said all that: There is a windows binary version of the ColladaViewer (32bit at the time of writing. I'll be creating a 64bit version today/tomorrow) that you can use to load COLLADA documents. There are some samples included in the download that I have used for testing.

So QuickLinks:
Sourceforge download page: www.sf.net/projects/ogrecollada
OgreCollada home: http://ogrecollada.sf.net

Future plans, in the next post.
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
nanocell
Google Summer of Code Student
Google Summer of Code Student
Posts: 37
Joined: Wed Oct 25, 2006 6:03 pm
Location: Stellenbosch, South Africa.
Contact:

Post by nanocell »

Future plans for OgreCollada.

A few things have happened during the GSoC term regarding FCollada, the ColladaMaya and ColladaMax exporters as well as the release of a new COLLADA-DOM API.

If I knew what I know now then I would most likely have opted to start the OgreCollada project from scratch will COLLADA-DOM (the new API looks more promising that its predecessor).

BUT! Having worked exclusively with COLLADA's animation gave me opportunity to learn how to load it into Ogre, which is not as easy as it may sound. There were so many issues that I would never even think of. So it was a valuable learning experience.

Now, what is going to happen with OgreCollada.
First and foremost:
OgreCollada is going to be rewritten using the COLLADA-DOM API v2.1. For the time being I will generate the DOM API with the COLLADA 1.4.1 schema. When the DOM API works with the COLLADA 1.5 schema, I'll switch over to that.

ColladaViewer will be written using GTKmm and I'll attempt to design it better (in both the source code and the GUI).

I have already started experimenting with GTKmm and laying out the bare bones for OgreCollada. Let's hope it goes easier this time around :).
A programmer is someone who solves a problem that you didn't know you had, in a way that you don't understand.
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Post by stenyak »

nanocell wrote:Now, what is going to happen with OgreCollada.
First and foremost:
OgreCollada is going to be rewritten using the COLLADA-DOM API v2.1. For the time being I will generate the DOM API with the COLLADA 1.4.1 schema. When the DOM API works with the COLLADA 1.5 schema, I'll switch over to that.
Yay, hurra! That way i'll be able to share the collada document between bullet and ogre, without having to reparse :-D

Thanks a lot for your work!
radman
Gnoblar
Posts: 6
Joined: Tue Jan 06, 2009 2:30 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by radman »

Hello nanocell:

How is the re-write using the Collada DOM progressing?

Thanx for the good work creating this valuable Ogre add-on.
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:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by sinbad »

They actually have their own forum now: http://ogrecollada.crazycoder.co.za/forum/
radman
Gnoblar
Posts: 6
Joined: Tue Jan 06, 2009 2:30 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by radman »

Thanx Sinbad. I will post a message there. BTW, do you know of any code to import FBX files into Ogre directly, without going through Max or Maya?
kaolite
Halfling
Posts: 78
Joined: Fri Feb 06, 2009 7:04 pm

Re: [GSoC 2008 - Accepted] OgreCollada

Post by kaolite »

it seems that OgreCollada is dead .... http://ogrecollada.crazycoder.co.za/for ... p?f=3&t=29
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

Understandable. Real life always take precedence.
Fortunately, it's on a git repository. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
kex
Google Summer of Code Mentor
Google Summer of Code Mentor
Posts: 49
Joined: Thu May 24, 2007 8:57 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by kex »

Status of OgreCOLLADA
******************************
The code in svn trunk is the one from last year's GSoC. It is mainly written by xavier; nanocell added basic Skeletal Animation support. It uses FCOLLADA to parse files. That lib is not maintained anymore and has some drawbacks, like big memory consumption or no support for <library_nodes> (required e.g. to read files written by sketchup).

In the OgreCOLLADA private dev forum has been a small team (nanocell, radman, me) discussing further steps. We decided to switch to OpenCOLLADA mainly because it uses a SAX approach and thus needs by far less memory.

There is a branch in OgreCOLLADA svn (branches/v0-2) but that contains merely premake based buildscripts. The git repo is based on that and contains very basic geometry support (just triangles, no normals, no materials).

OpenCOLLADA contains a subprojet called dae2ogre. It is similar to OgreCOLLADA (branch/git) but has some differences. As OGRE has currently no scene graph file format dae2ogre merges all geometries into one mesh. That way the whole COLLADA scene can be viewed in stock OGRE. OgreCOLLADA (branch/git) has not decided what to do with the scene graph. Options are an OGRE plugin, write a dot scene file or wait for an OGRE specific scene format. OgreCOLLADA (trunk) is (kind of) an OGRE plugin and does everything at runtime (-> not required to write a scene, geometry conversion cannot be done offline). dae2ogre supports normals and basic materials (no textures, no shaders). dae2ogre is a commandline tool only, while OgreCOLLADA contains a viewer (trunk: wxwidgets based, branch/git: qt based).

Textures, shaders and animations are currently supported in OgreCOLLADA (trunk) only.

I would be happy to help if somebody wants to contibute to an OpenCOLLADA based OGRE converter.

I'm posting this in both the OGRE and OgreCOLLADA forums.
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:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by sinbad »

Regarding scene formats, I think it's best to allow a pluggable approach to this, with an example dotscene implementation. I will probably create 'a' scene format for entity instancse as part of the paging component later on, but it won't be 'the' scene format because not everyone wants to use the paging component, some like dotscene, some have their own formats.

FYI, the Open File Formats Technology Working Group (OFF.TWG), which is concentrating on virtual worlds for education and other purposes, specifically with regards to data exchange, are probably going to choose COLLADA & Ogre and are creating a conditioning system which has an Ogre output pipeline. This is because realXtend (one of the group) uses Ogre and other members of the group I think are considering whether to use it too. They're still in the prototyping / evaluation phase but assuming they finalise this, for obvious reasons they will afterwards have a big commitment to a long-term COLLADA/Ogre pipeline so it would make sense to hook up with them, exchange ideas and investigate collaboration opportunities.
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

Hi All,

Is this project alive? From the three COLLADA supported plugins/addons that I tried, this one seemed
to be the most up-to-date of the three, the plugin/addon I tried were:

- colladaplugin from the addons repository on SourceForge.
- colladaplugin2 from the addons repository on SourceForge
- and this one, i.e. ogrecollada

When I tested the three plugins, they all had various issues with the latest Ogre version. In fact
the two colladaplugins have severe compatibility issues. I could not solve them without doing a
detailed study of COLLADA-DOM and other supporting libraries, everything that was used to build them
has moved on making it difficult now to pin-point exactly where to fix.

With OgreCollada, however, I was motivated since it had a viewer and some sample COLLADA examples,
so I wanted to make it work and spent considerable time doing so. I am happy to report that I was
successful and have created a patch that has been tested against the latest Ogre subversion version
(9247 at the moment) and using the latest Visual Studio version (VS 2008). The patch updates the
premake files too, creating the Visual Studio project files automatically. It follows the same
principles as the other premake files. Incidentally premake also has moved to version 4, but I did
not update the current premake scripts, they are at still at premake 3.6 at the moment.

I tested the patch on Linux (Ubuntu 9.04) and Windows Vista. The code compiles cleanly on Windows
Vista using VS 2008, however, there are issues left to iron out on Linux. Another point to note is
that only the COLLADA examples that come with ogrecollada are loading and animating properly. Other
COLLADA exports, like those from Blender, whether the default Blender cube or Suzanne, does not load
correctly with this version of OgreCollada, so obviously more work needs to be done here.

When testing my code on Linux and Windows, I had to make changes to the FCollada library too. Since
Feeling Collada has effectively shutdown development for the open source version of FCollada, I wonder how
do these changes would be sent upstream to other FCollada aware projects?

More work obviously needs to be done, and very likely my patch would need to be reviewed by some
knowledgeable folks, but I did not to know who to send the patch to, ideally I would like to send it
to the ogrecollada developers, but there has not been activity on the project for some time, and
their forum has been taken over by spam, which is why I have not posted this message there. I
decided to ask here first.

Another reason for posting here first was to know if there is interest in this project I hope this
project is alive because it seems like a good idea to keep working on it till we get COLLADA
compliance. Please respond to this thread, as I do not have a SourceForge account, I am new to the
OGRE forums and I had trouble finding the right thread to post this message to, etc.

Thanks,

Mark (typist) Fernandes.
Post Reply