Mel to Python Conversion issues

Mel to Python Conversion issues

absoluteKelvin
Collaborator Collaborator
730 Views
2 Replies
Message 1 of 3

Mel to Python Conversion issues

absoluteKelvin
Collaborator
Collaborator
import maya.cmds as cmds

def UDIMLayoutHelperWindow():
         if cmds.window('UDIMLayoutHelper', exist=True):
         cmds.deleteUI('UDIMLayoutHelper')
         cmds.window('UDIMLayoutHelper', title='UDIM Layout Helper', widthHeight=(404,256), resizeToFitChildren=True)
         cmds.columnLayout(width=150, adjustableColumn=True, collapse=False)
         cmds.setParent(top=True)
         cmds.frameLayout(label='Setup',collapsable=True, collapse=False)
         cmds.rowLayout(numberOfColumns=3)
         cmds.button(label='Open UV Editor', width=90)
         cmds.button(label='Setup UV Grid', width=90)
         cmds.button(label='Dock Control', width=90)
         cmds.showWindow()
            

UDIMLayoutHelperWindow()

Trying to convert some code i made in mel to python. Ran into a bit of an issue. When I run the above code, I get this error.

# Error: line 1: expected an indented block #

not quite sure what im suppose to do?

https://www.artstation.com/kelvintam
0 Likes
Accepted solutions (1)
731 Views
2 Replies
Replies (2)
Message 2 of 3

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

After

 

if cmds.window('UDIMLayoutHelper', exist=True):

 

The rest part of code should be indented with either tab or spaces. Here is more info.

 

Yours,

Li

 

 

Message 3 of 3

absoluteKelvin
Collaborator
Collaborator

thanks Cheng

https://www.artstation.com/kelvintam
0 Likes