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
[thumb]http://i.imgur.com/L5CaTbYh.png[/thumb]
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.
[thumb]http://i.imgur.com/EskDA8Nh.png[/thumb]
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)
[quote]vstSmdIO -export -selection -et vertexCache -filename "c:/DIRANDFILENAMEHERE.smd"[/quote]
[b]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.[/b]
[thumb]http://i.imgur.com/qcyj2Wnh.png[/thumb]
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 [B]"$include FILENAME.qci"[/b] 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.
[img]http://i.imgur.com/xRt9vns.png[/img]
[thumb]http://i.imgur.com/Dt7kHDWh.png[/thumb]
[thumb]http://i.imgur.com/GhOukbxh.png[/thumb]
Step 9:
Scrub through the frames and your simulation should be playing! Congrats!
Common issue(s):
[quote]I have 2 meshes inside SFM! What do I do? [/quote]
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.
[Quote] I get an error / Warning: CSmdExport::ExportVertexCache(2976): Vertex Cache Model Export Failed: "DIRHERE"[/quote]
Make sure you're using / and not \. Also make sure the directory exists.
And now an example of what can be done with this:
[media]http://www.youtube.com/watch?v=O2iZZHwDcZg[/media]
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.
[url]https://dl.dropbox.com/u/42169829/hair.rar[/url]
Epic wins Ill upload my test soon
[video=youtube;0ZZ8xH_nvX0]http://www.youtube.com/watch?v=0ZZ8xH_nvX0&feature=youtu.be[/video]
Here it is^
[media]http://www.youtube.com/watch?v=GvBWYH3_Rcc&hd=1[/media]
Have some WIP as fuck water.
Edit:
Wip2
[media]http://www.youtube.com/watch?v=hjQ7ywKeKK8&hd=1[/media]
[QUOTE=Funny Hats;39875859]Teach me.[/QUOTE]
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.
[QUOTE=Pw0nageXD;39876244]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.[/QUOTE]
I mostly want to know how the texture was done, it adds so much to the effect.
[QUOTE=Funny Hats;39876510]I mostly want to know how the texture was done, it adds so much to the effect.[/QUOTE]
Yeah well I'm very good with the material shader side of things.
Got it working : [url]https://www.dropbox.com/s/rzh00d2kpzu2eb7/vertANIM.mp4[/url]
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)
[QUOTE=bigjb;39887738]Got it working : [url]https://www.dropbox.com/s/rzh00d2kpzu2eb7/vertANIM.mp4[/url]
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)[/QUOTE]
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)
We need to work on the fullbright issue god dam I wish sfm supported custom shaders :(
[QUOTE=cra0kalo;39897917]We need to work on the fullbright issue god dam I wish sfm supported custom shaders :([/QUOTE]
Ask valve
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.
[QUOTE=NCDyson;39911244]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.[/QUOTE]
I used maya which may be the issue.
Edit:
[code]
$modelname "narry/vertex_test.mdl"
$include vertex_test.qci[/code]
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.
Thanks it works now my problem was that I always wrote the whole directory
[media]http://www.youtube.com/watch?v=DjwHLDwaDnY&feature=youtu.be[/media]
Dicking around with hair some more. Working on a practical head of hair.