1. Post #1
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    Hello there! Have you ever wanted to do vertex animations? Well so have I! And recently thanks to some help from some friends, I have figured out how to do them!

    Requirements:
    Maya
    Valve's Maya Plugins (The SMD exporter. At this time it seems this does not work with DMX)

    I'm going to be doing this tutorial with a cloth simulation. This can be applied to things other than cloth though.


    Step 1:
    Create a super thin box and subdivide it into however many divisions you want



    Step 2:
    Create your cloth simulation. I'm not going to go into detail about how to use nCloth. There are a ton of tutorials out there.



    Step 3:

    -snip this step, unneeded-

    Step 4:
    Select the items you want exported, and then click on the mel box in the bottom left, and type this (you need to modify it to your needs)
    vstSmdIO -export -selection -et vertexCache -filename "c:/DIRANDFILENAMEHERE.smd"
    IF YOU DO NOT HAVE A DRIVE DEFINED, THE SMD GETS SAVED TO GOD KNOWS WHERE. ALSO MAKE SURE YOU USE / AND NOT \ OR ELSE IT WILL FAIL TO EXPORT.


    Step 5:
    Go to the directory where you saved the smd file, you should see 4 files. Two smds, a vta, and a qci. Create your qc (do not include $model or else you'll end up with a double mesh). Make sure you add "$include FILENAME.qci" into the qc.


    Step 6:
    Compile the qc. I'm not sure what versions of studiomdl work. For example, SFM's compiles it fine, but Portal 2's throws an error. I'd just use SFM's.


    Step 7:
    Open SFM and spawn your model.


    Step 8:
    You should see 2 sliders. One should be MODELNAME, the other MODELNAME_multi. THe MODELNAME slider turns the simulation on and off. MODELNAME_multi runs the simulation.
    Go into the graph editor. At the frame you want your simulation to start set a keyframe. Set MODELNAME to max and MODELNAME_multi to minimum. Go however many frames your simulation was in, set a second keyframe, and slide MODELNAME_multi to the max.





    Step 9:
    Scrub through the frames and your simulation should be playing! Congrats!




    Common issue(s):

    I have 2 meshes inside SFM! What do I do?
    Make sure you don't have a $body or a $model for the simulation inside of the QC. It's done for you in the qci.


    I get an error / Warning: CSmdExport::ExportVertexCache(2976): Vertex Cache Model Export Failed: "DIRHERE"
    Make sure you're using / and not \. Also make sure the directory exists.




    And now an example of what can be done with this:
    Ignore the double mesh. This was made while I was figuring this stuff out.


    Have fun!

    Here's my hair simulation, the smds, the vta, and the qci.
    https://dl.dropbox.com/u/42169829/hair.rar
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 11Informative Informative x 1 (list)

  2. Post #2
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    Epic wins Ill upload my test soon


    Here it is^
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 4 (list)

  3. Post #3
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    Have some WIP as fuck water.

    Edit:
    Wip2
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 3Useful Useful x 1 (list)

  4. Post #4
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 8Agree Agree x 1 (list)

  5. Post #5
    Funny Hats's Avatar
    December 2007
    2,827 Posts
    Teach me.
    Reply With Quote Edit / Delete Reply Mac United States Show Events Agree Agree x 3 (list)

  6. Post #6

    August 2012
    531 Posts
    God you guys are on fire!!

  7. Post #7
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    Teach me.
    When we complete the effect either Cra0 or I will make a breakdown of how it was done. It's not a simple effect though.

  8. Post #8
    Funny Hats's Avatar
    December 2007
    2,827 Posts
    When we complete the effect either Cra0 or I will make a breakdown of how it was done. It's not a simple effect though.
    I mostly want to know how the texture was done, it adds so much to the effect.

  9. Post #9
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    I mostly want to know how the texture was done, it adds so much to the effect.
    Yeah well I'm very good with the material shader side of things.

  10. Post #10
    bigjb's Avatar
    October 2007
    33 Posts
    Got it working : https://www.dropbox.com/s/rzh00d2kpzu2eb7/vertANIM.mp4
    Thanks!

    One non-essential question: Is there a MEL command to do this via dmx so that I can include the $subd line in the qc and compile? (combining this with the subdivided cloth idea from the baked cloth physics thread)
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Artistic Artistic x 1 (list)

  11. Post #11
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    Got it working : https://www.dropbox.com/s/rzh00d2kpzu2eb7/vertANIM.mp4
    Thanks!

    One non-essential question: Is there a MEL command to do this via dmx so that I can include the $subd line in the qc and compile? (combining this with the subdivided cloth idea from the baked cloth physics thread)
    Sadly DMX doesn't support this. Valve doesn't make use of it so my guess is they didn't spend the time coding it into DMX. You can get really high poly with this method though. Up to 65655 (I get a lot of crashes over 32K though)

  12. Post #12
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    We need to work on the fullbright issue god dam I wish sfm supported custom shaders :(

  13. Post #13
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    We need to work on the fullbright issue god dam I wish sfm supported custom shaders :(
    Ask valve

  14. Post #14
    Fagalicious
    NCDyson's Avatar
    January 2008
    247 Posts
    how was that hairball created? I can't seem to import the smd into 3dsMax, it complains about smd version 2.

    EDIT:
    I wish source engine had a fur shader or something that would help with creating really short hair that doesn't look like shit.

  15. Post #15
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 4Informative Informative x 1Useful Useful x 1 (list)

  16. Post #16
    Dennab
    December 2012
    24 Posts
    Could someone please post an example .qc file

  17. Post #17
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    how was that hairball created? I can't seem to import the smd into 3dsMax, it complains about smd version 2.

    EDIT:
    I wish source engine had a fur shader or something that would help with creating really short hair that doesn't look like shit.
    I used maya which may be the issue.

    Edit:
    Code:
    $modelname "narry/vertex_test.mdl"
    $include vertex_test.qci
    Just put something like that into the directory of the qci and smd and it does everything else for you. You'll need to change the names though.

  18. Post #18
    Dennab
    December 2012
    24 Posts
    Thanks it works now my problem was that I always wrote the whole directory

  19. Post #19
    Horrible Username Connoisseur
    Pw0nageXD's Avatar
    September 2009
    986 Posts
    Dicking around with hair some more. Working on a practical head of hair.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 1 (list)

  20. Post #20
    Call me Rantis
    shad0w440's Avatar
    May 2010
    879 Posts
    Reply With Quote Edit / Delete Reply Windows 8 United States Show Events Artistic Artistic x 8Winner Winner x 1 (list)

  21. Post #21
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    1,848 Posts
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 2 (list)