Zaggy1024 Posted April 17, 2011 Report Share Posted April 17, 2011 Well, thats more than most of us have done. All the best with it Yesterday, I managed to export your lion blend to the game (after a few hours of bug-fixing). I think I have it all figured out (assuming the rig doesn't already exist for an animal, in which case it might be necessary to re-rig it), so I might write a tutorial for exporting (once I've checked that the method works most or all the time...).~Zaggy1024 Quote Link to comment Share on other sites More sharing options...
Pureon Posted April 17, 2011 Report Share Posted April 17, 2011 Hi Zaggy. Do you have the svn (latest) version of 0AD installed? (If you don't know what that is see here: http://trac.wildfiregames.com/wiki/BuildInstructions)If you do have the svn version, take a look at the Iberian siege ram - I committed some Blender animations for it yesterday. I also animated some ships yesterday but am unable to make them work without crashing the game first. Oh joy (assuming the rig doesn't already exist for an animal, in which case it might be necessary to re-rig it)In the 0AD directory take a look at this file: binaries\data\mods\public\art\skeletons\skeletons.xml - it shows the bone names and hierarchy of existing skeletons. Quote Link to comment Share on other sites More sharing options...
Zaggy1024 Posted April 17, 2011 Report Share Posted April 17, 2011 (edited) Do you have the svn (latest) version of 0AD installed? (If you don't know what that is see here: http://trac.wildfire...ildInstructions)I don't have the latest revision, but I do have the latest autobuild (I decided to use the dev build ppa).If you do have the svn version, take a look at the Iberian siege ram - I committed some Blender animations for it yesterday. I also animated some ships yesterday but am unable to make them work without crashing the game first. Oh joy If you mean that you made Collada files and put them in the game, it might be preferable for me to have the actual blends for the animations, since it takes a lot of tweaking of that and the game files to get it working in the game.In the 0AD directory take a look at this file: binaries\data\mods\public\art\skeletons\skeletons.xml - it shows the bone names and hierarchy of existing skeletons.I know about that file, since I had to play around with it a bunch to get the lion in the game.Edit:When I exported a third idle animation for the lion, it showed up in the game with the head and body spinning in a circle every few seconds (seemingly when one of the bones crosses the Y axis, negative or positive), so something'll have to be done about that... and since I don't know C++, I'll leave it to someone who does to try and fix it. Here is the set of animations I had done yesterday, which includes at least two broken animations (since then, I've animated two or three more, all of which didn't import into the game correctly...).~Zaggy1024 Edited April 18, 2011 by Zaggy1024 Quote Link to comment Share on other sites More sharing options...
Pureon Posted April 22, 2011 Report Share Posted April 22, 2011 Edit:When I exported a third idle animation for the lion, it showed up in the game with the head and body spinning in a circle every few seconds (seemingly when one of the bones crosses the Y axis, negative or positive), so something'll have to be done about that... and since I don't know C++, I'll leave it to someone who does to try and fix it. Here is the set of animations I had done yesterday, which includes at least two broken animations (since then, I've animated two or three more, all of which didn't import into the game correctly...).Unfortunately I've experienced similar bugs and difficulties with importing. In the Iberian siege ram's animation the wheels spin backwards after spinning forwards - which is a bug with the way 0AD converts the Collada files. I'd like to know if the same bug also affects 3DS Max Collada animations - in theory it should. Quote Link to comment Share on other sites More sharing options...
Almin Posted April 26, 2011 Report Share Posted April 26, 2011 I just read an announcement about the Google Summer of Code. If I understand it correct, one of the projects is to implement or improve the COLLADA-animation-support of Blender. I don't understand it but you can read about it here:http://code.blender.org/index.php/2011/04/google-summer-of-code-2011-blender-summer-of-polish-2/and here(if you type "blender" as organization):http://www.google-melange.com/gsoc/projects/list/google/gsoc2011I hope it will help anyone. Quote Link to comment Share on other sites More sharing options...
Zaggy1024 Posted May 1, 2011 Report Share Posted May 1, 2011 Unfortunately I've experienced similar bugs and difficulties with importing. In the Iberian siege ram's animation the wheels spin backwards after spinning forwards - which is a bug with the way 0AD converts the Collada files. I'd like to know if the same bug also affects 3DS Max Collada animations - in theory it should.If you're saying you think some of the 3ds Max animations might be messed up, I haven't seen any that are (though some attack animations look slightly strange)... but d'you actually know of what might be causing it in the game?~Zaggy1024 Quote Link to comment Share on other sites More sharing options...
Pureon Posted May 1, 2011 Report Share Posted May 1, 2011 but d'you actually know of what might be causing it in the game?No idea. Even adding a simple prop point is challenging. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted May 17, 2011 Author Report Share Posted May 17, 2011 I happened to notice one TODO comment in the code which might potentially explain some problems with modifying skeletons.xml: when the game first successfully loads a .dae file it converts it to .pmd format and then caches the result (for efficiency); if the .dae file changes then it re-converts to pick up the latest changes, but if skeletons.xml changes then it doesn't notice and doesn't re-convert the models and will still use the old cached .pmd (which was built with the old skeletons.xml). You can delete the cache by deleting ~/.cache/0ad/ (on Linux / OS X) or %appdata%\0ad\cache\ (on Windows) which will force it to re-convert everything, or you can modify the .dae file (e.g. just export it again to update the 'last modified' time) to force it to get reloaded. (It would certainly be better if the code handled this properly instead of requiring manual deletion, so that ought to get fixed some time.)In the Iberian siege ram's animation the wheels spin backwards after spinning forwards - which is a bug with the way 0AD converts the Collada files.Technically it's not the Collada conversion that's the problem (I think), it's the way the engine handles looped animations. If the animation has keyframes A,B,C then the engine interpolates between A and B, then between B and C, then between C and A, then starts from the beginning again, in order to loop smoothly. There's no way it can handle a continuously-spinning wheel since that requires a sudden jump from one keyframe (360 degree rotation) to another (0 degree) when looping.The Collada converter assumes the input animation has keyframes A,B,C,A (which seemed to be how at least 3ds Max tended to handle looping, I think), so it always drops the last keyframe to get it in the format the engine expects. Maybe it'd be possible to change it to stop dropping the last keyframe, and stop the engine interpolating from the last keyframe back to the first (for models exported in the new mode), to let it handle this better.(Just to be clear, by "keyframes" I don't mean the keyframes used explicitly in the animation program - the importer flattens everything into 30 frames per second, which the engine then treats as the keyframes it interpolates between (to ensure smooth animation at >30fps).) Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted May 17, 2011 Report Share Posted May 17, 2011 Just out of curiosity, does the celt chariot have this same problem of wheels spinning backwards? Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted May 17, 2011 Report Share Posted May 17, 2011 Just out of curiosity, does the celt chariot have this same problem of wheels spinning backwards?No, it doesn't. Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted May 17, 2011 Report Share Posted May 17, 2011 Maybe it'd be possible to change it to stop dropping the last keyframe, and stop the engine interpolating from the last keyframe back to the first (for models exported in the new mode), to let it handle this better.Hmm, I'm not thinking that would be a good idea. Wouldn't it effect all existing animations and require a tweak?I'm not familiar with how blender animation (key frames and interpolation) works, but in theory I would think it would the same as Max. What I always tried to do to get a perfect transition was clone my animation both before and after the frames I wanted to export. To use Philip's analogy, you want frames:ABCSo, copy those frames both before and after, to be:ABCABCABCThen, export the middle bolded frames. This ensures that position/rotation/translation between frames A & C are consistent both at the start and the end of the animation.You want the bezier interpelation to be calculated the same for both the entrance and exit.Like this:Not like this:If you take the steps above, I think it helps with that. No guarantees it will fix your wheel problem though Though, I think that is what I did for the chariot. You would have to look at the file in the art svn to be sure though.Hope that helps. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted May 17, 2011 Author Report Share Posted May 17, 2011 No, it doesn't.Hmm. Maybe my understanding is wrong, then . I guess I need to look into more detail to figure out what's actually going on. Quote Link to comment Share on other sites More sharing options...
Pureon Posted May 17, 2011 Report Share Posted May 17, 2011 Thanks for the tips guys. For the animation to look correct within Blender, the IPO for the 4 wheeled ram looks something like this:Which doesn't make any sense to me.I've tried it with linear, curve, and a mixture of both interpolation methods, including a similar shape to the one posted above. I need to get a bit more familiar with Blender 2.5, I haven't used it much and the animation functions have changed. Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted May 18, 2011 Report Share Posted May 18, 2011 Pureon, do you have a legend to that image? (what do each of the colors mean) It looks like it is only a 4 key animation, correct? Quote Link to comment Share on other sites More sharing options...
Pureon Posted May 18, 2011 Report Share Posted May 18, 2011 Sorry I'm at work now and won't be able to show you the ram's legend until I get home tonight (have been working really long hours for the past few weeks). Best online example I could find is this:Notice the W, X, Y and Z quaternion rotations in the middle left window - these are the ones that appear in my Ram's curve above. Hope that's helpful for now. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted May 18, 2011 Author Report Share Posted May 18, 2011 Ah, if it's quaternions then I think that diagram makes sense - if you convert from Euler angles with a constantly-increasing angle then the W component is a cosine curve, and the other components are sine curves scaled by some axis-dependent value. (Adding more keyframes would let it be a better approximation of sin/cos). (Quaternions are weird and make no logical sense, but they're nice mathematically). I have no idea if Blender gives the option of switching to Euler rotation, which would work with straight-line parameters instead. Quote Link to comment Share on other sites More sharing options...
Pureon Posted May 18, 2011 Report Share Posted May 18, 2011 Apparently new to Blender 2.5 is the option to use Euler bone rotation. Until I get home tonight I won't be able to confirm that, and there's surprisingly not very much info available online, but maybe changing it will solve all our Blender animation bugs? Edit: I created a new Euler bone rotation, but the wheels still turn backwards after turning forwards. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted July 30, 2011 Report Share Posted July 30, 2011 There was a discussion in IRC about importing the game's models into Blender (.dae COLLADA files), some people are having problems with this. I installed Blender 2.58.1 to see what the process looks like. The built-in importer gave a message "cannot create image" but silently failed otherwise.I'm not sure if it's a known problem, but apparently the importer doesn't like the absolute path(s) in <library_images>, so I removed that element from the test file and also the reference to it in <library_effects>. Then the file was able to import. Looks like a bug in the importer maybe, does anyone else have this problem? Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted November 3, 2011 Report Share Posted November 3, 2011 Looks like Blender animations export mostly correctly with 2.60a? Quote Link to comment Share on other sites More sharing options...
WhiteTreePaladin Posted November 3, 2011 Report Share Posted November 3, 2011 Nice! Will have to try it out. Quote Link to comment Share on other sites More sharing options...
Shield Bearer Posted November 4, 2011 Report Share Posted November 4, 2011 Me too! Quote Link to comment Share on other sites More sharing options...
Pureon Posted November 6, 2011 Report Share Posted November 6, 2011 Unfortunately this needs to be fixed before we can properly use Blender 2.60a to export animations for 0AD. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.