Created
September 12, 2014 14:12
-
-
Save kaptankereviz/1a7efd40d3b15fafe54e 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 maya.cmds as mc | |
| class SimpleUI(object): | |
| def __init__(self, *args): | |
| self.wg={} | |
| self.wg['win'] = 'MySimpleWindow' | |
| self.wg['dock'] = 'MySimpleDock' | |
| if mc.dockControl(self.wg['dock'], exists=True): | |
| mc.deleteUI(self.wg['dock']) | |
| # window | |
| mc.window(self.wg['win']) | |
| # layout | |
| mc.rowColumnLayout(nc=1) | |
| """ controls """ | |
| mc.button(l='textField_button', | |
| c=self.com_button_command) | |
| # this works | |
| self.wg['textField'] = mc.textField() | |
| mc.button(l='textFieldGrp_button', | |
| c=self.com_grp_button_command) | |
| # this does not work | |
| self.wg['textFieldGrp'] = mc.textFieldGrp() | |
| mc.dockControl(self.wg['dock'], | |
| area='left', | |
| content=self.wg['win']) | |
| def com_button_command(self, *args): | |
| # this works | |
| mc.textField(self.wg['textField'], e=True, tx='blabla') | |
| def com_grp_button_command(self, *args): | |
| # this does not work | |
| mc.textFieldGrp(self.wg['textFieldGrp'], e=True, tx='blabla') | |
| SimpleUI() | |
| """Error Code""" | |
| # // Error: RuntimeError: file <maya console> line 36: | |
| # Object 'MySimpleWindow|rowColumnLayout10|textFieldGrp26' not found. // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment