Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.0.5 #84

Merged
merged 28 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
44fa1df
init deformers module with Wrap methods
GenEugene Apr 2, 2024
ccb6d14
update wraps logic
GenEugene Apr 2, 2024
25ee68b
update blendshapes projecting logic
GenEugene Apr 3, 2024
deb2a6d
complete core logic for blendshapes projecting
GenEugene Apr 5, 2024
6daa457
cleanup blendshape projection logic
GenEugene Apr 5, 2024
e3b7917
save
GenEugene Apr 26, 2024
ae3114c
save:
GenEugene Jun 26, 2024
96f77d2
update Blendshapes logic, fix projecting
GenEugene Jun 26, 2024
0d2b23d
fix
GenEugene Jun 26, 2024
35d1fc7
Update Blendshapes.py
GenEugene Jun 26, 2024
eba6557
fix empty selected on blendshape zeroing
GenEugene Jun 26, 2024
501608b
update blendshapes general logic
GenEugene Jun 28, 2024
db6e419
add prototypes
GenEugene Jun 28, 2024
cfc2652
save
GenEugene Jun 28, 2024
e189bc7
add joint toggle button
GenEugene Jun 28, 2024
dfd5814
save:
GenEugene Jun 28, 2024
a6b991f
add toggle joint to shelf logic
GenEugene Jun 28, 2024
03049e5
Create SetAttributesBySimpleName.py
GenEugene Jul 5, 2024
22e5ac9
limit name search
GenEugene Jul 5, 2024
26e3890
Update Install.py
GenEugene Jul 8, 2024
735f997
add more toggles
GenEugene Jul 8, 2024
e10dee3
rework code install logic and cleanup
GenEugene Jul 9, 2024
ff600a6
update drag and drop module, cleanup
GenEugene Jul 9, 2024
268d846
Update changelog.txt
GenEugene Jul 9, 2024
494c6f1
save
GenEugene Jul 9, 2024
abd6b95
Update GeneralWindow.py
GenEugene Jul 9, 2024
67931b6
Merge branch 'master' into develop
GenEugene Jul 10, 2024
b140d1d
Update changelog.txt
GenEugene Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions DRAG_AND_DROP_INSTALL.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,12 +20,13 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import os

from GETOOLS_SOURCE.utils import Install
from GETOOLS_SOURCE.utils import Shelf

from GETOOLS_SOURCE.values import CodeSamples
from GETOOLS_SOURCE.values import Icons
from GETOOLS_SOURCE.values import License

Expand All @@ -38,23 +38,23 @@

# Button settings
buttonLabel = "GETools"
functionAddPathToEnvironment = Install.GetFunctionString(scriptPath)
buttonCommand = """\
#########################################
{license}
### GETools
### https://github.com/GenEugene/GETools
#########################################

imports = """\
import os
import sys
import maya.cmds as cmds
"""

environment = Install.GetFunctionString(scriptPath)
code = Install.ReadFunctionAsString(CodeSamples.GeneralWindow)

{func}

from GETOOLS_SOURCE.modules import GeneralWindow
GeneralWindow.GeneralWindow().RUN_DOCKED(\"{path}\")\
""".format(func = functionAddPathToEnvironment, path = scriptPath, license = License.text)
# Generate code line by line
buttonCommand = ""
buttonCommand += License.text + "\n"
buttonCommand += imports + "\n"
buttonCommand += environment + "\n\n"
buttonCommand += code + "(\"{0}\")".format(scriptPath)


# Drag and Drop function with button creation on current shelf
Expand Down
25 changes: 25 additions & 0 deletions GETOOLS_SOURCE/_prototypes/SetAttributesBySimpleName.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import maya.cmds as cmds

def FindAllObjects(objName):
objects = cmds.ls(type = "transform", long = True)
result = []
for item in objects:
if(item.endswith("|" + objName) or item.endswith(":" + objName)):
result.append(item)
return result

def SetAttributes(objectList):
for item in objectList:
cmds.setAttr(item + ".translateX", 0)
cmds.setAttr(item + ".translateY", 0)
cmds.setAttr(item + ".translateZ", 0)

def SetAttributesUnique(objectList):
for item in objectList:
cmds.setAttr(item + ".translateY", 0.5)

objNameL = "testL"
objNameR = "testR"
SetAttributes(FindAllObjects(objNameL))
SetAttributes(FindAllObjects(objNameR))
SetAttributesUnique(FindAllObjects(objNameR))
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if(`isChannelBoxRaised`)
{
openAEWindow;
}
else if(`isAttributeEditorRaised`)
{
raiseChannelBox;
}
2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/modules/CenterOfMass.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds
from functools import partial
Expand Down
156 changes: 120 additions & 36 deletions GETOOLS_SOURCE/modules/GeneralWindow.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/modules/Overlappy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds
import maya.mel as mel
Expand Down
37 changes: 29 additions & 8 deletions GETOOLS_SOURCE/modules/Rigging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,14 +20,17 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds
from functools import partial

