code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
from entity import Entity
from apihandler import json_encode
class Directory(Entity):
_default_data = {
'id' : 0,
'type' : 'directory',
'name' : '',
}
def serialize(self):
data = self._data.copy()
#for file in data.files:
# file = file.seri... | Python |
#-*- coding: utf-8 -*-
import json
import time
from entity import Entity
from apihandler import json_encode
class User (Entity):
_default_data = {
'id' : 0,
'name' : '',
'password' : '',
'sid' : '',
'regDate' : '',
'level' : 0,
}
... | 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 |
'''
'''
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 |
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 |
'''
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 baseSkeletonBuilder import *
class Arm(SkeletonPart):
HAS_PARITY = True
@classmethod
def _build( cls, parent=None, buildClavicle=True, **kw ):
idx = Parity( kw[ 'idx' ] )
partScale = kw[ 'partScale' ]
parent = getParent( parent )
allJoints = []
dirMult = idx.asMultiplier()
pari... | 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 |
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 |
from baseSkeletonBuilder import *
class Spine(SkeletonPart):
HAS_PARITY = False
@classmethod
def _build( cls, parent=None, count=3, direction='y', **kw ):
idx = kw[ 'idx' ]
partScale = kw[ 'partScale' ]
parent = getParent( parent )
directionAxis = Axis.FromName( direction )
allJoints =... | 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 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 |
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 |
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 __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 |
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 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 |
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 *
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 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 maya.OpenMaya import *
from vectors import Vector, Matrix
import sys
import maya.cmds as cmd
import time
getAttr = cmd.getAttr
setAttr = cmd.setAttr
MObject.__MPlug__ = None
def asMObject( otherMobject ):
'''
tries to cast the given obj to an mobject - it can be string
'''
if isinstance... | Python |
from devTest import Path, TestCase
from maya import cmds as cmd
TEST_DIRECTORY = Path( __file__ ).up() / '_devTest_testScenes_' #location for maya files written by tests
def d_makeNewScene( sceneName ):
'''
simple decorator macro - will create a new scene and save it so that it exists on disk
before t... | Python |
import os
import sys
from api import mel
from maya.cmds import *
from filesystem import Path, removeDupes, BreakException, getArgDefault
from vectors import Vector
import maya.cmds as cmd
import filesystem
import rigUtils
import triggered
import colours
import meshUtils
import profileDecorators
from ... | 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 |
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 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 |
'''
super simple vector class and vector functionality. i wrote this simply because i couldn't find
anything that was easily accessible and quick to write. this may just go away if something more
comprehensive/mature is found
'''
import re
import math
import random
from math import cos, sin, tan, acos, asin... | 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 |
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 _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 |
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 |
import maya.mel
from maya.cmds import cmd
melEval = maya.mel.eval
def pyArgToMelArg( arg ):
#given a python arg, this method will attempt to convert it to a mel arg string
if isinstance( arg, basestring ):
return u'"%s"' % cmd.encodeString( arg )
#if the object is iterable then turn it into a mel array strin... | 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 baseSkeletonBuilder import *
class ArbitraryChain(SkeletonPart):
HAS_PARITY = False
@classmethod
def _build( cls, parent=None, partName='', jointCount=5, direction='-z', **kw ):
if not partName:
partName = cls.__name__
idx = Parity( kw[ 'idx' ] )
partScale = kw[ 'partScale' ]
par... | 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 |
'''
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 |
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 |
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 |
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.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 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 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 |
from vectors import *
from filesystem import Path, resolvePath, writeExportDict
import time, datetime, names, filesystem
TOOL_NAME = 'weightSaver'
TOOL_VERSION = 2
DEFAULT_PATH = Path('%TEMP%/temp_skin.weights')
TOL = 0.25
EXTENSION = 'weights'
_MAX_RECURSE = 35
class SkinWeightException(Exceptio... | 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 |
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 |
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 |
import maya.cmds as cmd
class KeyServer(object):
'''
This class is basically an iterator over keys set on the given objects.
Key times are iterated over in chronological order. Calling getNodes
on the iterator will provide a list of nodes that have keys on the
current frame
'''
def __init__( self, nodes, cha... | 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 meshUtils import *
#end | 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 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 |
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 |
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 *
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 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 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 baseSkeletonPreset import *
#end
| 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 |
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 sys
import skeletonBuilder
import baseRigPrimitive
from filesystem import Path
from skeletonBuilder import *
from baseRigPrimitive import *
__author__ = 'hamish@macaronikazoo.com'
RIG_PART_SCRIPT_PREFIX = 'rigPrim_'
### !!! DO NOT IMPORT RIG SCRIPTS BELOW THIS LINE !!! ###
def _iterRigPa... | Python |
from maya.cmds import *
import re
import time
import api
import maya.cmds as cmd
mel = api.mel
melecho = api.melecho
def resolveCmdStr( cmdStr, obj, connects, optionals=[] ):
'''
NOTE: both triggered and xferAnim use this function to resolve command strings as well
'''
INVALID = '<invalid con... | Python |
from maya.OpenMaya import MGlobal
from exceptionHandlers import generateTraceableStrFactory
generateInfoStr, printInfoStr = generateTraceableStrFactory( '*** INFO ***', MGlobal.displayInfo )
generateWarningStr, printWarningStr = generateTraceableStrFactory( '', MGlobal.displayWarning )
generateErrorStr, print... | Python |
'''
this script contains a bunch of useful poly mesh functionality. at this stage its not really
much more than a bunch of functional scripts - there hasn't been any attempt to objectify any
of this stuff yet. as it grows it may make sense to step back a bit and think about how to
design this a little better
'''... | Python |
from baseMelUI import *
from filesystem import Path
import maya.cmds as cmd
import poseSym
import os
LabelledIconButton = labelledUIClassFactory( MelIconButton )
class PoseSymLayout(MelVSingleStretchLayout):
ICONS = ICON_SWAP, ICON_MIRROR, ICON_MATCH = 'poseSym_swap.xpm', 'poseSym_mirror.xpm', 'pose... | 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 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 baseMelUI import *
from filesystem import Path, Callback
from common import printWarningStr
import api, presetsUI
PRESET_ID_STR = 'zoo'
PRESET_EXTENSION = 'filter'
class FileScrollList(MelObjectScrollList):
def __init__( self, parent, *a, **kw ):
self._rootDir = None
self._displayRelativeTo... | 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 typeFactories import interfaceTypeFactory
from baseRigPrimitive import *
from apiExtensions import cmpNodes
ARM_NAMING_SCHEME = 'arm', 'bicep', 'elbow', 'wrist'
LEG_NAMING_SCHEME = 'leg', 'thigh', 'knee', 'ankle'
class SwitchableMixin(object):
'''
NOTE: we can't make this an interface class becaus... | 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 filesystem import Path
import os
import sys
import dependencies
import api
import maya
import baseMelUI
import maya.cmds as cmd
def flush():
pluginPaths = map( Path, api.mel.eval( 'getenv MAYA_PLUG_IN_PATH' ).split( ';' ) ) #NOTE: os.environ is different from the getenv call, and getenv isn'... | 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 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 |
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 |
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 |
import cProfile as prof
import pstats
import os
import time
def d_profile(f):
'''
writes out profiling info on the decorated function. the profile results are dumped in a file
called something like "_profile__<moduleName>.<functionName>.txt"
'''
def newFunc( *a, **kw ):
def run(): f( *a, **kw )
... | 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 baseMelUI import *
from maya.mel import eval as evalMel
from filesystem import Path
from common import printErrorStr
import re
import maya
try:
#try to connect to wing - otherwise don't worry
import wingdbstub
except ImportError: pass
def setupDagProcMenu():
'''
sets up the modifications ... | 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 baseMelUI import *
from apiExtensions import iterParents
from melUtils import mel, melecho
import maya.cmds as cmd
import mappingEditor
import mappingUtils
import xferAnim
import animLib
__author__ = 'mel@macaronikazoo.com'
class XferAnimForm(MelVSingleStretchLayout):
def __init__( self, paren... | 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 |
'''
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 |
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 |
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 |
def trackableTypeFactory( metaclassSuper=type ):
'''
returns a metaclass that will track subclasses. All classes of the type returned by this factory will
have the following class methods implemented:
IterSubclasses()
GetSubclasses()
GetNamedSubclass( name )
usage:
class SomeClass( metaclass=... | 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 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 |
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 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 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 |
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 |
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 |
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 |
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 |
"""Documentation about all HELPER function"""
import helper
import document
from nltk.stem import PorterStemmer
stemmer = PorterStemmer()
import nltk.data
sentence_tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
#Gunakan WordPunctTokenizar agar dipisah berdasarkan punctuation
from nltk.token... | Python |
'''
Created on Oct 30, 2012
@author: dolphinigle
'''
import document_query_processing as dqp
import comparison as cmpr
import relevanceFeedback as rf
import evaluator as eva
class Controller():
'''Responsible as a gate between view and engine.
Created once 'Commence War' (or process) is clicked.
Will be use... | Python |
import math
from collections import defaultdict
import document_query_processing
class Comparison:
def __init__(self, dqp):
self.inv_dict = defaultdict(list)
self.query_list = []
self.term_list = []
self.term_list_size = 0
self.total_term = 0
self.result = []
... | Python |
import document_query_processing as dqp
#Dipanggil saat ada tombol lakukan indexing ditekan pada PAGE 1
#inverted_file_saved_path : path+filename dari inverted file yang ingin disimpan(string)
#document_collection_file : File koleksi dokumen(format SMART)(string)
#query_list_file : Koleksi query(format SMART)(str... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.