Home Technical Talk

[MAYA] Fast Make planar Script

polycounter lvl 9
Offline / Send Message
Bodizzz polycounter lvl 9
Hi guys, just wanted to share a Make planar script which works with a one hotkey based on a current selected handle of Scale Tool.  Works with verts, edges and faces. 

///UPDATE///
Now script works with custom pivot position and orientation. Also updated the GIF.

Best explained by the GIF below :)  


\\\\\\\\\\\\ INSTALLATION \\\\\\\\\\\\\\\\\
Make a hotkey (MEL) and copy/paste code into the hotkey command.

Tested in Maya 2018
float $pos[] = `manipScaleContext -q -p Scale`;
float $orient[] = `manipPivot -q -o `;
int   $trans = `manipScaleContext -q -cah Scale`;
int   $transMode = `manipScaleContext -q -m Scale`;

		if ($transMode == 10){
		
			    if ($trans == 0){		
					scale -cs -p $pos[0] $pos[1] $pos[2] 1e-05 1 1;
					}
				if ($trans == 1){		
					scale -cs -p $pos[0] $pos[1] $pos[2] 1 1e-05 1;
					}	
				if ($trans == 2){		
					scale -cs -p $pos[0] $pos[1] $pos[2] 1 1 1e-05;
					}
				else if ($trans == 3){
					scale -cs -p $pos[0] $pos[1] $pos[2] 0 0 0;
					}							
				}
		
		else{
			    if ($trans == 0){ 
				scale -oa $orient[0] $orient[1] $orient[2] -r -p $pos[0] $pos[1] $pos[2] 1e-05 1 1 ;	
				}
				
				else if($trans == 1){ 
				scale -oa $orient[0] $orient[1] $orient[2] -r -p $pos[0] $pos[1] $pos[2] 1 1e-05 1 ;	
				}
				
				else if ($trans == 2){ 
				scale -oa $orient[0] $orient[1] $orient[2] -r -p $pos[0] $pos[1] $pos[2] 1 1 1e-05 ;	
				}
				
				else if ($trans == 3){
				scale -r -p $pos[0] $pos[1] $pos[2] 0 0 0;
				}
		   }	




Replies

Sign In or Register to comment.