Skip to content

Instantly share code, notes, and snippets.

@theodox
Created February 18, 2014 05:14
Show Gist options
  • Save theodox/9065001 to your computer and use it in GitHub Desktop.
Save theodox/9065001 to your computer and use it in GitHub Desktop.
import maya.cmds as cmds
class ExampleButton(object):
CMD = cmds.button
def __init__(self, *args, **kwargs):
self.Widget = self.CMD (*args, **kwargs)
@property
def Label(self):
return self.CMD(self.Widget, q=True, label=True)
example = cmds.window()
col = cmds.columnLayout()
btn = ExampleButton("hello world")
cmds.showWindow(example)
print btn.Label
# hello world</code></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment