1818# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1919# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020
21- # Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
21+ # Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene https://discord.gg/heMxJhTqCz
2222# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene
2323
2424import maya .cmds as cmds
@@ -98,38 +98,38 @@ def __init__(self, options):
9898 self .COMObject = None
9999 self .CachedSelectedObjects = None
100100
101- self .layoutSetup = None
102- self .layoutWeights = None
103- self .layoutBaking = None
101+ # self.layoutSetup = None
102+ # self.layoutWeights = None
103+ # self.layoutBaking = None
104104
105105 def UICreate (self , layoutMain ):
106106 self .UILayoutSetup (layoutMain )
107107 self .UILayoutWeights (layoutMain )
108108 self .UILayoutBaking (layoutMain )
109+ cmds .separator (parent = layoutMain , height = Settings .separatorHeight , style = "none" )
110+
109111 def UILayoutSetup (self , layoutMain ):
110- self . layoutSetup = cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "SETUP" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 )
111- layoutColumn = cmds .columnLayout (parent = self . layoutSetup , adjustableColumn = True )
112- #
113- COMButtons1 = 4
114- cmds .gridLayout (parent = layoutColumn , numberOfColumns = COMButtons1 , cellWidth = Settings .windowWidthMargin / COMButtons1 , cellHeight = Settings .lineHeight )
112+ cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "SETUP" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 , borderVisible = True )
113+ layoutColumn = cmds .columnLayout (adjustableColumn = True , rowSpacing = Settings . columnLayoutRowSpacing )
114+
115+ countCells = 4
116+ cmds .gridLayout (parent = layoutColumn , numberOfColumns = countCells , cellWidth = Settings .windowWidthMargin / countCells , cellHeight = Settings .lineHeight )
115117 cmds .button (label = "Create" , command = self .COMCreate , backgroundColor = Colors .green50 , annotation = CenterOfMassAnnotations .create )
116118 cmds .button (label = "Activate" , command = self .COMActivate , backgroundColor = Colors .yellow50 , annotation = CenterOfMassAnnotations .activate )
117119 cmds .button (label = "Select" , command = self .COMSelect , backgroundColor = Colors .lightBlue50 , annotation = CenterOfMassAnnotations .select )
118120 cmds .button (label = "Clean" , command = self .COMClean , backgroundColor = Colors .red50 , annotation = CenterOfMassAnnotations .clean )
119- #
120- rowLayoutSize = (110 , 40 , 40 , 40 )
121- cmds .rowLayout (parent = layoutColumn , numberOfColumns = 4 , columnWidth4 = rowLayoutSize , columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 ), (3 , "both" , 0 ), (4 , "both" , 0 )])
121+
122+ cmds .rowLayout (parent = layoutColumn , numberOfColumns = 4 , columnWidth4 = (110 , 40 , 40 , 40 ), columnAlign = [(1 , "right" ), (2 , "center" ), (3 , "center" ), (4 , "center" )], columnAttach = [(1 , "both" , 0 ), (2 , "both" , 0 ), (3 , "both" , 0 ), (4 , "both" , 0 )])
122123 cmds .text (label = "Project to plane" )
123124 cmds .button (label = "YZ" , command = partial (self .COMFloorProjection , "x" ), backgroundColor = Colors .red10 , annotation = CenterOfMassAnnotations .projectorYZ )
124125 cmds .button (label = "XZ" , command = partial (self .COMFloorProjection , "y" ), backgroundColor = Colors .green10 , annotation = CenterOfMassAnnotations .projectorXZ )
125126 cmds .button (label = "XY" , command = partial (self .COMFloorProjection , "z" ), backgroundColor = Colors .blue10 , annotation = CenterOfMassAnnotations .projectorXY )
126-
127127 def UILayoutWeights (self , layoutMain ):
128- self . layoutWeights = cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "WEIGHTS" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 )
129- layoutColumn = cmds .columnLayout (parent = self . layoutWeights , adjustableColumn = True )
128+ cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "WEIGHTS" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 , borderVisible = True )
129+ layoutColumn = cmds .columnLayout (adjustableColumn = True , rowSpacing = Settings . columnLayoutRowSpacing )
130130
131- count = 1
132- cmds .gridLayout (parent = layoutColumn , numberOfColumns = count , cellWidth = Settings .windowWidthMargin / count , cellHeight = Settings .lineHeight )
131+ countCells1 = 1
132+ cmds .gridLayout (parent = layoutColumn , numberOfColumns = countCells1 , cellWidth = Settings .windowWidthMargin / countCells1 , cellHeight = Settings .lineHeight )
133133 cmds .button (label = "Disconnect From Center Of Mass" , command = self .COMDisconnectTargets , backgroundColor = Colors .red10 , annotation = CenterOfMassAnnotations .disconnectTargets )
134134
135135 def PartButton (partInfo = ("" , 0 ), minMaxValue = CenterOfMassSettings .weightMinMax , onlyValue = False , annotation = "" ):
@@ -140,8 +140,8 @@ def PartButton(partInfo = ("", 0), minMaxValue = CenterOfMassSettings.weightMinM
140140 cmds .button (label = text .format (partInfo [0 ], value ), command = partial (self .COMConstrainToSelected , value ), backgroundColor = colorFinal , annotation = annotation )
141141
142142 ### WEIGHTS PALETTE
143- count = 10
144- cmds .gridLayout (parent = layoutColumn , numberOfColumns = count , cellWidth = Settings .windowWidthMargin / count , cellHeight = Settings .lineHeight )
143+ countCells2 = 10
144+ cmds .gridLayout (parent = layoutColumn , numberOfColumns = countCells2 , cellWidth = Settings .windowWidthMargin / countCells2 , cellHeight = Settings .lineHeight )
145145
146146 def CustomButton (value ):
147147 PartButton (("" , value ), onlyValue = True , annotation = CenterOfMassAnnotations .weightsCustom )
@@ -158,8 +158,8 @@ def CustomButton(value):
158158 CustomButton (10 )
159159
160160 ### BODYPARTS
161- count = 3
162- layoutBodyGrid = cmds .gridLayout (parent = layoutColumn , numberOfColumns = count , cellWidth = Settings .windowWidthMargin / count , cellHeight = Settings .lineHeight * count )
161+ countCells3 = 3
162+ layoutBodyGrid = cmds .gridLayout (parent = layoutColumn , numberOfColumns = countCells3 , cellWidth = Settings .windowWidthMargin / countCells3 , cellHeight = Settings .lineHeight * countCells3 )
163163
164164 cmds .columnLayout (parent = layoutBodyGrid , adjustableColumn = True )
165165 PartButton (CenterOfMassSettings .partHead , minMaxValue = (CenterOfMassSettings .partHand [1 ], CenterOfMassSettings .partChest [1 ]), annotation = CenterOfMassAnnotations .weightHead )
@@ -176,10 +176,11 @@ def CustomButton(value):
176176 PartButton (CenterOfMassSettings .partKnee , minMaxValue = (CenterOfMassSettings .partHand [1 ], CenterOfMassSettings .partChest [1 ]), annotation = CenterOfMassAnnotations .weightKnee )
177177 PartButton (CenterOfMassSettings .partFoot , minMaxValue = (CenterOfMassSettings .partHand [1 ], CenterOfMassSettings .partChest [1 ]), annotation = CenterOfMassAnnotations .weightFoot )
178178 def UILayoutBaking (self , layoutMain ):
179- self .layoutBaking = cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "BAKING" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 )
179+ cmds .frameLayout (parent = layoutMain , label = Settings .frames2Prefix + "BAKING" , collapsable = True , backgroundColor = Settings .frames2Color , marginWidth = 0 , marginHeight = 0 , borderVisible = True )
180+ layoutColumn = cmds .columnLayout (adjustableColumn = True , rowSpacing = Settings .columnLayoutRowSpacing )
180181
181- count = 3
182- cmds .gridLayout (numberOfColumns = count , cellWidth = Settings .windowWidthMargin / count , cellHeight = Settings .lineHeight )
182+ countCells = 3
183+ cmds .gridLayout (parent = layoutColumn , numberOfColumns = countCells , cellWidth = Settings .windowWidthMargin / countCells , cellHeight = Settings .lineHeight )
183184
184185 cmds .button (label = "Bake To COM" , command = self .BakeScenario3 , backgroundColor = Colors .orange10 , annotation = CenterOfMassAnnotations .bakeToCOMLink )
185186 cmds .popupMenu ()
0 commit comments