[Maya Python] Weird... bug? With formLayout

Hey,

I’ve been working with Maya Python for a bit, but have just recently started really delving into UI and layouts. However, when using cmds.formLayout, I’ve run across a weird bug involving colons. When running this code in Maya Python, the formLayout glitches and only adjusts the location of the first label placed (cut out from something I’m working on).

import maya.cmds as cmds
cmds.window(t='Export Keys', width=400, height=200)
form = cmds.formLayout(numberOfDivisions=100)

startLabel = cmds.text('Start Time:')
endLabel = cmds.text('End Time:')
startTime = cmds.floatField("startTime", value=0, precision=1, en=0, w=75)
endTime = cmds.floatField("endTime", value=10, precision=1, en=0, w=75)
testLabel = cmds.text('End Time:')

cmds.formLayout( form, edit=True, attachPosition=[
(startLabel, 'left', 30, 0), (startLabel, 'top', 0, 46),
(startTime, 'left', 105, 0 ), (startTime, 'top', 0, 44),
(endLabel, 'left', 30, 0), (endLabel, 'top', 0, 56), 
(endTime, 'left', 105, 0), (endTime, 'top', 0, 56),
(testLabel, 'left', 30, 0), (testLabel, 'top', 0, 90)
] )

cmds.showWindow()

If you remove the colons or add an extra character after them (not a space, blank character, or endline), this issue does not exist.

Is there a known workaround to this? Or should I be using a different type of layout for the UIs to my script? I attempted it and couldn’t figure out any really reasonable solution except to replace the colons with something else.

Also I’m using Maya 2013 on Win7. I haven’t extensively tested it on other OSs/versions of Maya, so it might not be a problem there.

the colons are probably generating an illegal character in the text object names. Does ’

startLabel = cmds.text(label= 'Start Time:')

cause the same issue?

[QUOTE=Theodox;23061]the colons are probably generating an illegal character in the text object names. Does ’

startLabel = cmds.text(label= 'Start Time:')

cause the same issue?[/QUOTE]

Oh wow I feel dumb that I didn’t think to try that :[

That fixes it. Thanks a lot!