Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

UV Border show/hide script request

UV Border show/hide script request

artofillusionist
Enthusiast Enthusiast
610 Views
2 Replies
Message 1 of 3

UV Border show/hide script request

artofillusionist
Enthusiast
Enthusiast

Hi.

 

I am not experienced in scripting. I would like to put in my shelf the UV border on/off button from UV editor.

 

import maya.cmds as cmds
cmds.polyOptions(gl=True, displayMapBorder=True)

 

this script only shows the border, possible to write a new the script?

if the border ON  then the script set them OFF

if the border OFF  then the script set them ON?

 

Thanks!

0 Likes
Accepted solutions (1)
611 Views
2 Replies
Replies (2)
Message 2 of 3

landonjpginn
Participant
Participant
Accepted solution

Not fancy but it ought to work since youre doing it for all assets.

import maya.cmds as cmds

if True in cmds.polyOptions(q=1,gl=1, displayMapBorder=True):
    cmds.polyOptions(gl=True, displayMapBorder=False)
else:
    cmds.polyOptions(gl=True, displayMapBorder=True)

Message 3 of 3

artofillusionist
Enthusiast
Enthusiast

Thank you!

0 Likes