Blender Collada2POD Bone Animations

Hi all,





I’m just starting try to figure out a tool chain for my iPhone development projects. It needs to support textured meshes with bone animations.





In two days I was able to learn enough Blender to create a skinned and boned character model, export it to Collada, use the Collada2POD utility on that file, convert my textures from PNG to PVR, then open the POD in PVRShaman and replace the .PNG file references with the .PVR files.





All of this works and I have a textured model showing on my iPhone, nice and easy.





However, I’m trying to get animations to work and I’m new to creating animations on the editor side, and using the PVRT SDK to display animations on the programming side. Here is what I have so far:





1) In Blender 2.49b, I enter the Pose mode and rotate the bones until I get a pose I like then select the skeleton, press ‘I’ to store as a key frame with Location and Rotation data. I then move the timeline to a new frame, rinse and repeat. The animation looks great and I can even render to an AVI file and show a video of my company’s character head-banging.





2) now that I have animation data, I export to Collada format then try to run Collada2POD-- it gives a warning "WARNING: An unsupported interpolation type for animations has been found. Collada2POD only


supports: Step and Linear."





POD info says there are 168 frames but pressing the PLAY button in the viewer itterates the slider bar but the model seems static.





Looking at the .dae COLLADA file, sure enough theres a bunch of “BEZIER BEZIER BEZIER” stuff going on.





I cant figure out how I would tell Blender to interpolate LINEARLY so I look into the BLENDER->COLLADA export script and hack it to force “LINEAR” as the output (hoping the rest of the data doesn’t have to change and i’ll only have a minor descrepency in animation if my key frames are set at regular intervals).





The warning goes away in COLLADA2POD but now POD Info in PODShaman lists only 6 frames, and pressing PLAY still shows a static model.





My results on the code side match up with PODShaman: the same number of frames is present, but using setFrame does not deform the mesh in any way. Furthermore, mesh.sBoneWeight.pData is NIL which suggests that no bone data is actually present in the SPODMesh even though I can see the names of the bones present when I open the file in a hex editor.





Therefore, I have the following questions—





So first of all: is there something I can do to modify the BLENDER->COLLADA script to properly output the interpolation data so everything is happy.





Or failing that, is there any reason POD files created from COLLADA2Pod cant support bone animation?





And finally, it seems that there is only support for one animation per POD file. Does this basically mean I have to string a series of different animations into one long animation and manipulate the start and end frames to get the behavior of several different character animations? (ie: kick, punch, die animations)





Thank you for your time,


-Paul Zirkle


keless2009-11-04 23:17:04

Update: I was able to figure out how to use Linear Interpolation format for my “IPOs” in Blender (it involves selecting IPO channels after they’re made and switching from the default Bezier to Linear… for each action, this becomes tedious for complicated animations!!)





However, the results are exactly the same as if I’d hacked the exporter to LINEAR in the first place (yes I did remember to revert to a clean version of the exporter first). IE: PODShaman shows 6 frames and PLAY button results in a the slide bar moving but the mesh looks static.





So I think the problem is not on the Blender->Collada side of the tool chain, but on the Collada->Pod side of things.

Update for the benefit of anyone trying to do the same thing:





I downloaded Blender 2.5 beta test which seems to have GSoC Collada export code built into the current executable-- it exports in Collada 1.4.1 format (and seems to have a problem where the library_animations tag is empty).





I can load these files into PVRShaman (after Collada2POD) and now they CORRECTLY show Bone Batches in the POD Info window (previously these were always ZERO for all meshes, even if Animation frames was greater than zero).





However, Collada2POD gives a warning “WARNING: Rescaling the bone weights.” and PVRShaman does not properly display the model. Loading one of these models on the iPhone showed that the mesh WAS being deformed by bones, however the bone positions were all sorts of messed up causing the mesh to look like a melted plastic GI Joe. Also the animation frames was 3 (instead of the 150 I set in Blender… but since library_animation was empty in the .DAE I wasn’t expecting the animation to show correctly anyway).





The difference in .DAE format that seems to help is the “library_controllers” tag which is present in the Blender 2.5 exports but no in the Blender 2.49 exports.





Exactly what version(s) of Collada does Collada2POD support?





I’m still working on this.keless2009-11-13 00:29:45


Hi,<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />


 


Quote:

Or failing that, is there any reason POD files created from COLLADA2Pod _cant_ support bone animation?



 


Unfortunately as mentioned in the user manual there is a known problem with exporting skinned animations and Collada2POD. The cause of this is still currently unknown but as you have seen in quite a lot of circumstances the mesh will end up looking "like a melted plastic GI Joe". I'm always looking for more examples of Collada files that contain skinned animations so if possible could you send your Collada file to devtech@imgtec.org so I can use it for future investigation.


 


Quote:

Exactly what version(s) of Collada does Collada2POD support?



 


Collada2POD supports the 1.4.1 Collada specification. I've realised this information is missing from the user manual and I'll get this added for our next SDK release.


 


Quote:

And finally, it seems that there is only support for one animation per POD file. Does this basically mean I have to string a series of different animations into one long animation and manipulate the start and end frames to get the behavior of several different character animations? (ie: kick, punch, die animations)



 


This would certainly be one way to do it. In this case you would probably need to store each character in its own .pod file as another limitation to the POD format is that each object must have the same number of frames. Another approach though I haven't tried it myself and is purely theoretical is you could export the different animations to separate .pod files (unticking the 'export geometry' option so you don't duplicate the mesh data) and just get the appropriate transformations in your app.









 

Thanks,



 

Scott
Scott2009-11-16 11:07:07

Hi,

I have come from the future…

When I export the animated model out of Blender to .dae then convert it

to POD I get a “warning: rescaling the bone weights.”. When PVRShaman

loads up the model its animated and the vertices are shown but the

transformations are completely wrong. Even with only two bones covering the

vertices of the body so I could move one joint the transformations remained broken. I have heard

people praising POD for working well and heard rumour that Blenders .dae

converter is incomplete. So is this issue not a problem with POD or is POD a dead or limited operation? I have seen animated bones on the iPhone and I know that there are things like Unity that have the power, but being poor I was rather hoping POD had a solution.





Is there a different standardised mesh SDK that

is all the rage for the job on the iOS which works with Blender? Can I assume that Blender to dae is the problem in the present?

Are there any rules to prevent this issue, is it a matter of mesh complexity? My skeleton is at 300verts.

Please tell me someone has a work around :confused:

EnlightenedOne



EnlightenedOne wrote:

When I export the animated model out of Blender to .dae then convert it to POD .............. PVRShaman loads up the model its animated and the vertices are shown but the transformations are completely wrong.

 

This sounds like the known issue with Collada2POD not converting collada files with skinning correctly. This is an issue we're aiming to fix in our 2.9 release which will be available in the future.

 

EnlightenedOne wrote:

Please tell me someone has a work around :/

There is unfortunately no known work around apart from cutting out the middle man and using our Blender .pod exporter.