[Closed] Add or subtract value to selected animation curves
I’m basically trying to find the Max equivalent of Maya’s animation offset command ““+=360” or “-=360”” that allows you to add or subtract a numerical value to your current key selection. Does anyone know if 3dsMax has this function? If not, does anyone know of a current simple script that can do this?
Thanks!
if you want to change a key value you have to be in animation mode and at the time of this key.
there is no UI solution to change multiple keys at the same moment
What are you doing, trying to achieve – plain english?
When someone mention animation (keys ) and offsetting I automatically think about changing/offseting time values for anim. keys
And when I see +/- 360 than bout trans. rotation
And “numerical value to your current key selection” isn’t very precise term, or?
For instance: say you have 3 keys selected in the Max curve editor with values “20, 40, and 60”. I want to edit all the of them at once “numerically” (as opposed to just manually dragging them in the curve editor). So let’s say I want to add +100 to all 3 keys. In Maya, you simply go into the curve editor, select the desired keys and enter “+=100” which would change their values to “120, 140, and 160”.
Obviously this is easy enough to do manually with just 3 keys. But when you’re dealing with hundreds, or even thousands of keys at once, doing this manually isn’t practical. I’m basically asking if Max has a “+=” or “-=” equivalent?
Yeah I tried this as well. Unfortunately, this only works for keys on the current frame
try (destroydialog OffsetSelectedKeysRol) catch()
rollout OffsetSelectedKeysRol "Offset Selected Keys" width:200
(
fn offsetControllerValue offset:1.0 =
(
if (tv = trackviews.current) != undefined do
(
num_keys = 0
done = #()
for k=1 to tv.numSelTracks() do
(
c = tv.getSelected k
if (iskindof c FloatController) and (numKeys c > -1) and (findItem done c == 0) do
(
append done c
if (num = numSelKeys c) > 0 do
(
keys = for k in c.keys where k.selected collect k
keys.value += offset
num_keys += num
)
)
)
#(done, num_keys)
)
)
edittext exprassion_ed " Execute Expression: " labelOnTop:on fieldwidth:120 align:#left offset:[-4,6] across:2
edittext lastoffset_ed " Value: " labelOnTop:on readonly:on fieldwidth:60 align:#right offset:[4,6]
label emp offset:[0,-10]
on exprassion_ed entered text do
(
v = try(execute text) catch()
if iskindof v Number then undo "Key Value Offset" on
(
offsetControllerValue offset:(v as float)
exprassion_ed.text = ""
lastoffset_ed.text = v as string
)
else
(
lastoffset_ed.text = ""
)
)
)
createdialog OffsetSelectedKeysRol
of course it’s possible to make a macros with nice interface but it’s for another enthusiasts…
how it woks…
open any trackview and select controllers you want to work with.
write any expression that make sense and does make a valid number and enter the text.
the executed expression makes the value that will be added to all selected keys to selected controllers
simple case expression:
10 (adds 10)
-10 (subtract 10)
it’s easy to extend the script to do more fancy calculations
as well as support spinners or sliders. but again, it’s for how wants to practice in MXS
also i remember that i posted example of a FANCY expression dialog on this forum but i don’t know now how to find it with new forum’s UI
oh! i found it max calculator help