-
Notifications
You must be signed in to change notification settings - Fork 0
/
MirrorObjects
98 lines (53 loc) · 2.11 KB
/
MirrorObjects
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
#################################################################
###################### Mirror Objects ########################
#################################################################
#Author:Siddarth Mehra
#Email:[email protected]
#Mobile: +91-7728050400(Whatsapp)
#MirrorObjects
def MirrorBojs():
slc = cmds.ls(sl=True)
if (len(slc)==0):
cmds.inViewMessage( amg='Please select something to <hl>Mirror</hl>.', pos='botCenter', fade=True)
else:
newObj = cmds.duplicate(slc,n=('Mirrored_'+str(slc[0])))
newobjgrp = cmds.group(newObj,n=(str(slc[0])+'_MirrorGrp'))
mel.eval("xform -os -piv 0 0 0;")
cmds.scale( -1, 1, 1 )
cmds.ungroup(newobjgrp)
cmds.makeIdentity(newObj, apply=True, t=1, r=1, s=1 )
cmds.select(newObj)
a=cmds.promptDialog(
title='Mirror',
message='If LT suffix exists type 1',
button=['Rename', "Don't Rename"],
defaultButton='Rename',
cancelButton="Don't Rename",
dismissString='Not Renaming')
if a == 'Rename':
text = cmds.promptDialog(query=True, text=True)
g = int(text)
try:
mel.eval('searchReplaceNames"_LT" "_RT" "selected"')
except:
pass
try:
mel.eval('searchReplaceNames"_lt" "_rt" "selected"')
except:
pass
try:
mel.eval('searchReplaceNames"_L" "_R" "selected"')
except:
pass
try:
mel.eval('searchReplaceNames"_Left" "_Right" "selected"')
except:
pass
if g==1:
mel.eval('searchReplaceNames"Mirrored_" "" "selected"')
print 'removed mirrored names'
else:
pass
else:
pass
MirrorBojs()