Bonedaddy
02-07-2004, 11:47 PM
Hey all,
I have never coded in MEL before, so all of this is still very, very confusing for me, but I have great need of a LOD script that works with Mental Ray (Maya's default does not). Thus, I'm learning.
I've managed to get a script together that will tell me the distance from the camera of an object, if I specify the object's name. From there, I plan on setting a threshhold, and if the distance crosses that threshhold, to turn off the visibility of one object and turning on the visibility of another.
However, to implement this, I have some questions:
1) How would I set this up so that it's, for lack of a better word, habitual? So that it evaluates every time the camera or object's position changes? Would I use the Expression Editor, rig something up there? Or am I barking up the wrong tree?
2) I have to do this with a large number of objects (basically a forest blanketing several mountains, one for each tree), so how should I configure it to easily keep tabs on which objects are affected by this? I realize that naming is going to be a big thing (oak1_heavy and oak1_card, for example), but still, would appreciate any thoughts, insights people had.
Thanks much for any help anyone can provide. I'd be happy if I could just get the LOD packaged with Maya to work, but whatever it's doing to make the objects invisible doesn't work in Mental Ray...
I have never coded in MEL before, so all of this is still very, very confusing for me, but I have great need of a LOD script that works with Mental Ray (Maya's default does not). Thus, I'm learning.
I've managed to get a script together that will tell me the distance from the camera of an object, if I specify the object's name. From there, I plan on setting a threshhold, and if the distance crosses that threshhold, to turn off the visibility of one object and turning on the visibility of another.
However, to implement this, I have some questions:
1) How would I set this up so that it's, for lack of a better word, habitual? So that it evaluates every time the camera or object's position changes? Would I use the Expression Editor, rig something up there? Or am I barking up the wrong tree?
2) I have to do this with a large number of objects (basically a forest blanketing several mountains, one for each tree), so how should I configure it to easily keep tabs on which objects are affected by this? I realize that naming is going to be a big thing (oak1_heavy and oak1_card, for example), but still, would appreciate any thoughts, insights people had.
Thanks much for any help anyone can provide. I'd be happy if I could just get the LOD packaged with Maya to work, but whatever it's doing to make the objects invisible doesn't work in Mental Ray...
