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)
def _ignore(self, name): if name == Attribute.getTypeName(): return True if name == Option.getTypeName(): return True if name == Object.getInstanceQualifier(): return True return False
def getBaseName(self): return Object.getTypeName()