Search Unity

Presenting MetaMorph Toolkit for Blender and Unity

Discussion in 'Made With Unity' started by foolish-frost, Jan 26, 2011.

  1. gryff

    gryff

    Joined:
    Apr 17, 2012
    Posts:
    360
    ashess, basically the Metamorph package has two sets of scripts - the python script for creating the DiffMaps and the shapekey animation file (as a .txt) in Blender and the two scripts for Unity - Metamorph.js and a Play script of some kind.

    Once you have generated the DiffMaps and the txt file successfully, you are essentially finished with Blender. You could manually create a .fbx file for you mesh that want to use (method I use) with Metamorph or you could hand the .blend file over to Unity and let it do the import (method you use). As far as I know there should be no difference between versions 2.60 - 2.62. All you are doing is importing the mesh - the animation comes from the scripts you use in Unity, the DiffMaps and the animation .txt files.

    My experience is that there is a bug in the PlayMoon DEMO .js script which is why I suggested you use my script. If you go to line 262 263 of the PlayMoon DEMO.js you will find :

    link = test_MetaMorph_Link(MetaMorphScriptObject);
    link.GetComponent(MetaMorph).mm_Animate_Play( Morph_Name, Morph_Level );

    REM both those lines out - they are not used by the script as far as I can tell - but are there to apply a shape key permanently to a mesh.

    The script I use called humanshapekeys. js has that fixed.

    By the way what version of Unity are you using ?

    cheers, gryff :)
     
    Last edited: May 7, 2013
  2. cerebrate

    cerebrate

    Joined:
    Jan 8, 2010
    Posts:
    261
    The parker script works in blender 2.62.

    Some things about errors I encountered while trying to get it to work, that haven't really been explained in here:

    Code (csharp):
    1.  
    2. Invalid file path
    3.  
    The problem is that in browser for the folder in blender, you entered a file name. Do not do this. It should be empty. The file name is the name in the settings for the exporter.

    Code (csharp):
    1.  
    2. line 185, in generate_diffmap_from_shape vcol.data[i[0]].color1 = color
    3. IndexError: bpy_prop_collection[index]: index *somvalue, out of range, size 0
    4.  
    Apparently the script fails if the shapekeys have drivers. You have to remove the drivers in order for this to go away.
     
  3. Mike4

    Mike4

    Joined:
    Oct 24, 2013
    Posts:
    92