示例#1
0
    def __init__(self, factories, typename='', **kwargs):
        self.node       = self.createNode()
        self.factories  = factories
        self.type       = typename
        self.attrs      = {}
        self.children   = {}
        self.parents    = {}
        self.gui        = CRObject_GUI(self)
        self.bScript    = True

        clstypename = self.__class__.crtype.getTypeName()
        if not typename: typename = clstypename
        if Object.getInstanceQualifier() in kwargs:
            typename = kwargs[Object.getInstanceQualifier()]
        fact = self.factories.getFactory(clstypename)
        sim = fact.build(typename, **kwargs)
        self.initMembers(self.__class__.crtype, sim, prefix='default')

        if Scriptable.getTypeName() in kwargs:
            self.addScript(prefix='script', **kwargs[Scriptable.getTypeName()])

        self.rename(typename)
        CRObject.addObjToGlobalContext(self)

        pm.select(self.node)
示例#2
0
 def _ignore(self, name):
     if name == Attribute.getTypeName():
         return True
     if name == Option.getTypeName():
         return True
     if name == Object.getInstanceQualifier():
         return True
     return False
示例#3
0
 def getBaseName(self):
     return Object.getTypeName()