PDA

View Full Version : how do I set to minutes/sec/frames/ticks


Dmaxer
01-23-2007, 08:23 PM
how do I set to minutes/sec/frames/ticks in my script ? Im sure its something simple but I cant remember .

thanks for reading

PiXeL_MoNKeY
01-23-2007, 09:50 PM
From the Maxscript Help:The at time <time> context corresponds to the 3ds Max time slider. Any animatable property references will yield their interpolated values for the specified time. If the Animate button is on, or the script is also in an animate on context, keyframes are generated at the specified time when an animatable property of a 3ds Max object is changed.

Setting an at time context does not affect the 3ds Max time slider. The time associated with the time slider can be queried and set using the sliderTime global variable.-Eric

Dmaxer
01-23-2007, 10:11 PM
sorry but thats not what I mean . I want to set max to minutes/sec/frames/ticks right now its set to 25 fps Pal . I want it to be minutes/sec/frames/ticks,Ive made a script to read midi files it animates a set of objects using the timing and note on data from the midi file but I need to set max to minutes/sec/frames/ticks by hand before I run the script , so it would be nice it my script did this for me you see what I mean ?

PiXeL_MoNKeY
01-23-2007, 10:16 PM
You want to set what to minutes/sec/frames/ticks, the timeline, values in your script, time to complete an operation, etc? You need to be more specific.

-Eric

Dmaxer
01-23-2007, 10:20 PM
yeah my first post was a bit short . sorry :) anyway hope the post above makes it a bit more clear

PiXeL_MoNKeY
01-23-2007, 10:30 PM
Why do you need to change the time display? You should be able to read in the values and convert that to frames/ticks/etc. The only way I found to change the time display value is through Avgaurd Maxscript Extensions 7.09 (http://www.scriptspot.com/Main_Extensions.asp?BrowseType=Complete&Sort=MAXVer&ST=-1) or later.

-Eric

NeonMojo
01-23-2007, 10:32 PM
Not quite sure what you mean either... if all you want to do is change the time format then just click on the time configuration button on the lower right side of the screen below the playback controls. If that is not what you meant then you need to clarify a bit.

Hope that helps...

Dmaxer
01-23-2007, 10:42 PM
ok . Im reading in that data from a midi file , and the data is at ticks resolution , say the first note on message starts at 2 frames 1 sec and 23 ticks or something like that , if max is not set to M/F/S/T I get a small error ( max is rounding it off to a frame maybe ?)and if Im using a 5 minute tack then these small errors add up and by the end of the track the animation is way out of sync ,as I have said before if I have max set frames/ticks the sync is fine even for a tack running for 10 minuites . so you see this is why I want to set it in the script .by the way Im running max 9. thanks for the replys anyway guys :)

Dmaxer
01-23-2007, 10:46 PM
"just click on the time configuration button " yes I know this as I said in my post before but I want the script to do this for me . thanks anyway dude

NeonMojo
01-23-2007, 10:54 PM
My bad, I must have missed the part where you said you needed to change it within the script...pixel monkey is right then, thats the only way I am aware of to change it like you want. good luck

Dmaxer
01-23-2007, 11:03 PM
ok thanks guys Ive downloaded Avgaurd Maxscript Extensions 7.09 (http://www.scriptspot.com/Main_Extensions.asp?BrowseType=Complete&Sort=MAXVer&ST=-1) for max 9 , hope you dont think Im takin the pi$$ but could anyone of you guys tell me the command that I need to write into my script now I have this extension installed. I have read the text file that comes with it but not found any info on setting the time dissplay. but its late and maybe I just missed it so will reread it .. once again guys thanks for your input :)

Dmaxer
01-23-2007, 11:17 PM
ok I found it :)

PiXeL_MoNKeY
01-23-2007, 11:20 PM
If you format the information you are reading in properly it should not alter the information.
Time Values
Example Literals:
2.5s -- 2.5 seconds
1m15s -- 1 minute 15 seconds
2m30s5f2t -- 2 minutes 30 seconds 5 frames 2 ticks
125f -- 125 frames
17.25f -- 17.25 frames
1f20t -- 1 frame 20 ticks
2:10.0 -- 2 minutes 10 seconds 0 frames (SMPTE)
0:0.29 -- 29 frames (SMPTE)Also, you could convert the information to ticks and apply it all as ticks. I still don't see why you need to change the time display.

-Eric

Dmaxer
01-23-2007, 11:46 PM
math is not my best subject so maybe there is a better way to do what im doing but the main thing is i got it working, I can always fine tune it at a later . its taken me ages to get the script working so setting the timedisplay is working with the Extensions 7.09 (http://www.scriptspot.com/Main_Extensions.asp?BrowseType=Complete&Sort=MAXVer&ST=-1) thanks for the link :) . its not the input but the play back that seems to be the problem anyway thanks for your help :) below is part of my input Im working with as you can see there quite a few floats Im dealing with maybe I will work out abetter way later .

ppq = Tempo/Division as float -- microseconds per PPQ
Ta = 60.0/bpm as float
Tb = Ta*Tsig as float
Tbar = Tb*bar as float
Tc = Tb/Tsig as float
Tbeat = Tc*beat as float
Td = Tc/Division as float
Tclick = Td*click as float
T3 = Tbar+Tbeat+Tclick as float
if T3 != 0 then (animationRange = interval 0 (execute(T3 as string + "s")))

CGTalk Moderation
01-23-2007, 11:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.