PDA

View Full Version : Running a script when an object moves


McBain
09-21-2005, 02:08 AM
I want to run a script when an object moves, a camera to be exact. I want to show and hide different LOD models depending on the distance to the object.

I tried:

scriptJob -attributeChange persp.translate "myscript"

but that only changes whenever I'm done moving the camera by lifting the mouse button. I want it to move whenever the distance to the selected object changes. Is scriptJob the right approach or is there a better way to do this?

Thanks in advance!

jtilden20
09-21-2005, 03:56 AM
You might be able to get away with creating an attribute expression, or a clever set of attribute conenctions, which determines which LOD. That would be the only way I know of to dynamically satisfy your needs with MEL script (you could totally do it in API).

-Jon

PixelMachine
09-22-2005, 11:07 PM
Maybe I'm missing something out, but why don't you simply use a LOD group?

CGTalk Moderation
09-22-2005, 11:07 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.