Notifications
Clear all

[Closed] Can a script execute on every frame?

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?

3 Replies

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?

Did you look into the topic of callbacks?
In the 3ds max 7 mxs docs: “[color=white][size=2]Time Change Callback Mechanism[/color][/size][color=white][size=2]”[/color][/size][b][color=white][b]

[/b][/color][/b]

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.