Last active
October 5, 2017 11:26
-
-
Save rondreas/03d03b09ad13096635696f018103fecc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
import maya.mel as mel | |
# Get current selection | |
selected = pm.selected() | |
mel.eval("ConvertSelectionToUVs") | |
# Unfold, straighten, unfold | |
pm.u3dUnfold(selected, ite = 1, p = 0, bi = 1, tf = 1, ms = 1024, rs = 0) | |
mel.eval('texStraightenUVs "UV" 30') | |
pm.u3dUnfold(selected, ite = 1, p = 0, bi = 1, tf = 1, ms = 1024, rs = 0) | |
pm.hilite(pm.ls(hilite=True), r=True) # Solves highlighting of UVs by highliging... whatever is highlighted? | |
# Select the previous selection and convert to UVShell. | |
pm.select(selected, r=True) | |
mel.eval("ConvertSelectionToUVShell") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment