Animated Mesh Deformation using Diff-Maps

Okay I mentioned before in scripting that i was working on a way to easily animate a mesh in Unity.

It’s done.

How this works:

  • You make your mesh just like normal, building, setting UV texturing, Even boning and animating.

  • You then make a copy of the base neutral mesh and reshape it so what you need. (normal face into a smiling face)

  • You then use the blender script to make a color Diff map in the vertex color data of the mesh, and then using baking to render that into a UV texture.

  • Do this for each new shape.

  • Now, you copy those diff maps into Unity, with the base mesh (either a static mesh or an animated character).

  • Drop the Morph API script into your model, and make a script to send morph animation commands to it remotely.

The above is missing a lot of steps, but I just got this demo done today, so I’m a bit tired. The included Unity file includes the Blender meshes so you can see how some of it was done and experiment.

I’ll also try to make a web demo soonish.

…

Okay, still trying to upload this UnityProject…

…

Annnnd, can’t.

Hey, Unity guys! Your upload system is broke!

You can see the demo and get the project here:

http://rezzable.com/blog/foolish-frost/easy-way-animate-mesh-unity3d-unitymorph

Okay, that last update worked, at least.

I hope you enjoyed this, and can make use of it. I’ll accept donations if you REALLY like it. Just IM me about here.

I’m sure it could be made more efficient, but this version server my needs for now.

really nice work!!!
well done!~

any chance to do this in 3dmax?? how?

Many thanks for sharing the code with us!

The effects are very impressing, however, they are also pretty CPU eater :-).

Martin
http://www.dobesgames.com

Sure, same way I did: Just make a script that takes the xyz difference of each vertex and makes it into a color from 0 - 255, with 0 being negative shift, 128 being centered, and 255 being a positive shift.

The math is in the Python script. You should have an easier time getting help with 3dSM than I did with getting Python Blender info.

I was just today trying to figure out how to import Blender “shapes” into Unity3D. Gonna have to try this, thanks.

Wow! You’re all a quiet bunch. hundreds of views on almost no comments.

This is way cool. I had an excellent frame rate on this slower internet computer.

Thank you for sharing this. This will have some very cool applications.

sorry for our dumb,most of us know nothing about 3dmax scrips,would you please write some scripts for using this in 3dsmax??

this is really useful!!!thanks!!!

Sure, Just get me a full copy of 3dSmax, about $300 worth of books on the system and scripting language it uses, and I’ll get right on that!

Otherwise, I have no way to do it.

That looks pretty cool, especially for facial animation!

I was doing some searching for Blender info on this kind of thing to see if I could do this myself when I ran across your post here in the Unity forums. The funny thing is that I was doing it for a Unity project. That’ll teach me to look within our own community first, huh?

Very nicely done