Ejemplo n.º 1
0
'''
#import python modules
import os
#import Maya modules
import maya.cmds as cmds
import maya.OpenMaya as om

#import package modules
import japeto.libs.common as common
import japeto.libs.fileIO as fileIO
from japeto import PLUGINDIR
#Constant Variables
PUPPET     = 'Puppet' 
TAGNAME    = 'puppet_nodes'

fileIO.loadPlugin(os.path.join(PLUGINDIR,'puppetNode.py'))

class Puppet(object):
    def __init__(self, mobject):
        #if string is passed 
        if isinstance(mobject, basestring):
            mobject = common.getMObject(mobject)
        
        try:
            self.__mobject = mobject
            self.__mFnNode = om.MFnDependencyNode(self.__mobject)
        except:
            raise RuntimeError('%s must be an *OpenMaya.MObject* or *str*. Puppet object not constructed' % mobject)
  
    #-----------------------------
    #GETTERS
Ejemplo n.º 2
0
#libs
from japeto.libs import common 
from japeto.libs import attribute
from japeto.libs import joint
from japeto.libs import control
from japeto.libs import fileIO
from japeto.mlRig import ml_node
reload(ml_node)
reload(control)

#components
import japeto.components.puppet as puppet
reload(puppet)

#import decompose matrix plugin
fileIO.loadPlugin('matrixNodes.bundle')


# Overload Arguments Decorator
def overloadArguments (func):
    '''
    Overload default arguments decorator

    :param func: Function to decorate
    :type func: *Function*

    :return: Return function
    :rtype: *Function*
    '''
    # Define wrapper
    @wraps (func)
Ejemplo n.º 3
0
Archivo: rig.py Proyecto: jonntd/japeto
# import libs
from japeto.libs import common
from japeto.libs import attribute
from japeto.libs import joint
from japeto.libs import control
from japeto.libs import ordereddict
from japeto.libs import fileIO

# import components
from japeto.components import component
from japeto.mlRig import ml_graph
from japeto.mlRig import ml_node
from japeto.mlRig import ml_attribute

fileIO.loadPlugin(os.path.join(PLUGINDIR, "rigNode.py"))


class Rig(ml_graph.MlGraph):
    @classmethod
    def getControls(cls, asset):
        """
        Get controls based on whether or not the given asset has
        a tag_controls attribute.
        
        :param asset: Asset you want to get controls from
        :type asset: str
        
        :return: Returns controls on the given asset
        :rtype: list | None
        """