code
stringlengths
1
1.72M
language
stringclasses
1 value
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
Python
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
Python
# This file is part of Androguard. # # Copyright (C) 2013, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
Python
''' Module which prompts the user for translations and saves them. TODO: implement @author: Rodrigo Damazio ''' class Translator(object): ''' classdocs ''' def __init__(self, language): ''' Constructor ''' self._language = language def Translate(self, string_names): print string_names
Python
''' Module which brings history information about files from Mercurial. @author: Rodrigo Damazio ''' import re import subprocess REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*') def _GetOutputLines(args): ''' Runs an external process and returns its output as a list of lines. @param args: the argume...
Python
''' Module which parses a string XML file. @author: Rodrigo Damazio ''' from xml.parsers.expat import ParserCreate import re #import xml.etree.ElementTree as ET class StringsParser(object): ''' Parser for string XML files. This object is not thread-safe and should be used for parsing a single file at a time...
Python
#!/usr/bin/python ''' Entry point for My Tracks i18n tool. @author: Rodrigo Damazio ''' import mytracks.files import mytracks.translate import mytracks.validate import sys def Usage(): print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0] print 'Commands are:' print ' cleanup' print ' translate' p...
Python
''' Module which compares languague files to the master file and detects issues. @author: Rodrigo Damazio ''' import os from mytracks.parser import StringsParser import mytracks.history class Validator(object): def __init__(self, languages): ''' Builds a strings file validator. Params: @para...
Python
''' Module for dealing with resource files (but not their contents). @author: Rodrigo Damazio ''' import os.path from glob import glob import re MYTRACKS_RES_DIR = 'MyTracks/res' ANDROID_MASTER_VALUES = 'values' ANDROID_VALUES_MASK = 'values-*' def GetMyTracksDir(): ''' Returns the directory in which the MyTrac...
Python
#!/usr/bin/env python # Copyright (c) 2004,2005 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
Python
#!/usr/bin/env python # Copyright (c) 2004,2005 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
Python
#!/usr/bin/env python # Copyright (c) 2004,2005 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
Python
#!/usr/bin/env python # Copyright (c) 2004 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED ...
Python
#!/usr/bin/env python # Copyright (c) 2004,2005 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
Python
from distutils.core import setup, Extension module = Extension('fparser', sources = ['fparser.c', 'collector.c', 'dumper.c', 'logging.c', 'packer.c', 'parser.c', 'sniff.c'], libraries = ['pcap', 'pthread'], extra_co...
Python
import fparser import time fp = fparser.FParser('en0') while True: time.sleep(10) for flow in fp.flow_iter(): if flow.get_info().Bps > 1000: print flow.get_id()
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
#! /usr/bin/env python # encoding: utf-8 # waf 1.6.2 VERSION='0.3.3' import sys APPNAME='p2t' top = '.' out = 'build' CPP_SOURCES = ['poly2tri/common/shapes.cc', 'poly2tri/sweep/cdt.cc', 'poly2tri/sweep/advancing_front.cc', 'poly2tri/sweep/sweep_context.cc', ...
Python
''' Module which brings history information about files from Mercurial. @author: Rodrigo Damazio ''' import re import subprocess REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*') def _GetOutputLines(args): ''' Runs an external process and returns its output as a list of lines. @param args: the argume...
Python
#!/usr/bin/python ''' Entry point for My Tracks i18n tool. @author: Rodrigo Damazio ''' import mytracks.files import mytracks.translate import mytracks.validate import sys def Usage(): print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0] print 'Commands are:' print ' cleanup' print ' translate' p...
Python
''' Module which prompts the user for translations and saves them. TODO: implement @author: Rodrigo Damazio ''' class Translator(object): ''' classdocs ''' def __init__(self, language): ''' Constructor ''' self._language = language def Translate(self, string_names): print string_names
Python
''' Module which compares languague files to the master file and detects issues. @author: Rodrigo Damazio ''' import os from mytracks.parser import StringsParser import mytracks.history class Validator(object): def __init__(self, languages): ''' Builds a strings file validator. Params: @para...
Python
''' Module for dealing with resource files (but not their contents). @author: Rodrigo Damazio ''' import os.path from glob import glob import re MYTRACKS_RES_DIR = 'MyTracks/res' ANDROID_MASTER_VALUES = 'values' ANDROID_VALUES_MASK = 'values-*' def GetMyTracksDir(): ''' Returns the directory in which the MyTrac...
Python
''' Module which parses a string XML file. @author: Rodrigo Damazio ''' from xml.parsers.expat import ParserCreate import re #import xml.etree.ElementTree as ET class StringsParser(object): ''' Parser for string XML files. This object is not thread-safe and should be used for parsing a single file at a time...
Python
from maya.cmds import * from names import Parity, Name, camelCaseToNice from vectors import Vector, Colour from control import attrState, NORMAL, HIDE, LOCK_HIDE, NO_KEY from apiExtensions import asMObject, castToMObjects, cmpNodes from mayaDecorators import d_unifyUndo from maya.OpenMaya import MGlobal from r...
Python
from rigPrim_ikFkBase import * from rigPrim_stretchy import StretchRig class IkFkArm(IkFkBase): __version__ = 3 + IkFkBase.__version__ #factor in the version of the ikfk sub rig part SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'Arm' ), ) CONTROL_NAMES = 'control', 'fkBicep', 'fkElbow', 'fkWris...
Python
from maya.cmds import * from devTest_base import d_makeNewScene, _BaseTest import skeletonBuilder import skeletonBuilderUI import rigPrimitives __all__ = [ 'TestSkeletonBuilder' ] #PERFORM_RELOAD = False SkeletonPart = skeletonBuilder.SkeletonPart Root = SkeletonPart.GetNamedSubclass( 'Root' ) Spin...
Python
import filesystem import typeFactories from maya.cmds import * from maya import cmds as cmd from rigUtils import * from control import * from names import Parity, Name, camelCaseToNice, stripParity from skeletonBuilder import * from vectors import Vector, Matrix from mayaDecorators import d_unifyUndo from...
Python
from __future__ import with_statement import os import re import sys import time import marshal import datetime import subprocess import tempfile import path from path import * from misc import iterBy ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ### IMPORTANT: perforce is disabled by default -...
Python
from path import * from misc import removeDupes LOCALES = LOCAL, GLOBAL = 'local', 'global' DEFAULT_XTN = 'preset' #define where the base directories are for presets kLOCAL_BASE_DIR = Path('%HOME%/presets/') kGLOBAL_BASE_DIR = Path( __file__ ).up( 2 ) class PresetException(Exception): def __init__( s...
Python
from path import * from misc import * #from perforce import * from presets import * IS_WING_DEBUG = 'WINGDB_ACTIVE' in os.environ class GoodException(Exception): ''' good exceptions are just a general purpose way of breaking out of loops and whatnot. basically anytime an exception is needed to con...
Python
import inspect def removeDupes( iterable ): ''' ''' unique = set() newIterable = iterable.__class__() for item in iterable: if item not in unique: newIterable.append(item) unique.add(item) return newIterable def iterBy( iterable, count ): ''' returns an generator which will yield "ch...
Python
from __future__ import with_statement from cacheDecorators import * import os import re import sys import stat import shutil import cPickle import datetime #the mail server used to send mail MAIL_SERVER = 'exchange' DEFAULT_AUTHOR = 'default_username@your_domain.com' #set the pickle protocol to ...
Python
from vectors import Vector _MAX_RECURSE = 35 class BinarySearchTree(list): SORT_DIMENSION = 0 def __init__( self, data ): list.__init__( self, data ) #sort by the desired dimension if self.SORT_DIMENSION == 0: self.sort() else: sortDimension = self.SORT_DIMENSION self.sort( key...
Python
import exportManagerCore, filesystem, datetime, api import maya.cmds as cmd from filesystem import resolvePath mel = api.mel melecho = api.melecho TOOL_NAME = 'visManager' TOOL_VERSION = 1 EXTENSION = filesystem.DEFAULT_XTN DEFAULT_LOCALE = filesystem.LOCAL def exportPreset( presetName, visHierarchyTop...
Python
''' general utils to push changes to referenced scene data back to its original source currently just contains a function to take skin weights from the current scene and push them to the model file ''' from maya.cmds import * from filesystem import Path from api import mel from common import printWarningStr ...
Python
from baseSkeletonBuilder import * class Head(SkeletonPart): HAS_PARITY = False @property def head( self ): return self[ -1 ] @classmethod def _build( cls, parent=None, neckCount=1, **kw ): idx = kw[ 'idx' ] partScale = kw[ 'partScale' ] parent = getParent( parent ) posInc = partScale ...
Python
from baseRigPrimitive import * class StretchRig(RigSubPart): ''' creates stretch attribs on the given control, and makes all given joints stretchy ------- control the character prefix used to identify the character parity which side is the arm on? l (left) or r (right) axis the stretch axis us...
Python
from filesystem import Path, PresetManager, Preset, savePreset, readPreset, LOCAL, GLOBAL import skeletonBuilder from maya.cmds import * from baseSkeletonBuilder import SkeletonPart, setupAutoMirror, TOOL_NAME, buildSkeletonPartContainer from names import camelCaseToNice import maya.cmds as cmd import apiExtensions...
Python
from rigPrim_ikFkBase import * from rigPrim_stretchy import StretchRig class QuadrupedIkFkLeg(IkFkBase): __version__ = 0 SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'QuadrupedFrontLeg' ), SkeletonPart.GetNamedSubclass( 'QuadrupedBackLeg' ) ) CONTROL_NAMES = 'control', 'poleControl', 'clavicle' ...
Python
from skinWeightsBase import * from filesystem import removeDupes from maya.cmds import * from binarySearchTree import BinarySearchTree from mayaDecorators import d_unifyUndo import maya.cmds as cmd import api import apiExtensions mel = api.mel iterParents = api.iterParents VertSkinWeight = MayaVertSkinW...
Python
from maya.cmds import * from baseMelUI import * from common import printWarningStr from control import attrState, LOCK_HIDE, Axis from mayaDecorators import d_unifyUndo from names import camelCaseToNice from apiExtensions import getNodesCreatedBy class DynamicChain(object): ''' provides a high level in...
Python
import vectors, cPickle, names, math, time, datetime, mayaVectors, api import exportManagerCore import maya.cmds as cmd import maya.OpenMaya as OpenMaya import maya.OpenMayaAnim as OpenMayaAnim import bisect, os g_defaultKeyUtilsPickle = 'd:/temp.pickle' g_validWorldAttrs = ('translateX','translateY','transl...
Python
from baseSkeletonBuilder import * class Hand(SkeletonPart): HAS_PARITY = True AUTO_NAME = False #this part will handle its own naming... #odd indices are left sided, even are right sided FINGER_IDX_NAMES = ( 'Thumb', 'Index', 'Mid', 'Ring', 'Pinky', 'Sixth' 'Seventh', 'Eighth', '...
Python
import sys import baseSkeletonBuilder from filesystem import Path from baseSkeletonBuilder import * __author__ = 'mel@macaronikazoo.com' SKELETON_PART_SCRIPT_PREFIX = 'skeletonPart_' _LOAD_ORDER = 'spine', 'head', 'arm', 'hand', 'leg' def _iterSkeletonPartScripts(): for p in sys.path: p = Path...
Python
import os from consoleChroma import Good from filesystem import Path, removeDupes from dependencies import generateDepTree, makeScriptPathRelative _THIS_FILE = Path( os.path.abspath( __file__ ) ) _PYTHON_TOOLS_TO_PACKAGE = _THIS_FILE.up() / 'pythonToolsToPackage.txt' _PACKAGE_DIR_NAME = 'zooToolboxPy' _PAC...
Python
try: import wingdbstub except ImportError: pass from filesystem import Path from unittest import TestCase, TestResult from maya import cmds as cmd import sys import inspect ### POPULATE THE LIST OF TEST SCRIPTS ### TEST_SCRIPTS = {} def populateTestScripts(): global TEST_SCRIPTS thisScriptD...
Python
from triggered import * import spaceSwitching def removeDupes( iterable ): unique = set() newIterable = iterable.__class__() for item in iterable: if item not in unique: newIterable.append( item ) unique.add( item ) return newIterable def buildMenuItems( parent, obj ): ''' build...
Python
import __future__ from filesystem import * from vectors import * import maya.OpenMaya as OpenMaya import maya.cmds as cmd import maya.mel import maya.utils import names def getFps(): ''' returns the current fps as a number ''' timebases = {'ntsc': 30, 'pal': 25, 'film': 24, 'game': 15, 'show...
Python
from maya.OpenMaya import MGlobal from exceptionHandlers import generateTraceableStrFactory generateInfoStr, printInfoStr = generateTraceableStrFactory( '*** INFO ***', MGlobal.displayInfo ) generateWarningStr, printWarningStr = generateTraceableStrFactory( '', MGlobal.displayWarning ) generateErrorStr, print...
Python
from maya.cmds import * from baseMelUI import * from mayaDecorators import d_disableViews, d_noAutoKey, d_unifyUndo from common import printWarningStr @d_unifyUndo @d_disableViews @d_noAutoKey def changeParent( parent=0, objs=None ): if objs is None: objs = ls( sl=True, type='transform' ) or [] ...
Python
from filesystem import * from common import printInfoStr, printErrorStr from mayaDecorators import d_unifyUndo import maya.cmds as cmd import names import api import apiExtensions __author__ = 'mel@macaronikazoo.com' TOOL_NAME = 'animLib' kEXT = 'clip' VER = 3 #version ### clip types kPOSE = 0 ...
Python
parityTestsL = ["l", "left", "lft", "lf", "lik"] parityTestsR = ["r", "right", "rgt", "rt", "rik"] DEFAULT_THRESHOLD = 1 class Parity(int): PARITIES = NONE, LEFT, RIGHT = None, 0, 1 #odd indices are left sided, even are right sided NAMES = [ '_L', '_R', '_A_L', '_A_R', '_B_L', '...
Python
def range2( count, start=0 ): n = start while n < count: yield n def buildMPath( objs, squish=True ): #first we need to build a curve - we build an ep curve so that it goes exactly through the joint pivots numObjs = len( objs ) cmdKw = { 'd': 1 } cmdKw[ 'p' ] = tuple( xform( obj, q=True, ws=Tr...
Python
from baseMelUI import * from filesystem import * import maya.cmds as cmd import api ui = None class PresetOptionMenu(MelOptionMenu): def __init__( self, parent, tool, extension, *a, **kw ): MelOptionMenu.__init__( self, parent, *a, **kw ) self.setChangeCB( self.on_change ) self._manager = ...
Python
try: import wingdbstub except ImportError: pass from baseMelUI import * from maya.cmds import * from common import printWarningStr #this dict stores attribute values for the selection - attributeChange scriptjobs fire when an attribute changes #but don't pass in pre/post values, or even the name of the ...
Python
from maya import cmds as cmd def d_showWaitCursor(f): ''' turns the wait cursor on while the decorated method is executing, and off again once finished ''' def func( *args, **kwargs ): cmd.waitCursor( state=True ) try: return f( *args, **kwargs ) finally: cmd.waitCursor( state=False ) ...
Python
from baseMelUI import * from changeIkFk import ChangeIkFkLayout from changeParent import ChangeParentLayout from changeRo import ChangeRoLayout __author__ = 'hamish@valvesoftware.com' class ChangeLayout(MelColumnLayout): def __init__( self, parent ): frame = MelFrameLayout( self, l='Change Ik/Fk', c...
Python
from names import * from apiExtensions import * def findItem( itemName ): itemName = str( itemName ) if cmd.objExists( itemName ): return itemName match = matchNames( itemName, cmd.ls( type='transform' ) )[ 0 ] if match: return match return None def resolveMappingToScene( mapping, thres...
Python
from baseSkeletonBuilder import * class Leg(SkeletonPart): HAS_PARITY = True PLACER_NAMES = 'footTip', 'footInner', 'footOuter', 'heel' @property def thigh( self ): return self[ 0 ] @property def knee( self ): return self[ 1 ] @property def ankle( self ): return self[ 2 ] @property def to...
Python
''' ''' def d_initCache(f): def __init__(*args, **kwargs): self = args[0] self._CACHE_ = {} return f(*args, **kwargs) __init__.__name__ = f.__name__ __init__.__doc__ = f.__doc__ return __init__ initCache = d_initCache def d_cacheValue(f): def cachedRetValFunc(*args, **kwargs): se...
Python
import apiExtensions from maya.cmds import * from filesystem import removeDupes def resetAttrs( obj, skipVisibility=True ): ''' simply resets all keyable attributes on a given object to its default value great for running on a large selection such as all character controls... ''' #obj = apiExtens...
Python
from triggered import Trigger from names import camelCaseToNice from filesystem import removeDupes from control import getNiceName from apiExtensions import asMObject, getShortName from maya.cmds import * import re import triggered import control import rigUtils import maya.cmds as cmd import apiExtensio...
Python
from maya.cmds import * def getNamespaceTokensFromReference( node ): ''' returns a list of namespaces added to the given node via referencing ''' if not referenceQuery( node, inr=True ): return [] theReferenceFilepath = referenceQuery( node, filename=True ) theReferenceNode = file( theReferenceF...
Python
from maya.cmds import * from maya import OpenMaya from filesystem import Path, Preset, GLOBAL, LOCAL, removeDupes from names import * from vectors import * from melUtils import mel from picker import resolveCmdStr from mappingUtils import * from common import printWarningStr, printErrorStr from mayaDecor...
Python
from vectors import Vector, Matrix, Axis, AX_X, AX_Y, AX_Z from rigUtils import MATRIX_ROTATION_ORDER_CONVERSIONS_FROM, MATRIX_ROTATION_ORDER_CONVERSIONS_TO from maya.cmds import * from maya.OpenMaya import MGlobal from mayaDecorators import d_unifyUndo import maya import apiExtensions AXES = Axis.BASE_AXE...
Python
from maya.cmds import * from baseMelUI import * from filesystem import removeDupes from rigUtils import MATRIX_ROTATION_ORDER_CONVERSIONS_FROM, MATRIX_ROTATION_ORDER_CONVERSIONS_TO, \ MAYA_ROTATION_ORDERS, ROO_XYZ, ROO_YZX, ROO_ZXY, ROO_XZY, ROO_YXZ, ROO_ZYX, ROT_ORDER_STRS from mayaDecorators import d_di...
Python
from filesystem import P4File, P4Change, removeDupes from baseMelUI import * from devTest import TEST_CASES, runTestCases class DevTestLayout(MelVSingleStretchLayout): def __init__( self, parent, *a, **kw ): MelVSingleStretchLayout.__init__( self, parent, *a, **kw ) self.UI_tests = UI_tests = MelOb...
Python
''' this module is simply a miscellaneous module for rigging support code - most of it is maya specific convenience code for determining things like aimAxes, aimVectors, rotational offsets for controls etc... ''' from maya.cmds import * from vectors import * import apiExtensions import maya.cmds as cmd impo...
Python
from rigPrim_curves import * from spaceSwitching import build, NO_TRANSLATION, NO_ROTATION class FkSpine(PrimaryRigPart): __version__ = 0 SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'Spine' ), ) def _build( self, skeletonPart, translateControls=True, **kw ): spineBase, spineEnd = skeletonP...
Python
''' Referencing in maya kinda sucks. Getting reference information from nodes/files is split across at least 3 different mel commands in typically awkward autodesk fashion, and there is a bunch of miscellaneous functionality that just doesn't exist at all. So this module is supposed to be a collection of function...
Python
''' provides console colouring - currently only NT is supported ''' STD_OUTPUT_HANDLE = -11 FG_BLUE = 0x01 FG_GREEN = 0x02 FG_CYAN = 0x03 FG_RED = 0x04 FG_MAGENTA = 0x05 FG_YELLOW = 0x06 FG_WHITE = 0x07 BRIGHT = 0x08 BG_BLUE = 0x10 BG_GREEN = 0x20 BG_CYAN = 0x30 BG_RED = 0x40 BG_MAGENTA = 0x50 BG...
Python
from baseRigPrimitive import * from skeletonPart_arbitraryChain import ArbitraryChain class ControlHierarchy(PrimaryRigPart): __version__ = 0 #part doesn't have a CONTROL_NAMES list because parts are dynamic - use indices to refer to controls SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'Arbit...
Python
from baseSkeletonBuilder import * class _QuadCommon(object): AVAILABLE_IN_UI = False def _buildPlacers( self ): assert isinstance( self, SkeletonPart ) parity = self.getParity() parityMultiplier = parity.asMultiplier() scale = self.getBuildScale() / 30 toeTipPlacer = buildEndPlacer() ...
Python
import re import rigPrimitives from maya.cmds import * from baseMelUI import * from mayaDecorators import d_disableViews, d_noAutoKey, d_unifyUndo, d_restoreTime from common import printWarningStr from triggered import Trigger from rigUtils import findPolePosition, alignFast _FK_CMD_NAME = 'switch to FK...
Python
from filesystem import Path, removeDupes, Callback from api import mel from names import getCommonPrefix from baseMelUI import * import maya.cmds as cmd import mappingEditor import skinWeights import meshUtils import rigUtils import time import api def isMesh( item ): shapes = cmd.listRelatives( it...
Python
from baseRigPrimitive import * HandSkeletonCls = SkeletonPart.GetNamedSubclass( 'Hand' ) FINGER_IDX_NAMES = HandSkeletonCls.FINGER_IDX_NAMES or () class Hand(PrimaryRigPart): __version__ = 0 SKELETON_PRIM_ASSOC = ( HandSkeletonCls, ) CONTROL_NAMES = 'control', 'poses' NAMED_NODE_NAMES = ( 'qss', ) ...
Python
import baseMelUI, visManager, api, skinCluster, presets, presetsUI import maya.cmds as cmd mel = api.mel melecho = api.melecho name = __name__ ui = None class VisManagerUI(baseMelUI.BaseMelWindow): WINDOW_NAME = "visManagerUI" WINDOW_TITLE = 'vis set manager' DEFAULT_SIZE = 254, 375 SPACER = " ...
Python
import maya.OpenMaya as om import maya.cmds as cmd from math import sqrt class BlendShape(): def __init__( self, nodeName ): self.name = nodeName self.__minRowLength = 5 def __repr__( self ): return self.targets def __str__( self ): return str(self.__repr__()) def __add__( self, value ): '''...
Python
''' these are the optional args and their default values for the keyed rig primitive build functions ''' PRIM_OPTIONS = { 'zooBuildControl': {}, 'zooCSTBuildPrimBasicSpine': {}, #'parents': tuple(), #'hips': '', #'scale': 1.0, ...
Python
import os import sys import cgitb import inspect import traceback from filesystem import findMostRecentDefitionOf def printMsg( *args ): for a in args: print a, def SHOW_IN_UI(): from wx import MessageBox, ICON_ERROR MessageBox( 'Sorry, it seems an un-expected problem occurred.\nYour error has been...
Python
from baseRigPrimitive import * class Head(PrimaryRigPart): __version__ = 0 SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'Head' ), ) CONTROL_NAMES = 'control', 'gimbal', 'neck' def _build( self, skeletonPart, translateControls=False, **kw ): return self.doBuild( skeletonPart.head, translate...
Python
from maya.cmds import * from maya import cmds as cmd from baseMelUI import * import names import control import baseMelUI import spaceSwitching class ParentsScrollList(MelObjectScrollList): def itemAsStr( self, item ): return '%s :: %s' % tuple( item ) class SpaceSwitchingLayout(MelVSingleStret...
Python
from baseRigPrimitive import * class Root(PrimaryRigPart): __version__ = 0 SKELETON_PRIM_ASSOC = ( skeletonBuilder.Root, ) CONTROL_NAMES = 'control', 'gimbal', 'hips' def _build( self, skeletonPart, buildHips=True, **kw ): root = skeletonPart.base #deal with colours colour = ColourDesc( 'blu...
Python
from baseSkeletonPreset import * #end
Python
from baseRigPrimitive import * from spaceSwitching import build, NO_TRANSLATION, NO_ROTATION class SplineIK(PrimaryRigPart): __version__ = 2 SKELETON_PRIM_ASSOC = ( SkeletonPart.GetNamedSubclass( 'ArbitraryChain' ), ) PRIORITY = 11 @classmethod def CanRigThisPart( cls, skeletonPart ): return len(...
Python
from math import sqrt class _Node(list): ''' simple wrapper around tree nodes - mainly to make the code a little more readable (although members are generally accessed via indices because its faster) ''' @property def point( self ): return self[0] @property def left( self ): return self[1...
Python
from maya.cmds import * import maya.cmds as cmd import vectors import re Vector = vectors.Vector Colour = Color = vectors.Colour def setShaderColour( shader, colour ): if not isinstance( colour, Colour ): colour = Colour( colour ) setAttr( '%s.outColor' % shader, *colour ) if colour[ 3 ]: a ...
Python
from baseMelUI import * from animLib import * import presetsUI import xferAnimUI __author__ = 'mel@macaronikazoo.com' def getSelectedChannelBoxAttrNames(): attrNames = cmd.channelBox( 'mainChannelBox', q=True, sma=True ) or [] attrNames += cmd.channelBox( 'mainChannelBox', q=True, ssa=True ) or [] ...
Python
from vectors import Matrix, Vector, Axis import maya.cmds as cmd import maya.OpenMaya as OpenMaya import maya.OpenMayaMPx as OpenMayaMPx import vectors import apiExtensions from maya.OpenMaya import MObject, MFnMatrixAttribute, MFnCompoundAttribute, MFnMessageAttribute, MGlobal, \ MFnEnumAttribute, ...
Python
import maya.OpenMaya as OpenMaya import maya.OpenMayaMPx as OpenMayaMPx AUTHOR = '-:macaroniKazoo:-' VERSION = '1.0' NODE_NAME = 'twister' ID = OpenMaya.MTypeId( 0x43899 ) class twister( OpenMayaMPx.MPxNode ): aInWorldMatrixA = OpenMaya.MObject() aInWorldMatrixB = OpenMaya.MObject() aAxisA = OpenMay...
Python
from maya.cmds import * from maya import cmds as cmd from filesystem import Path from baseMelUI import * import os import api import names import skeletonBuilderPresets import rigPrimitives import baseRigPrimitive import rigUtils import control import meshUtils import baseMelUI import presetsUI impor...
Python
''' This module abstracts and packages up the maya UI that is available to script in a more object oriented fashion. For the most part the framework tries to make working with maya UI a bit more like proper UI toolkits where possible. For more information there is some high level documentation on how to use th...
Python
from filesystem import * from baseMelUI import * from mappingUtils import * import names import api import presetsUI TOOL_NAME = 'zoo' TOOL_VER = 1 EXT = 'mapping' ui = None class MappingForm(MelHLayout): ''' Acts as a generic UI for editing "mappings". A mapping is basically just a dictionar...
Python
from __future__ import with_statement from maya import mel from maya.cmds import * from baseMelUI import * from vectors import Vector, Colour from common import printErrorStr, printWarningStr from mayaDecorators import d_unifyUndo from apiExtensions import asMObject, sortByHierarchy from triggered import re...
Python
import subprocess import marshal import inspect import pickle import time import imp import sys import os import gc from zlib import crc32 from modulefinder import ModuleFinder import filesystem from filesystem import Path, removeDupes _MODULE_TYPE = type( os ) def getPythonStdLibDir(): ''...
Python