Ejemplo n.º 1
0
def mirror_verify(self, progressBar=None, progressEnd=True):
    """
    Verify the mirror setup of the puppet modules
    """
    _str_func = ' mirror_verify'.format(self)
    log.debug("|{0}| >> ... [{1}]".format(_str_func, self) + '-' * 80)

    md_data = {}
    ml_modules = modules_get(self)

    d_runningSideIdxes = {'Centre': 0, 'Left': 0, 'Right': 0}
    ml_processed = []

    ml_modules = modules_get(self)
    int_lenModules = len(ml_modules)

    if progressBar:
        cgmUI.progressBar_start(progressBar)

    for i, mModule in enumerate(ml_modules):
        if progressBar:
            cgmUI.progressBar_set(progressBar,
                                  minValue=0,
                                  maxValue=int_lenModules + 1,
                                  progress=i,
                                  vis=True)
        try:
            mModule.UTILS.mirror_verifySetup(mModule,
                                             d_runningSideIdxes,
                                             ml_processed,
                                             progressBar=progressBar,
                                             progressEnd=False)
        except Exception, err:
            log.error("{0} | {1}".format(mModule, err))
Ejemplo n.º 2
0
def rigNodes_setAttr(self,
                     attr=None,
                     value=None,
                     progressBar=None,
                     progressEnd=True):
    """
    Verify the mirror setup of the puppet modules
    """
    _str_func = ' rigNodes_setAttr'.format(self)
    log.debug("|{0}| >> ... [{1}]".format(_str_func, self) + '-' * 80)

    md_data = {}
    ml_modules = modules_get(self)

    ml_processed = []

    ml_modules = modules_get(self)
    if progressBar:
        int_lenModules = len(ml_modules)
        cgmUI.progressBar_start(progressBar, int_lenModules + 1)

    l_dat = self.getMessage('rigNodes')

    for i, mModule in enumerate(ml_modules):
        if progressBar:
            cgmUI.progressBar_set(progressBar, progress=i, vis=True)
        try:
            l_dat.extend(mModule.rigNull.getMessage('rigNodes'))
        except Exception, err:
            log.error("{0} | {1}".format(mModule, err))
Ejemplo n.º 3
0
def rig_connectAll(self, mode='connect', progressBar=None, progressEnd=True):
    """
    Connect/disconnect the whole puppet
    """
    _str_func = ' rig_connectAll'.format(self)
    log.debug("|{0}| >> ... [{1}]".format(_str_func, self) + '-' * 80)

    ml_modules = modules_get(self)

    ml_modules = modules_get(self)
    if progressBar:
        int_lenModules = len(ml_modules)
        cgmUI.progressBar_start(progressBar, int_lenModules + 2)

    _d_modeToCall = {'connect': 'rig_connect', 'disconnect': 'rig_disconnect'}
    if not _d_modeToCall.get(mode):
        raise ValueError, "Unknown mode: {0}".format(mode)
    for i, mModule in enumerate([self] + ml_modules):
        if progressBar:
            cgmUI.progressBar_set(progressBar,
                                  status=mModule.p_nameShort,
                                  progress=i,
                                  vis=True)

        try:
            mModule.atUtils(_d_modeToCall.get(mode))
        except Exception, err:
            log.error("{0} | {1}".format(mModule, err))
Ejemplo n.º 4
0
def collect_worldSpaceObjects(self, progressBar=None):
    _str_func = 'collect_worldSpaceObjects'
    log.debug("|{0}| >> ...".format(_str_func) + cgmGEN._str_hardBreak)
    log.debug(self)
    ml_objs = []
    mMasterNull = self.masterNull
    mWorldSpaceObjectsGroup = mMasterNull.worldSpaceObjectsGroup
    mPuppetSpaceObjectsGroup = mMasterNull.puppetSpaceObjectsGroup

    ml_children = self.masterControl.getChildren(asMeta=1) or []
    if progressBar:
        cgmUI.progressBar_start(progressBar)
        len_children = len(ml_children)
    for i, mObj in enumerate(ml_children):
        if progressBar:
            #mc.progressBar(progressBar,edit = True,
            #               minValue = 0,
            #               maxValue=len_children,step=i, vis=True)
            cgmUI.progressBar_set(progressBar,
                                  minValue=0,
                                  maxValue=len_children + 1,
                                  progress=i,
                                  vis=True)
            time.sleep(.01)
        if mObj.getMayaAttr('cgmType') in ['dynDriver']:
            mObj.parent = mPuppetSpaceObjectsGroup
            ml_objs.append(mObj)

    ml_children = mObj in mMasterNull.getChildren(asMeta=1) or []
    if progressBar:
        len_children = len(ml_children)
    for i, mObj in enumerate(ml_children):
        if progressBar:
            cgmUI.progressBar_set(progressBar,
                                  minValue=0,
                                  maxValue=len_children + 1,
                                  progress=i,
                                  vis=True)
            time.sleep(.01)

        if mObj.getMayaAttr('cgmType') in ['dynDriver']:
            mObj.parent = mWorldSpaceObjectsGroup
            ml_objs.append(mObj)
    if progressBar: cgmUI.progressBar_end(progressBar)
    return ml_objs
Ejemplo n.º 5
0
        cgmUI.progressBar_start(progressBar, int_lenModules + 1)

    l_dat = self.getMessage('rigNodes')

    for i, mModule in enumerate(ml_modules):
        if progressBar:
            cgmUI.progressBar_set(progressBar, progress=i, vis=True)
        try:
            l_dat.extend(mModule.rigNull.getMessage('rigNodes'))
        except Exception, err:
            log.error("{0} | {1}".format(mModule, err))

    if attr and value is not None:
        int_lenNodes = len(l_dat)
        if progressBar:
            cgmUI.progressBar_start(progressBar, int_lenNodes + 1)
        for i, node in enumerate(l_dat):
            if progressBar:
                cgmUI.progressBar_set(progressBar,
                                      status=node,
                                      progress=i,
                                      vis=True)
            try:
                _shapes = TRANS.shapes_get(node)
                if _shapes:
                    for s in _shapes:
                        ATTR.set(node, attr, value)
                ATTR.set(node, attr, value)
            except Exception, err:
                log.error("{0} | {1}".format(node, err))