Help with MEL?

Hello,

I’m looking for some help for the following things on my scripts :slight_smile:

  1. I don’t want the view port to update in some of my procedures. For example if I create a locator and snap it several times and I just want the end result and not to show how the locators are created and snapped. What command can I use?

Thanks! :slight_smile:

When you’re snapping overtime you can do one of 2 things. Either use the time flags in the getAttr/setAttr so you get the value at a specific time, or if you’re having to updated the currentTime do it with the Update flag OFF. This means you’re scrolling time but without the draw updates.

Or…

refresh -suspend true;

<Do your shiz>

refresh -suspend false;

NB: Do be careful with this though, as if something errors before you reach the last refresh, your vp will still be disabled and you’ll have to enable it manually through the command line! Oh, and if your giving it to an artist to use they’ll probably just whinge that Maya’s crashed - which of course it hasn’t!!

Oh hello, someone else in Cambridge!

(sorry, not useful to the question I know)

Oh hello, two other people in Cambridge!

(just as much use as sockmonkey heh)

this

if something errors before you reach the last refresh, your vp will still be disabled and you’ll have to enable it manually through the command line!

is good to know though :slight_smile:

[QUOTE=Bugsy;10777]if something errors before you reach the last refresh, your vp will still be disabled and you’ll have to enable it manually through the command line! [/QUOTE]

This is when you use try finally blocks if you’re in python.
E.g.


try:
    # Turn off viewport updating

    # Do stuff

finally:
    # Turn on viewport updating

So even if an error ocurs in the try block, the viewport will still be re-enabled. (Although, I wouldn’t recommend disabling the viewport updating…)

[QUOTE=Bugsy;10777]Or…

refresh -suspend true;

<Do your shiz>

refresh -suspend false;

NB: Do be careful with this though, as if something errors before you reach the last refresh, your vp will still be disabled and you’ll have to enable it manually through the command line! Oh, and if your giving it to an artist to use they’ll probably just whinge that Maya’s crashed - which of course it hasn’t!![/QUOTE]

Incidentally, I think the -suspend flag is >=2011 only.

Matt.