ScriptSpot

Script

Bake vertex position from modifier stack

By haavards · 2010-04-21

Version
1.0
Version requirement
Tested on max2010
Date updated
2010-04-22
Votes
32
Download
Download
Description

I was wondering on how I could achieve a footstep-like effect on a mesh without some fancy softbody/physics/plugin-action, and I came up with this script. It basically bakes the vertex position from the modifierstack on each frame to a keyframed editable_poly object. It keyframes only the modified part of the mesh, and does not change it back, hence the "track-effect". See the example image:

example

The first rectangle shows a standard editable_poly with volume select and  push modifiers applied to it. The volume select is connected to the sphere floating around. The next three rectangles are the result from applying the bake script, just with different modifiers applied to it after the baking.

Some quick info:

- It only applies to the object's vertex selection, so if you have no vertices selected, the script bakes the whole object.

- The object must be an editable_poly.

- It is kinda slow.

If anything is unclear or you have suggestions to the script, drop me a line!

You could produce some really cool effects using this script, hope you like it : )

Ps. If there is another easy way to produce footsteps, let me know ; )


Tags: modifier, baking, trais, footsteps

Comments (14)

Fantastic!

michaelwbell · 2015-10-07

This script worked great! Can't believe it isn't possible to do this in Max already - unless i'm wrong?

-Download link is gone, but if you copy the link found in the 'download URL' of this page into the "Wayback Machine" (google it), you can download the script!

Usage instructions:
1) make sure your timeline is starting from frame 0 to whatever frame you need.
2) add an EDIT POLY modifier on top of your object's modifier stack (on top of the skin, etc)
3) go into the vertex mode of the EDIT POLY modifier and select all vertices
4) open the script
5) Select the "object" in the script (click on your object)
6) hit bake!

Thanks for this great script!

How slow is it?

LaSauvage · 2017-03-03

I downloaded the script, tried it
I used a pathdeform modifier, so I couldn't add the edit poly on top but I added it beneath instead
It seemed to work, selecting the vertex and everything, and clicking bake, but now I've been staring at the progress bar for an hour or so, and it's still only halfway filled and in the background my modifier is gone and I don't see any keyframe having been made...

Sooo wondering if I messed up somewhere?

PathDeform Modifier Trick

redddrum · 2017-09-05

Hi,
I know it'a bit old but, i experienced the same with PathDeform modifier.
In my case, I 've all baked to a PointCache and load the xml in again and collapse the stack under it.
Allowing me to add the EditPoly on top, sub-select all vertex and launch this awesome script.
It worked very well through this process !!
As a side note, i think there is just a weird thing about timeline length :
My animation and timeline were both 0-60.
Executing the script as is, produced the baked keys from 0 to 35 only.
So the fast way for me was to extend the original timeline end to 120, then the script processed the entire 0-60 section i originally wanted.
I finally bring the timeline end back to 60 and this is all good now.
Hope this can help someone else !

note: i'm using 3dsMax 2014

New DL Location?

RhinoMan · 2014-09-22

Hello,
This seems to be just what I need right now, but the download location doesn't work.
Does anyone have an updated DL location, or can someone maybe send me the file?

superhoha · 2012-02-02

Sorry. Sth to ask.

First, why do you need to add a edit mesh mod to the plane for soft selection if the volume select have soft selection already?

Second, when I bake the vertex, it doesnt keep the soft selection, is it normal?

Very nice sript btw. handy for things like footstep or trail, way better than use softbody plugins.

about fbx

Electro Magnetic · 2011-02-08

hi man your script is perfect
really really im looking for somthing like that for long time ago
But.......!

after make simple cloth then bake animation
script make keyframes good

when export fbx file
sure check on animation export and bake animation on propety window

after import sam file i have only 1 frame all keyframes script created lost

any help ?
thx man
wating for you

haavards · 2010-06-08

If you read the description of this script you will see "The first rectangle shows a standard editable_poly with volume select and push modifiers applied to it." 😉

GustavoXX · 2010-06-04

I need to do exactly the same of the first rectangle.
I have my sphere animated and a "floor" that i need to be modified by this sphere...How can i do it??

mark pigott · 2010-04-30

I'm afraid it doesn't work with 3ds Max 6.

haavards · 2010-05-01

Thanks for testing!
Do you get an error message? What does the listener say?

Hi! I set up a 200x100 grid,

mark pigott · 2011-11-28

It will work on Max 6 if BOTH the plane AND the sphere are editble polys,

It Removes the Volume Select
ande Push ()in my case) but it does not remember the effect.
Nothing is printed on the max listener.

Budi G · 2010-04-29

it's look like a great idea. thank you

the script remind me of Object Deform plugins from peter watje

cheers

haavards · 2010-04-22

Hey, thanks for testing the script! I failed to clarify that the first example is the origin of the last three examples, meaning that the last three is copies of the first one AFTER i applied the script, with different modifiers attached after baking. The second example has noise modifier to it, the third is a shell modifier and a turbosmooth i think. The last one has a squeese modifier to it.

www.folk.ntnu.no/havardsc/img/vertexBakeEx1.png

This image shows a quick way to set up the indentation effect:

Apply a volume select modifier with these settings:

Stack selection level: vertex

Selection method: choose what ever fits your need, in my example I used replace. If you have multiple objects that you want to apply to the mesh you must choose add so the selection gets passed on to the next modifier.

Select by volume: Mesh object : select the object that you want to  affect the mesh (the sphere in my example)

To get a more nicer selection effect for the push modifier I applied an edit mesh modifier. Go into vertex submode, select soft selection, adjust it to your needs.

Don't go out of vertex mode, just apply the push modifier and use whatever value you want.

Then apply the script, if you have done it right you should see the indentation effect (hopefully :P)

The important thing is to pass the current vertex selection to from one modifier to the next if you want the baking only to be applied to that selection. You will see the dots to the right of each modifier if the vertex selection has been passed on to the next modifier. See the picture

This was a quick and dirty explanation, so I apologize if it's still unclear.

Script_Butler · 2010-04-22

Hello. This script is pretty nifty! I've tried it out and managed to replicate the first image.

When you say the other three are achieved by placing different modifiers after the bake, can you name which they are for each image? It's a bit unclear and I've tried some different modifiers but nothing happens.

I'd like to recreate the second image where the push stays in place after the ball has moved along, therefore creating a lasting indentation but I cant figure it out.

Cheers.