28 January 2011

Mel scripting - toggle Pin UV Borders

Pretty similar to the other script I made a few posts down.

This is for the Smooth UV Tool in the UV Texture Editor. I find it quite tedious to keep opening up the tool to toggle the Pin Borders option so I thought this would shave off a few seconds!

I also made sure that when the Pin Borders is toggled off, it will automatically select the current object's shell so you can get on with the smoothing :D


//finding out what the value is set to
int $smoothResult = `texSmoothContext -q -pb texSmoothCtx`;


if ($smoothResult == 0)
    {   
//toggle on 
        texSmoothContext -e -pb true texSmoothCtx;
        print ("Pin borders: ON\n");
    }
    else
        {
   //toggle off
            texSmoothContext -e -pb false texSmoothCtx;
   //selects the shell of the selected object so you can smooth those UVs asap!
            polySelectBorderShell 0;
            print ("Pin borders: OFF\n");
        }
    
  

No comments:

Post a Comment