-
Notifications
You must be signed in to change notification settings - Fork 0
/
RiggingSlave_v1.0
303 lines (234 loc) · 9.69 KB
/
RiggingSlave_v1.0
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
from PySide.QtGui import *
from PySide.QtCore import *
import maya.OpenMayaUI as mui
from shiboken import wrapInstance
# Main UI
def mayaMainWindow():
mainWindow= mui.MQtUtil.mainWindow()
return wrapInstance(long(mainWindow), QWidget)
class Form(QDialog):
def __init__(self, parent=mayaMainWindow()):
super(Form, self).__init__()
# Menu Bar
bar= QMenuBar()
barFile= bar.addMenu("Edit")
self.fileReset= barFile.addAction("Reset ")
self.fileReset.setShortcut("Ctrl + R")
self.connect( self.fileReset, SIGNAL("triggered()"), self.resetUI() )
barFile.addSeparator()
fileQuit= barFile.addAction("Quit ")
self.connect( fileQuit, SIGNAL("triggered()"), SLOT("reject()") )
barHelp= bar.addMenu("Help")
helpReadme= barHelp.addAction("ReadMe ")
self.connect( helpReadme, SIGNAL("triggered()"), self.readMeDialog() )
# Tab Widget
self.tab= QTabWidget()
self.tab1= QWidget()
self.tab2= QWidget()
self.tab3= QWidget()
self.tab.addTab( self.tab1, "Prop" )
self.tab.addTab( self.tab2, "Biped" )
self.tab.addTab( self.tab3, "Quadruped" )
self.tab1UI()
self.tab2UI()
self.tab3UI()
# Layout
mainLayout= QVBoxLayout()
mainLayout.addWidget( bar )
mainLayout.setSpacing(5)
mainLayout.addWidget( self.tab )
mainLayout.stretch(1)
# Window Structure
self.setLayout(mainLayout)
#self.resize( 220, 400 )
self.setWindowTitle("RiggingSlave v1.0")
self.setWindowFlags(Qt.WindowStaysOnTopHint)
# Menu Function
def resetUI(self):
# reset Function
print "reset"
def readMeDialog(self):
# Read Me Function
print "read me"
# Prop Tab UI
def tab1UI(self):
tab1Layout= QVBoxLayout()
tab1Layout.addWidget( self.propGrpBox() )
tab1Layout.addWidget( self.ropeGrpBox() )
tab1Layout.addWidget( self.cRigGrpBox() )
self.tab1.setLayout( tab1Layout )
tab1Layout.addStretch(1)
def propGrpBox(self):
propLayout= QGridLayout()
propBox= QGroupBox("Auto Prop Rig")
rigMethodLabel= QLabel( "Rig" )
oneByOneRB= QRadioButton("&One By One")
allToOneRB= QRadioButton( "&All To One" )
deformLabel= QLabel( "Deformers" )
addSquashCB= QCheckBox("Add &Squash")
propRigBttn= QPushButton( "Rig" )
oneByOneRB.setChecked(True)
addSquashCB.setChecked(True)
propLayout.addWidget( rigMethodLabel , 0, 0, 1, 3 )
propLayout.addWidget( oneByOneRB, 1, 0 )
propLayout.addWidget( allToOneRB, 1, 1 )
propLayout.addWidget( deformLabel, 2, 0, 1, 3 )
propLayout.addWidget( addSquashCB, 3, 0 )
propLayout.addWidget( propRigBttn, 4, 0, 1, 3 )
propBox.setLayout( propLayout )
return propBox
def ropeGrpBox(self):
ropeLayout= QGridLayout()
ropeBox= QGroupBox("Auto Rope Rig")
IKSpineRB= QRadioButton("&IK Spine")
wireInOneRB= QRadioButton( "&Wire Deformer" )
crvLE= QLineEdit()
crvLE.setPlaceholderText( "Please add curve..." )
crvBttn= QPushButton( "Add Curve" )
crvBttn.setStyleSheet("background-color: #333333 ")
crvMenu = QMenu(self)
crvMenu.addAction("&Add Selected Curve")
crvMenu.addAction("&Poly Edge To Curve")
crvMenu.addAction("&Create Curve")
crvBttn.setMenu(crvMenu)
ctrlLabel= QLabel("Ctrls number:")
ctrlSB= QDoubleSpinBox()
ctrlSB.setRange( 1, 1000 )
ropeRigBttn= QPushButton( "Rig" )
wireInOneRB.setChecked(True)
ropeLayout.addWidget( IKSpineRB, 0, 0 )
ropeLayout.addWidget( wireInOneRB, 0, 1 )
ropeLayout.addWidget( crvLE, 1, 0, 1, 3 )
ropeLayout.addWidget( crvBttn, 2, 0, 1, 3 )
ropeLayout.addWidget( ctrlLabel, 3, 0 )
ropeLayout.addWidget( ctrlSB, 3, 1 )
ropeLayout.addWidget( ropeRigBttn, 4, 0, 1, 3 )
ropeBox.setLayout( ropeLayout )
return ropeBox
def cRigGrpBox(self):
cRigLayout= QVBoxLayout()
cRigBox= QGroupBox( "Master Controllers")
cRigBttn= QPushButton( "Add" )
cRigBttn.setStyleSheet("background-color: #777777")
cRigLayout.addWidget( cRigBttn )
cRigBox.setLayout( cRigLayout )
return cRigBox
# Biped Tab UI
def tab2UI(self):
tab2Layout= QVBoxLayout()
tab2Layout.addWidget( self.boneGrpBox() )
tab2Layout.addWidget( self.bindSkinGrpBox() )
tab2Layout.addWidget( self.bipedRigGrpBox() )
self.tab2.setLayout( tab2Layout )
tab2Layout.addStretch(1)
def boneGrpBox(self):
boneLayout= QGridLayout()
boneBox= QGroupBox("Proxy Joint")
mirrorLabel= QLabel( "Mirror Joint?" )
yesRB= QRadioButton( "Yes" )
noRB= QRadioButton( "No" )
setUpJntBttn= QPushButton("Create")
resetJntBttn= QPushButton("Reset")
resetJntBttn.setStyleSheet("background-color: #333333 ")
freezeJntBttn= QPushButton( "Polish" )
freezeJntBttn.setStyleSheet("background-color: #666666")
yesRB.setChecked(True)
boneLayout.addWidget( mirrorLabel, 0, 0 )
boneLayout.addWidget( yesRB, 0, 1 )
boneLayout.addWidget( noRB, 0, 2 )
boneLayout.addWidget( setUpJntBttn, 1, 0, 1, 3 )
boneLayout.addWidget( resetJntBttn, 2, 0, 1, 3 )
boneLayout.addWidget( freezeJntBttn, 3, 0, 1, 3 )
boneBox.setLayout( boneLayout )
return boneBox
def bindSkinGrpBox(self):
bindSkinLayout= QVBoxLayout()
bindSkinBox= QGroupBox( "Skinning" )
bindBttn= QPushButton( "Bind Skin" )
bindSkinLayout.addWidget( bindBttn )
bindSkinBox.setLayout( bindSkinLayout )
return bindSkinBox
def bipedRigGrpBox(self):
bipedLayout= QVBoxLayout()
bipedBox= QGroupBox( "Setup Controllers" )
setupRigBttn= QPushButton( "Setup Rig" )
setupRigBttn.setStyleSheet("background-color: #777777")
bipedLayout.addWidget( self.bendyBox() )
bipedLayout.addWidget( setupRigBttn )
bipedBox.setLayout( bipedLayout )
return bipedBox
def bendyBox(self):
bendyLayout= QVBoxLayout()
bendyBox= QGroupBox("Bendy Setup")
bendyBox.setCheckable(True)
bendyBox.setChecked(True)
allRB= QRadioButton( "All" )
armRB= QRadioButton( "Arm" )
legRB= QRadioButton( "Leg" )
allRB.setChecked(True)
bendyLayout.addWidget( allRB )
bendyLayout.addWidget( armRB )
bendyLayout.addWidget( legRB )
bendyBox.setLayout( bendyLayout )
return bendyBox
# Quadruped Tab UI
def tab3UI(self):
tab3Layout= QVBoxLayout()
tab3Layout.addWidget( self.qBoneGrpBox() )
tab3Layout.addWidget( self.qBindSkinGrpBox() )
tab3Layout.addWidget( self.quadrupedRigGrpBox() )
self.tab3.setLayout( tab3Layout )
tab3Layout.addStretch(1)
def qBoneGrpBox(self):
qBoneLayout= QGridLayout()
qBoneBox= QGroupBox("Proxy Joint")
qMirrorLabel= QLabel( "Mirror Joint?" )
qYesRB= QRadioButton( "Yes" )
qNoRB= QRadioButton( "No" )
qSetUpJntBttn= QPushButton("Create")
qResetJntBttn= QPushButton("Reset")
qResetJntBttn.setStyleSheet("background-color: #333333 ")
qFreezeJntBttn= QPushButton( "Polish" )
qFreezeJntBttn.setStyleSheet("background-color: #666666")
qYesRB.setChecked(True)
qBoneLayout.addWidget( qMirrorLabel, 0, 0 )
qBoneLayout.addWidget( qYesRB, 0, 1 )
qBoneLayout.addWidget( qNoRB, 0, 2 )
qBoneLayout.addWidget( qSetUpJntBttn, 1, 0, 1, 3 )
qBoneLayout.addWidget( qResetJntBttn, 2, 0, 1, 3 )
qBoneLayout.addWidget( qFreezeJntBttn, 3, 0, 1, 3 )
qBoneBox.setLayout( qBoneLayout )
return qBoneBox
def qBindSkinGrpBox(self):
qBindSkinLayout= QVBoxLayout()
qBindSkinBox= QGroupBox( "Skinning" )
qBindBttn= QPushButton( "Bind Skin" )
qBindSkinLayout.addWidget( qBindBttn )
qBindSkinBox.setLayout( qBindSkinLayout )
return qBindSkinBox
def quadrupedRigGrpBox(self):
quadrupedLayout= QVBoxLayout()
quadrupedBox= QGroupBox( "Setup Controllers" )
qSetupRigBttn= QPushButton( "Setup Rig" )
qSetupRigBttn.setStyleSheet("background-color: #777777")
quadrupedLayout.addWidget( self.qBendyBox() )
quadrupedLayout.addWidget( qSetupRigBttn )
quadrupedBox.setLayout( quadrupedLayout )
return quadrupedBox
def qBendyBox(self):
qBendyLayout= QVBoxLayout()
qBendyBox= QGroupBox("Bendy Setup")
qBendyBox.setCheckable(True)
qBendyBox.setChecked(True)
qAllRB= QRadioButton( "All" )
qArmRB= QRadioButton( "Arm" )
qLegRB= QRadioButton( "Leg" )
qAllRB.setChecked(True)
qBendyLayout.addWidget( qAllRB )
qBendyLayout.addWidget( qArmRB )
qBendyLayout.addWidget( qLegRB )
qBendyBox.setLayout( qBendyLayout )
return qBendyBox
if __name__ == "__main__":
a= Form()
a.show()