From 3c32db393fb5aecaec94ba06fa44366af27b91d3 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 30 Oct 2024 13:37:28 -0700 Subject: [PATCH 1/9] Update changelog.txt --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index 7ae0109..f40cf96 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ GETools changelog - TODO [OVERLAPPY] added collisions UI - TODO [OVERLAPPY] added nRigid collision logic - TODO added non-cycle origin animation with loop mode +- TODO Rotate Order rebake ********************************************** v1.3.8 From 2ff385feb897285eb8a38821d01e457c0059f4a6 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 6 Nov 2024 20:56:28 -0800 Subject: [PATCH 2/9] cut "Print Animatable Attributes With Shapes" button --- GETOOLS_SOURCE/modules/GeneralWindow.py | 4 ++-- GETOOLS_SOURCE/utils/Attributes.py | 2 +- changelog.txt | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/GETOOLS_SOURCE/modules/GeneralWindow.py b/GETOOLS_SOURCE/modules/GeneralWindow.py index cfd98d7..e2c310f 100644 --- a/GETOOLS_SOURCE/modules/GeneralWindow.py +++ b/GETOOLS_SOURCE/modules/GeneralWindow.py @@ -48,7 +48,7 @@ class GeneralWindow: - _version = "v1.3.8" + _version = "v1.3.9" _name = "GETools" _title = _name + " " + _version @@ -119,7 +119,7 @@ def ColorsPalette(*args): cmds.menuItem(dividerLabel = "Prints", divider = True) cmds.menuItem(label = "Print Selected Objects To Console", command = Print.PrintSelected, image = Icons.text) cmds.menuItem(label = "Print Animatable Attributes", command = partial(Print.PrintAttributesAnimatableOnSelected, False), image = Icons.text) - cmds.menuItem(label = "Print Animatable Attributes With Shapes", command = partial(Print.PrintAttributesAnimatableOnSelected, True), image = Icons.text) + # cmds.menuItem(label = "Print Animatable Attributes With Shapes", command = partial(Print.PrintAttributesAnimatableOnSelected, True), image = Icons.text) # FIXME cmds.menuItem(label = "Print Channel Box Selected Attributes", command = Print.PrintAttributesSelectedFromChannelBox, image = Icons.text) cmds.menuItem(dividerLabel = "Blendshapes", divider = True) cmds.menuItem(label = "Print Blendshapes Base Nodes", command = Blendshapes.GetBlendshapeNodesFromSelected, image = Icons.text) diff --git a/GETOOLS_SOURCE/utils/Attributes.py b/GETOOLS_SOURCE/utils/Attributes.py index f966508..1449072 100644 --- a/GETOOLS_SOURCE/utils/Attributes.py +++ b/GETOOLS_SOURCE/utils/Attributes.py @@ -84,7 +84,7 @@ def FilterAttributesWithoutAnimation(attributes): return attributesWithoutAnimation -def GetAttributesAnimatableOnSelected(useShapes=False): +def GetAttributesAnimatableOnSelected(useShapes=False): # TODO fix shapes detection, check on curves, cameras, meshes # Check selected objects selectedList = Selector.MultipleObjects(minimalCount = 1, transformsOnly = False) if (selectedList == None): diff --git a/changelog.txt b/changelog.txt index f40cf96..ea4dc62 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,6 +9,9 @@ GETools changelog - TODO Rotate Order rebake ********************************************** +v1.3.9 +- [UTILS] hide "Print Animatable Attributes With Shapes" button because of redundancy + v1.3.8 - [CENTER OF MASS] fixed constraining to multiple selected objects - [CENTER OF MASS] simplified UI buttons, removed redundant and merge similar From a949664e924b9d5cb8fa00dfc6d1c26867bc5c80 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 6 Nov 2024 21:07:11 -0800 Subject: [PATCH 3/9] change button names --- GETOOLS_SOURCE/modules/GeneralWindow.py | 8 ++++---- changelog.txt | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/GETOOLS_SOURCE/modules/GeneralWindow.py b/GETOOLS_SOURCE/modules/GeneralWindow.py index e2c310f..58fc748 100644 --- a/GETOOLS_SOURCE/modules/GeneralWindow.py +++ b/GETOOLS_SOURCE/modules/GeneralWindow.py @@ -166,25 +166,25 @@ def LinkVersionHistory(self): cmds.showHelp("https://github.com/GenEugene/GETool def LinkGithub(self): cmds.showHelp("https://github.com/GenEugene/GETools", absolute = True) def LinkGumroad(self): cmds.showHelp("https://gumroad.com/l/iCNa", absolute = True) def LinkGithubWiki(self): cmds.showHelp("https://github.com/GenEugene/GETools/wiki", absolute = True) - def LinkYoutubeTutorial(self): cmds.showHelp("https://youtube.com/playlist?list=PLhwndaM4LAxhbl95yz9WVie1iYflTFy6S&si=UOoK-mdk4Rm5bVyp", absolute = True) + def LinkYoutubeVideos(self): cmds.showHelp("https://youtube.com/playlist?list=PLhwndaM4LAxhbl95yz9WVie1iYflTFy6S&si=UOoK-mdk4Rm5bVyp", absolute = True) def LinkLinkedin(self): cmds.showHelp("https://www.linkedin.com/in/geneugene", absolute = True) def LinkYoutube(self): cmds.showHelp("https://youtube.com/@EugeneGataulin", absolute = True) def LinkDiscord(self): cmds.showHelp("https://discord.gg/heMxJhTqCz", absolute = True) def LinkShareIdeas(self): cmds.showHelp("https://github.com/GenEugene/GETools/discussions/categories/ideas", absolute = True) def LinkReport(self): cmds.showHelp("https://github.com/GenEugene/GETools/discussions/categories/report-a-problem", absolute = True) - cmds.menuItem(label = "About GETools", enable = False, image = self.directory + Icons.get1[0]) # TODO add window with information + # cmds.menuItem(label = "About GETools", enable = False, image = self.directory + Icons.get1[0]) # TODO add window with information cmds.menuItem(label = "Version History", command = LinkVersionHistory) cmds.menuItem(dividerLabel = "Links", divider = True) cmds.menuItem(label = "GitHub", command = LinkGithub, image = Icons.home) cmds.menuItem(label = "Gumroad", command = LinkGumroad) cmds.menuItem(dividerLabel = "HOW TO USE", divider = True) cmds.menuItem(label = "Documentation", command = LinkGithubWiki, image = Icons.help) - cmds.menuItem(label = "Tutorial Video", command = LinkYoutubeTutorial, image = Icons.playblast) + cmds.menuItem(label = "Videos Playlist", command = LinkYoutubeVideos, image = Icons.playblast) cmds.menuItem(dividerLabel = "Contacts", divider = True) + cmds.menuItem(label = "Discord", command = LinkDiscord) cmds.menuItem(label = "Linkedin", command = LinkLinkedin) cmds.menuItem(label = "YouTube", command = LinkYoutube) - cmds.menuItem(label = "Discord", command = LinkDiscord) cmds.menuItem(dividerLabel = "Support", divider = True) cmds.menuItem(label = "Share Your Ideas", command = LinkShareIdeas, image = Icons.light) cmds.menuItem(label = "Report a Problem", command = LinkReport, image = Icons.warning) diff --git a/changelog.txt b/changelog.txt index ea4dc62..38544c5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,10 +7,12 @@ GETools changelog - TODO [OVERLAPPY] added nRigid collision logic - TODO added non-cycle origin animation with loop mode - TODO Rotate Order rebake +- TODO Chain Distribution Rig ********************************************** v1.3.9 -- [UTILS] hide "Print Animatable Attributes With Shapes" button because of redundancy +- [UTILS] removed "Print Animatable Attributes With Shapes" button because of redundancy +- [UI] changed some button names v1.3.8 - [CENTER OF MASS] fixed constraining to multiple selected objects From 5e0dcd4b8ef75c2266b084bd4cd458b59db691c5 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 14:40:54 -0800 Subject: [PATCH 4/9] Create CreatePolygonWithLocators.py --- .../_prototypes/CreatePolygonWithLocators.py | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py diff --git a/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py b/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py new file mode 100644 index 0000000..9ae21c8 --- /dev/null +++ b/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py @@ -0,0 +1,62 @@ +import maya.cmds as cmds +import math + + +nameGroup = "grpPolygon" +namePolygon = "CustomPolygon" +nameLocator = "locator_" +nameCluster = "cluster_" + + +def CreatePolygonWithLocators(numPoints=3, radius=10): + if numPoints < 3: + cmds.error("Number of points must be 3 or more to create a polygon") + + ### Create main group as a container for all new objects + mainGroup = cmds.group(name = nameGroup, empty = True) + + ### Calculate vertex positions based on the number of points and radius + angleStep = 360 / numPoints + vertices = [] + for i in range(numPoints): + angle_rad = math.radians(i * angleStep) + x = math.cos(angle_rad) * radius + z = math.sin(angle_rad) * radius + vertices.append((x, 0, z)) + + ### Create the polygon + poly = cmds.polyCreateFacet(point = vertices, name = namePolygon)[0] + + ### Invert normals so the polygon faces upwards + cmds.polyNormal(poly, normalMode = 0) # normalMode = 0 inverts normals + + ### Create locators for each vertex and attach them via clusters + locators = [] + handles = [] + for i, vertex in enumerate(vertices): + ### Create locator and position it at the vertex's initial position + locator = cmds.spaceLocator(name = "{0}{1}".format(nameLocator, i + 1))[0] + locators.append(locator) + cmds.xform(locator, worldSpace = True, translation = vertex) + + ### Create a cluster for the current vertex + cluster, handle = cmds.cluster("{0}.vtx[{1}]".format(poly, i), name = "{0}{1}".format(nameCluster, i + 1)) + handles.append(handle) + cmds.setAttr(handle + ".visibility", 0) + + ### Attach the cluster to the locator + cmds.pointConstraint(locator, handle, maintainOffset = False) + + ### Parent to group + cmds.parent(poly, mainGroup) + cmds.parent(locators, mainGroup) + cmds.parent(handles, mainGroup) + + ### Select polygon + cmds.select(poly, replace = True) + + return poly + + +CreatePolygonWithLocators(4) + From 533361f97ff6f356d93a62385e7ead0b22d172bc Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 15:46:02 -0800 Subject: [PATCH 5/9] integrate Create Polygon to Rigging module --- .../_prototypes/CreatePolygonWithLocators.py | 62 -------------- GETOOLS_SOURCE/modules/Rigging.py | 39 ++++++++- GETOOLS_SOURCE/utils/Create.py | 85 +++++++++++++++++++ 3 files changed, 121 insertions(+), 65 deletions(-) delete mode 100644 GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py create mode 100644 GETOOLS_SOURCE/utils/Create.py diff --git a/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py b/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py deleted file mode 100644 index 9ae21c8..0000000 --- a/GETOOLS_SOURCE/_prototypes/CreatePolygonWithLocators.py +++ /dev/null @@ -1,62 +0,0 @@ -import maya.cmds as cmds -import math - - -nameGroup = "grpPolygon" -namePolygon = "CustomPolygon" -nameLocator = "locator_" -nameCluster = "cluster_" - - -def CreatePolygonWithLocators(numPoints=3, radius=10): - if numPoints < 3: - cmds.error("Number of points must be 3 or more to create a polygon") - - ### Create main group as a container for all new objects - mainGroup = cmds.group(name = nameGroup, empty = True) - - ### Calculate vertex positions based on the number of points and radius - angleStep = 360 / numPoints - vertices = [] - for i in range(numPoints): - angle_rad = math.radians(i * angleStep) - x = math.cos(angle_rad) * radius - z = math.sin(angle_rad) * radius - vertices.append((x, 0, z)) - - ### Create the polygon - poly = cmds.polyCreateFacet(point = vertices, name = namePolygon)[0] - - ### Invert normals so the polygon faces upwards - cmds.polyNormal(poly, normalMode = 0) # normalMode = 0 inverts normals - - ### Create locators for each vertex and attach them via clusters - locators = [] - handles = [] - for i, vertex in enumerate(vertices): - ### Create locator and position it at the vertex's initial position - locator = cmds.spaceLocator(name = "{0}{1}".format(nameLocator, i + 1))[0] - locators.append(locator) - cmds.xform(locator, worldSpace = True, translation = vertex) - - ### Create a cluster for the current vertex - cluster, handle = cmds.cluster("{0}.vtx[{1}]".format(poly, i), name = "{0}{1}".format(nameCluster, i + 1)) - handles.append(handle) - cmds.setAttr(handle + ".visibility", 0) - - ### Attach the cluster to the locator - cmds.pointConstraint(locator, handle, maintainOffset = False) - - ### Parent to group - cmds.parent(poly, mainGroup) - cmds.parent(locators, mainGroup) - cmds.parent(handles, mainGroup) - - ### Select polygon - cmds.select(poly, replace = True) - - return poly - - -CreatePolygonWithLocators(4) - diff --git a/GETOOLS_SOURCE/modules/Rigging.py b/GETOOLS_SOURCE/modules/Rigging.py index c6eac16..da673aa 100644 --- a/GETOOLS_SOURCE/modules/Rigging.py +++ b/GETOOLS_SOURCE/modules/Rigging.py @@ -28,6 +28,7 @@ from ..utils import Blendshapes from ..utils import Colors from ..utils import Constraints +from ..utils import Create from ..utils import Curves from ..utils import Deformers from ..utils import Other @@ -72,7 +73,7 @@ class RiggingAnnotations: curveCreateFromTrajectory = "***DRAFT***\nCreate a curve from objects trajectories." class Rigging: - _version = "v1.5" + _version = "v1.6" _name = "RIGGING" _title = _name + " " + _version @@ -80,6 +81,11 @@ def __init__(self): self.checkboxConstraintReverse = None self.checkboxConstraintMaintain = None # self.checkboxConstraintOffset = None + + self.intFieldPolygonWithLocatorsPoints = None + self.floatFieldPolygonWithLocatorsRadius = None + self.floatFieldPolygonWithLocatorsAngle = None + def UICreate(self, layoutMain): ### CONSTRAINTS layoutConstraints = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "CONSTRAINTS", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) @@ -155,8 +161,28 @@ def UICreate(self, layoutMain): cmds.gridLayout(parent = layoutColumnCurves, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "From Selected Objects", command = Curves.CreateCurveFromSelectedObjects, backgroundColor = Colors.blue10, annotation = RiggingAnnotations.curveCreateFromSelectedObjects) cmds.button(label = "From Trajectory", command = Curves.CreateCurveFromTrajectory, backgroundColor = Colors.orange10, annotation = RiggingAnnotations.curveCreateFromTrajectory) - - + + ### POLYGON WITH LOCATORS + self.UILayoutPolygonWithLocators(layoutMain) + + def UILayoutPolygonWithLocators(self, layoutMain): + layoutMesh = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "Polygon With Locators", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) + cellWidth1 = 75 + cellWidth2 = 75 + cellWidth3 = 75 + cellWidth4 = 40 + rowLayout = cmds.rowLayout(parent = layoutMesh, numberOfColumns = 4, columnWidth4 = (cellWidth1, cellWidth2, cellWidth3, cellWidth4), columnAlign = [(1, "right"), (2, "center"), (3, "center"), (4, "center")], columnAttach = [(1, "both", 0), (2, "both", 0), (3, "both", 0), (4, "both", 0)]) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth1 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Points") + self.intFieldPolygonWithLocatorsPoints = cmds.intField(value = 3, minValue = 3) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth2 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Radius") + self.floatFieldPolygonWithLocatorsRadius = cmds.floatField(value = 10, minValue = 0, precision = 1) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth3 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Angle") + self.floatFieldPolygonWithLocatorsAngle = cmds.floatField(value = 0, precision = 1) + cmds.button(parent = rowLayout, label = "Create", command = self.CreatePolygonWithLocators, backgroundColor = Colors.green10) + ### CONSTRAINTS def GetCheckboxConstraintReverse(self): return cmds.checkBox(self.checkboxConstraintReverse, query = True, value = True) @@ -174,3 +200,10 @@ def ConstrainScale(self, *args): def ConstrainAim(self, *args): # TODO Constraints.ConstrainSelectedToLastObject(reverse = self.GetCheckboxConstraintReverse(), maintainOffset = self.GetCheckboxConstraintMaintain(), parent = False, point = False, orient = False, scale = False, aim = True) + ### MESH + def CreatePolygonWithLocators(self, *args): + points = cmds.intField(self.intFieldPolygonWithLocatorsPoints, query = True, value = True) + radius = cmds.floatField(self.floatFieldPolygonWithLocatorsRadius, query = True, value = True) + angle = cmds.floatField(self.floatFieldPolygonWithLocatorsAngle, query = True, value = True) + Create.CreatePolygonWithLocators(countPoints = points, radius = radius, rotation = angle) + diff --git a/GETOOLS_SOURCE/utils/Create.py b/GETOOLS_SOURCE/utils/Create.py new file mode 100644 index 0000000..0bdb78c --- /dev/null +++ b/GETOOLS_SOURCE/utils/Create.py @@ -0,0 +1,85 @@ +# 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 math + +from ..utils import Text + + +nameGroup = "grpPolygon" +namePolygon = "CustomPolygon" +nameLocator = "locator_" +nameCluster = "cluster_" + + +def CreatePolygonWithLocators(countPoints=3, radius=10, rotation=0): + if countPoints < 3: + cmds.warning("Number of points must be 3 or more to create a polygon") + return None + + ### Create main group as a container for all new objects + mainGroup = cmds.group(name = Text.SetUniqueFromText(nameGroup), empty = True) + + ### Calculate vertex positions based on the number of points and radius + angleStep = 360 / countPoints + vertices = [] + for i in range(countPoints): + angleRadian = math.radians(i * angleStep + rotation) + x = math.cos(angleRadian) * radius + z = math.sin(angleRadian) * radius + vertices.append((x, 0, z)) + + ### Create the polygon + poly = cmds.polyCreateFacet(point = vertices, name = Text.SetUniqueFromText(namePolygon))[0] + + ### Invert normals so the polygon faces upwards + cmds.polyNormal(poly, normalMode = 0) # normalMode = 0 inverts normals + + ### Create locators for each vertex and attach them via clusters + locators = [] + handles = [] + for i, vertex in enumerate(vertices): + ### Create locator and position it at the vertex's initial position + locator = cmds.spaceLocator(name = Text.SetUniqueFromText("{0}{1}".format(nameLocator, i + 1)))[0] + locators.append(locator) + cmds.xform(locator, worldSpace = True, translation = vertex) + + ### Create a cluster for the current vertex + cluster, handle = cmds.cluster("{0}.vtx[{1}]".format(poly, i), name = Text.SetUniqueFromText("{0}{1}".format(nameCluster, i + 1))) + handles.append(handle) + cmds.setAttr(handle + ".visibility", 0) + + ### Attach the cluster to the locator + cmds.pointConstraint(locator, handle, maintainOffset = False) + + ### Parent to group + cmds.parent(poly, mainGroup) + cmds.parent(locators, mainGroup) + cmds.parent(handles, mainGroup) + + ### Select polygon + cmds.select(poly, replace = True) + + return poly, locators, handles + From f70a2226c756bb47496c49574500573f9997561d Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 16:12:16 -0800 Subject: [PATCH 6/9] save: - lock attributes for group of Polygon - extract Rigging UI code blocks to separate functions --- GETOOLS_SOURCE/modules/Rigging.py | 58 +++++++++++++++---------------- GETOOLS_SOURCE/utils/Create.py | 11 +++++- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/GETOOLS_SOURCE/modules/Rigging.py b/GETOOLS_SOURCE/modules/Rigging.py index da673aa..c683f7d 100644 --- a/GETOOLS_SOURCE/modules/Rigging.py +++ b/GETOOLS_SOURCE/modules/Rigging.py @@ -33,7 +33,6 @@ from ..utils import Deformers from ..utils import Other from ..utils import Skinning -from ..utils import UI class RiggingAnnotations: @@ -87,7 +86,31 @@ def __init__(self): self.floatFieldPolygonWithLocatorsAngle = None def UICreate(self, layoutMain): - ### CONSTRAINTS + ### POLYGON WITH LOCATORS + self.UILayoutPolygonWithLocators(layoutMain) + self.UILayoutConstraints(layoutMain) + self.UILayoutUtils(layoutMain) + self.UILayoutBlendshapes(layoutMain) + self.UILayoutCurves(layoutMain) + + def UILayoutPolygonWithLocators(self, layoutMain): + layoutMesh = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "POLYGON WITH LOCATORS", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) + cellWidth1 = 75 + cellWidth2 = 75 + cellWidth3 = 75 + cellWidth4 = 40 + rowLayout = cmds.rowLayout(parent = layoutMesh, numberOfColumns = 4, columnWidth4 = (cellWidth1, cellWidth2, cellWidth3, cellWidth4), columnAlign = [(1, "right"), (2, "center"), (3, "center"), (4, "center")], columnAttach = [(1, "both", 0), (2, "both", 0), (3, "both", 0), (4, "both", 0)]) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth1 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Points") + self.intFieldPolygonWithLocatorsPoints = cmds.intField(value = 3, minValue = 3) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth2 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Radius") + self.floatFieldPolygonWithLocatorsRadius = cmds.floatField(value = 10, minValue = 0, precision = 1) + cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth3 / 2, cellHeight = Settings.lineHeight) + cmds.text(label = "Angle") + self.floatFieldPolygonWithLocatorsAngle = cmds.floatField(value = 0, precision = 1) + cmds.button(parent = rowLayout, label = "Create", command = self.CreatePolygonWithLocators, backgroundColor = Colors.green10) + def UILayoutConstraints(self, layoutMain): layoutConstraints = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "CONSTRAINTS", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) layoutColumnConstraints = cmds.columnLayout(parent = layoutConstraints, adjustableColumn = True) # @@ -111,9 +134,7 @@ def UICreate(self, layoutMain): cmds.gridLayout(parent = layoutColumnConstraints, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "Disconnect", command = Constraints.DisconnectTargetsFromConstraintOnSelected, backgroundColor = Colors.red50, annotation = RiggingAnnotations.constraintDisconnectSelected) cmds.button(label = "Delete Constraints", command = Constraints.DeleteConstraintsOnSelected, backgroundColor = Colors.red50, annotation = RiggingAnnotations.constraintDelete) - - - ### UTILS + def UILayoutUtils(self, layoutMain): layoutUtils = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "UTILS", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) layoutColumnUtils = cmds.columnLayout(parent = layoutUtils, adjustableColumn = True) # @@ -137,8 +158,7 @@ def UICreate(self, layoutMain): countOffsets = 1 cmds.gridLayout(parent = layoutColumnUtils, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "Copy Skin Weights From Last Selected", command = Skinning.CopySkinWeightsFromLastMesh, backgroundColor = Colors.blue10, annotation = RiggingAnnotations.copySkinWeights) - - ### BLENDSHAPES + def UILayoutBlendshapes(self, layoutMain): layoutBlendshapes = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "BLENDSHAPES", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) layoutColumnBlendshapes = cmds.columnLayout(parent = layoutBlendshapes, adjustableColumn = True) # @@ -152,8 +172,7 @@ def UICreate(self, layoutMain): countOffsets = 1 cmds.gridLayout(parent = layoutColumnBlendshapes, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "Zero Weights", command = Blendshapes.ZeroBlendshapeWeightsOnSelected, backgroundColor = Colors.blackWhite100, annotation = RiggingAnnotations.blendshapeZeroWeights) - - ### CURVES + def UILayoutCurves(self, layoutMain): layoutCurves = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "CURVES", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) layoutColumnCurves = cmds.columnLayout(parent = layoutCurves, adjustableColumn = True) # @@ -161,28 +180,7 @@ def UICreate(self, layoutMain): cmds.gridLayout(parent = layoutColumnCurves, numberOfColumns = countOffsets, cellWidth = Settings.windowWidthMargin / countOffsets, cellHeight = Settings.lineHeight) cmds.button(label = "From Selected Objects", command = Curves.CreateCurveFromSelectedObjects, backgroundColor = Colors.blue10, annotation = RiggingAnnotations.curveCreateFromSelectedObjects) cmds.button(label = "From Trajectory", command = Curves.CreateCurveFromTrajectory, backgroundColor = Colors.orange10, annotation = RiggingAnnotations.curveCreateFromTrajectory) - - ### POLYGON WITH LOCATORS - self.UILayoutPolygonWithLocators(layoutMain) - def UILayoutPolygonWithLocators(self, layoutMain): - layoutMesh = cmds.frameLayout(parent = layoutMain, label = Settings.frames2Prefix + "Polygon With Locators", collapsable = True, backgroundColor = Settings.frames2Color, marginWidth = 0, marginHeight = 0) - cellWidth1 = 75 - cellWidth2 = 75 - cellWidth3 = 75 - cellWidth4 = 40 - rowLayout = cmds.rowLayout(parent = layoutMesh, numberOfColumns = 4, columnWidth4 = (cellWidth1, cellWidth2, cellWidth3, cellWidth4), columnAlign = [(1, "right"), (2, "center"), (3, "center"), (4, "center")], columnAttach = [(1, "both", 0), (2, "both", 0), (3, "both", 0), (4, "both", 0)]) - cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth1 / 2, cellHeight = Settings.lineHeight) - cmds.text(label = "Points") - self.intFieldPolygonWithLocatorsPoints = cmds.intField(value = 3, minValue = 3) - cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth2 / 2, cellHeight = Settings.lineHeight) - cmds.text(label = "Radius") - self.floatFieldPolygonWithLocatorsRadius = cmds.floatField(value = 10, minValue = 0, precision = 1) - cmds.gridLayout(parent = rowLayout, numberOfColumns = 2, cellWidth = cellWidth3 / 2, cellHeight = Settings.lineHeight) - cmds.text(label = "Angle") - self.floatFieldPolygonWithLocatorsAngle = cmds.floatField(value = 0, precision = 1) - cmds.button(parent = rowLayout, label = "Create", command = self.CreatePolygonWithLocators, backgroundColor = Colors.green10) - ### CONSTRAINTS def GetCheckboxConstraintReverse(self): return cmds.checkBox(self.checkboxConstraintReverse, query = True, value = True) diff --git a/GETOOLS_SOURCE/utils/Create.py b/GETOOLS_SOURCE/utils/Create.py index 0bdb78c..e519619 100644 --- a/GETOOLS_SOURCE/utils/Create.py +++ b/GETOOLS_SOURCE/utils/Create.py @@ -28,7 +28,7 @@ nameGroup = "grpPolygon" -namePolygon = "CustomPolygon" +namePolygon = "customPolygon" nameLocator = "locator_" nameCluster = "cluster_" @@ -40,6 +40,15 @@ def CreatePolygonWithLocators(countPoints=3, radius=10, rotation=0): ### Create main group as a container for all new objects mainGroup = cmds.group(name = Text.SetUniqueFromText(nameGroup), empty = True) + cmds.setAttr(mainGroup + ".tx", lock = True) + cmds.setAttr(mainGroup + ".ty", lock = True) + cmds.setAttr(mainGroup + ".tz", lock = True) + cmds.setAttr(mainGroup + ".rx", lock = True) + cmds.setAttr(mainGroup + ".ry", lock = True) + cmds.setAttr(mainGroup + ".rz", lock = True) + cmds.setAttr(mainGroup + ".sx", lock = True) + cmds.setAttr(mainGroup + ".sy", lock = True) + cmds.setAttr(mainGroup + ".sz", lock = True) ### Calculate vertex positions based on the number of points and radius angleStep = 360 / countPoints From 0193e01ee94d928b8cabfb04db062fb7221e6607 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 18:19:26 -0800 Subject: [PATCH 7/9] update changelog and create todo file --- changelog.txt | 12 ++---------- todo.txt | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 todo.txt diff --git a/changelog.txt b/changelog.txt index 38544c5..c60d17d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,16 +1,8 @@ GETools changelog -***FUTURE PLAN*** -- TODO [PHYSICS] added new physics with nHair logic -- TODO [OVERLAPPY] added Chain mode with nHair -- TODO [OVERLAPPY] added collisions UI -- TODO [OVERLAPPY] added nRigid collision logic -- TODO added non-cycle origin animation with loop mode -- TODO Rotate Order rebake -- TODO Chain Distribution Rig -********************************************** - v1.3.9 +- [TOOLS] added "Polygon With Locators" button to create custom polygons with locators for each vertex +- [TOOLS] extracted Rigging UI code blocks to separate functions - [UTILS] removed "Print Animatable Attributes With Shapes" button because of redundancy - [UI] changed some button names diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..f039a8d --- /dev/null +++ b/todo.txt @@ -0,0 +1,27 @@ +GETools TODO List + +[TOOLS] +- chain distribution rig +- pin scale +- rotate Order rebake +- relative Camera + +[RIGGING] +- finish Create curve from trajectory button + +[OVERLAPPY] +- fix particle offset on loop mode +- fix nucleus double nodes +- fix loop mode with rootmotion +- non-cycle origin animation with loop mode +- scale baking +- chain mode with nHair +- nRigid collision logic +- collisions UI + +[PHYSICS] +- physics with nHair logic + +[CENTER OF MASS] +- improve projection approach + From 1cfd448ae608580f70072729e7357ee7073973c6 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 18:31:39 -0800 Subject: [PATCH 8/9] Update GeneralWindow.py --- GETOOLS_SOURCE/modules/GeneralWindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GETOOLS_SOURCE/modules/GeneralWindow.py b/GETOOLS_SOURCE/modules/GeneralWindow.py index 58fc748..ed04285 100644 --- a/GETOOLS_SOURCE/modules/GeneralWindow.py +++ b/GETOOLS_SOURCE/modules/GeneralWindow.py @@ -48,7 +48,7 @@ class GeneralWindow: - _version = "v1.3.9" + _version = "v1.4.0" _name = "GETools" _title = _name + " " + _version From 988d1c3a84f58c5e71ef7ecb437ece323b3a077d Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 7 Nov 2024 18:33:57 -0800 Subject: [PATCH 9/9] Update changelog.txt --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index c60d17d..e6aa501 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ GETools changelog -v1.3.9 +v1.4.0 - [TOOLS] added "Polygon With Locators" button to create custom polygons with locators for each vertex - [TOOLS] extracted Rigging UI code blocks to separate functions - [UTILS] removed "Print Animatable Attributes With Shapes" button because of redundancy