get highest value in position x ?

hi guys

is there a way to get the highest value of position x lets say
from an object that has animation already on x ?

basically im importing a tracked node into max , and it has some crazy position animation baked in .
i need to get the highest value
of x in the entire animation ( or from frame 1 to 100 lets say )
to use in the reaction manger , so i need the value of x .
is there any easy way of getting it with script ? instead of eyeballing it?

thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

or...

collect keys values and get the highest one with amax function:
amax (for k in $[3][1][1].keys collect k.value)

my recent MAXScripts RSS (archive here)

splinterD's picture

ok

this is interesting ... "amax" ... never seen it .
ill check it out , thanks allot

br0t's picture

You could look at the x

You could look at the x position at each frame, store it to an array and sort it afterwards. Something like this:

fn log_position obj=
(
	if obj != undefined do
	(
		local arrX = #()
		local arrY = #()
		local arrZ = #()
 
		sliderTime = animationRange.Start
		for i=animationRange.Start to animationRange.End do
		(
	-- 		print (obj.name + " Position: " + obj.position as String)
			append arrX obj.position.x
			append arrY obj.position.y
			append arrZ obj.position.z
			sliderTime +=1
		)--end for
 
		sort arrX
		sort arrY
		sort arrZ
 
		print ("--- " + selection[1].name + ": ---")
		print ("Highest X Position: " + arrX[1] as string)
		print ("Highest Y Position: " + arrY[1] as string)
		print ("Highest Z Position: " + arrZ[1] as string)
		print "-------------------"
	)--end if
)--end fn
 
--execute:
log_position selection[1]

Cheers

Never get low & slow & out of ideas

splinterD's picture

thanks

sweet , thanks allot .

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.