Friday, October 22, 2010

First Blender Animation Imported into Unity

I have had my nose to the proverbial grindstone these last few days, working hard to get a Blender animation to play inside of Unity. After two solid days of coding, debugging, and scouring the Web for clues, I finally got it to work:




To summarize my findings: Unity doesn't automatically import mesh animations from Blender. Rather, what you need to do is to create an armature, make the mesh child object to the parent armature, and then animate the armature. The animation needs to be saved as an action in the Blender Action Editor, which Unity picks up once you import the file. Work on the animation spanned three development platforms, Blender, Unity and Microsoft Visual C# Express (which I configured for automatic code completion). Now that I have a rough idea of how to get objects to move within the game, I'll add some extras such as sound and screen-based text. Should be a lot of fun.

Monday, October 11, 2010

Jacked-Up .blend Files

For some reason or another, it has been a busy start of the semester, even though I have one course reduction and also minimal preps since I'm teaching a course I've already taught in the past. Getting the NEH Digital Humanities Start-Up Grant team together, the proposal written, and submitted took some time, in addition to my other committee responsibilities at the university. Pretty soon, the semester was half-way over and I hadn't done any real development work on the project directly.

To get me back into development, I formulated a project workflow that would increase my knowledge of Blender and Unity while getting a prototype game developed, which I hope to test live in my beginning German language and culture course next semester: (a) view a few videos from Blender Essential Training; (b) import models into Unity; and (c) begin programming game in Unity. Imagine how frustrated I was when, after opening the .blend file for the main building in the game, I noticed that I could not get the models to rotate while in mesh mode:




After I had checked other .blend files, which seemed to work fine, I came to the realization that the model file itself must - somehow - be corrupted. Nothing I did seemed to correct the problem, and I'm not even sure I could fix it, so I was forced to revert to a prior version. Good thing for backups! I did lose some work, which perhaps equates to about 1-2 days of recreating what I lost.