Collada -> Unity with Animation

Started by
6 comments, last by xexuxjy 8 years, 9 months ago

This is really a follow up to a post I made earlier this year :

http://www.gamedev.net/topic/665461-alternatives-to-wavefront-obj-format-for-skinned-models/#entry5208662

I've pieced together some more information on my models and now have Bones,Weights and Animation Data available.

I've written a Collada exporter for this, and as far as I can tell using the AssImp viewer the data is now correct, I can play through the various animations in the viewer and they all appear ok.

Despite this I'm still struggling to get the data into my Unity scenes. There doesn't seem to be an option for importing raw collada files. If I use Autodesk FBX converter then it doesn't convert the anims. If I import my collada file into Blender and try and export from there It only seems to read one of the animations (the dopesheet shows a single action). Importing that into Unity shows no animations either.

I feel like I'm going round and round in circles trying to get a format that will import successfully so wanted to check again and see if anyone had any recommendations for apps, toolchains or techniques for doing this form of conversion

Help!

Thanks :)

Advertisement

This doesn't quite answer your question, but have you just tried dragging your blender or maya file directly to Unity3d? I feel you may be over-complicating things.

Anyhow, Unity3d does support just importing directly from blender/maya. It ought to have all of your animations/materials etc included (though you will need to drag the appropriate material/texture onto the object in the scene). Then use the animation/animator panels to set things up. The animations will be included (expand the maya or blender project in the hierarchy to find the animations).

Just place the .ma or .blend file into your assets folder. The nice thing is you can edit them and Unity will update automatically.

http://docs.unity3d.com/Manual/HOWTO-ImportObjectMaya.html

http://docs.unity3d.com/Manual/HOWTO-ImportObjectBlender.html

Beginner here <- please take any opinions with grain of salt

Unfortunately I don't have a 'raw' blender/maya file, Instead I've generated a Collada file from my own converter program. Collada is just the latest of my converters, I originally had .OBJ which was great for everything apart from skinned models and I could just drag that to unity, or convert to FBX. Then I had an ASCII FBX converter which again worked well for static, but the fact that the documentation was lacking meant that even when I figured out the skinning information in my files I couldn't find a good reference to put that into FBX. So then came Collada as that had a (relatively) well defined spec and tools that I could check and debug by export errors in. Unfortunately having done all that, and generated all the animations and seeing them work in the viewer I then was again stumped in that Blender or Unity wouldn't make proper use of the multiple anims (no anims at all in Unity). I guess my next step could be to look at the Blender Collada importer and see how /when/why it generates amature actions as I think that may be key, but just wanted to see if someone else had the same issues.

Thanks for the links, I've just tried saving a blend file and dragging it into Unity and that does give me one animation, i think if I can persuade blender to generate more armature actions then that could do the trick.

For blender, in the dope sheet / action editor, make sure your animations are saved separately, and push them down to the NLA editor. I've had some issues with unity not recognizing some of them, but that usually does the trick for me. Also, when adding new animations, don't save the .blend to the same file but make a new one, if you've already added it to the project. (Unity, at least for me, doesn't add additional animations when I try to overwrite the existing blend file).

Anyhow, apologies I don't have an answer to your original question, but hopefully this will help.

Beginner here <- please take any opinions with grain of salt

Yes definitely. Thanks.

while researching blender to .x, i came across info on colllada to unity. do a google, its out there. don't have a link, since i'm using .x, not .DAE.

i did discover about a dozen idiosyncrasies getting blender to export.

some probably apply to exporting to unity.

the issues are detailed in the comments of the skinned mesh code i recently posted to my gamedev info journal.

they include things like exporting multiple animations, etc.

http://www.gamedev.net/blog/1729/entry-2261223-skinned-mesh-code-part-1-low-level-microsoft-code/

i think the blender export info is at the end of part 2 - maybe part 3.

might provide a clue as to whats not set correctly for export.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Thanks. I'll have a read through.

In case anyone's interested I came up with a workaround / decided to cheat (depending on how you look at it) . I rolled all the separate animations into a single one and stored off the frame timings. This then loaded into blender and therefore hopefully into Unity where I can set-up some animation fragments with the frame info.

This topic is closed to new replies.

Advertisement