MEL script toggle

MEL script toggle

Anonymous
Not applicable
2,641 Views
1 Reply
Message 1 of 2

MEL script toggle

Anonymous
Not applicable

First try at MEL and I'm there! Well... nearly.

 

Essentially I want to toggle NURBS curves on an off (viewport > show > NURBS > tick/untick) with a shelf script.

 

int $b = false:
$b = (!$b);
//print $b;
modelEditor -e -nurbsCurves $b modelPanel3;

 

So far so good. However, how do I get the initial state of the window NURBS setting in order to toggle it?

 

 

 

0 Likes
Accepted solutions (1)
2,642 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

With the query flag you can get the Value of the flag you specify. The return value is based on the queried flag.

So this should do it.

modelEditor -q -nurbsCurves modelPanel3;