diff --git a/DRAG_AND_DROP_INSTALL.py b/DRAG_AND_DROP_INSTALL.py index a2bfeed..c58aaa8 100644 --- a/DRAG_AND_DROP_INSTALL.py +++ b/DRAG_AND_DROP_INSTALL.py @@ -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 @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/_prototypes/SetAttributesBySimpleName.py b/GETOOLS_SOURCE/_prototypes/SetAttributesBySimpleName.py new file mode 100644 index 0000000..2c8018f --- /dev/null +++ b/GETOOLS_SOURCE/_prototypes/SetAttributesBySimpleName.py @@ -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)) \ No newline at end of file diff --git a/GETOOLS_SOURCE/_prototypes/ToggleChannelBoxAndAttributeEditor.py b/GETOOLS_SOURCE/_prototypes/ToggleChannelBoxAndAttributeEditor.py new file mode 100644 index 0000000..acfc108 --- /dev/null +++ b/GETOOLS_SOURCE/_prototypes/ToggleChannelBoxAndAttributeEditor.py @@ -0,0 +1,8 @@ +if(`isChannelBoxRaised`) +{ + openAEWindow; +} +else if(`isAttributeEditorRaised`) +{ + raiseChannelBox; +} \ No newline at end of file diff --git a/GETOOLS_SOURCE/modules/CenterOfMass.py b/GETOOLS_SOURCE/modules/CenterOfMass.py index e217913..e207368 100644 --- a/GETOOLS_SOURCE/modules/CenterOfMass.py +++ b/GETOOLS_SOURCE/modules/CenterOfMass.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/modules/GeneralWindow.py b/GETOOLS_SOURCE/modules/GeneralWindow.py index 0b63487..bb0f5d3 100644 --- a/GETOOLS_SOURCE/modules/GeneralWindow.py +++ b/GETOOLS_SOURCE/modules/GeneralWindow.py @@ -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 @@ -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 @@ -31,6 +31,7 @@ from ..modules import Settings from ..modules import Tools +from ..utils import Blendshapes from ..utils import Colors from ..utils import Install from ..utils import Layers @@ -38,11 +39,12 @@ from ..utils import MotionTrail from ..utils import Scene from ..utils import Selector +from ..utils import Toggles from ..values import Icons class GeneralWindow: - version = "v1.0.4" + version = "v1.0.5" name = "GETools" title = name + " " + version @@ -107,9 +109,45 @@ def PrintChannelBoxAttributes(*args): cmds.menuItem(divider = True) cmds.menuItem(label = "Print selected objects to console", command = Selector.PrintSelected, image = Icons.text) cmds.menuItem(label = "Print channel box selected attributes", command = PrintChannelBoxAttributes, image = Icons.text) + cmds.menuItem(dividerLabel = "Blendshapes", divider = True) + cmds.menuItem(label = "Print Blendshapes Base Nodes", command = Blendshapes.GetBlendshapeNodesFromSelected, image = Icons.text) + cmds.menuItem(label = "Print Blendshapes Names", command = Blendshapes.GetBlendshapeWeightsFromSelected, image = Icons.text) cmds.menuItem(divider = True) cmds.menuItem(label = "Open Colors Palette", command = ColorsPalette, image = Icons.color) + cmds.menu(label = "Toggle", tearOff = True) + # cmds.menuItem(label = "All Objects", command = Toggles.ToggleAllObjects) + cmds.menuItem(label = "Cameras", command = Toggles.ToggleCameras, image = Icons.camera) + cmds.menuItem(label = "Control Vertices", command = Toggles.ToggleControlVertices) + cmds.menuItem(label = "Deformers", command = Toggles.ToggleDeformers) + cmds.menuItem(label = "Dimensions", command = Toggles.ToggleDimensions) + cmds.menuItem(label = "Dynamic Constraints", command = Toggles.ToggleDynamicConstraints, image = Icons.dynamicConstraint) + cmds.menuItem(label = "Dynamics", command = Toggles.ToggleDynamics) + cmds.menuItem(label = "Fluids", command = Toggles.ToggleFluids) + cmds.menuItem(label = "Follicles", command = Toggles.ToggleFollicles, image = Icons.follicle) + cmds.menuItem(label = "Grid", command = Toggles.ToggleGrid, image = Icons.grid) + cmds.menuItem(label = "Hair Systems", command = Toggles.ToggleHairSystems, image = Icons.hairSystem) + cmds.menuItem(label = "Handles", command = Toggles.ToggleHandles) + cmds.menuItem(label = "Hulls", command = Toggles.ToggleHulls) + cmds.menuItem(label = "IK Handles", command = Toggles.ToggleIkHandles, image = Icons.ikHandle) + cmds.menuItem(label = "Joints", command = Toggles.ToggleJoints, image = Icons.joint) + cmds.menuItem(label = "Lights", command = Toggles.ToggleLights, image = Icons.light) + cmds.menuItem(label = "Locators", command = Toggles.ToggleLocators, image = Icons.locator) + cmds.menuItem(label = "Manipulators", command = Toggles.ToggleManipulators) + cmds.menuItem(label = "NCloths", command = Toggles.ToggleNCloths, image = Icons.nCloth) + cmds.menuItem(label = "NParticles", command = Toggles.ToggleNParticles, image = Icons.particle) + cmds.menuItem(label = "NRigids", command = Toggles.ToggleNRigids, image = Icons.nRigid) + cmds.menuItem(label = "Nurbs Curves", command = Toggles.ToggleNurbsCurves, image = Icons.nurbsCurve) + cmds.menuItem(label = "Nurbs Surfaces", command = Toggles.ToggleNurbsSurfaces, image = Icons.nurbsSurface) + cmds.menuItem(label = "Pivots", command = Toggles.TogglePivots) + cmds.menuItem(label = "Planes", command = Toggles.TogglePlanes, image = Icons.plane) + cmds.menuItem(label = "Poly Meshes", command = Toggles.TogglePolymeshes, image = Icons.polyMesh) + cmds.menuItem(label = "Shadows", command = Toggles.ToggleShadows, image = Icons.shadows) + cmds.menuItem(label = "Strokes", command = Toggles.ToggleStrokes, image = Icons.stroke) + cmds.menuItem(label = "Subdiv Surfaces", command = Toggles.ToggleSubdivSurfaces) + cmds.menuItem(label = "Textures", command = Toggles.ToggleTextures) + + self.LayoutMenuInstall() cmds.menu(label = "Help", tearOff = True) # , helpMenu = True @@ -170,19 +208,53 @@ def LayerMove(*args): pass def LayoutMenuInstall(self): cmds.menu(label = "To Shelf", tearOff = True) - ### - cmds.menuItem(subMenu = True, label = "General", image = Icons.fileOpen) - cmds.menuItem(dividerLabel = "File", divider = True) + + cmds.menuItem(subMenu = True, label = "File", tearOff = True, image = Icons.fileOpen) cmds.menuItem(label = "Reload Scene (force)", command = partial(Install.ToShelf_ReloadScene, self.directory)) cmds.menuItem(label = "Exit Maya (force)", command = partial(Install.ToShelf_ExitMaya, self.directory)) - cmds.menuItem(dividerLabel = "Utils", divider = True) + cmds.setParent('..', menu = True) + + cmds.menuItem(subMenu = True, label = "Utils", tearOff = True) cmds.menuItem(label = "Select Hiererchy", command = partial(Install.ToShelf_SelectHierarchy, self.directory)) - cmds.menuItem(label = "Create Reset Button", command = partial(Install.ToShelf_CreateResetButton, self.directory), image = Icons.reset) + # cmds.menuItem(label = "Create Reset Button", command = partial(Install.ToShelf_CreateResetButton, self.directory), image = Icons.reset) cmds.setParent('..', menu = True) - # + + cmds.menuItem(subMenu = True, label = "Toggle", tearOff = True) + # cmds.menuItem(label = "All Objects", command = partial(Install.ToShelf_ToggleAllObjects, self.directory)) + cmds.menuItem(label = "Cameras", command = partial(Install.ToShelf_ToggleCameras, self.directory), image = Icons.camera) + cmds.menuItem(label = "Control Vertices", command = partial(Install.ToShelf_ToggleControlVertices, self.directory)) + cmds.menuItem(label = "Deformers", command = partial(Install.ToShelf_ToggleDeformers, self.directory)) + cmds.menuItem(label = "Dimensions", command = partial(Install.ToShelf_ToggleDimensions, self.directory)) + cmds.menuItem(label = "Dynamic Constraints", command = partial(Install.ToShelf_ToggleDynamicConstraints, self.directory), image = Icons.dynamicConstraint) + cmds.menuItem(label = "Dynamics", command = partial(Install.ToShelf_ToggleDynamics, self.directory)) + cmds.menuItem(label = "Fluids", command = partial(Install.ToShelf_ToggleFluids, self.directory)) + cmds.menuItem(label = "Follicles", command = partial(Install.ToShelf_ToggleFollicles, self.directory), image = Icons.follicle) + cmds.menuItem(label = "Grid", command = partial(Install.ToShelf_ToggleGrid, self.directory), image = Icons.grid) + cmds.menuItem(label = "Hair Systems", command = partial(Install.ToShelf_ToggleHairSystems, self.directory), image = Icons.hairSystem) + cmds.menuItem(label = "Handles", command = partial(Install.ToShelf_ToggleHandles, self.directory)) + cmds.menuItem(label = "Hulls", command = partial(Install.ToShelf_ToggleHulls, self.directory)) + cmds.menuItem(label = "IK Handles", command = partial(Install.ToShelf_ToggleIkHandles, self.directory), image = Icons.ikHandle) + cmds.menuItem(label = "Joints", command = partial(Install.ToShelf_ToggleJoints, self.directory), image = Icons.joint) + cmds.menuItem(label = "Lights", command = partial(Install.ToShelf_ToggleLights, self.directory), image = Icons.light) + cmds.menuItem(label = "Locators", command = partial(Install.ToShelf_ToggleLocators, self.directory), image = Icons.locator) + cmds.menuItem(label = "Manipulators", command = partial(Install.ToShelf_ToggleManipulators, self.directory)) + cmds.menuItem(label = "NCloths", command = partial(Install.ToShelf_ToggleNCloths, self.directory), image = Icons.nCloth) + cmds.menuItem(label = "NParticles", command = partial(Install.ToShelf_ToggleNParticles, self.directory), image = Icons.particle) + cmds.menuItem(label = "NRigids", command = partial(Install.ToShelf_ToggleNRigids, self.directory), image = Icons.nRigid) + cmds.menuItem(label = "Nurbs Curves", command = partial(Install.ToShelf_ToggleNurbsCurves, self.directory), image = Icons.nurbsCurve) + cmds.menuItem(label = "Nurbs Surfaces", command = partial(Install.ToShelf_ToggleNurbsSurfaces, self.directory), image = Icons.nurbsSurface) + cmds.menuItem(label = "Pivots", command = partial(Install.ToShelf_TogglePivots, self.directory)) + cmds.menuItem(label = "Planes", command = partial(Install.ToShelf_TogglePlanes, self.directory), image = Icons.plane) + cmds.menuItem(label = "Poly Meshes", command = partial(Install.ToShelf_TogglePolymeshes, self.directory), image = Icons.polyMesh) + cmds.menuItem(label = "Shadows", command = partial(Install.ToShelf_ToggleShadows, self.directory), image = Icons.shadows) + cmds.menuItem(label = "Strokes", command = partial(Install.ToShelf_ToggleStrokes, self.directory), image = Icons.stroke) + cmds.menuItem(label = "Subdiv Surfaces", command = partial(Install.ToShelf_ToggleSubdivSurfaces, self.directory)) + cmds.menuItem(label = "Textures", command = partial(Install.ToShelf_ToggleTextures, self.directory)) + cmds.setParent('..', menu = True) + cmds.menuItem(dividerLabel = "TOOLS - Locators", divider = True) ### - cmds.menuItem(subMenu = True, label = "Size") + cmds.menuItem(subMenu = True, label = "Size", tearOff = True) cmds.menuItem(label = "50%", command = partial(Install.ToShelf_LocatorsSizeScale50, self.directory)) cmds.menuItem(label = "90%", command = partial(Install.ToShelf_LocatorsSizeScale90, self.directory)) cmds.menuItem(divider = True) @@ -190,26 +262,26 @@ def LayoutMenuInstall(self): cmds.menuItem(label = "200%", command = partial(Install.ToShelf_LocatorsSizeScale200, self.directory)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Create", image = Icons.locator) + cmds.menuItem(subMenu = True, label = "Create", tearOff = True, image = Icons.locator) cmds.menuItem(label = "Locator", command = partial(Install.ToShelf_LocatorCreate, self.directory)) cmds.menuItem(label = "Match", command = partial(Install.ToShelf_LocatorsMatch, self.directory)) cmds.menuItem(label = "Parent", command = partial(Install.ToShelf_LocatorsParent, self.directory)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Pin", image = Icons.pin) + cmds.menuItem(subMenu = True, label = "Pin", tearOff = True, image = Icons.pin) cmds.menuItem(label = "Pin", command = partial(Install.ToShelf_LocatorsPin, self.directory)) cmds.menuItem(label = "Without reverse constraint", command = partial(Install.ToShelf_LocatorsPinWithoutReverse, self.directory)) cmds.menuItem(label = "POS", command = partial(Install.ToShelf_LocatorsPinPos, self.directory)) cmds.menuItem(label = "ROT", command = partial(Install.ToShelf_LocatorsPinRot, self.directory)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Relative", image = Icons.pinInvert) + cmds.menuItem(subMenu = True, label = "Relative", tearOff = True, image = Icons.pinInvert) cmds.menuItem(label = "Relative", command = partial(Install.ToShelf_LocatorsRelative, self.directory)) cmds.menuItem(label = "Skip last object reverse constraint", command = partial(Install.ToShelf_LocatorsRelativeSkipLast, self.directory)) cmds.menuItem(label = "Without reverse constraint", command = partial(Install.ToShelf_LocatorsRelativeWithoutReverse, self.directory)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Aim", image = Icons.pin) + cmds.menuItem(subMenu = True, label = "Aim", tearOff = True, image = Icons.pin) minus = "-" plus = "+" axisX = "X" @@ -240,10 +312,10 @@ def LayoutMenuInstall(self): cmds.menuItem(label = axisZMinus, command = partial(Install.ToShelf_LocatorsAim, self.directory, axisZMinus, True, (0, 0, -1))) cmds.menuItem(label = axisZPlus, command = partial(Install.ToShelf_LocatorsAim, self.directory, axisZPlus, True, (0, 0, 1))) cmds.setParent('..', menu = True) - # + cmds.menuItem(dividerLabel = "TOOLS - Baking", divider = True) ### - cmds.menuItem(subMenu = True, label = "Bake") + cmds.menuItem(subMenu = True, label = "Bake", tearOff = True) cmds.menuItem(label = "Classic", command = partial(Install.ToShelf_BakeClassic, self.directory)) cmds.menuItem(label = "Classic Cut Out", command = partial(Install.ToShelf_BakeClassicCutOut, self.directory)) cmds.menuItem(divider = True) @@ -251,21 +323,21 @@ def LayoutMenuInstall(self): cmds.menuItem(label = "Custom Cut Out", command = partial(Install.ToShelf_BakeCustomCutOut, self.directory)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "By Last") + cmds.menuItem(subMenu = True, label = "By Last", tearOff = True) cmds.menuItem(label = "By Last", command = partial(Install.ToShelf_BakeByLast, self.directory, True, True)) cmds.menuItem(label = "POS", command = partial(Install.ToShelf_BakeByLast, self.directory, True, False)) cmds.menuItem(label = "ROT", command = partial(Install.ToShelf_BakeByLast, self.directory, False, True)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "World", image = Icons.world) + cmds.menuItem(subMenu = True, label = "World", tearOff = True, image = Icons.world) cmds.menuItem(label = "World", command = partial(Install.ToShelf_BakeByWorld, self.directory, True, True)) cmds.menuItem(label = "POS", command = partial(Install.ToShelf_BakeByWorld, self.directory, True, False)) cmds.menuItem(label = "ROT", command = partial(Install.ToShelf_BakeByWorld, self.directory, False, True)) cmds.setParent('..', menu = True) - # + cmds.menuItem(dividerLabel = "TOOLS - Animation", divider = True) ### - cmds.menuItem(subMenu = True, label = "Delete", image = Icons.delete) + cmds.menuItem(subMenu = True, label = "Delete", tearOff = True, image = Icons.delete) cmds.menuItem(label = "Animation", command = partial(Install.ToShelf_DeleteKeys, self.directory)) cmds.menuItem(label = "Nonkeyable", command = partial(Install.ToShelf_DeleteNonkeyable, self.directory)) cmds.menuItem(label = "Static", command = partial(Install.ToShelf_DeleteStatic, self.directory)) @@ -273,7 +345,7 @@ def LayoutMenuInstall(self): # cmds.menuItem(label = "Euler Filter", command = partial(Install.ToShelf_EulerFilter, self.directory), image = Icons.filter) # - cmds.menuItem(subMenu = True, label = "Infinity") + cmds.menuItem(subMenu = True, label = "Infinity", tearOff = True) cmds.menuItem(label = "Constant", command = partial(Install.ToShelf_SetInfinity, self.directory, 1)) cmds.menuItem(label = "Linear", command = partial(Install.ToShelf_SetInfinity, self.directory, 2)) cmds.menuItem(divider = True) @@ -283,7 +355,7 @@ def LayoutMenuInstall(self): cmds.menuItem(label = "Oscillate", command = partial(Install.ToShelf_SetInfinity, self.directory, 5)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Offset") + cmds.menuItem(subMenu = True, label = "Offset", tearOff = True) cmds.menuItem(label = "-3", command = partial(Install.ToShelf_AnimOffset, self.directory, -1, 3)) cmds.menuItem(label = "-2", command = partial(Install.ToShelf_AnimOffset, self.directory, -1, 2)) cmds.menuItem(label = "-1", command = partial(Install.ToShelf_AnimOffset, self.directory, -1, 1)) @@ -292,25 +364,25 @@ def LayoutMenuInstall(self): cmds.menuItem(label = "+2", command = partial(Install.ToShelf_AnimOffset, self.directory, 1, 2)) cmds.menuItem(label = "+3", command = partial(Install.ToShelf_AnimOffset, self.directory, 1, 3)) cmds.setParent('..', menu = True) - # + cmds.menuItem(dividerLabel = "TOOLS - Timeline", divider = True) ### - cmds.menuItem(subMenu = True, label = "Timeline") + cmds.menuItem(subMenu = True, label = "Timeline", tearOff = True) cmds.menuItem(label = "Min Out", command = partial(Install.ToShelf_SetTimelineMinOut, self.directory)) cmds.menuItem(label = "Min In", command = partial(Install.ToShelf_SetTimelineMinIn, self.directory)) cmds.menuItem(divider = True) cmds.menuItem(label = "Max In", command = partial(Install.ToShelf_SetTimelineMaxIn, self.directory)) cmds.menuItem(label = "Max Out", command = partial(Install.ToShelf_SetTimelineMaxOut, self.directory)) cmds.menuItem(divider = True) - cmds.menuItem(label = "Expand Out", command = partial(Install.ToShelf_SetTimelineExpandOut, self.directory)) - cmds.menuItem(label = "Expand In", command = partial(Install.ToShelf_SetTimelineExpandIn, self.directory)) + cmds.menuItem(label = "Focus Out", command = partial(Install.ToShelf_SetTimelineFocusOut, self.directory)) + cmds.menuItem(label = "Focus In", command = partial(Install.ToShelf_SetTimelineFocusIn, self.directory)) cmds.menuItem(divider = True) cmds.menuItem(label = "Selected Range", command = partial(Install.ToShelf_SetTimelineSet, self.directory)) cmds.setParent('..', menu = True) - # + cmds.menuItem(dividerLabel = "RIGGING - Constraints", divider = True) ### - cmds.menuItem(subMenu = True, label = "Constraints", image = Icons.constraint) + cmds.menuItem(subMenu = True, label = "Constraints", tearOff = True, image = Icons.constraint) cmds.menuItem(label = "Parent", command = partial(Install.ToShelf_Constraint, self.directory, False, True, False, False, False)) cmds.menuItem(label = "Point", command = partial(Install.ToShelf_Constraint, self.directory, False, False, True, False, False)) cmds.menuItem(label = "Orient", command = partial(Install.ToShelf_Constraint, self.directory, False, False, False, True, False)) @@ -322,33 +394,42 @@ def LayoutMenuInstall(self): cmds.menuItem(label = "Scale with maintain", command = partial(Install.ToShelf_Constraint, self.directory, True, False, False, False, True)) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Connections", image = Icons.constraint) + cmds.menuItem(subMenu = True, label = "Connections", tearOff = True, image = Icons.constraint) cmds.menuItem(label = "Disconnect", command = partial(Install.ToShelf_DisconnectTargets, self.directory)) cmds.menuItem(label = "Delete Constraints", command = partial(Install.ToShelf_DeleteConstraints, self.directory)) cmds.setParent('..', menu = True) - # + cmds.menuItem(dividerLabel = "RIGGING - Utils", divider = True) ### - cmds.menuItem(subMenu = True, label = "Rotate Order") + cmds.menuItem(subMenu = True, label = "Rotate Order", tearOff = True) cmds.menuItem(label = "Show", command = partial(Install.ToShelf_RotateOrder, self.directory, True), image = Icons.visibleOn) cmds.menuItem(label = "Hide", command = partial(Install.ToShelf_RotateOrder, self.directory, False), image = Icons.visibleOff) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Segment Scale Compensate", image = Icons.joint) + cmds.menuItem(subMenu = True, label = "Segment Scale Compensate", tearOff = True, image = Icons.joint) cmds.menuItem(label = "On", command = partial(Install.ToShelf_SegmentScaleCompensate, self.directory, True), image = Icons.on) cmds.menuItem(label = "Off", command = partial(Install.ToShelf_SegmentScaleCompensate, self.directory, False), image = Icons.off) cmds.setParent('..', menu = True) # - cmds.menuItem(subMenu = True, label = "Joint Draw Style", image = Icons.joint) + cmds.menuItem(subMenu = True, label = "Joint Draw Style", tearOff = True, image = Icons.joint) cmds.menuItem(label = "Bone", command = partial(Install.ToShelf_JointDrawStyle, self.directory, 0), image = Icons.visibleOn) cmds.menuItem(label = "Hidden", command = partial(Install.ToShelf_JointDrawStyle, self.directory, 2), image = Icons.visibleOff) cmds.setParent('..', menu = True) # cmds.menuItem(label = "Copy Skin Weights From Last Selected", command = partial(Install.ToShelf_CopySkin, self.directory), image = Icons.copy) - # + + cmds.menuItem(dividerLabel = "RIGGING - Blendshapes", divider = True) + ### + # cmds.menuItem(subMenu = True, label = "Rotate Order", tearOff = True) + cmds.menuItem(label = "Wraps Create", command = partial(Install.ToShelf_WrapsCreate, self.directory), image = Icons.wrap) + # cmds.menuItem(label = "Wraps Convert", command = partial(Install.ToShelf_WrapsCreate, self.directory), image = Icons.wrap) # TODO + cmds.menuItem(label = "Reconstruct", command = partial(Install.ToShelf_BlendshapesReconstruct, self.directory), image = Icons.blendshape) + cmds.menuItem(label = "Zero Weights", command = partial(Install.ToShelf_BlendshapesZeroWeights, self.directory), image = Icons.blendshape) + cmds.setParent('..', menu = True) + cmds.menuItem(dividerLabel = "EXPERIMENTAL", divider = True) ### - cmds.menuItem(subMenu = True, label = "Motion Trail") + cmds.menuItem(subMenu = True, label = "Motion Trail", tearOff = True) cmds.menuItem(label = "Create", command = partial(Install.ToShelf_MotionTrailCreate, self.directory)) cmds.menuItem(label = "Select", command = partial(Install.ToShelf_MotionTrailSelect, self.directory)) cmds.menuItem(label = "Delete", command = partial(Install.ToShelf_MotionTrailDelete, self.directory)) @@ -379,14 +460,17 @@ def LayoutExperimental(self, parentLayout): cmds.menuItem(label = "Right-Click test") countOffsets = 3 - cmds.gridLayout(numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) - + cmds.gridLayout(parent = self.frameExperimental, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "Trails Create", command = MotionTrail.Create, backgroundColor = Colors.orange10) cmds.button(label = "Trails Select", command = MotionTrail.Select, backgroundColor = Colors.orange50) cmds.button(label = "Trails Delete", command = MotionTrail.Delete, backgroundColor = Colors.orange100) # cmds.popupMenu() # cmds.menuItem(label = "Select", command = MotionTrail.Select) # cmds.menuItem(label = "Delete", command = MotionTrail.Delete) + + # countOffsets = 1 + # cmds.gridLayout(parent = self.frameExperimental, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) + # cmds.button(label = "Print function", command = Install.TEST_INSPECT) pass # WINDOW diff --git a/GETOOLS_SOURCE/modules/Overlappy.py b/GETOOLS_SOURCE/modules/Overlappy.py index 6559584..3f71c59 100644 --- a/GETOOLS_SOURCE/modules/Overlappy.py +++ b/GETOOLS_SOURCE/modules/Overlappy.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/modules/Rigging.py b/GETOOLS_SOURCE/modules/Rigging.py index 6ad4666..a70cc80 100644 --- a/GETOOLS_SOURCE/modules/Rigging.py +++ b/GETOOLS_SOURCE/modules/Rigging.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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 diff --git a/GETOOLS_SOURCE/modules/Settings.py b/GETOOLS_SOURCE/modules/Settings.py index 4743940..2ca0486 100644 --- a/GETOOLS_SOURCE/modules/Settings.py +++ b/GETOOLS_SOURCE/modules/Settings.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/modules/Tools.py b/GETOOLS_SOURCE/modules/Tools.py index a90ef61..10b920e 100644 --- a/GETOOLS_SOURCE/modules/Tools.py +++ b/GETOOLS_SOURCE/modules/Tools.py @@ -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 @@ -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 @@ -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." @@ -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) diff --git a/GETOOLS_SOURCE/utils/Animation.py b/GETOOLS_SOURCE/utils/Animation.py index c552c98..0533ad8 100644 --- a/GETOOLS_SOURCE/utils/Animation.py +++ b/GETOOLS_SOURCE/utils/Animation.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Baker.py b/GETOOLS_SOURCE/utils/Baker.py index 2a621fd..38b20ad 100644 --- a/GETOOLS_SOURCE/utils/Baker.py +++ b/GETOOLS_SOURCE/utils/Baker.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Blendshapes.py b/GETOOLS_SOURCE/utils/Blendshapes.py new file mode 100644 index 0000000..4c29853 --- /dev/null +++ b/GETOOLS_SOURCE/utils/Blendshapes.py @@ -0,0 +1,121 @@ +# 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 +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# 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 + +from ..utils import Selector + +def GetBlendshapeNodeFromModel(model): + if (model == None): + return None + + result = "" + + # Get blendshape nodes + relatives = cmds.listRelatives(model) + blendshapes = [] + + for relative in relatives: + connections = cmds.listConnections(relative, type = "blendShape") + if (connections == None): + continue + + for connection in connections: + if connection not in blendshapes: + result = connection + + if (len(result) == 0): + return None + + print(result)# + return result +def GetBlendshapeNodesFromModelList(modelList): + if (modelList == None): + return None + + result = [] + + # Get blendshape nodes + print("\tBLENDSHAPES")# + for model in modelList: + result.append(GetBlendshapeNodeFromModel(model)) + + return result +def GetBlendshapeNodesFromSelected(*args): + # Check selected objects + selectedList = Selector.MultipleObjects(1) + if (selectedList == None): + return None + + return GetBlendshapeNodesFromModelList(selectedList) + +def GetBlendshapeWeights(blendshape): + # Check blendshape node + if (blendshape == None or len(blendshape) == 0): + return None + + # Get blendshape weights + blendshapeNode = blendshape + weightsNames = cmds.listAttr(blendshapeNode + ".weight", multi = True) + + weightsNamesFull = [] + + # Print result + print("\tBLENDSHAPE \"{0}\" WEIGHTS".format(blendshape))# + for weight in weightsNames: + weightsNamesFull.append(blendshapeNode + "." + weight) + print(weightsNamesFull[-1])# + + return weightsNamesFull, weightsNames +def GetBlendshapeWeightsFromSelected(*args): + blendshapes = GetBlendshapeNodesFromSelected() + if (blendshapes == None): + return None + + weightsNamesFull = [] + weightsNames = [] + + for blendshape in blendshapes: + weightsRaw = GetBlendshapeWeights(blendshape) + if (weightsRaw == None): + continue + weightsNamesFull.append(weightsRaw[0]) + weightsNames.append(weightsRaw[1]) + + return weightsNamesFull, weightsNames + +def ZeroBlendshapeWeights(weights): + for weight in weights: + cmds.setAttr(weight, 0) +def ZeroBlendshapeWeightsOnSelected(*args): + weights = GetBlendshapeWeightsFromSelected() + if (weights == None): + return + + for item in weights[0]: + if (item == None): + continue + ZeroBlendshapeWeights(item) + diff --git a/GETOOLS_SOURCE/utils/Colors.py b/GETOOLS_SOURCE/utils/Colors.py index 0f96a3d..0beb347 100644 --- a/GETOOLS_SOURCE/utils/Colors.py +++ b/GETOOLS_SOURCE/utils/Colors.py @@ -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 @@ -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 blackWhite00 = (0, 0, 0) blackWhite10 = (0.1, 0.1, 0.1) diff --git a/GETOOLS_SOURCE/utils/Constraints.py b/GETOOLS_SOURCE/utils/Constraints.py index 05607d1..0d963da 100644 --- a/GETOOLS_SOURCE/utils/Constraints.py +++ b/GETOOLS_SOURCE/utils/Constraints.py @@ -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 @@ -21,11 +20,11 @@ # 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 ..utils import Selector - from ..values import Enums def ConstrainSelectedToLastObject(reverse=False, maintainOffset=True, parent=True, point=False, orient=False, scale=False, aim=False, weight=1): diff --git a/GETOOLS_SOURCE/utils/Deformers.py b/GETOOLS_SOURCE/utils/Deformers.py new file mode 100644 index 0000000..8a90e04 --- /dev/null +++ b/GETOOLS_SOURCE/utils/Deformers.py @@ -0,0 +1,165 @@ +# 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 +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# 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 + +from ..utils import Blendshapes +from ..utils import Selector +# from ..values import Enums + +nameWrap = "wrapTemp" +nameBlendshapePrefix = "bs_" +dropoff = 4 +smoothness = 0 + +def WrapsCreateOnList(elements): + if (len(elements) < 2): + cmds.warning("Need at least 2 objects for Wrap") + return + + wrapsList = [] + sourceDuplicate = cmds.duplicate(elements[-1], name = elements[-1] + "Wrap") + + for i in range(len(elements)): + if (i >= len(elements) - 1): + break + + # sourceTransform = elements[-1] + sourceDuplicateShape = cmds.listRelatives(sourceDuplicate, shapes = True, noIntermediate = True)[0] + sourceShape = cmds.listRelatives(elements[-1], shapes = True, noIntermediate = True)[0] + targetShape = cmds.listRelatives(elements[i], shapes = True, noIntermediate = True)[0] + + # Create wrap node + node = cmds.deformer(targetShape, name = nameWrap, type = "wrap")[0] + wrapsList.append(node) + + # Set wrap parameters + cmds.setAttr(node + ".falloffMode", 1) + cmds.setAttr(node + ".autoWeightThreshold", 1) + cmds.setAttr(node + ".dropoff[0]", dropoff) + cmds.setAttr(node + ".smoothness[0]", smoothness) + cmds.setAttr(node + ".inflType[0]", 2) + + # Connect to other nodes + cmds.connectAttr(sourceDuplicateShape + ".worldMesh[0]", node + ".basePoints[0]") + cmds.connectAttr(sourceShape + ".worldMesh[0]", node + ".driverPoints[0]") + # cmds.connectAttr(sourceTransform + ".inflType", node + ".inflType[0]") + + return wrapsList, sourceDuplicate +def WrapsCreateOnSelected(*args): + # Check selected objects + selectedList = Selector.MultipleObjects(2) + if (selectedList == None): + return + + cmds.select(clear = True) + wraps = WrapsCreateOnList(selectedList) + cmds.select(selectedList, replace = True) + + return selectedList, wraps[0], wraps[1] + +def WrapConvertToBlendshapes(blendshape): # TODO create single conversion logic from Wrap to Blendshapes + # Check selected objects + selectedList = Selector.MultipleObjects(1) + if (selectedList == None): + return + + # Get blendshape nodes + relatives = cmds.listRelatives(selectedList[0]) + wraps = [] + + for relative in relatives: + connections = cmds.listConnections(relative, type = "wrap") + if (connections == None): + continue + + for connection in connections: + if connection not in wraps: + wraps.append(connection) + + print(wraps) + +def WrapsConvertFromSelected(*args): # TODO + pass + +def WrapsDelete(wraps): # TODO move out from current script, looks like just a regular delete method + for wrap in wraps: + cmds.delete(wrap) + +def BlendshapesReconstruction(*args): # TODO simplify function, split to smaller blocks + # Check selected objects + selectedList = Selector.MultipleObjects(2) + if (selectedList == None): + return + + # Get blendshape node + sourceMesh = selectedList[-1] + blendshapeSource = Blendshapes.GetBlendshapeNodeFromModel(sourceMesh) + + # Check blendshape node + if (blendshapeSource == None): + cmds.warning("Last selected object has no blendShape node. Operation aborted") + return + + # Create wraps + result = WrapsCreateOnSelected() + if (result == None): + cmds.warning("No objects detected") + return + + cmds.select(clear = True) + + # Map values + wraps = result[1] + sourceDuplicate = result[2] + + # Get blendshape weights and zero all of them + weights = Blendshapes.GetBlendshapeWeights(blendshapeSource) + Blendshapes.ZeroBlendshapeWeights(weights[0]) + + # Activate one by one and duplicate results + duplicatesList = [] + for i in range(len(selectedList) - 1): + duplicates = [] + for y in range(len(weights[0])): + cmds.setAttr(weights[0][y], 1) + duplicate = cmds.duplicate(selectedList[i], name = weights[1][y]) + duplicates.append(duplicate) + cmds.setAttr(weights[0][y], 0) + duplicatesList.append(duplicates) + + # Wraps cleanup + WrapsDelete(wraps) + cmds.delete(sourceDuplicate) + + # Create blendshape nodes, add targets and delete duplicates + for x in range(len(selectedList) - 1): + blendshapeTarget = cmds.blendShape(selectedList[x], name = nameBlendshapePrefix + selectedList[x]) + for y in range(len(duplicatesList[x])): + cmds.blendShape(blendshapeTarget, edit = True, target = (selectedList[x], y, duplicatesList[x][y][0], 1.0)) + cmds.delete(duplicatesList[x][y][0]) + + cmds.select(selectedList, replace = True) + diff --git a/GETOOLS_SOURCE/utils/Install.py b/GETOOLS_SOURCE/utils/Install.py index 7b9d9c3..a6d7b1b 100644 --- a/GETOOLS_SOURCE/utils/Install.py +++ b/GETOOLS_SOURCE/utils/Install.py @@ -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 @@ -21,252 +20,33 @@ # SOFTWARE. # Author: Eugene Gataulin tek942@gmail.com https://www.linkedin.com/in/geneugene -# Logic in this module is not optimal enough, need manually change path names, methods and parameters. +# Source code: https://github.com/GenEugene/GETools or https://app.gumroad.com/geneugene import os import sys +import inspect from ..utils import Shelf - +from ..values import CodeSamples from ..values import Enums -class Presets: # TODO simplify - pathGeneral =\ - "import GETOOLS_SOURCE.modules.GeneralWindow as gtwindow" - pathScene =\ - "import GETOOLS_SOURCE.utils.Scene as scene" - pathInstall =\ - "import GETOOLS_SOURCE.utils.Install as install" - pathBaker =\ - "import GETOOLS_SOURCE.utils.Baker as baker" - pathSelector =\ - "import GETOOLS_SOURCE.utils.Selector as selector" - pathOther =\ - "import GETOOLS_SOURCE.utils.Other as other" - pathConstraints =\ - "import GETOOLS_SOURCE.utils.Constraints as constraints" - pathLocators =\ - "import GETOOLS_SOURCE.utils.Locators as locators" - pathTimeline =\ - "import GETOOLS_SOURCE.utils.Timeline as timeline" - pathAnimation =\ - "import GETOOLS_SOURCE.utils.Animation as animation" - pathSkinning =\ - "import GETOOLS_SOURCE.utils.Skinning as skinning" - pathMotionTrail =\ - "import GETOOLS_SOURCE.utils.MotionTrail as mtrail" - - - # GENERAL - runGeneralWindow ='''\ -{0} -gtwindow.GeneralWindow().RUN_DOCKED()\ -'''.format(pathGeneral) - - - # FILE - runSceneReload ='''\ -{0} -scene.Reload()\ -'''.format(pathScene) - - runExitMaya ='''\ -{0} -scene.ExitMaya()\ -'''.format(pathScene) - - - # UTILS - runSelectHierarchy ='''\ -{0} -selector.SelectHierarchy()\ -'''.format(pathSelector) +# LOGIC +def ReadFunctionAsString(func): + source = inspect.getsource(func) + + # Remove first line and indents in code body + lines = source.split('\n') + lines = lines[1:-1] + lines = [line.lstrip() for line in lines] + linesCount = len(lines) + result = "" - runCreateResetButton ='''\ -{0} -install.CreateResetButton()\ -'''.format(pathInstall) - - - # LOCATORS - runLocatorsSizeScale ='''\ -{0} -locators.SelectedLocatorsSizeScale\ -'''.format(pathLocators) - - runLocatorsSizeSet ='''\ -{0} -locators.SelectedLocatorsSizeSet\ -'''.format(pathLocators) - - runLocatorCreate ='''\ -{0} -locators.Create()\ -'''.format(pathLocators) - - runLocatorsMatch ='''\ -{0} -locators.CreateOnSelected(constraint = False)\ -'''.format(pathLocators) - - runLocatorsParent ='''\ -{0} -locators.CreateOnSelected(constraint = True)\ -'''.format(pathLocators) - - runLocatorsPin ='''\ -{0} -locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = True, constrainRotate = True)\ -'''.format(pathLocators) - - runLocatorsPinWithoutReverse ='''\ -{0} -locators.CreateOnSelected(constraint = True, bake = True)\ -'''.format(pathLocators) - - runLocatorsPinPos ='''\ -{0} -locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = True, constrainRotate = False)\ -'''.format(pathLocators) - - runLocatorsPinRot ='''\ -{0} -locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = False, constrainRotate = True)\ -'''.format(pathLocators) - - runLocatorsRelative ='''\ -{0} -locators.CreateAndBakeAsChildrenFromLastSelected(constraintReverse = True, skipLastReverse = False)\ -'''.format(pathLocators) - - runLocatorsRelativeSkipLast ='''\ -{0} -locators.CreateAndBakeAsChildrenFromLastSelected(constraintReverse = True)\ -'''.format(pathLocators) - - runLocatorsRelativeWithoutReverse ='''\ -{0} -locators.CreateAndBakeAsChildrenFromLastSelected()\ -'''.format(pathLocators) - - runLocatorsAim ='''\ -{0} -locators.CreateOnSelectedAim\ -'''.format(pathLocators) - - - # BAKING - runBakeClassic ='''\ -{0} -baker.BakeSelected\ -'''.format(pathBaker) - - runBakeCustom ='''\ -{0} -baker.BakeSelected\ -'''.format(pathBaker) - - runBakeByLast ='''\ -{0} -baker.BakeSelectedByLastObject\ -'''.format(pathBaker) - - runBakeByWorld ='''\ -{0} -baker.BakeSelectedByWorld\ -'''.format(pathBaker) - - - # ANIMATION - runAnimOffset ='''\ -{0} -animation.OffsetObjects\ -'''.format(pathAnimation) - - runDeleteKeys ='''\ -{0} -animation.DeleteKeys(True)\ -'''.format(pathAnimation) - - runDeleteNonkeyable ='''\ -{0} -animation.DeleteKeysNonkeyable()\ -'''.format(pathAnimation) - - runDeleteStatic ='''\ -{0} -animation.DeleteStaticCurves()\ -'''.format(pathAnimation) - - runEulerFilter ='''\ -{0} -animation.FilterCurve()\ -'''.format(pathAnimation) - - runSetInfinity ='''\ -{0} -animation.SetInfinity\ -'''.format(pathAnimation) - - runSetTimeline ='''\ -{0} -timeline.SetTime\ -'''.format(pathTimeline) - - - # RIGGING - runConstraint ='''\ -{0} -constraints.ConstrainSelectedToLastObject\ -'''.format(pathConstraints) - - runDeleteConstraints ='''\ -{0} -constraints.DeleteConstraintsOnSelected()\ -'''.format(pathConstraints) - - runDisconnectTargets ='''\ -{0} -constraints.DisconnectTargetsFromConstraintOnSelected()\ -'''.format(pathConstraints) - - runRotateOrder ='''\ -{0} -other.RotateOrderVisibility\ -'''.format(pathOther) - - runSegmentScaleCompensateCompensate ='''\ -{0} -other.SegmentScaleCompensate\ -'''.format(pathOther) - - runJointDrawStyle ='''\ -{0} -other.JointDrawStyle\ -'''.format(pathOther) - - runCopySkin ='''\ -{0} -skinning.CopySkinWeightsFromLastMesh()\ -'''.format(pathSkinning) - - - # EXPERIMENTAL - runMotionTrailCreate ='''\ -{0} -mtrail.Create()\ -'''.format(pathLocators) - runMotionTrailSelect ='''\ -{0} -mtrail.Select()\ -'''.format(pathLocators) - runMotionTrailDelete ='''\ -{0} -mtrail.Delete()\ -'''.format(pathLocators) - + for i in range(linesCount): + result = result + lines[i] + if (i < linesCount - 1): + result = result + "\n" -# LOGIC + return result def AddPathToEnvironment(path, *args): if not os.path.exists(path): raise IOError(r'The source path {0} does not exist!'.format(path)) @@ -282,14 +62,12 @@ def GetFunctionString(path, *args): sys.path.insert(0, "{path}")\ """.format(path = path) def GetFunctionStringForTool(path, tool, *args): - return """\ -import os -import sys - -{path} - -{tool}\ -""".format(path = GetFunctionString(path), tool = tool) + result = "" + result += "import os" + "\n" + result += "import sys" + "\n\n" + result += GetFunctionString(path) + "\n\n" + result += tool + return result def MoveToShelf(path, tool, label, labelImage, *args): command = GetFunctionStringForTool(path, tool) Shelf.AddToCurrentShelf( @@ -298,65 +76,96 @@ def MoveToShelf(path, tool, label, labelImage, *args): labelImage = labelImage ) - # FILE def ToShelf_ReloadScene(path, *args): - MoveToShelf(path, Presets.runSceneReload, "SceneReload", "Reload") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SceneReload), "SceneReload", "Reload") def ToShelf_ExitMaya(path, *args): - MoveToShelf(path, Presets.runExitMaya, "ExitMaya", "Exit") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.ExitMaya), "ExitMaya", "Exit") # UTILS def ToShelf_SelectHierarchy(path, *args): - MoveToShelf(path, Presets.runSelectHierarchy, "SelectHierarchy", "SelHi") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SelectHierarchy), "SelectHierarchy", "SelHi") def ToShelf_CreateResetButton(path, *args): - MoveToShelf(path, Presets.runCreateResetButton, "CreateResetButton", "Reset") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.CreateResetButton), "CreateResetButton", "Reset") + +# TOGGLES +# def ToShelf_ToggleAllObjects(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.), "ToggleAllObjects", "tglAllObjects") # TODO +def ToShelf_ToggleCameras(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleCameras), "ToggleCameras", "tglCameras") +def ToShelf_ToggleControlVertices(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleControlVertices), "ToggleControlVertices", "tglControlVertices") +def ToShelf_ToggleDeformers(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleDeformers), "ToggleDeformers", "tglDeformers") +def ToShelf_ToggleDimensions(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleDimensions), "ToggleDimensions", "tglDimensions") +def ToShelf_ToggleDynamicConstraints(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleDynamicConstraints), "ToggleDynamicConstraints", "tglDynamicConstraints") +def ToShelf_ToggleDynamics(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleDynamics), "ToggleDynamics", "tglDynamics") +def ToShelf_ToggleFluids(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleFluids), "ToggleFluids", "tglFluids") +def ToShelf_ToggleFollicles(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleFollicles), "ToggleFollicles", "tglFollicles") +def ToShelf_ToggleGrid(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleGrid), "ToggleGrid", "tglGrid") +def ToShelf_ToggleHairSystems(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleHairSystems), "ToggleHairSystems", "tglHairSystems") +def ToShelf_ToggleHandles(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleHandles), "ToggleHandles", "tglHandles") +def ToShelf_ToggleHulls(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleHulls), "ToggleHulls", "tglHulls") +def ToShelf_ToggleIkHandles(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleIkHandles), "ToggleIkHandles", "tglIkHandles") +def ToShelf_ToggleJoints(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleJoints), "ToggleJoints", "tglJoints") +def ToShelf_ToggleLights(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleLights), "ToggleLights", "tglLights") +def ToShelf_ToggleLocators(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleLocators), "ToggleLocators", "tglLocators") +def ToShelf_ToggleManipulators(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleManipulators), "ToggleManipulators", "tglManipulators") +def ToShelf_ToggleNCloths(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleNCloths), "ToggleNCloths", "tglNCloths") +def ToShelf_ToggleNParticles(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleNParticles), "ToggleNParticles", "tglNParticles") +def ToShelf_ToggleNRigids(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleNRigids), "ToggleNRigids", "tglNRigids") +def ToShelf_ToggleNurbsCurves(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleNurbsCurves), "ToggleNurbsCurves", "tglNurbsCurves") +def ToShelf_ToggleNurbsSurfaces(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleNurbsSurfaces), "ToggleNurbsSurfaces", "tglNurbsSurfaces") +def ToShelf_TogglePivots(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.TogglePivots), "TogglePivots", "tglPivots") +def ToShelf_TogglePlanes(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.TogglePlanes), "TogglePlanes", "tglPlanes") +def ToShelf_TogglePolymeshes(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.TogglePolymeshes), "TogglePolymeshes", "tglPolymeshes") +def ToShelf_ToggleShadows(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleShadows), "ToggleShadows", "tglShadows") +def ToShelf_ToggleStrokes(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleStrokes), "ToggleStrokes", "tglStrokes") +def ToShelf_ToggleSubdivSurfaces(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleSubdivSurfaces), "ToggleSubdivSurfaces", "tglSubdivSurfaces") +def ToShelf_ToggleTextures(path, *args): MoveToShelf(path, ReadFunctionAsString(CodeSamples.ToggleTextures), "ToggleTextures", "tglTextures") # LOCATORS def ToShelf_LocatorsSizeScale50(path, *args): - MoveToShelf(path, Presets.runLocatorsSizeScale + "(0.5)", "LocatorsSizeScale50", "L50%") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsSizeScale) + "(0.5)", "LocatorsSizeScale50", "L50%") def ToShelf_LocatorsSizeScale90(path, *args): - MoveToShelf(path, Presets.runLocatorsSizeScale + "(0.9)", "LocatorsSizeScale90", "L90%") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsSizeScale) + "(0.9)", "LocatorsSizeScale90", "L90%") def ToShelf_LocatorsSizeScale110(path, *args): - MoveToShelf(path, Presets.runLocatorsSizeScale + "(1.1)", "LocatorsSizeScale110", "L110%") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsSizeScale) + "(1.1)", "LocatorsSizeScale110", "L110%") def ToShelf_LocatorsSizeScale200(path, *args): - MoveToShelf(path, Presets.runLocatorsSizeScale + "(2.0)", "LocatorsSizeScale200", "L200%") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsSizeScale) + "(2.0)", "LocatorsSizeScale200", "L200%") def ToShelf_LocatorCreate(path, *args): - MoveToShelf(path, Presets.runLocatorCreate, "LocatorCreate", "Loc") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorCreate), "LocatorCreate", "Loc") def ToShelf_LocatorsMatch(path, *args): - MoveToShelf(path, Presets.runLocatorsMatch, "LocatorsMatch", "LocMatch") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsMatch), "LocatorsMatch", "LocMatch") def ToShelf_LocatorsParent(path, *args): - MoveToShelf(path, Presets.runLocatorsParent, "LocatorsParent", "LocParent") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsParent), "LocatorsParent", "LocParent") def ToShelf_LocatorsPin(path, *args): - MoveToShelf(path, Presets.runLocatorsPin, "LocatorsPin", "Pin") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsPin), "LocatorsPin", "Pin") def ToShelf_LocatorsPinWithoutReverse(path, *args): - MoveToShelf(path, Presets.runLocatorsPinWithoutReverse, "LocatorsPinWithoutReverse", "Pin-") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsPinWithoutReverse), "LocatorsPinWithoutReverse", "Pin-") def ToShelf_LocatorsPinPos(path, *args): - MoveToShelf(path, Presets.runLocatorsPinPos, "LocatorsPinPos", "P-Pos") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsPinPos), "LocatorsPinPos", "P-Pos") def ToShelf_LocatorsPinRot(path, *args): - MoveToShelf(path, Presets.runLocatorsPinRot, "LocatorsPinRot", "P-Rot") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsPinRot), "LocatorsPinRot", "P-Rot") def ToShelf_LocatorsRelative(path, *args): - MoveToShelf(path, Presets.runLocatorsRelative, "Relative", "Rel") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsRelative), "Relative", "Rel") def ToShelf_LocatorsRelativeSkipLast(path, *args): - MoveToShelf(path, Presets.runLocatorsRelativeSkipLast, "RelativeSkipLast", "Rel-1") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsRelativeSkipLast), "RelativeSkipLast", "Rel-1") def ToShelf_LocatorsRelativeWithoutReverse(path, *args): - MoveToShelf(path, Presets.runLocatorsRelativeWithoutReverse, "RelativeWithoutReverse", "Rel-") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsRelativeWithoutReverse), "RelativeWithoutReverse", "Rel-") def ToShelf_LocatorsAim(path, name, rotateOnly, aimVector, *args): parameters = "(rotateOnly = {0}, aimVector = {1}, reverse = True)".format(rotateOnly, aimVector) - MoveToShelf(path, Presets.runLocatorsAim + parameters, "LocatorsAim{0}".format(name), "Aim {0}".format(name)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.LocatorsAim) + parameters, "LocatorsAim{0}".format(name), "Aim {0}".format(name)) # BAKING def ToShelf_BakeClassic(path, *args): - MoveToShelf(path, Presets.runBakeClassic + "(classic = True, preserveOutsideKeys = True)", "BakeClassic", "Bake") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeClassic) + "(classic = True, preserveOutsideKeys = True)", "BakeClassic", "Bake") def ToShelf_BakeClassicCutOut(path, *args): - MoveToShelf(path, Presets.runBakeClassic + "(classic = True, preserveOutsideKeys = False)", "BakeClassicCutOut", "BakeCut") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeClassic) + "(classic = True, preserveOutsideKeys = False)", "BakeClassicCutOut", "BakeCut") def ToShelf_BakeCustom(path, *args): - MoveToShelf(path, Presets.runBakeCustom + "(classic = False, preserveOutsideKeys = True, selectedRange = True, channelBox = True)", "BakeCustom", "BakeC") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeCustom) + "(classic = False, preserveOutsideKeys = True, selectedRange = True, channelBox = True)", "BakeCustom", "BakeC") def ToShelf_BakeCustomCutOut(path, *args): - MoveToShelf(path, Presets.runBakeCustom + "(classic = False, preserveOutsideKeys = False, selectedRange = True, channelBox = True)", "BakeCustomCutOut", "BakeCCut") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeCustom) + "(classic = False, preserveOutsideKeys = False, selectedRange = True, channelBox = True)", "BakeCustomCutOut", "BakeCCut") def ToShelf_BakeByLast(path, translate, rotate, *args): if (translate and rotate): @@ -370,7 +179,7 @@ def ToShelf_BakeByLast(path, translate, rotate, *args): suffix = "ROT" attributes = Enums.Attributes.rotateShort parameters = "(selectedRange = True, channelBox = False, attributes = {0})".format(attributes) - MoveToShelf(path, Presets.runBakeByLast + parameters, "BakeByLast{0}".format(suffix), "BL{0}".format(suffix)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeByLast) + parameters, "BakeByLast{0}".format(suffix), "BL{0}".format(suffix)) def ToShelf_BakeByWorld(path, translate, rotate, *args): if (translate and rotate): suffix = "" @@ -383,40 +192,39 @@ def ToShelf_BakeByWorld(path, translate, rotate, *args): suffix = "ROT" attributes = Enums.Attributes.rotateShort parameters = "(selectedRange = True, channelBox = False, attributes = {0})".format(attributes) - MoveToShelf(path, Presets.runBakeByWorld + parameters, "BakeByWorld{0}".format(suffix), "BW{0}".format(suffix)) - + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BakeByWorld) + parameters, "BakeByWorld{0}".format(suffix), "BW{0}".format(suffix)) # ANIMATION def ToShelf_AnimOffset(path, direction, time, *args): - MoveToShelf(path, Presets.runAnimOffset + "({0}, {1})".format(direction, time), "AnimOffset_{0}_{1}".format(direction, time), "AO{0}_{1}".format(direction, time)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.AnimOffset) + "({0}, {1})".format(direction, time), "AnimOffset_{0}_{1}".format(direction, time), "AO{0}_{1}".format(direction, time)) def ToShelf_DeleteKeys(path, *args): - MoveToShelf(path, Presets.runDeleteKeys, "DeleteKeys", "DKeys") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.DeleteKeys), "DeleteKeys", "DKeys") def ToShelf_DeleteNonkeyable(path, *args): - MoveToShelf(path, Presets.runDeleteNonkeyable, "DeleteNonkeyable", "DNonkeyable") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.DeleteNonkeyable), "DeleteNonkeyable", "DNonkeyable") def ToShelf_DeleteStatic(path, *args): - MoveToShelf(path, Presets.runDeleteStatic, "DeleteStatic", "DStatic") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.DeleteStatic), "DeleteStatic", "DStatic") def ToShelf_EulerFilter(path, *args): - MoveToShelf(path, Presets.runEulerFilter, "EulerFilter", "Euler") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.EulerFilter), "EulerFilter", "Euler") def ToShelf_SetInfinity(path, mode, *args): - MoveToShelf(path, Presets.runSetInfinity + "({0})".format(mode), "SetInfinity{0}".format(mode), "Inf{0}".format(mode)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetInfinity) + "({0})".format(mode), "SetInfinity{0}".format(mode), "Inf{0}".format(mode)) # TIMELINE def ToShelf_SetTimelineMinOut(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(3)", "SetTimelineMinOut", "<<") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(3)", "SetTimelineMinOut", "<<") def ToShelf_SetTimelineMinIn(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(1)", "SetTimelineMinIn", "<-") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(1)", "SetTimelineMinIn", "<-") def ToShelf_SetTimelineMaxIn(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(2)", "SetTimelineMaxIn", "->") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(2)", "SetTimelineMaxIn", "->") def ToShelf_SetTimelineMaxOut(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(4)", "SetTimelineMaxOut", ">>") -def ToShelf_SetTimelineExpandOut(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(5)", "SetTimelineExpandOut", "<->") -def ToShelf_SetTimelineExpandIn(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(6)", "SetTimelineExpandIn", ">-<") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(4)", "SetTimelineMaxOut", ">>") +def ToShelf_SetTimelineFocusOut(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(5)", "SetTimelineFocusOut", "<->") +def ToShelf_SetTimelineFocusIn(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(6)", "SetTimelineFocusIn", ">-<") def ToShelf_SetTimelineSet(path, *args): - MoveToShelf(path, Presets.runSetTimeline + "(7)", "SetTimelineSet", "|<->|") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SetTimeline) + "(7)", "SetTimelineSet", "|<->|") # RIGGING def ToShelf_Constraint(path, maintainOffset, parent, point, orient, scale, *args): @@ -436,31 +244,38 @@ def ToShelf_Constraint(path, maintainOffset, parent, point, orient, scale, *args suffix = suffixMaintain + suffix - MoveToShelf(path, Presets.runConstraint + "(maintainOffset = {0}, parent = {1}, point = {2}, orient = {3}, scale = {4})".format(maintainOffset, parent, point, orient, scale), "Constraint{0}".format(suffix), "C{0}".format(suffix)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.Constraint) + "(maintainOffset = {0}, parent = {1}, point = {2}, orient = {3}, scale = {4})".format(maintainOffset, parent, point, orient, scale), "Constraint{0}".format(suffix), "C{0}".format(suffix)) def ToShelf_DeleteConstraints(path, *args): - MoveToShelf(path, Presets.runDeleteConstraints, "DeleteConstraints", "DeleteConstraints") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.DeleteConstraints), "DeleteConstraints", "DeleteConstraints") def ToShelf_DisconnectTargets(path, *args): - MoveToShelf(path, Presets.runDisconnectTargets, "DisconnectTargets", "Disconnect") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.DisconnectTargets), "DisconnectTargets", "Disconnect") def ToShelf_RotateOrder(path, mode, *args): - MoveToShelf(path, Presets.runRotateOrder + "({0})".format(mode), "RotateOrder{0}".format(mode), "RO{0}".format(mode)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.RotateOrder) + "({0})".format(mode), "RotateOrder{0}".format(mode), "RO{0}".format(mode)) def ToShelf_SegmentScaleCompensate(path, mode, *args): - MoveToShelf(path, Presets.runSegmentScaleCompensateCompensate + "({0})".format(mode), "SegmentScaleCompensate{0}".format(mode), "SSC{0}".format(mode)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.SegmentScaleCompensate) + "({0})".format(mode), "SegmentScaleCompensate{0}".format(mode), "SSC{0}".format(mode)) def ToShelf_JointDrawStyle(path, mode, *args): - MoveToShelf(path, Presets.runJointDrawStyle + "({0})".format(mode), "JointDrawStyle{0}".format(mode), "J{0}".format(mode)) + MoveToShelf(path, ReadFunctionAsString(CodeSamples.JointDrawStyle) + "({0})".format(mode), "JointDrawStyle{0}".format(mode), "J{0}".format(mode)) def ToShelf_CopySkin(path, *args): - MoveToShelf(path, Presets.runCopySkin, "CopySkin", "CopySkin") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.CopySkin), "CopySkin", "CopySkin") +def ToShelf_WrapsCreate(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.WrapsCreate), "WrapsCreate", "WrapsCreate") +def ToShelf_WrapsConvert(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.WrapsConvert), "WrapsConvert", "WrapsConvert") # TODO add corresponding logic +def ToShelf_BlendshapesReconstruct(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BlendshapesReconstruct), "BSReconstruct", "BSReconstruct") +def ToShelf_BlendshapesZeroWeights(path, *args): + MoveToShelf(path, ReadFunctionAsString(CodeSamples.BlendshapesZeroWeights), "BSZeroWeights", "BSZeroWeights") # MOTION TRAIL def ToShelf_MotionTrailCreate(path, *args): - MoveToShelf(path, Presets.runMotionTrailCreate, "MotionTrailCreate", "MTCreate") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.MotionTrailCreate), "MotionTrailCreate", "MTCreate") def ToShelf_MotionTrailSelect(path, *args): - MoveToShelf(path, Presets.runMotionTrailSelect, "MotionTrailSelect", "MTSelect") + MoveToShelf(path, ReadFunctionAsString(CodeSamples.MotionTrailSelect), "MotionTrailSelect", "MTSelect") def ToShelf_MotionTrailDelete(path, *args): - MoveToShelf(path, Presets.runMotionTrailDelete, "MotionTrailDelete", "MTDelete") - + MoveToShelf(path, ReadFunctionAsString(CodeSamples.MotionTrailDelete), "MotionTrailDelete", "MTDelete") # RESET BUTTON def CreateResetButton(*args): # TODO get all published attributes diff --git a/GETOOLS_SOURCE/utils/Layers.py b/GETOOLS_SOURCE/utils/Layers.py index c45cdf1..1ab1aa5 100644 --- a/GETOOLS_SOURCE/utils/Layers.py +++ b/GETOOLS_SOURCE/utils/Layers.py @@ -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 @@ -21,16 +20,15 @@ # 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 ..utils import Text - LayerBase = "BaseAnimation" LayerPrefix = "_layer_" - def Create(layerName, parent=LayerBase, *args): # if(cmds.objExists(layerName)): # cmds.warning("Layer \"{0}\" already exists".format(layerName)) diff --git a/GETOOLS_SOURCE/utils/Locators.py b/GETOOLS_SOURCE/utils/Locators.py index d163cb1..3a2d1dc 100644 --- a/GETOOLS_SOURCE/utils/Locators.py +++ b/GETOOLS_SOURCE/utils/Locators.py @@ -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 @@ -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 @@ -31,7 +31,6 @@ from ..utils import Parent from ..utils import Selector from ..utils import Text - from ..values import Enums nameBase = "gLoc" diff --git a/GETOOLS_SOURCE/utils/MayaSettings.py b/GETOOLS_SOURCE/utils/MayaSettings.py index fd82e64..b045f79 100644 --- a/GETOOLS_SOURCE/utils/MayaSettings.py +++ b/GETOOLS_SOURCE/utils/MayaSettings.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/MotionTrail.py b/GETOOLS_SOURCE/utils/MotionTrail.py index 3a0d792..3e74c49 100644 --- a/GETOOLS_SOURCE/utils/MotionTrail.py +++ b/GETOOLS_SOURCE/utils/MotionTrail.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Other.py b/GETOOLS_SOURCE/utils/Other.py index 9d77dce..7df264d 100644 --- a/GETOOLS_SOURCE/utils/Other.py +++ b/GETOOLS_SOURCE/utils/Other.py @@ -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 @@ -21,11 +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 maya.cmds as cmds # import maya.mel as mel from ..utils import Selector +from ..values import Enums def RotateOrderVisibility(on=True, *args): # Check selected objects @@ -34,7 +35,7 @@ def RotateOrderVisibility(on=True, *args): return for item in selectedList: - cmds.setAttr(item + ".rotateOrder", channelBox = on) + cmds.setAttr(item + "." + Enums.Attributes.rotateOrder, channelBox = on) def SegmentScaleCompensate(value=0, *args): # TODO refactor # Check selected objects @@ -42,9 +43,9 @@ def SegmentScaleCompensate(value=0, *args): # TODO refactor if (selectedList == None): return - selected = cmds.ls(selection = True, type = "joint") + selected = cmds.ls(selection = True, type = Enums.Types.joint) for item in selected: - cmds.setAttr(item + ".segmentScaleCompensate", value) + cmds.setAttr(item + "." + Enums.Attributes.segmentScaleCompensate, value) def JointDrawStyle(mode=0, *args): # TODO refactor # Check selected objects @@ -52,12 +53,12 @@ def JointDrawStyle(mode=0, *args): # TODO refactor if (selectedList == None): return - selected = cmds.ls(selection = True, type = "joint") + selected = cmds.ls(selection = True, type = Enums.Types.joint) for item in selected: - cmds.setAttr(item + ".drawStyle", mode) + cmds.setAttr(item + "." + Enums.Attributes.drawStyle, mode) def SelectJointsInScene(): # TODO make universal for other types - selected = cmds.ls(type = "joint") + selected = cmds.ls(type = Enums.Types.joint) cmds.select(selected) def GetShapeType(element, type): diff --git a/GETOOLS_SOURCE/utils/Parent.py b/GETOOLS_SOURCE/utils/Parent.py index b897121..080decf 100644 --- a/GETOOLS_SOURCE/utils/Parent.py +++ b/GETOOLS_SOURCE/utils/Parent.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Scene.py b/GETOOLS_SOURCE/utils/Scene.py index 16d4c08..b965e78 100644 --- a/GETOOLS_SOURCE/utils/Scene.py +++ b/GETOOLS_SOURCE/utils/Scene.py @@ -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 @@ -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 @@ -29,7 +29,7 @@ def Reload(*args): if(currentScene): cmds.file(currentScene, open = True, force = True) else: - cmds.file(newFile = 1, force = 1) + cmds.file(newFile = True, force = True) def ExitMaya(*args): cmds.quit(force = True) diff --git a/GETOOLS_SOURCE/utils/Selector.py b/GETOOLS_SOURCE/utils/Selector.py index 10acd61..6dff6ac 100644 --- a/GETOOLS_SOURCE/utils/Selector.py +++ b/GETOOLS_SOURCE/utils/Selector.py @@ -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 @@ -21,15 +20,18 @@ # 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 -def MultipleObjects(minimalCount=1, transformsOnly=True): +from ..values import Enums + +def MultipleObjects(minimalCount=1, transformsOnly=True, shapes=False): # Save selected objects to variable if (transformsOnly): - selectedList = cmds.ls(selection = True, type = "transform", shapes = False) + selectedList = cmds.ls(selection = True, type = Enums.Types.transform, shapes = shapes) else: - selectedList = cmds.ls(selection = True, shapes = False) + selectedList = cmds.ls(selection = True, shapes = shapes) # Check selected objects if (len(selectedList) < minimalCount): @@ -51,7 +53,7 @@ def SelectHierarchyTransforms(*args): return None cmds.select(hierarchy = True) - list = cmds.ls(selection = True, type = "transform", shapes = False) + list = cmds.ls(selection = True, type = Enums.Types.transform, shapes = False) cmds.select(clear = True) for i in range(len(list)): diff --git a/GETOOLS_SOURCE/utils/Shelf.py b/GETOOLS_SOURCE/utils/Shelf.py index af3b5db..8ed71ad 100644 --- a/GETOOLS_SOURCE/utils/Shelf.py +++ b/GETOOLS_SOURCE/utils/Shelf.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Skinning.py b/GETOOLS_SOURCE/utils/Skinning.py index 7c9b2e6..87000e9 100644 --- a/GETOOLS_SOURCE/utils/Skinning.py +++ b/GETOOLS_SOURCE/utils/Skinning.py @@ -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 @@ -21,10 +20,12 @@ # 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 ..utils import Selector +from ..values import Enums def CopySkinWeightsFromLastMesh(*args): selected = Selector.MultipleObjects(2) @@ -46,7 +47,8 @@ def CopySkinWeightsFromLastMesh(*args): cmds.select(selected) def HasSkinCluster(targetObject): - skinClusterDestination = cmds.ls(cmds.listHistory(targetObject), type = "skinCluster") + history = cmds.listHistory(targetObject) + skinClusterDestination = cmds.ls(history, type = Enums.Types.skinCluster) if (len(skinClusterDestination) == 0): print("{0} doesn't have skinCluster".format(targetObject)) return False diff --git a/GETOOLS_SOURCE/utils/Text.py b/GETOOLS_SOURCE/utils/Text.py index 7e6fed2..773a45f 100644 --- a/GETOOLS_SOURCE/utils/Text.py +++ b/GETOOLS_SOURCE/utils/Text.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Timeline.py b/GETOOLS_SOURCE/utils/Timeline.py index b89e1e6..d6b9530 100644 --- a/GETOOLS_SOURCE/utils/Timeline.py +++ b/GETOOLS_SOURCE/utils/Timeline.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/utils/Toggles.py b/GETOOLS_SOURCE/utils/Toggles.py new file mode 100644 index 0000000..3cf5f5a --- /dev/null +++ b/GETOOLS_SOURCE/utils/Toggles.py @@ -0,0 +1,71 @@ +# 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 +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# 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 ..values import Enums + +def Toggle(parameter): + currentPanel = cmds.getPanel(withFocus = True) + checkModelEditor = cmds.modelEditor(currentPanel, exists = True) + + if (not checkModelEditor): + cmds.warning("No Model Editor in panel \"{0}\"".format(currentPanel)) + return + + check = cmds.modelEditor(currentPanel, query = True, **{parameter: True}) + cmds.modelEditor(currentPanel, edit = True, **{parameter: not check}) + print("Panel \"{0}\", {1} {2}".format(currentPanel, parameter, not check)) + +# def ToggleAllObjects(*args): Toggle(Enums.ModelEditor.allObjects) +def ToggleCameras(*args): Toggle(Enums.ModelEditor.cameras) +def ToggleControlVertices(*args): Toggle(Enums.ModelEditor.controlVertices) +def ToggleDeformers(*args): Toggle(Enums.ModelEditor.deformers) +def ToggleDimensions(*args): Toggle(Enums.ModelEditor.dimensions) +def ToggleDynamicConstraints(*args): Toggle(Enums.ModelEditor.dynamicConstraints) +def ToggleDynamics(*args): Toggle(Enums.ModelEditor.dynamics) +def ToggleFluids(*args): Toggle(Enums.ModelEditor.fluids) +def ToggleFollicles(*args): Toggle(Enums.ModelEditor.follicles) +def ToggleGrid(*args): Toggle(Enums.ModelEditor.grid) +def ToggleHairSystems(*args): Toggle(Enums.ModelEditor.hairSystems) +def ToggleHandles(*args): Toggle(Enums.ModelEditor.handles) +def ToggleHulls(*args): Toggle(Enums.ModelEditor.hulls) +def ToggleIkHandles(*args): Toggle(Enums.ModelEditor.ikHandles) +def ToggleJoints(*args): Toggle(Enums.ModelEditor.joints) +def ToggleLights(*args): Toggle(Enums.ModelEditor.lights) +def ToggleLocators(*args): Toggle(Enums.ModelEditor.locators) +def ToggleManipulators(*args): Toggle(Enums.ModelEditor.manipulators) +def ToggleNCloths(*args): Toggle(Enums.ModelEditor.nCloths) +def ToggleNParticles(*args): Toggle(Enums.ModelEditor.nParticles) +def ToggleNRigids(*args): Toggle(Enums.ModelEditor.nRigids) +def ToggleNurbsCurves(*args): Toggle(Enums.ModelEditor.nurbsCurves) +def ToggleNurbsSurfaces(*args): Toggle(Enums.ModelEditor.nurbsSurfaces) +def TogglePivots(*args): Toggle(Enums.ModelEditor.pivots) +def TogglePlanes(*args): Toggle(Enums.ModelEditor.planes) +def TogglePolymeshes(*args): Toggle(Enums.ModelEditor.polymeshes) +def ToggleShadows(*args): Toggle(Enums.ModelEditor.shadows) +def ToggleStrokes(*args): Toggle(Enums.ModelEditor.strokes) +def ToggleSubdivSurfaces(*args): Toggle(Enums.ModelEditor.subdivSurfaces) +def ToggleTextures(*args): Toggle(Enums.ModelEditor.textures) + diff --git a/GETOOLS_SOURCE/utils/UI.py b/GETOOLS_SOURCE/utils/UI.py index 60046b6..2c38a45 100644 --- a/GETOOLS_SOURCE/utils/UI.py +++ b/GETOOLS_SOURCE/utils/UI.py @@ -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 @@ -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 diff --git a/GETOOLS_SOURCE/values/CodeSamples.py b/GETOOLS_SOURCE/values/CodeSamples.py new file mode 100644 index 0000000..e654f9b --- /dev/null +++ b/GETOOLS_SOURCE/values/CodeSamples.py @@ -0,0 +1,330 @@ +# 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 +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# 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 +# Logic in this module is not optimal enough, need manually change path names, methods and parameters. + + +def GeneralWindow(): # brackets added method use + import GETOOLS_SOURCE.modules.GeneralWindow as gtwindow + gtwindow.GeneralWindow().RUN_DOCKED + + +# FILE +def SceneReload(): + import GETOOLS_SOURCE.utils.Scene as scene + scene.Reload() + +def ExitMaya(): + import GETOOLS_SOURCE.utils.Scene as scene + scene.ExitMaya() + + +# UTILS +def SelectHierarchy(): + import GETOOLS_SOURCE.utils.Selector as selector + selector.SelectHierarchy() + +def CreateResetButton(): + import GETOOLS_SOURCE.utils.Install as install + install.CreateResetButton() + + +# TOGGLES +def ToggleCameras(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleCameras() + +def ToggleControlVertices(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleControlVertices() + +def ToggleDeformers(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleDeformers() + +def ToggleDimensions(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleDimensions() + +def ToggleDynamicConstraints(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleDynamicConstraints() + +def ToggleDynamics(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleDynamics() + +def ToggleFluids(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleFluids() + +def ToggleFollicles(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleFollicles() + +def ToggleGrid(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleGrid() + +def ToggleHairSystems(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleHairSystems() + +def ToggleHandles(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleHandles() + +def ToggleHulls(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleHulls() + +def ToggleIkHandles(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleIkHandles() + +def ToggleJoints(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleJoints() + +def ToggleLights(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleLights() + +def ToggleLocators(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleLocators() + +def ToggleManipulators(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleManipulators() + +def ToggleNCloths(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleNCloths() + +def ToggleNParticles(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleNParticles() + +def ToggleNRigids(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleNRigids() + +def ToggleNurbsCurves(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleNurbsCurves() + +def ToggleNurbsSurfaces(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleNurbsSurfaces() + +def TogglePivots(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.TogglePivots() + +def TogglePlanes(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.TogglePlanes() + +def TogglePolymeshes(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.TogglePolymeshes() + +def ToggleShadows(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleShadows() + +def ToggleStrokes(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleStrokes() + +def ToggleSubdivSurfaces(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleSubdivSurfaces() + +def ToggleTextures(): + import GETOOLS_SOURCE.utils.Toggles as toggles + toggles.ToggleTextures() + + +# LOCATORS +def LocatorsSizeScale(): # brackets added method use + import GETOOLS_SOURCE.utils.Locators as locators + locators.SelectedLocatorsSizeScale + +def LocatorsSizeSet(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.SelectedLocatorsSizeSet() + +def LocatorCreate(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.Create() + +def LocatorsMatch(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = False) + +def LocatorsParent(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = True) + +def LocatorsPin(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = True, constrainRotate = True) + +def LocatorsPinWithoutReverse(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = True, bake = True) + +def LocatorsPinPos(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = True, constrainRotate = False) + +def LocatorsPinRot(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelected(constraint = True, bake = True, constrainReverse = True, constrainTranslate = False, constrainRotate = True) + +def LocatorsRelative(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateAndBakeAsChildrenFromLastSelected(constraintReverse = True, skipLastReverse = False) + +def LocatorsRelativeSkipLast(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateAndBakeAsChildrenFromLastSelected(constraintReverse = True) + +def LocatorsRelativeWithoutReverse(): + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateAndBakeAsChildrenFromLastSelected() + +def LocatorsAim(): # brackets added method use + import GETOOLS_SOURCE.utils.Locators as locators + locators.CreateOnSelectedAim + + +# BAKINNG +def BakeClassic(): # brackets added method use + import GETOOLS_SOURCE.utils.Baker as baker + baker.BakeSelected + +def BakeCustom(): # brackets added method use + import GETOOLS_SOURCE.utils.Baker as baker + baker.BakeSelected + +def BakeByLast(): # brackets added method use + import GETOOLS_SOURCE.utils.Baker as baker + baker.BakeSelectedByLastObject + +def BakeByWorld(): # brackets added method use + import GETOOLS_SOURCE.utils.Baker as baker + baker.BakeSelectedByWorld + + +# ANIMATION +def AnimOffset(): # brackets added method use + import GETOOLS_SOURCE.utils.Animation as animation + animation.OffsetObjects + +def DeleteKeys(): + import GETOOLS_SOURCE.utils.Animation as animation + animation.DeleteKeys(True) + +def DeleteNonkeyable(): + import GETOOLS_SOURCE.utils.Animation as animation + animation.DeleteKeysNonkeyable() + +def DeleteStatic(): + import GETOOLS_SOURCE.utils.Animation as animation + animation.DeleteStaticCurves() + +def EulerFilter(): + import GETOOLS_SOURCE.utils.Animation as animation + animation.FilterCurve() + +def SetInfinity(): # brackets added method use + import GETOOLS_SOURCE.utils.Animation as animation + animation.SetInfinity + +def SetTimeline(): # brackets added method use + import GETOOLS_SOURCE.utils.Timeline as timeline + timeline.SetTime + + +# RIGGING +def Constraint(): # brackets added method use + import GETOOLS_SOURCE.utils.Constraints as constraints + constraints.ConstrainSelectedToLastObject + +def DeleteConstraints(): + import GETOOLS_SOURCE.utils.Constraints as constraints + constraints.DeleteConstraintsOnSelected() + +def DisconnectTargets(): + import GETOOLS_SOURCE.utils.Constraints as constraints + constraints.DisconnectTargetsFromConstraintOnSelected() + +def RotateOrder(): # brackets added method use + import GETOOLS_SOURCE.utils.Other as other + other.RotateOrderVisibility + +def SegmentScaleCompensate(): # brackets added method use + import GETOOLS_SOURCE.utils.Other as other + other.SegmentScaleCompensate + +def JointDrawStyle(): # brackets added method use + import GETOOLS_SOURCE.utils.Other as other + other.JointDrawStyle + +def CopySkin(): + import GETOOLS_SOURCE.utils.Skinning as skinning + skinning.CopySkinWeightsFromLastMesh() + +def WrapsCreate(): + import GETOOLS_SOURCE.utils.Deformers as deformers + deformers.WrapsCreateOnSelected() + +def WrapsConvert(): # TODO + import GETOOLS_SOURCE.utils.Deformers as deformers + deformers.WrapsConvertFromSelected() + +def BlendshapesReconstruct(): + import GETOOLS_SOURCE.utils.Deformers as deformers + deformers.BlendshapesReconstruction() + +def BlendshapesZeroWeights(): + import GETOOLS_SOURCE.utils.Blendshapes as blendshapes + blendshapes.ZeroBlendshapeWeightsOnSelected() + + +# EXPERIMENTAL +def MotionTrailCreate(): + import GETOOLS_SOURCE.utils.MotionTrail as mtrail + mtrail.Create() + +def MotionTrailSelect(): + import GETOOLS_SOURCE.utils.MotionTrail as mtrail + mtrail.Select() + +def MotionTrailDelete(): + import GETOOLS_SOURCE.utils.MotionTrail as mtrail + mtrail.Delete() + diff --git a/GETOOLS_SOURCE/values/Enums.py b/GETOOLS_SOURCE/values/Enums.py index 1956268..ac1deef 100644 --- a/GETOOLS_SOURCE/values/Enums.py +++ b/GETOOLS_SOURCE/values/Enums.py @@ -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 @@ -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 class Types: transform = "transform" @@ -47,7 +47,7 @@ class Attributes: visibility = "visibility" - scaleLocal = ("localScaleX", "localScaleY", "localScaleZ") + scaleLocal = ("localScaleX", "localScaleY", "localScaleZ") # used for locators rotateOrder = "rotateOrder" startFrame = "startFrame" @@ -102,3 +102,36 @@ class Other: ".overrideEnabled" ".overrideDisplayType" + +class ModelEditor: + # allObjects = "allObjects" + cameras = "cameras" + controlVertices = "controlVertices" + deformers = "deformers" + dimensions = "dimensions" + dynamicConstraints = "dynamicConstraints" + dynamics = "dynamics" + fluids = "fluids" + follicles = "follicles" + grid = "grid" + hairSystems = "hairSystems" + handles = "handles" + hulls = "hulls" + ikHandles = "ikHandles" + joints = "joints" + lights = "lights" + locators = "locators" + manipulators = "manipulators" + nCloths = "nCloths" + nParticles = "nParticles" + nRigids = "nRigids" + nurbsCurves = "nurbsCurves" + nurbsSurfaces = "nurbsSurfaces" + pivots = "pivots" + planes = "planes" + polymeshes = "polymeshes" + shadows = "shadows" + strokes = "strokes" + subdivSurfaces = "subdivSurfaces" + textures = "textures" + diff --git a/GETOOLS_SOURCE/values/Icons.py b/GETOOLS_SOURCE/values/Icons.py index 545eb1c..a941e52 100644 --- a/GETOOLS_SOURCE/values/Icons.py +++ b/GETOOLS_SOURCE/values/Icons.py @@ -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 @@ -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 root = "\\GETOOLS_SOURCE" @@ -35,22 +35,29 @@ arrowLeft = "arrowLeft.png" arrowRight = "arrowRight.png" arrowUp = "arrowUp.png" +blendshape = "blendShape.png" bookmark = "Bookmark.png" +camera = "camera.svg" color = "colorPresetSpectrum.png" confirm = "confirm.png" constraint = "out_normalConstraint.png" copy = "skinWeightCopy.png" cursor = "aselect.png" delete = "delete.png" +dynamicConstraint = "dynamicConstraint.svg" error = "error.png" expandLeft = "leftExpand.png" expandRight = "rightExpand.png" fileOpen = "fileOpen.png" fileSave = "fileSave.png" filter = "filter.png" +follicle = "follicle.svg" +grid = "grid.svg" +hairSystem = "hairSystem.svg" help = "help.png" helpLine = "help_line.png" home = "home.png" +ikHandle = "ikHandle.svg" itemDown = "item_down.png" itemUp = "item_up.png" joint = "kinJoint.png" @@ -61,24 +68,33 @@ lock = "lock.png" lockOff = "Lock_OFF.png" lockOn = "Lock_ON.png" +nCloth = "nCloth.svg" +nRigid = "nRigid.svg" nucleus = "nucleus.svg" +nurbsCurve = "nurbsCurve.svg" +nurbsSurface = "nurbsSurface.svg" off = "hyper_s_OFF.png" on = "hyper_s_ON.png" particle = "particle.svg" pin = "pinItem.png" pinInvert = "invertUVpinning.png" +plane = "plane.png" playblast = "playblast.png" plus = "addClip.png" +polyMesh = "polyMesh.png" reset = "menuIconReset.png" rotateCClockwise = "counterclockwise.png" rotateClockwise = "clockwise.png" settings = "advancedSettings.png" +shadows = "Shadows.png" +stroke = "stroke.svg" text = "polyType.png" visibleOff = "hidden.png" visibleOn = "visible.png" wait = "waitBusy.png" warning = "warningIcon.svg" world = "volumeSphere.png" +wrap = "wrap.png" zoom = "zoom.png" # TODO add icons sample window diff --git a/GETOOLS_SOURCE/values/License.py b/GETOOLS_SOURCE/values/License.py index 3eba71e..de24752 100644 --- a/GETOOLS_SOURCE/values/License.py +++ b/GETOOLS_SOURCE/values/License.py @@ -1,6 +1,5 @@ text = """\ # 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 @@ -22,5 +21,6 @@ # 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 """ diff --git a/changelog.txt b/changelog.txt index 1e0ee9b..f80c913 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,17 @@ GETools changelog +v1.0.5 +- Fixed motion trails to shelf button +- Decreased hardcode in Drag and Drop logic. +- Reworked Button Install module. +- [UI] Added tear-off to sub menus +- [UTILS] Added toggle buttons for active viewport. +- [UTILS] Added "Print Blendshapes Base Nodes". +- [UTILS] Added "Print Blendshapes Names". +- [RIGGING] Added wraps button. +- [RIGGING] Added blendshapes reconstruct button. +- [RIGGING] Added "Zero Blendshapes Weights" button. + v1.0.4 - [OVERLAPPY] Reworked Nucleus implementation with non-destructive way. - [UTILS] Added simple SelectHierarchy method.