3131
3232
3333class TransformationsAnnotations :
34- annotation = "xxxxxxxxxxxxxxxxxxx"
34+ space = "WORLD SPACE uses global axes orientations.\n LOCAL SPACE uses parent space, useful when selected object is a child of other object.\n OBJECT SPACE uses selected objects' axes and move accordingly arrows."
35+ relative = "Current position used as a start point resulting move addition each step.\n Deactivate to use absolute mode to set specific coordinates."
36+ preserveChildPosition = "Child object will stay on the same position while selected object will be moved.\n Very useful when you need to tweak object's position in the middle of hierarchy."
37+ pivot = "Move pivot of selected objects instead of moving objects transform nodes"
38+ multiplier = "Extra multiplier for DIRECTION and DISTANCE values."
3539
36- class TransformationsSettings :
37- value = 0
40+ editPivot = "Toggle pivot editing for selected objects.\n The same action as 'D' hotkey on keyboard."
41+ pivotOn = "Show pivot attributes in channel box"
42+ pivotOff = "Hide pivot attributes in channel box"
43+
44+ direction = "XYZ values for directional movement"
45+ moveDirectionNegative = "Apply directional movement with reverse direction values"
46+ moveDirectionPositive = "Apply directional movement with original direction values"
47+
48+ distance = "Distance value for separate axes movement"
49+ moveDistance = "Apply movement to current axis.\n -+ symbols mean negative and positive directinos."
3850
3951class Transformations :
40- _version = "v0.0 "
52+ _version = "v0.1 "
4153 _name = "TRANSFORMATIONS"
4254 _title = _name + " " + _version
4355
@@ -64,17 +76,17 @@ def UILayoutLocators(self, layoutMain):
6476 cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "MOVE" , collapsable = True , backgroundColor = Settings .frames2Color , highlightColor = Colors .green100 , marginWidth = 0 , marginHeight = 0 , borderVisible = True )
6577 layoutColumn = cmds .columnLayout (adjustableColumn = True )
6678
67- self .radioButtonGrpSpace = cmds .radioButtonGrp (parent = layoutColumn , label = "Space: " , labelArray3 = ["World" , "Local" , "Object" ], select = 1 , numberOfRadioButtons = 3 , columnWidth4 = (60 , 50 , 50 , 50 ), columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )], height = Settings .lineHeight )
79+ self .radioButtonGrpSpace = cmds .radioButtonGrp (parent = layoutColumn , label = "Space: " , labelArray3 = ["World" , "Local" , "Object" ], select = 1 , numberOfRadioButtons = 3 , columnWidth4 = (60 , 50 , 50 , 50 ), columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )], height = Settings .lineHeight , annotation = TransformationsAnnotations . space )
6880 self .radioButtonGrpSpace = self .radioButtonGrpSpace .replace (Settings .windowName + "|" , "" ) # HACK fix for docked window only. Don't know how to avoid issue
6981
7082 cmds .rowLayout (parent = layoutColumn , numberOfColumns = 3 , columnWidth3 = (70 , 150 , 50 ), columnAlign = [(1 , "center" ), (2 , "center" ), (3 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 ), (3 , "both" , 0 )], height = Settings .lineHeight )
71- self .checkBoxRelative = cmds .checkBox (label = "Relative" , value = True )
72- self .checkBoxPreserveChildPosition = cmds .checkBox (label = "Preserve Child Position" , value = False )
73- self .checkBoxPivot = cmds .checkBox (label = "Pivot" , value = False )
83+ self .checkBoxRelative = cmds .checkBox (label = "Relative" , value = True , annotation = TransformationsAnnotations . relative )
84+ self .checkBoxPreserveChildPosition = cmds .checkBox (label = "Preserve Child Position" , value = False , annotation = TransformationsAnnotations . preserveChildPosition )
85+ self .checkBoxPivot = cmds .checkBox (label = "Pivot" , value = False , annotation = TransformationsAnnotations . pivot )
7486
7587 cmds .rowLayout (parent = layoutColumn , adjustableColumn = 2 , numberOfColumns = 5 , columnWidth5 = (60 , 50 , 60 , 50 , 50 ), columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" ), (5 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 ), (3 , "both" , 0 ), (4 , "both" , 0 ), (5 , "both" , 0 )], height = Settings .lineHeight )
76- cmds .text (label = "Multiplier: " )
77- self .floatFieldMultiplier = cmds .floatField (value = 1 , precision = 3 )
88+ cmds .text (label = "Multiplier: " , annotation = TransformationsAnnotations . multiplier )
89+ self .floatFieldMultiplier = cmds .floatField (value = 1 , precision = 3 , annotation = TransformationsAnnotations . multiplier )
7890 cmds .popupMenu ()
7991 cmds .menuItem (label = "0.001" , command = partial (self .SetMultiplier , 0.001 ))
8092 cmds .menuItem (label = "0.01" , command = partial (self .SetMultiplier , 0.01 ))
@@ -96,12 +108,12 @@ def UILayoutLocators(self, layoutMain):
96108 cmds .menuItem (label = "10" , command = partial (self .SetMultiplier , 10 ))
97109 cmds .menuItem (label = "100" , command = partial (self .SetMultiplier , 100 ))
98110 cmds .menuItem (label = "1000" , command = partial (self .SetMultiplier , 1000 ))
99- cmds .button (label = "Edit Pivot" , command = cmds .EnterEditModePress , backgroundColor = Colors .yellow10 )
100- cmds .button (label = "Pivot On" , command = partial (self .SetPivotAttributes , True ), backgroundColor = Colors .blackWhite80 )
101- cmds .button (label = "Pivot Off" , command = partial (self .SetPivotAttributes , False ), backgroundColor = Colors .blackWhite80 )
111+ cmds .button (label = "Edit Pivot" , command = cmds .EnterEditModePress , backgroundColor = Colors .yellow10 , annotation = TransformationsAnnotations . editPivot )
112+ cmds .button (label = "Pivot On" , command = partial (self .SetPivotAttributes , True ), backgroundColor = Colors .blackWhite80 , annotation = TransformationsAnnotations . pivotOn )
113+ cmds .button (label = "Pivot Off" , command = partial (self .SetPivotAttributes , False ), backgroundColor = Colors .blackWhite80 , annotation = TransformationsAnnotations . pivotOff )
102114
103115 rowLayoutDirection = cmds .rowLayout (parent = layoutColumn , adjustableColumn = 2 , numberOfColumns = 2 , columnWidth2 = (188 , 60 ), columnAlign = [(1 , "right" ), (2 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 )], height = Settings .lineHeight )
104- self .floatFieldGrpDirection = cmds .floatFieldGrp (parent = rowLayoutDirection , label = "Direction: " , numberOfFields = 3 , columnWidth4 = (60 , 40 , 40 , 40 ), value = [0 , 0 , 0 , 0 ], columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )])
116+ self .floatFieldGrpDirection = cmds .floatFieldGrp (parent = rowLayoutDirection , label = "Direction: " , numberOfFields = 3 , columnWidth4 = (60 , 40 , 40 , 40 ), value = [0 , 0 , 0 , 0 ], columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )], annotation = TransformationsAnnotations . direction )
105117 self .floatFieldGrpDirection = self .floatFieldGrpDirection .replace (Settings .windowName + "|" , "" ) # HACK fix for docked window only. Don't know how to avoid issue
106118 cmds .popupMenu ()
107119 cmds .menuItem (label = "0, 0, 0" , command = partial (self .SetDirection , [0 , 0 , 0 ]))
@@ -110,12 +122,12 @@ def UILayoutLocators(self, layoutMain):
110122 cmds .menuItem (label = "0, 1, 0" , command = partial (self .SetDirection , [0 , 1 , 0 ]))
111123 cmds .menuItem (label = "0, 0, 1" , command = partial (self .SetDirection , [0 , 0 , 1 ]))
112124 cmds .gridLayout (parent = rowLayoutDirection , numberOfColumns = 2 , cellWidth = 44 , cellHeight = Settings .lineHeight )
113- cmds .button (label = "-XYZ" , command = partial (self .MoveSelected , 0 , True ), backgroundColor = Colors .orange10 )
114- cmds .button (label = "+XYZ" , command = partial (self .MoveSelected , 0 , False ), backgroundColor = Colors .orange50 )
125+ cmds .button (label = "-XYZ" , command = partial (self .MoveSelected , 0 , True ), backgroundColor = Colors .orange10 , annotation = TransformationsAnnotations . moveDirectionNegative )
126+ cmds .button (label = "+XYZ" , command = partial (self .MoveSelected , 0 , False ), backgroundColor = Colors .orange50 , annotation = TransformationsAnnotations . moveDirectionPositive )
115127
116128 cmds .rowLayout (parent = layoutColumn , adjustableColumn = 2 , numberOfColumns = 3 , columnWidth3 = (60 , 50 , 156 ), columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 ), (3 , "both" , 0 )], height = Settings .lineHeight )
117- cmds .text (label = "Distance: " )
118- self .floatFieldDistance = cmds .floatField (value = 1 , precision = 3 )
129+ cmds .text (label = "Distance: " , annotation = TransformationsAnnotations . distance )
130+ self .floatFieldDistance = cmds .floatField (value = 1 , precision = 3 , annotation = TransformationsAnnotations . distance )
119131 cmds .popupMenu ()
120132 cmds .menuItem (label = "0" , command = partial (self .SetDistance , 0 ))
121133 cmds .menuItem (divider = True )
@@ -132,12 +144,12 @@ def UILayoutLocators(self, layoutMain):
132144 cmds .menuItem (label = "100" , command = partial (self .SetDistance , 100 ))
133145 cmds .menuItem (label = "1000" , command = partial (self .SetDistance , 1000 ))
134146 cmds .gridLayout (numberOfColumns = 6 , cellWidth = 26 , cellHeight = Settings .lineHeight )
135- cmds .button (label = "-X" , command = partial (self .MoveSelected , 1 , True ), backgroundColor = Colors .red10 )
136- cmds .button (label = "+X" , command = partial (self .MoveSelected , 1 , False ), backgroundColor = Colors .red50 )
137- cmds .button (label = "-Y" , command = partial (self .MoveSelected , 2 , True ), backgroundColor = Colors .green10 )
138- cmds .button (label = "+Y" , command = partial (self .MoveSelected , 2 , False ), backgroundColor = Colors .green50 )
139- cmds .button (label = "-Z" , command = partial (self .MoveSelected , 3 , True ), backgroundColor = Colors .blue10 )
140- cmds .button (label = "+Z" , command = partial (self .MoveSelected , 3 , False ), backgroundColor = Colors .blue50 )
147+ cmds .button (label = "-X" , command = partial (self .MoveSelected , 1 , True ), backgroundColor = Colors .red10 , annotation = TransformationsAnnotations . moveDistance )
148+ cmds .button (label = "+X" , command = partial (self .MoveSelected , 1 , False ), backgroundColor = Colors .red50 , annotation = TransformationsAnnotations . moveDistance )
149+ cmds .button (label = "-Y" , command = partial (self .MoveSelected , 2 , True ), backgroundColor = Colors .green10 , annotation = TransformationsAnnotations . moveDistance )
150+ cmds .button (label = "+Y" , command = partial (self .MoveSelected , 2 , False ), backgroundColor = Colors .green50 , annotation = TransformationsAnnotations . moveDistance )
151+ cmds .button (label = "-Z" , command = partial (self .MoveSelected , 3 , True ), backgroundColor = Colors .blue10 , annotation = TransformationsAnnotations . moveDistance )
152+ cmds .button (label = "+Z" , command = partial (self .MoveSelected , 3 , False ), backgroundColor = Colors .blue50 , annotation = TransformationsAnnotations . moveDistance )
141153
142154 def SetMultiplier (self , value , * args ):
143155 cmds .floatField (self .floatFieldMultiplier , edit = True , value = value )
0 commit comments