Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions GETOOLS_SOURCE/modules/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions GETOOLS_SOURCE/utils/Locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down