Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Vertex Morphing Sample

  1. #1
    DX Studio Non-Commercial Pro Edition
    Join Date
    Jun 2007
    Posts
    564

    Vertex Morphing Sample

    I found a vertex morph sample, I try same project, I create 2 same teaport model.
    Teaport1 - Normal (not changed)
    Teaport2 - Deformated (I change vertex positions)

    2 models are same vertex number

    I select 2 teaports and make a group DXMORPH named.
    and I Exported. but not worked.

    Please can you help me with pictures (my english not good) I dont understand how to export or use with 3dsmax.

    PS: I using Panda XFile Exporter, but I try DxMesh exported not worked...

  2. #2
    Senior Member
    Join Date
    Jun 2006
    Location
    Behind you!
    Posts
    7,904
    Can you post the documents, resources?

  3. #3
    Senior Member ucm's Avatar
    Join Date
    Oct 2007
    Location
    online, i think?
    Posts
    4,196
    This is all I could find with searching through DX Studio; I hope some of the information in these two places help. I would like to try my hand at DXMorphing some day too :-)


    Wiki: Vertex Morphing


    Forum Topic: Changing morph targets,


  4. #4
    Senior Member ucm's Avatar
    Join Date
    Oct 2007
    Location
    online, i think?
    Posts
    4,196
    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 &gt; Inside

    Step 12: rename this to --&gt; Current

    Step 13: once again; right-click on the DXMORPH_anyNameYouWantHere you made in step 8 and left-click on Paste &gt; Inside

    Step 14: rename this to --&gt; 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 &gt; Inside

    Step 17: rename this new subgroup to anything you like &lt;-- 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!!

  5. #5
    DX Studio Non-Commercial Pro Edition
    Join Date
    Jun 2007
    Posts
    564
    Thanks I understand...

  6. #6
    Hello UCM !

    First of all: Thank You very much for the Vertex Morphing Timing Script !

    Further remarks/questions:
    - I have done lots of attempts to create a working DXMORPH subgroup in the manner described above:
    * Create DXMORPH subgroup inside DX Studio
    * Import each morph target model separately
    * Copy/Paste/Rename morph target subgroup meshes inside DX Studio

    BUT: All those attempts have failed ! When activating one of the morph targets, the DX Studio Player crashes with a runtime exception !

    The way I got a working DXMORPH subgroup is:
    - Creating a model containing all morph target meshes
    - Exporting that model in the X format
    - I have done that with Deep Exploration
    - Importing the X format model into DX Studio
    - Renaming the top node of the imported mesh to DXMORPH_anyNameYouWant
    - Renaming the morph target subgroups appropriately, if not already done in the X model


    Of course I would also like to have the option to create a DXMORPH subgroup in the manner You described above: Inside DX Studio ! Is it just me who encounters those runtime exception crashes ?


    The goal I am very much after is really the following:
    - Having a skinned mesh with bone animation AND morph target animation
    - Imagine for example a character which is bone-animated; I import the head as a separate mesh in order to be able to add morph target animation to it

    So what I have done is the following:
    - Importing bone-animated models - including the bones and mesh groups - via FBX or X into DX Studio
    - Add morph-target-based animations to those models by creating a DXMORPH subgroup
    - The experiences I have had so far:
    * Runtime exception crashes of the DX Studio Player
    * Runtime exception crashes inside the DX Studio Editor during the DXMORPH subgroup creation process
    * If all went well without crashes: Triggering a morph target does not result in any animation; this holds true when not playing the bone animation, too.

    So the important question is: Does DX Studio allow playing morph-target-based animations in conjunction with bone-based animations at all ? If yes: Could someone be so kind and post a recipe for it along the lines UCM did above ?



    DX Studio Version used: v3.3.10 (beta)


    TIA for clarification of this very important topic !

    Cheers and Tsch

  7. #7
    Junior Member
    Join Date
    Jul 2011
    Posts
    11
    Hi, I tried to follow these instructions a year or so back and I tried them again today but I don't get some parts. Please please could a more thorough tutorial be written and added to the wiki for dummies like me ? Pretty please

    One of the main areas I am stuck is at the 'fun part'. I don't understand the process of adding the morph targets. It just seems to say to copy the base mesh again and rename it. Surely we should be importing a different mesh, ie the one that we want to transform to ?

    Lost in the mist, but I really want to get this working, please could someone help me ?

    Cheers

  8. #8
    Junior Member
    Join Date
    Jul 2011
    Posts
    11
    Also this confuses me : "Step 9: import all of your Expression models including your Neutral Expression model. You will see them as their own mesh definition."

    Import them how ? When I add my other meshes they appear in the scene which does not seem right...

  9. #9
    Junior Member
    Join Date
    Jul 2011
    Posts
    11
    This is what my base mesh is like..


    basemesh.jpg
    Last edited by Rogad; 29th November 2013 at 07:16 PM.

  10. #10
    Junior Member
    Join Date
    Jul 2011
    Posts
    11
    OK another try with something simpler. I followed the instructions but does not work again.

    So I have a cube and I have an elongated cube (rectangle!) and I want to morph from the regular cube into the long cube.

    Does my tree look right ?

    When I try to use the script, nothing happens and like in the preview I see the long (tall) cube when it's supposed to be the small cube.

    Image attached. Must be something simple I am missing. Where he says 'import' the other models, I added the meshes then did the copying, then deleted them because they appear in the scene when I don't want them there. IS this somehow the problem area ?

    cube-morph.jpg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •