Trying to understand the morphmixer export format

Dennik

Member
Does anyone understand how the morphmixer translates frames and values of 0-100 and curve settings to the numbers you see when you save a morph mixer file?
I'd like to write a script in Unity that takes a morph animation and translates it to unity animation since fbx from Lightwave does not export morph animations.
I just need to make sense of those values. I expected to see 1-100 and curve settings, but I couldn't decipher the values I saw.
 

ernpchan

Active member
If it's anything like a motion file the time I believe is a floating point value, same with the actual frame value. There's probably a value for how the keyframe is interpreted (linear, stepped, etc).
 

meshpig

Active member
LW Morphs via FBX do work in Unity. They appear as Blendshapes at the top of the 'Slinned Mesh Renderer' pane. Make sure you have (Morphs) blendshapes and animations ticked in the FBX export window.
 
Last edited:

Dennik

Member
LW Morphs via FBX do work in Unity. They appear as Blendshapes at the top of the 'Slinned Mesh Renderer' pane. Make sure you have (Morphs) blendshapes and animations ticked in the FBX export window.
I see that you use LW 2015. Have they changed the fbx exporter to support morphmixer animation? The current one I use (still on 11.6) exports blendshapes but not their animation.
 

Dennik

Member
The export animation box, only exports skeleton animation, no morphmixer stuff.
Sure the morphs appear in unity but they don't animate during runtime. The animation clip doesn't include them.
By all means, check it and let me know if i'm wrong.
 

Dennik

Member
... this will give you keyboard access. I've used the keys A and M for 2 morphs. You don't need to change the names just attach it to the SMR.

View attachment 133801
I appreciate your effort and the script. But you really didn't have to. I know how to access the morphs in unity through script, but i'm not interested to animate them interactively at runtime.

I will try one more time to explain what I wanted to do, cause i probably wasn't clear enough. I want to animate everything in Lightwave. Morphs included.
Then since the morph animation from lightwave doesn't export, I'd like to save it from morph mixer (into its text file) and then read that file in unity and create a new unity animation clip for the morphs. I want to port morph mixer data to unity since nobody else has done it. My only issue was i didn't understand the values that morph mixer saves. I'll take another hard look at it.
 

meshpig

Active member
No problem. I understand what you want and I'm curious but what is Unity going to make of the MM code without a Unity script? Chilton Webb aka Conjure Bunny would know.
 

Dennik

Member
Oh. I would write the unity script myself. Its a text file so I was planning to parse through it.
for example lets say I have a morph "Eybrows_Up" that goes from 0 in frame 7, to 100 in frame 14. Both keyframes have a TCB spline tension 1.0
here is what morph mixer saves:
{ KeyedMorph
"Morph.Eyebrows_Up"
{ Envelope
3
Key 0 0 0 0 0 0 0 0 0
Key 0 0.29166666666666669 0 1 0 0 0 0 0
Key 1 0.58333333333333337 0 1 0 0 0 0 0
Behaviors 1 1
}
}

Just to figure it out I changed the keyframe at 14, to a value of 50 and the tcb to 0.25
here is the morph mixer data:
{ KeyedMorph
"Morph.Eyebrows_Up"
{ Envelope
3
Key 0 0 0 0 0 0 0 0 0
Key 0 0.29166666666666669 0 1 0 0 0 0 0
Key 0.5 0.58333333333333337 0 0.25 0 0 0.3746431969552807 0 0
Behaviors 1 1
}
}

Now I guess the first entry is the value of the keyframe normalized, and the 4th entry is the tcb value.
What I don't understand is how it translate the frames 7 and 14 (where the keyframes are) in those long float entries.
 

Dennik

Member
Found it! It divides the frame # by the framerate (of 24). I'f only I've been more analytical from the beginning. :-D. Sometimes you figure out the solution to a problem when you are trying to explain it to someone else. hehehe
 
Top Bottom