Skip to content

Commit f3660fe

Browse files
authored
Merge pull request #127 from GenEugene/general-cleanup
Quality of life patch
2 parents e80ad2d + 92ca512 commit f3660fe

46 files changed

Lines changed: 286 additions & 277 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DRAG_AND_DROP_INSTALL.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
import os

GETOOLS_SOURCE/Settings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
from .utils import Colors
@@ -30,15 +30,15 @@
3030
dockName = "dockGETools"
3131
dockAllowedAreas = ("left", "right")
3232
dockStartArea = dockAllowedAreas[0] # start docking state, 0 - left, 1 - right
33-
windowHeight = 500 # vertical window size when undocked
33+
marginWidth = 8
34+
marginHeight = 0
35+
windowHeight = 500
3436
windowWidth = 300
35-
windowWidthScrollSpace = 20
37+
windowWidthOffset = windowWidth - marginWidth + 16
38+
windowWidthMargin = windowWidth - marginWidth * 2
3639
lineHeight = 24
37-
margin = 2
38-
sliderWidth = (60, 54, 10)
39-
sliderWidthMarker = 14
40-
windowWidthScroll = windowWidth - windowWidthScrollSpace
41-
windowWidthMargin = windowWidthScroll - margin * 2
40+
columnLayoutRowSpacing = 2
41+
separatorHeight = 1
4242
frames1Color = Colors.blackWhite13
4343
frames2Color = Colors.blackWhite20
4444
frames2Prefix = "// "

GETOOLS_SOURCE/experimental/Physics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
import maya.cmds as cmds

GETOOLS_SOURCE/experimental/PhysicsHair.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
import maya.mel as mel

GETOOLS_SOURCE/experimental/PhysicsParticle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
# TODO Set different time scale values. Aim and up should use slightly different values

GETOOLS_SOURCE/modules/CenterOfMass.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
import 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()

GETOOLS_SOURCE/modules/Experimental.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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

2424
import maya.cmds as cmds
@@ -51,8 +51,8 @@ def UICreate(self, layoutMain):
5151
# cmds.menuItem(dividerLabel = "label", divider = True)
5252

5353
### MENU
54-
cmds.columnLayout("layoutMenuBar", parent = layoutMain, adjustableColumn = True, width = Settings.windowWidthScroll)
55-
cmds.menuBarLayout()
54+
# cmds.columnLayout("layoutMenuBar", parent = layoutMain, adjustableColumn = True)
55+
cmds.menuBarLayout(parent = layoutMain)
5656

5757
cmds.menu(label = "Layers", tearOff = True)
5858
cmds.menuItem(label = "Layer Create", command = self.LayerCreate)

0 commit comments

Comments
 (0)