from ..modules import Settings

from ..utils import Blendshapes
from ..utils import Colors
from ..utils import Constraints
from ..utils import Deformers
from ..utils import Other
from ..utils import Skinning
from ..utils import UI
Expand Down Expand Up @@ -59,8 +61,13 @@ class RiggingAnnotations:
jointDrawStyleHidden = "Hidden {0}".format(_jointDrawStyle)
copySkinWeights = "Copy skin weights from last selected object to all other selected objects"

# Deformers
wrapsCreate = "Create a wrap deformer on selected objects.\nThe last object used as a source deformation object"
blendshapeCopyFromTarget = "Reconstruct blendshapes on selected objects from the last selected object.\nThe last object must have a blendshape node"
blendshapeZeroWeights = "Zero all blendshape weights on selected objects"

class Rigging:
version = "v1.0"
version = "v1.1"
name = "RIGGING"
title = name + " " + version

Expand All @@ -82,7 +89,7 @@ def UICreate(self, layoutMain):
cmds.separator(style = "none")
self.checkboxConstraintReverse = UI.Checkbox(label = "Reverse", value = False, annotation = RiggingAnnotations.constraintReverse)
self.checkboxConstraintMaintain = UI.Checkbox(label = "Maintain", value = False, annotation = RiggingAnnotations.constraintMaintain)
# self.checkboxConstraintOffset = UI.Checkbox(label = "Offset", value = False, annotation = RiggingAnnotations.constraintOffset)
# self.checkboxConstraintOffset = UI.Checkbox(label = "**Offset", value = False, annotation = RiggingAnnotations.constraintOffset)
cmds.separator(style = "none")
#
countOffsets = 4
Expand All @@ -91,7 +98,7 @@ def UICreate(self, layoutMain):
cmds.button(label = "Point", command = self.ConstrainPoint, backgroundColor = Colors.red10, annotation = RiggingAnnotations.constraintPoint)
cmds.button(label = "Orient", command = self.ConstrainOrient, backgroundColor = Colors.red10, annotation = RiggingAnnotations.constraintOrient)
cmds.button(label = "Scale", command = self.ConstrainScale, backgroundColor = Colors.red10, annotation = RiggingAnnotations.constraintScale)
# cmds.button(label = "Aim", command = self.ConstrainAim, backgroundColor = Colors.red10, annotation = RiggingAnnotations.constraintAim, enable = False) # TODO
# cmds.button(label = "**Aim", command = self.ConstrainAim, backgroundColor = Colors.red10, annotation = RiggingAnnotations.constraintAim, enable = False) # TODO
#
countOffsets = 2
cmds.gridLayout(parent = layoutColumnConstraints, numberOfColumns = countOffsets, cellWidth = windowWidthMargin / countOffsets, cellHeight = lineHeight)
Expand All @@ -107,14 +114,28 @@ def UICreate(self, layoutMain):
cmds.gridLayout(parent = layoutColumnUtils, numberOfColumns = countOffsets, cellWidth = windowWidthMargin / countOffsets, cellHeight = lineHeight)
cmds.button(label = "Rotate Order - SHOW", command = partial(Other.RotateOrderVisibility, True), backgroundColor = Colors.green10, annotation = RiggingAnnotations.rotateOrderShow)
cmds.button(label = "Rotate Order - HIDE", command = partial(Other.RotateOrderVisibility, False), backgroundColor = Colors.green10, annotation = RiggingAnnotations.rotateOrderHide)
cmds.button(label = "Compensate - ON", command = partial(Other.SegmentScaleCompensate, True), backgroundColor = Colors.yellow10, annotation = RiggingAnnotations.scaleCompensateOn)
cmds.button(label = "Compensate - OFF", command = partial(Other.SegmentScaleCompensate, False), backgroundColor = Colors.yellow10, annotation = RiggingAnnotations.scaleCompensateOff)
cmds.button(label = "Joint - BONE", command = partial(Other.JointDrawStyle, 0), backgroundColor = Colors.orange10, annotation = RiggingAnnotations.jointDrawStyleBone)
cmds.button(label = "Joint - HIDDEN", command = partial(Other.JointDrawStyle, 2), backgroundColor = Colors.orange10, annotation = RiggingAnnotations.jointDrawStyleHidden)
cmds.button(label = "Compensate - ON", command = partial(Other.SegmentScaleCompensate, True), backgroundColor = Colors.orange10, annotation = RiggingAnnotations.scaleCompensateOn)
cmds.button(label = "Compensate - OFF", command = partial(Other.SegmentScaleCompensate, False), backgroundColor = Colors.orange10, annotation = RiggingAnnotations.scaleCompensateOff)
cmds.button(label = "Joint - BONE", command = partial(Other.JointDrawStyle, 0), backgroundColor = Colors.yellow10, annotation = RiggingAnnotations.jointDrawStyleBone)
cmds.button(label = "Joint - HIDDEN", command = partial(Other.JointDrawStyle, 2), backgroundColor = Colors.yellow10, annotation = RiggingAnnotations.jointDrawStyleHidden)
#
countOffsets = 1
cmds.gridLayout(parent = layoutColumnUtils, numberOfColumns = countOffsets, cellWidth = windowWidthMargin / countOffsets, cellHeight = lineHeight)
cmds.button(label = "Copy Skin Weights From Last Selected", command = Skinning.CopySkinWeightsFromLastMesh, backgroundColor = Colors.blue10, annotation = RiggingAnnotations.copySkinWeights)

