Skip to content

Instantly share code, notes, and snippets.

@manhha00
Created December 9, 2017 11:14
Show Gist options
  • Select an option

  • Save manhha00/052adb44fdfbefc863c887e3ee783614 to your computer and use it in GitHub Desktop.

Select an option

Save manhha00/052adb44fdfbefc863c887e3ee783614 to your computer and use it in GitHub Desktop.
maya - mel - select edges and move vertex Z to 0
global proc havm_moveZero() {
string $sel[]= (`ls -sl`);
//print ($sel[1] + "\n");
string $veSel[] = (`polyListComponentConversion -fe -tv $sel`);
string $vertex[] = (`filterExpand -ex 1 -sm 31 ($veSel) `);
int $n = size($vertex);
print $n;
print "\n";
for ($i=0 ; $i<$n ; $i++) {
print ("dau tien la` " + $vertex[$i]);
print "\n";
float $pos[] = (`xform -ws -q -t $vertex[$i]`);
xform -ws -t $pos[0] $pos[1] 0 $vertex[$i];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment