hey,
i'm currently making a 'walkcycle-creator' maxscript
and i just faced my first big problem:
i can't find how i convert an integer into a frame
so i have this timespinner in which you can set the number of frame's for a walk-loop
so i would like to get the integer from the spinner and convert it into frames so i can use it in the slidertime to set keys.
here's the code i have so far
thanks in advance,
Sandeir
Replies
because when my Timespinner value is 24 an i want to set a key at the 12th frame i would type "timeslider = (tijd/2)f" and ik give's an error
it's probably easy'er if i just add my code, sorry
slidertime = (tijd/2)
If you run into a situation where you do need the integer as a frame number you can convert it using "as time"
slidertime = (tijd/2) as time
The trickier situation is converting a frame to an integer. For example,
60f as integer
--Result: 11520
(60f as integer)/ticksperframe
--Result: 60
For some reason, the result is in ticks and not frames. But if you divide by the global variable ticksperframe you get the number you are looking for. Luckily, just like slidertime accepts an integer, most things that require and integer can be fed a frame number.
it's suppose to set key at frame 6, but is doesn't
my code looks like this at the moment:
I want to make from 'tijd' a global variable so i can change the animationrange when you turn the spinner but it give's this error "** system exception **"
But, you can execute code once the rollout is created.
on WalkcycleCreator open do
(
global tijd = TijdSpinner.value
)
so here's my code up 'till now
found dees : http://www.cgplusplus.com/online-reference/maxscript-reference/source/biped_maxscript_extensions.htm
but that's just the help