Notifications
Clear all
[Closed] Check for animated Modifiers
Mar 04, 2020 11:00 pm
Short question everyone:
is it possible to check (via Max Script) if any parameter in a Modifier is animated?
For example: I have a Box with a Chamfer modifier on top. The amount parameter of the chamfer modifier is animated through keyframes. The Script should only tell me that the Chamfer modifier is animated. (true or false value)
I don’t want to call a specific controller of the modifier. It should work more or less “independent” regardless of the modifier type…
Thanks everyone!
3 Replies
Mar 04, 2020 11:00 pm
modif = $.modifiers[#Chamfer]
animatedsel = #()
--get all animated getproperty
for i = 1 to modif.numSubs do
if modif[i].isAnimated do
animatedsel[animatedsel.count+1] = modif[i]
--get value
for i in animatedsel do
print i.value
--get property
for i in animatedsel do
print i.name
--get state direct
modif[#amount].isAnimated
modif["amount"].isAnimated
Mar 04, 2020 11:00 pm
-- hasAnimMod-v1_00.ms
--
-- 01.04.01, swami*, a.k.a. "codeWarrior()", swami@cfl.rr.com
-- Written for MAX r3.1
--
--------------------------
-- FUNCTION (hasAnimMod)
--
-- This function checks if at least one object modifier is animated.
fn hasAnimMod obj =
(
local isAnim=false
local mods=obj.modifiers
for m = 1 to mods.count do
(
local nSubs=mods[m].numSubs
for i = 1 to nSubs do
(
try
(
isAnim=mods[m][i].isAnimated
if isAnim then exit
)
catch()
)
if isAnim then exit
)
isAnim
)
--------------------------