Monday, May 29, 2006

Morphs Working

Well, after a few sidetracks (Cal3D-0.11rc1/rc2) and a busy week at work, I've completed the first working steps of integrating Morph Animations into Soya. It's not complete yet (and requires using both my Soya branch at and at least Cal3D SVN/trunk as of last night), but it is only lacking as regards "polish" and cleanup. The core guts are there, for sure.

For your viewing pleasure here are some screenshots and an AVI video. Please note that many people have said the AVI does not work correctly in certain versions of MPlayer. :/ It should be 26seconds long and very "smooth."

Before Morph (PNG)
After Morpht (PNG)
A Movie, huzzah! (AVI)

The next step, following cleanup, will be to modify the exporter (which I am also restructuring) to export Shape Keys for the artist automatically. This should all be done by the 26th of June or so, which is our target date for merging this stuff into trunk. Cal3D-0.11/12-release should also be out by then, which will be a requirement.

Tuesday, May 23, 2006

I Watched You Change

More on the morph targets:

I had to modify the submesh building function a bit so that only meshes as a part of the _meshes dictionary are rendered. The old method was to use the Cal3D wrapper function to get the highest mesh value and simply render them all. However, Morph Targets introduce a new complication in that you add CoreMeshes (CoreMeshii?) as usual, but shouldn't render or attach them in the "normal sense."

As it stands, adding a morph will require something like the following:

1. In your model.cfg: morph=foo.xmf
2. In your code: cal3dshape.add_morph_target("myMorphName", "meshFrom", "meshTo")
3. In your code: cal3dvolume.animate_morph_target("myMorphName", 1.0, 1.0)

Is using "morph_target" superfluous? Would add_morph()/animate_morph() be sufficient?

Also, guess what error message Cal3D gives you when you try and setup a morph from one incompatible mesh to another? "Internal Error." That's pretty ambiguous.

Saturday, May 20, 2006

addAsMorphTarget FTW!!1!11

Well, after about six hours of hacking around (and a slight nudge in the right direction from J. Walker), I've the basics of Morph Targets in Cal3D working. Now to work on integrating that with Soya.

I probably could have done it faster, but I got distracted playing X2 again.

"Gross shots are cool--that is, if you want to be sober and throw up..."

yield self.__next()

First of all, thanks to Arc for cleaning up the photo and creating this sweet Dick Tracy mockup; mad skills. :) Secondly, I don't really know what to put here other than a few words of what I'm working on at the moment.

I found Soya a few weeks ago while writing a Blender exporter for another project and liked it immediately. I'm a Python programmer first and foremost, so Soya is right up my alley. (Engines w/ "Python bindings" aren't the same thing--Soya isn't a light wrapper around something else in C++, it __IS__ Python.) At the moment I'm working on cleaning up and restructuring the Cal3D exporter, since a lot of poeople use it as a template for writing their own exporters (I did!) and there's no reason it can't be made more modular. I know PRaabjerg is probably going to get a SOC backing for working on the exporter too, so hopefully I can have it done for him to do his work a little bit easier.

Is that last sentence a run-on?

Another thing I want to do this weekend is get some Cal3D morph target action going. As far as Cal3D's implementation is concerned, it's not too terrible to grasp. Basically, given two meshes A and B (with the understading they use the same vertices in the same order), interpolate between the two over a period of time, also honoring all action/animation trasformations. I actually think I'll start hacking on that now...