Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a script welds the selected verts to the closest vert on the same mesh, I use the mag command to calculate the distance between selected vert and the surrounding verts. On certain machines specifically in Maya 2022 only my script has a bit of a lag when merging the verts. I think I've tracked it down to the mag command. Is there any alternative to mag, or is it possible to write the mag command out by hand using regular mel script to test if that executes faster. Here's what I'm using mag for.
float $coseVertPOS[] = `pointPosition -w`;
//Find the difference between the two positions
float $xValue = $coseVertPOS[0] - $vertToMovePOS[0];
float $yValue = $coseVertPOS[1] - $vertToMovePOS[1];
float $zValue = $coseVertPOS[2] - $vertToMovePOS[2];
vector $difference = <<$xValue, $yValue, $zValue>>;
//Find the distance between the two points
float $distance = `mag $difference`;
Solved! Go to Solution.