PDA

View Full Version : Can a script execute on every frame?


danielkenobi
01-19-2005, 06:07 PM
Hi guys I have one newbe question that I havent find out yet.

I am triying to animate the visivility of similar objects base on their relative distance from a dummy, Is just I dont know were to execute the script, I mean I can put it on each object, seting the visibility constraint to script, and write a specific script for each object, but due there are several objects that need this I dont find this as an elegant way of solving the problem. the other way I figure out was to write a script that did it with a for (that is more elegant if you know what I mean), but the question is, is there a way that this script execute every frame? where do I put it? If I execut it on the listener it will only execute in one frame, another way would be using animate on and creating keys with the for, but unfortunately that doesnt convence me because every time I change the animation of the dummy I would have to execute the script again. so Any sugestions?

danielkenobi
01-19-2005, 11:04 PM
I solve it? so those how read and didnt know the answer Here is what I did, I used a dumies float script space to write the code so it will evaluates each frame. But now it doesnt render the transparenci because I am using mental ray does somebody know a way to doit with mentalray?

DonMeck
01-20-2005, 04:31 PM
Did you look into the topic of callbacks?
In the 3ds max 7 mxs docs: "Time Change Callback Mechanism"

danielkenobi
02-14-2005, 08:41 PM
tks Donmec that was pretty helpfull, I actually have some problems later because at render time it didnt change the transparency of the object that I want. It only did in the viewports. Now I am planing to set the keys using the script, and then delet it because I am runing out of time to investigate how to fix that problem with the script.

CGTalk Moderation
02-14-2006, 09:00 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.