PDA

View Full Version : MEL Speed


Mikkel Jans
05-29-2002, 04:53 PM
I have made ConnectVertex script like the one in Meshtools in Max..
http://www.maya3d.dk/temp/convert.jpg

It works just like the one the Max but there is one problem: It's Very slow.
I could maybe make less MEL kodes if i work more with the script but i don't think it would be much more faster.

Is there any tricks to make MEL scripts work faster?

bigfatMELon
05-30-2002, 05:39 AM
A few ways to keep your MEL snappy:

-Try to avoid unnecessary loops. If you can easily get it done without a loop, do it.

-Don't divide. Multiply. For instance. If you need to divide some value by two, multiply it by .5 instead.

-Avoid printing to the screen. Very slow.

-Short circuiting your searches and logic. Sometimes you know that you can just let a portion of the script run whether it applies to the one possible situation or not and the result will work. However, if you can throw in an evaulation to see if it's necessary first, then that portion of the code can be skipped. For instance, let's say you are searching for an object in a string array who's name contains the word "joint." Adding a counter to evaluate whether the item has already found lets the search loop exit early.

-jl

CGTalk Moderation
01-13-2006, 07:00 AM
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.