XNA Animations Viewer and Loader

Any of you who visit my site may notice that I haven’t been keeping my “Weekly Summary” promise that I made a couple weeks back.  Trying to get a job while under financial stress, as well as working on the project for IGF has left me little time to even enjoy myself.  So I thought I’d at least take a moment and post about what I’ve been working on.

Our tech lead discovered a WinForms XNA model viewer/loading project.  This helps us in a lot of ways because our pipeline for art assets was to have the artist make them, bug a tech guy to load them into the project so they could view them and make sure they look right.  If they didn’t, the artists would change something, bug a tech guy again, and see if it was fixed.  This process happened numerous times when we were first starting to load animations into our game.  And for each model/animation we loaded, increased our build time exponentially because we had the models set to compile every time we wanted to compile any code change we made.

With this WinForms application, we could have the artists load up this tool, open a model, and save out the .xnbs that were created into our Assets folder.  However, the program in it’s discovered state couldn’t do everything we needed, so it was expanded upon.  I was in charge of getting the Animations to load and save correctly.  It seemed like an easy task, but I managed to run into a couple problems getting it to draw correctly.  When I had thought I used pretty much the same code that we used to draw it in our engine, I couldn’t for the life of me get it to draw.  It wasn’t until a friend pointed out to me that the WinForms app didn’t have a Update loop and asked where I was updating the animation controller.  I felt a bit dumb for forgetting that, but then ran into the problem of it wanting XNA GameTime as a variable to pass the update, which I worked around by creating a stopwatch and resetting it every update.

We’ll hopefully be able to post our expansion of this tool on Codeplex or something in the future.  But for now, we need to keep working on our game.