Can I edit the numberOfDivisions of a formLayout once initialized via Maya Python command api?

Can I edit the numberOfDivisions of a formLayout once initialized via Maya Python command api?

Anonymous
473 Views
0 Replies
Message 1 of 1

Can I edit the numberOfDivisions of a formLayout once initialized via Maya Python command api?

Anonymous
Not applicable

I want to change the numberOfDivisions of a formLayout via Maya Python command api. It seems straightforward, but you can try it yourself with this simple chunk of code:

import maya.cmds as cmds

# Initialization.
w = cmds.window()
f = cmds.formLayout(numberOfDivisions=5)
b = cmds.button()

# Edit number of divisions from 5 to 10.
cmds.formLayout(f, edit=True, numberOfDivisions=10)

# Attach the button to it.
# NOTE - The program should die here.
cmds.formLayout(f, edit=True, attachPosition=[(b, 'top', 5, 0),(b, 'right', 5, 10)])

# The program should not reach here.
cmds.showWindow(w)
474 Views
0 Replies
Replies (0)