# BLENDSHAPES
layoutBlendshapes = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "BLENDSHAPES", collapsable = True, backgroundColor = Settings.frames2Color)
layoutColumnBlendshapes = cmds.columnLayout(parent = layoutBlendshapes, adjustableColumn = True)
#
countOffsets = 2
cmds.gridLayout(parent = layoutColumnBlendshapes, numberOfColumns = countOffsets, cellWidth = windowWidthMargin / countOffsets, cellHeight = lineHeight)
cmds.button(label = "Wraps", command = Deformers.WrapsCreateOnSelected, backgroundColor = Colors.yellow10, annotation = RiggingAnnotations.wrapsCreate)
# cmds.button(label = "**Convert", command = Deformers.WrapConvertToBlendshapes) # TODO
cmds.button(label = "Reconstruct", command = Deformers.BlendshapesReconstruction, backgroundColor = Colors.green50, annotation = RiggingAnnotations.blendshapeCopyFromTarget)
#
countOffsets = 1
cmds.gridLayout(parent = layoutColumnBlendshapes, numberOfColumns = countOffsets, cellWidth = windowWidthMargin / countOffsets, cellHeight = lineHeight)
cmds.button(label = "Zero Weights", command = Blendshapes.ZeroBlendshapeWeightsOnSelected, backgroundColor = Colors.blackWhite100, annotation = RiggingAnnotations.blendshapeZeroWeights)


# CONSTRAINTS
Expand Down
2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/modules/Settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

from ..utils import Colors

Expand Down
10 changes: 5 additions & 5 deletions GETOOLS_SOURCE/modules/Tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds
from functools import partial
Expand Down Expand Up @@ -96,8 +96,8 @@ class ToolsAnnotations:
timelineSetMinIn = "Set minimal inner timeline value"
timelineSetMaxIn = "Set maximum inner timeline value"
timelineSetMaxOut = "Set maximum outer timeline value"
timelineExpandOut = "Expand timeline range to outer range"
timelineExpandIn = "Expand timeline range to inner range"
timelineFocusOut = "Focus outer timeline range"
timelineFocusIn = "Focus inner timeline range"
timelineSetRange = "Set timeline inner range on selected range by mouse"

animationOffset = "Move animation on selected objects in time.\nThe animation will move relative to the index of the selected object.\nThe best way to desync animation.\nWorks with selection in the channel box."
Expand Down Expand Up @@ -300,8 +300,8 @@ def UILayoutTimeline(self, layoutMain, windowWidthMargin, lineHeight):
cmds.button(label = "<-", command = partial(Timeline.SetTime, 1), backgroundColor = Colors.green50, annotation = ToolsAnnotations.timelineSetMinIn)
cmds.button(label = "->", command = partial(Timeline.SetTime, 2), backgroundColor = Colors.green50, annotation = ToolsAnnotations.timelineSetMaxIn)
cmds.button(label = ">>", command = partial(Timeline.SetTime, 4), backgroundColor = Colors.green10, annotation = ToolsAnnotations.timelineSetMaxOut)
cmds.button(label = "<->", command = partial(Timeline.SetTime, 5), backgroundColor = Colors.orange10, annotation = ToolsAnnotations.timelineExpandOut)
cmds.button(label = ">-<", command = partial(Timeline.SetTime, 6), backgroundColor = Colors.orange10, annotation = ToolsAnnotations.timelineExpandIn)
cmds.button(label = "<->", command = partial(Timeline.SetTime, 5), backgroundColor = Colors.orange10, annotation = ToolsAnnotations.timelineFocusOut)
cmds.button(label = ">-<", command = partial(Timeline.SetTime, 6), backgroundColor = Colors.orange10, annotation = ToolsAnnotations.timelineFocusIn)
cmds.button(label = "|<->|", command = partial(Timeline.SetTime, 7), backgroundColor = Colors.orange50, annotation = ToolsAnnotations.timelineSetRange)


Expand Down
2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/utils/Animation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds
import maya.mel as mel
Expand Down
2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/utils/Baker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GETOOLS is under the terms of the MIT License

# Copyright (c) 2018-2024 Eugene Gataulin (GenEugene). All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,6 +20,7 @@
# SOFTWARE.

# Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene
# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene

import maya.cmds as cmds

Expand Down
Loading