Skip to content

Commit

Permalink
Merge pull request #76 from GenEugene/develop
Browse files Browse the repository at this point in the history
Version 1.0.4
  • Loading branch information
GenEugene committed Mar 6, 2024
2 parents 5315c6a + 615d3f1 commit 01d473f
Show file tree
Hide file tree
Showing 30 changed files with 273 additions and 201 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## Contributing to GETools

If you want to contribute please follow the [PEP8](https://www.python.org/dev/peps/pep-0008/) standard

17 changes: 9 additions & 8 deletions GETOOLS_SOURCE/_prototypes/Namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
def ClearRigNamespaces(_namespace=''):
rigNamespace = _namespace # Filename of rig (.mb)

refs = cmds.ls(type = 'reference')
refs = cmds.ls(type = "reference")
for i in range(len(refs)):
if (refs[i][0:-2] == rigNamespace):
rFile = cmds.referenceQuery(refs[i], f=True)
cmds.file(rFile, importReference=True) # Import reference
rFile = cmds.referenceQuery(refs[i], f = True)
cmds.file(rFile, importReference = True) # Import reference

name2 = ':' + rigNamespace
cmds.namespace( rm = name2, mnr = True) # Remove namespace
cmds.namespace(rm = name2, mnr = True) # Remove namespace

cmds.setAttr('Main.jointVis', 1 ) # Show root joint
cmds.setAttr('MotionSystem.visibility', 1 ) # Show controls
cmds.setAttr('_controllers.visibility', 1 ) # Set visibility to controls layer
cmds.select("SET_EXPORT_ANIM_ALL", r=1) # Select all objects for baking
cmds.setAttr("Main.jointVis", 1) # Show root joint
cmds.setAttr("MotionSystem.visibility", 1) # Show controls
cmds.setAttr("_controllers.visibility", 1) # Set visibility to controls layer
cmds.select("SET_EXPORT_ANIM_ALL", r = 1) # Select all objects for baking

def NamespacesFromSelected(self, *args):
selected = cmds.ls(sl = 1)
Expand All @@ -36,3 +36,4 @@ def NamespacesFromSelected(self, *args):
return selected, namespaces
else:
return None, None

11 changes: 6 additions & 5 deletions GETOOLS_SOURCE/_prototypes/Sets.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import maya.cmds as cmds

def CreateSets():
set0 = cmds.sets(n="SETS")
setE0 = cmds.sets(n="SET_EXPORT")
setE1 = cmds.sets(n="SET_EXPORT_ALL")
setE2 = cmds.sets(n="SET_EXPORT_ANIM_ALL")
set0 = cmds.sets(n = "SETS")
setE0 = cmds.sets(n = "SET_EXPORT")
setE1 = cmds.sets(n = "SET_EXPORT_ALL")
setE2 = cmds.sets(n = "SET_EXPORT_ANIM_ALL")

cmds.sets(setE0, e = 1, fe = set0) # Привязка SET_EXPORT к SETS
cmds.sets(setE1, e = 1, fe = setE0) # Привязка SET_EXPORT_ALL к SET_EXPORT
cmds.sets(setE2, e = 1, fe = setE0) # Привязка SET_EXPORT_ANIM_ALL к SET_EXPORT
cmds.sets(setE2, e = 1, fe = setE0) # Привязка SET_EXPORT_ANIM_ALL к SET_EXPORT

2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/experimental/TESTING.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
windowWidth = 300
windowHeight = 100
margin = 5
windowWidthMargin = windowWidth - margin * 2
windowWidthMargin = windowWidth - margin*2


# Create a new window
Expand Down
2 changes: 1 addition & 1 deletion GETOOLS_SOURCE/experimental/UItest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import maya.cmds as cmds
from GETOOLS_SOURCE.utils import UI
from ..utils import UI

testUI = UI.Window(titleText = " TITLE")
testUI.CreateWindow()
Expand Down
6 changes: 3 additions & 3 deletions GETOOLS_SOURCE/modules/CenterOfMass.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def COMClean(self, *args):
cmds.delete(self.COMObject)
self.COMObject = None
cmds.warning("Last active center of mass object was deleted")
def COMFloorProjection(self, skipAxis = "y", *args):
def COMFloorProjection(self, skipAxis="y", *args):
if (not self.COMObjectCheck()):
return

Expand Down Expand Up @@ -261,7 +261,7 @@ def COMConstrainToSelected(self, weight, *args):
selectedList.append(self.COMObject)
Constraints.ConstrainListToLastElement(reverse = True, selected = selectedList, maintainOffset = False, parent = False, point = True, weight = weight)
def COMDisconnectTargets(self, *args):
if (self.COMObject == None or cmds.objExists(self.COMObject) == False):
if (self.COMObject == None or not cmds.objExists(self.COMObject)):
cmds.warning("Center Of Mass object is not connected to script. Please select Center Of Mass object and press Activate button before")
return

Expand Down Expand Up @@ -306,7 +306,7 @@ def BakeCached(self, *args):
Baker.BakeSelected()
cmds.delete(self.CachedSelectedObjects[1][-1])

def LinkCached(self, maintainOffset = False, *args):
def LinkCached(self, maintainOffset=False, *args):
if (self.CachedSelectedObjects == None):
cmds.warning("No cached objects yet, operation cancelled")
return
Expand Down
12 changes: 7 additions & 5 deletions GETOOLS_SOURCE/modules/GeneralWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from ..values import Icons

class GeneralWindow:
version = "v1.0.3"
version = "v1.0.4"
name = "GETools"
title = name + " " + version

Expand Down Expand Up @@ -102,7 +102,8 @@ def ColorsPalette(*args):
def PrintChannelBoxAttributes(*args):
print(Selector.GetChannelBoxAttributes())
cmds.menu(label = "Utils", tearOff = True)
cmds.menuItem(label = "Select Transform Hiererchy", command = Selector.SelectTransformHierarchy)
cmds.menuItem(label = "Select Hiererchy", command = Selector.SelectHierarchy)
# cmds.menuItem(label = "Create Reset Button", command = Install.CreateResetButton)
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)
Expand Down Expand Up @@ -175,7 +176,8 @@ def LayoutMenuInstall(self):
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.menuItem(label = "Select Transform Hiererchy", command = partial(Install.ToShelf_SelectHierarchy, self.directory))
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.setParent('..', menu = True)
#
cmds.menuItem(dividerLabel = "TOOLS - Locators", divider = True)
Expand Down Expand Up @@ -449,10 +451,10 @@ def DockToSide(self, areaSide, *args):
def WindowCreate(self, *args):
self.CreateUI()
self.FramesCollapse(True)
def RUN_DOCKED(self, path = "", forced = False, *args):
def RUN_DOCKED(self, path="", forced=False, *args):
self.directory = path

if (forced == False and self.DockCheck()): # for script toggling. Comment these 3 lines if you need to deactivate toggling
if (not forced and self.DockCheck()): # for script toggling. Comment these 3 lines if you need to deactivate toggling
if (self.DockCheckVisible()):
self.DockDelete()
print("{0} closed".format(GeneralWindow.title))
Expand Down
Loading

0 comments on commit 01d473f

Please sign in to comment.