/
ra_SuperCombiner.py
executable file
·80 lines (57 loc) · 2.48 KB
/
ra_SuperCombiner.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
76
77
78
79
80
__author__ = 'ronnie ashlock'
# Consolidates a lot of reused workflow procedures in one handy GUI.
import pymel.core as pmc
import maya.mel as mel
class SuperCombiner():
def combine_all(self):
pmc.select(all = True)
pmc.polyUnite()
def combine_selected(self):
pmc.polyUnite()
def separate_all(self):
pmc.select(all = True)
pmc.polySeparate()
def separate_selected(self):
pmc.polySeparate()
def nuke_history(self):
pmc.general.delete(constructionHistory = True)
def reset_transform(self):
pmc.makeIdentity(t = True, a = False)
def freeze_transform(self):
pmc.makeIdentity(t = True, r=True, s=True, a = True)
def center_pivot(self):
pmc.xform(centerPivots=True)
def move_to_origin(self):
pmc.mel.eval('numericalInputChangeCommand abs')
pmc.makeIdentity(t = True, a = True)
def wfos_on(*args):
x = pmc.mel.eval('findNewCurrentModelView')
active_panel = 'modelPanel%i' % (4)
shade_state = 'true '
option = 'setWireframeOnShadedOption %s %s' % (shade_state, active_panel)
z = 'setWireframeOnShadedOption false modelPanel4'
pmc.mel.eval(option)
def wfos_off(*args):
x = pmc.mel.eval('findNewCurrentModelView')
active_panel = 'modelPanel%i' % (4)
shade_state = 'false '
option = 'setWireframeOnShadedOption %s %s' % (shade_state, active_panel)
z = 'setWireframeOnShadedOption false modelPanel4'
pmc.mel.eval(option)
def hypeshade(self):
pmc.runtime.HypershadeWindow()
pmc.window(width=200, title='Super Combiner')
pmc.columnLayout(adjustableColumn = True)
pmc.button(label = "Combine Selected", command = combine_selected)
pmc.button(label = "Separate Selected", command = separate_selected)
pmc.button(label = "Combine All", command = combine_all)
pmc.button(label = "Separate All", command = separate_all)
pmc.button(label = "Reset Transforms", command = reset_transform)
pmc.button(label = "Freeze Transforms", command = freeze_transform)
pmc.button(label = "Delete History", command = nuke_history)
pmc.button(label = "Center Pivot", command = center_pivot)
pmc.button(label = "Move to Origin", command = move_to_origin)
pmc.button(label = "WFoS ON", command = wfos_on)
pmc.button(label = "WFoS OFF", command = wfos_off)
pmc.button(label = "HyperShade", command = hypeshade)
pmc.showWindow()