I just read that Wiki article ( Wiki: Vertex Morphing ) for the first time and I "think" I get it!
@SUPPORT: If I get any of this wrong please let us know ;-)
Code:
/*
MESH
|
- any other meshes, bones, etc
- any other meshes, bones, etc
- any other meshes, bones, etc
- any other meshes, bones, etc
|
|
- DXMORPH_Head
|
| - Current
| - Neutral
| - Eyes_Closed
| - Smile
| - Scared
| - Laugh
| - Sad
| - Mad
| - Cry
| - Hurt_Eye
| - Closed_Eye_Left
| - Closed_Eye_Right
| - Spock_Eye_Brow_Up
| - Spock_Eye_Brow_Down
*/
OK Here's how I "believe" it is supposed to work:
in your modeling program:
Step 1: In your modeling program create your model how you like it in it's default vertices positions ( this is called "Neutral" in the Wiki article )
Step 2: Save your model so that you have a backup of the Neutral Expression
Step 3: Now move the vertices around to create your desired expression. Make sure this is the final position of your expression!
Step 4: Save your model as it's own different file; give it a name to help you remember what Expression it is.
Step 5: RE-Load your original "Neutral Expression" model
Step 6: Repeat Step 3 through Step 5 until you have your various desired expressions.
in the DX Studio Editor:
Explaination: In the Wiki Article you see:
> Inside this subgroup, the very first child subgroup must have a copy of the neutral mesh. This will be where the moprhed copy is stored, so will change at runtime.
^-- this is the subgroup named: Current Note that this is where DX Studio will get the verticies group and display them in the player. This will change at runtime as you choose different expressions to morph by a specified amount.
In other words: If you call in your script:
Code:
objects.myObject.subgroups.Spock_Eye_Brow_Up.morphAmount = 0.5;
Then what will happen is that DX Studio will make your myObject "morph" half of the way of your Spock_Eye_Brow_Up expression.
Illustration:

Timing Script, ( enjoy ):
Code:
//Scene Level
var morphSpeed = 0.1; // <-- Change this to change the speed of the eyebrow raising;
// try 0.01 to go ten times as fast or
// try 0.05 to go twice as fast or
// try 0.2 to go half as fast
var morphIncrement = 0.1; // <-- Change this to adjust the smoothness of the morphing
// try 0.01 to go more smooth
function onInit(){
objects.myObject.subgroups.Spock_Eye_Brow_Up.morphAmount = 0.0;
// ^-- the Current subgroup will be set to the Neutral subgroup ;-)
scene.setTimer("raiseEyeBrow", 2); // <-- Wait 2 seconds then start raising his eyebrow...
}
function onTimer(timerId){
if(timerId == "raiseEyeBrow"){
objects.myObject.subgroups.Spock_Eye_Brow_Up.morphAmount += morphIncrement;
// ^-- the Current subgroup will be set increased by the "morphIncrement" amount of the Spock_Eye_Brow_Up position
if(objects.myObject.subgroups.Spock_Eye_Brow_Up.morphAmount + morphIncrement >= 1.0){
objects.myObject.subgroups.Spock_Eye_Brow_Up.morphAmount = 1.0;
// ^-- the Current subgroup will be set to the Spock_Eye_Brow_Up subgroup ;)
}else{
scene.setTimer("raiseEyeBrow", morphSpeed);
}
}
Step 7: expand your meshes in the mesh definitions panel in the editor.
Step 8: right-click on the top-most subgroup and add a subgroup after it. Then rename that subgroup to DXMORPH_anyNameYouWantHere

Step 9: import all of your Expression models including your Neutral Expression model. You will see them as their own mesh definition.
Step 10: right-click on the top-most node ( aka top-most subgroup ) of your Neutral Expression model and left-click on Copy
Step 11: right-click on the DXMORPH_anyNameYouWantHere you made in step 8 and left-click on Paste > Inside
Step 12: rename this to --> Current
Step 13: once again; right-click on the DXMORPH_anyNameYouWantHere you made in step 8 and left-click on Paste > Inside
Step 14: rename this to --> Neutral
Now for the fun part: ( for each of your Expression models )
Step 15: right-click on the top-most node ( aka top-most subgroup ) of your Expression model and left-click on Copy
Step 16: right-click on the DXMORPH_anyNameYouWantHere you made in step 8 and left-click on Paste > Inside
Step 17: rename this new subgroup to anything you like <-- FYI: remember that when you refer to this in the objects.myObject.subgroups. that this is where you will type in the name of this and the following Expressions you add in ;-)
Step 18: Repeat Step 15 through Step 17 until you have your various desired expressions added as subgroups of the DXMORPH_anyNameYouWantHere subgroup
Step 19: You'll end up with something approximating this:

That should do it :-)
Now in your script; every time you call:
objects.myObject.subgroups.<a style="color:#000099;">myExpression[/URL].morphAmount
Then DX Studio should morph the "Current" subgroup from whatever state it is in to the .morphAmount you specify of the the <a style="color:#000099;">myExpression[/URL] subgroup (H)
DX Studio Rules!!