diff --git a/GETOOLS_SOURCE/modules/Tools.py b/GETOOLS_SOURCE/modules/Tools.py index fdc754d..4c9d071 100644 --- a/GETOOLS_SOURCE/modules/Tools.py +++ b/GETOOLS_SOURCE/modules/Tools.py @@ -198,18 +198,19 @@ def UILayoutLocators(self, layoutMain): # cmds.setParent("..") ### LOCATORS ROW 1 - countCells2 = 6 + countCells2 = 7 cmds.gridLayout(parent = layoutColumn, numberOfColumns = countCells2, cellWidth = Settings.windowWidthMargin / countCells2, cellHeight = Settings.lineHeight) cmds.button(label = "Locator", command = self.Locator, backgroundColor = Colors.green10, annotation = ToolsAnnotations.locator) cmds.button(label = "Match", command = self.LocatorsMatch, backgroundColor = Colors.green10, annotation = ToolsAnnotations.locatorMatch) cmds.button(label = "Parent", command = self.LocatorsParent, backgroundColor = Colors.green10, annotation = ToolsAnnotations.locatorParent) - cmds.button(label = "Pin", command = partial(self.LocatorsBakeReverse, True, True), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReverse) + cmds.button(label = "Pin", command = partial(self.LocatorsBakeReverse, True, True, True), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReverse) cmds.popupMenu() cmds.menuItem(label = "Without Reverse Constraint", command = self.LocatorsBake) - cmds.button(label = "P-POS", command = partial(self.LocatorsBakeReverse, True, False), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReversePos) - cmds.button(label = "P-ROT", command = partial(self.LocatorsBakeReverse, False, True), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReverseRot) + cmds.button(label = "P-POS", command = partial(self.LocatorsBakeReverse, True, False, False), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReversePos) + cmds.button(label = "P-ROT", command = partial(self.LocatorsBakeReverse, False, True, False), backgroundColor = Colors.yellow50, annotation = ToolsAnnotations.locatorsBakeReverseRot) + cmds.button(label = "P-SCL", command = partial(self.LocatorsBakeReverse, False, False, True), backgroundColor = Colors.yellow50, annotation = "TODO") # TODO # cmds.setParent("..") - + ### LOCATORS ROW 2 cmds.rowLayout(parent = layoutColumn, adjustableColumn = 1, numberOfColumns = 2, columnWidth2 = (50, 150), columnAlign = [(1, "center"), (2, "center")], columnAttach = [(1, "both", 0), (2, "both", 0)]) cmds.button(label = "Relative", command = self.LocatorsRelativeReverse, backgroundColor = Colors.orange10, annotation = ToolsAnnotations.locatorsRelativeReverse) @@ -378,7 +379,7 @@ def LocatorsParent(self, *args): def LocatorsBake(self, *args): Locators.CreateOnSelected(scale = self.GetFloatLocatorSize(), hideParent = self.GetCheckboxLocatorHideParent(), subLocator = self.GetCheckboxLocatorSubLocator(), constraint = True, bake = True) - def LocatorsBakeReverse(self, translate=True, rotate=True, *args): # TODO , channelBox = False + def LocatorsBakeReverse(self, translate=True, rotate=True, scale=True, *args): # TODO , channelBox = False Locators.CreateOnSelected(scale = self.GetFloatLocatorSize(), hideParent = self.GetCheckboxLocatorHideParent(), subLocator = self.GetCheckboxLocatorSubLocator(), constraint = True, bake = True, constrainReverse = True, constrainTranslate = translate, constrainRotate = rotate) def LocatorsRelative(self, *args): diff --git a/GETOOLS_SOURCE/utils/Locators.py b/GETOOLS_SOURCE/utils/Locators.py index 6b52e41..e3746da 100644 --- a/GETOOLS_SOURCE/utils/Locators.py +++ b/GETOOLS_SOURCE/utils/Locators.py @@ -105,7 +105,7 @@ def Create(name=_nameBase, scale=_scale, hideParent=False, subLocator=False): return locatorCurrent, subLocator else: return locatorCurrent -def CreateOnSelected(name=_nameBase, scale=_scale, minSelectedCount=_minSelectedCount, hideParent=False, subLocator=False, constraint=False, bake=False, parentToLastSelected=False, constrainReverse=False, constrainTranslate=True, constrainRotate=True, euler=False): +def CreateOnSelected(name=_nameBase, scale=_scale, minSelectedCount=_minSelectedCount, hideParent=False, subLocator=False, constraint=False, bake=False, parentToLastSelected=False, constrainReverse=False, constrainTranslate=True, constrainRotate=True, constrainScale=True, euler=False): # TODO change scale to False after tests if needed # Check selected objects selectedList = Selector.MultipleObjects(minSelectedCount) if (selectedList == None): @@ -153,7 +153,7 @@ def CreateOnSelected(name=_nameBase, scale=_scale, minSelectedCount=_minSelected firstObject = sublocatorsList[i] else: firstObject = locatorsList[i] - Constraints.ConstrainSecondToFirstObject(firstObject, selectedList[i], maintainOffset = False, parent = constrainTranslate and constrainRotate, point = constrainTranslate, orient = constrainRotate) + Constraints.ConstrainSecondToFirstObject(firstObject, selectedList[i], maintainOffset = False, parent = constrainTranslate and constrainRotate, point = constrainTranslate, orient = constrainRotate, scale = constrainScale) # Select objects and return if subLocator: