-
Notifications
You must be signed in to change notification settings - Fork 1
/
DemoUI.py
75 lines (58 loc) · 1.78 KB
/
DemoUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# DemoUI.py
import maya.cmds as cmds
import Mesh as mm
from config import *
class DemoUI(object):
def __init__(self):
self._mesh = mm.Mesh()
self.window = cmds.window(title="SliderWindow")
self.column = cmds.columnLayout()
cmds.button(
'Create Nails',
backgroundColor=LIGHT_GRAY,
command=lambda *args: self._createNails()
)
cmds.button(
'Simple bend',
backgroundColor=DEFAULT_GRAY,
command=lambda *args: self._simpleBend()
)
cmds.button(
'Uniform wave',
backgroundColor=DEFAULT_GRAY,
command=lambda *args: self._uniformWave()
)
cmds.button(
'Sine wave',
backgroundColor=MID_GRAY,
command=lambda *args: self._sineWave()
)
cmds.button(
'Simple wave',
backgroundColor=DARK_GRAY,
command=lambda *args: self._simpleWave()
)
cmds.button(
'Apply material',
backgroundColor=DARK_GREEN,
command=lambda *args: self._assignPewter()
)
cmds.showWindow(self.window)
def startUI(self):
currentWindows = cmds.lsUI(windows=True)
for window in currentWindows:
title = cmds.window(window, query=True, title=True)
if title == 'Controls':
cmds.deleteUI(window)
def _createNails(self):
self._mesh.createNails()
def _simpleBend(self):
self._mesh.simpleBend()
def _uniformWave(self):
self._mesh.uniformWave()
def _sineWave(self):
self._mesh.sineWave()
def _simpleWave(self):
self._mesh.simpleWave()
def _assignPewter(self):
self._mesh.assignPewter()