Blender, MetaMorph, Unity and Shape Keys revisited

After several attempts at using the foolish frost’s Metamorph scripts, thanks to an example file that Desimus sent me, I have Metamorph and Blender shape keys working.

I am using the version of the Diff Map exporter that was created by parker for Blender 2.6. LINK

I have tested the parker script in Blender 2.63 and above - and it does not work. According to Jonathan Williamson @ cgcookie.com, with the introduction of BMesh in Blender 2.63 the were changes made to the shape key functionality which is probably why the scripts fail in these later versions. However, the script works fine in Blender 2.61 and here is a demo video:

Blender 2.61, Metamorph, Unity 4.0 and Shape Keys/Morphs

Ty to foolish frost, parker and Desimus

cheers,

gryff :slight_smile:

Great vid and congrats. Can you please tell simply the workflow because I’m getting invalid filepath error messages and first try ended blender not responding.

Couple of questions:

  1. What operating system are you using? There is a known issue of this type with a Mac OS. See this LINK Scroll down to the middleman post (and to see fixes)

  2. What version of Blender are you using? The script in the asset store works with Blender 2.58. parker’s script - link in my first post - works with Blender 2.60, 2.61.

You have to get the right script with the right Blender version.

cheers,

gryff :slight_smile:

I’m using win 7 and blender 2.61 with the parker script. First it seemed to do something when importing, then after minute or so blender stopped responding, but it didn’t crash so I thought it worked, but it didn’t. After that it started to give wrong filepath error, and that’s why it would help a lot to know what you do in blender so that it works, because I’m following Metamorph instructions and can’t get results.

Hi Univia. I will layout my set up for the script on my PC - which is very basic.

a.) An Intel I5 running windows XP
b.) Blender 2.61.0 r42615 - the 32bit version which I downloaded as a zip file - NOT the executable
c.) the “parker” version of Metamorph script for Blender 2.6

Installation of Blender and the Diff_Map script - see images screen_capture 1 and 2

1.) I created a directory on my D drive called Blender 2.61
2.) Unzipped the Blender files to that directory
3.) Unzipped the parker file on my external HD and copy and pasted the “io_export_diffmap.py” file to the “scripts/addons” directory of Blender 2.61

Activating the Diff_Map script:

1.) Started Blender 2.61 and opened the User Preferences window from the Blender File menu. Under Addons/Import-Export found the addon and put a check mark in box, then clicked the button "Save As Default.

I did NOT use the Install Addon Button to install the Diff_Map addon

So, possible differences:

1.) I’m using Windows XP.
2.) I’m running the 32bit version of Blender 2.61 that was installed manually (from the zip file)
3.) The addon was installed manually - no use of Blender’s install code.

I have just repeated the above with Blender 2.62.0 r44162 which I have just downloaded from the Blender archives. Ran a test with my male figure - worked fine with Blender 2.62.

screen_capture1

screen_capture2

Hope that helps

cheers,

gryff :slight_smile:

Hi gryff and thank you x 3 for the help, I had also the…

a. zipped 2.61 blender with parker’s script and
b.installed the addons by checking the boxes and saving as default, and
c. Intel I5 running windows 7

I tried also the 2.58 blender but couln’t get the mhx importer to enable the mhx lip sync tool which I need to use with papagayo. Now I installed the blender 2.61 exe version and got the same wrong filepath error, so may be the reason is different OS versions or what I do in blender which is;

  1. import the makehuman mhx model
  2. load the papagayo moho .dat
  3. select the model to go object mode, and
  4. export the diffmaps and animations
  5. in the Export Diff v.1.1.2 dialog I use default settings, and give the same name to the file that is in the Export Diff v.1.1.2 settings

2 pictures, inside blender and export
http://www.use.com/0bfcda032f94d974c71b

I wish I could use Tagarela, but for some reason it keeps asking to assign an audio which I already have assigned, and I never get to the editor.

Univia, can you post your file you are trying to animate somewhere - so I can try the export and checkout your settings?

cheers,

gryff :slight_smile:

Sure, I was cleaning assets and somehow it lost its skin so had to make it again;
http://www.freefilehosting.net/liz

Wow!

Couple of initial thoughts

  1. Your model has ~14600 verts my human male has ~7900 verts
  2. Your model has ~64 shape keys my human was done with just one shape key (+ the Basis key which does not get exported)
  3. When I export the shape key from my model, it takes over 2 minutes to create that one tga file and the animation text file

So you have almost twice the vertices and 64 shape keys - it would take well over two hours on my PC to create all the .tga files for your liz model.

Are you pushing Blender/Metamorph into some extreme case ?

Will be back with more later tonight or tomorrow. Just need to find a simple blend file that I used for experimentation so that you can try using it to export from.

cheers,

gryff :slight_smile:

It was just for testing purposes for the lipsync and for the game I would reduce the polycount. I need some sort of lipsync to have conversations similar to Unreal II: The awakening

and then try to figure out how to do it in unity, may be with RAIN indie, and or trying to learn some scripting why I’m reading java for dummies and watching those Learn scripting videos.

I just added decimate modifier and reduced the animation to 5 frames, but got the same wrong filepath message again. I noticed earlier in the zipped blender 2.61 that it had in the object data panel vertex color map too but it didn’t work then either. Great if you can upload some of your file for testing, cya.

I think that is very doable Univia. You don’t need 64 shape keys for that kind of lipsyncing.

I have found my test blend file - I will package it up with the DiffMaps I get, the fbx file for Unity and the animation script I use in Unity V4. Will post it tomorrow.

cheers,

gryff :slight_smile:

Univia, as promised earlier in the thread here is a simple head model set of files. It includes:

  1. The blend file saved from Blender 2.61.
  2. The exported .fbx file (Blender 2.61)
  3. The two exported DiffMaps for the two shape keys and the animation .txt file (Blender 2.61)
  4. The two scripts I used to animate the mouth - Metamorph and humanshapekey (which triggers the animation)
  5. A .psd image that shows the settings for the two scripts on the imported .fbx file

The animation is run in Unity 4. Blender and the “parker” script for DiffMap export from Blender were installed as described above on a PC running Windows XP.

By a simple mixing of two mouth keys one can simulate a number of phonemes. A few more shape keys can be added - blinking, smiling, raising an eyebrow to give some more animation to the face.

http://dl.dropbox.com/u/70260871/metamorph_demo_files.zip

The “parker” script does not work in Blender 2.63 and above

cheers,

gryff :slight_smile:

Thank you again gryff, I am now playing with the file and noticed you had two uv maps in the object data tab uvmap box, UVMapp and DiffMap, whereas I had only UVTex, and in the DiffMap exporter there is UVTex and Shapekey, but then again it’s a different version of the exporter and has Export shapekeys and Export animations checkboxs, but no matter what I do I get the invalid filepath error so i have to fix that somehow before I can proceed. I’ll try your head in unity asap.

The two UV maps are to try and improve the accuracy and and resolution of the DiffMap texture. Take the whole humanoid I used in the video - only some vertices are influenced by the shape keys (those on the face)… There is no need to give lots of space to vertices that are not being moved. Here are the maps for the model I used in the video:

First the DiffMap: http://dl.dropbox.com/u/70260871/DiffMap.png

The Full Body Texture: http://dl.dropbox.com/u/70260871/UVMap_texture.png

In the DiffMap most of the body, which does not move using Shape keys, is downsized and tucked in the corner, the face vertices take up most of the map.

Not sure what you mean by that. For Blender 2.61 use the parker version of the exporter script:

http://dl.dropbox.com/u/8451123/io_export_diffmap.py

For Blender 2.58 use the foolish frost version of the script available at the asset store otherwise you will get that path error.

I would be inclined to reinstall both Blender 2.61 and the parker script as I outlined above.

cheers,

gryff :slight_smile:

Ooh I’m sorry, I was reading MetaMorph manual while writing that and forgot to mention that the Exporter in the image is different version.
http://rezzable.com/metamorph/manuals/blender-diffmaps

So I am using Blender 2.61 and the parker script, but it didn’t work for me for some reason with zipped or installable version of blender 2.61, and that I have to solve somehow or try to get the Tagarela to work. Cheers.

Phew, I finally got your head demo set up in unity and it’s working, but the animation is distorted probably because i resized the head in the editor because it was so small, and later realized to make it bigger in import settings, and then I had to make it smaller again and it may have affected the animation, just quessing. I still haven’t figured out why I can’t get the exporter working but I’m sure I’ll find a way;)

Well I’m glad the parts worked in Unity.

I build stuff in blender using blender units. When you import the fbx you have to set the “scale factor” to 1. A standard default cube in blender is 2 blender units and when exported to Unity is correct when compared to the Unity cube .

Also, I’m using Unity 4 . No idea what the impact of scaling in the Transform properties would be - but those vertices are very close together around the mouth, which is another reason I use second DiffMap for the face face vertices then are taking up most of the UVs as they are the ones in motion for the shape keys

One other thought on the DiffMap export, if it is a Windows 7 issue, can you not run Blender in a “Windows XP mode”

cheers,

gryff :slight_smile:

That didn’t even cross my mind until you told me but no, it didn’t work with xp sp2 or sp3 compatibility mode, so it’s still a bit of a mystery to me why it won’t run. Let us not fall in despair:-D. Maybe a few hours rest is in place for me now. Happy easter gryff:smile:

Hi,
I hope you can help me. Having tried metamorph with Blender versions from 2.49 to 2.66a, you have no idea how delighted I was when I came across this trail. Well, I now seem to be at the point that Univia reported “invalid file path”. I would like to test this with your demo files but I cannot access the files. Do you think you can make your demo files available again please. Many thanks!!!
I’m using Win 7, 64. Blender 2.61 (exe installation), metamorph Blender plugin (installed add-on).
1230941--51766--$metamorph_exportdiff.JPG

Hi legendre - will be glad to help.

The files are still in my dropbox and at the dropbox website - so I do not know why you can not access them. So please try again.

If it still does not work, send me a private notification with an email address that you use - and I will send them that way.

A few things I should point out -

  1. I use Windows XP,
  2. I do NOT use the executable version of Blender but rather the zip file installations -allows me to easily install multiple versions of Blender - and of course the 32bit version of Blender.
  3. Foolish Frost’s orginal script worked in Blender 2.58 but not in 2.6 versions.
  4. Get the “parker” scripts - they work in Blender 2.61 and 2.62. They will not work in 2.63 and above as the functionality of shape keys changed with the introduction of the BMesh functionality.
  5. I am using Unity 4.0

I am happy to help you with Metamorph.

cheers, gryff :slight_smile: