Toogle show/hide motion trails in Maya 2012


#1

Hi, could someone please make a script for toogle show/hide motion trails in ALL viewports for Maya 2012?
On this forum I have also found toogle show/hide NURBS curves and it is very useful to me for animation, this is the code.

Curves_Toogle;
string $myPanel = `getPanel -wf`;

if(`getPanel -to $myPanel` == "modelPanel") {

if(`modelEditor -q -nurbsCurves $myPanel` == 0) {

modelEditor -e -nurbsCurves 1 $myPanel;
}
else {

modelEditor -e -nurbsCurves 0 $myPanel;
}
};

I need this because it saves me time, I do not have to go to Show-NURBS Curves - check, and again Show-NURBS Curves uncheck.
So if someone knows how to do this in MEL I would appreciate it, tnx. :slight_smile:


#2

Just replace any instances of nurbsCurves with motionTrails and it’s done :


  string $myPanel = `getPanel -wf`;  if(`getPanel -to $myPanel` == "modelPanel") {
  
    if(`modelEditor -q -motionTrails $myPanel` == 0) {
  
    modelEditor -e -motionTrails 1 $myPanel;
  
   }
  
   else {
  
    modelEditor -e -motionTrails 0 $myPanel;
  
   }
  
   };
  

This code could be simplified a lot btw, but it will work fine…

for example - this will do the same thing with less lines of code ; )


string $myPanel = `getPanel -wf`;  if(`getPanel -to $myPanel` == "modelPanel") {

  modelEditor -e -motionTrails (1-`modelEditor -q -motionTrails $myPanel`) $myPanel;

  };

Cheers,
Brian


#3

Short or long for me it’s the same, I am not really into MEL.
Tnx for editing. :slight_smile:


#4

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.