Exemple #1
0
def matchPositionOrientation():
    """
    @ match orientation and position connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('Match Position and Orientation'):
        ar_gen.ar_matchPositionOrientation()
Exemple #2
0
def matchPositionConn():
    """
    @ match position connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('Match Position'):
        ar_gen.ar_matchPosition()
Exemple #3
0
def findDuplicatesConn():
    """
    @ findDuplicates UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('jointsOnSelection'):
        ar_gen.ar_findDuplicates()
Exemple #4
0
def selectAllConn():
    """
    @ selectAll UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('selectAll'):
        ar_selection.ar_selectAll()
Exemple #5
0
def zeroOutConn():
    """
    @ zeroOut UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('zeroOut'):
        sel = cmds.ls(sl=True)
        ar_gen.ar_zeroOut(sel)
Exemple #6
0
def parentHirarchyConn():
    """
    @ parentHierarchy UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('parentHirarchy'):
        sel = cmds.ls(sl=True)
        ar_gen.ar_parentHirarchy(sel)
Exemple #7
0
def noneOrientConn():
    """
    @ noneOrient UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('noneOrient'):
        sel = cmds.ls(sl=True)
        ar_joint.ar_noneOrient(sel)
Exemple #8
0
def jointsOnSelectionConn():
    """
    @ jointsOnSelection UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('jointsOnSelection'):
        sel = cmds.ls(sl=True)
        ar_joint.ar_jointsOnSelection(sel)
Exemple #9
0
 def _createWireTool(self):
     with ar_qui.ar_undoChunkOpen('WireTool'):
         crv = self.curve_LE.text()
         geo = self.geo_LE.text()
         if self.orientSample_LE.text():
             ar_wireTool.ar_addWireTool(str(crv),
                                        str(geo),
                                        orientSample=str(
                                            self.orientSample_LE.text()))
         else:
             ar_wireTool.ar_addWireTool(str(crv), str(geo))
Exemple #10
0
def ar_changeDrawStyleOfExtraJoints():
    """
    @ none draw style of unused joints in asp rig tool.
    Returns:
            unusedJoints.
    """
    with ar_qui.ar_undoChunkOpen('hide extra joints'):
        unusedJoints = cmds.ls('FKX*', 'IKX*', 'FKOffset*', type='joint')
        for each in unusedJoints:
            cmds.setAttr(each + '.drawStyle', 2)
        return unusedJoints
Exemple #11
0
def multiParentConstraintConn(passUI):
    """
    @ multiParentConstraint UI connections.
    Args:
        passUI: 

    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('multiParentConstraint'):
        sel = cmds.ls(sl=True)
        offset = passUI.maintainOffset_cb.isChecked()
        ar_constraint.ar_multiParentConstraint(offset, sel)
Exemple #12
0
def shiftInputOutputConnectionsConn():
    """
    @ shiftInputOutputConnections UI connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('shiftInputOutputConnections'):
        sourceInp = cmds.textField('srcInp_LE', q=True, tx=True)
        sourceOut = cmds.textField('srcOut_LE', q=True, tx=True)
        destInp = cmds.textField('destInp_LE', q=True, tx=True)
        destOut = cmds.textField('destOut_LE', q=True, tx=True)
        ar_skin.ar_shiftInputOutputConnections(sourceInp, sourceOut, destInp,
                                               destOut)
Exemple #13
0
def controllerConn(ctlType, passUI):
    """
    @ controller and replace shape of current objects connection.
    Args:
        ctlType (string): enter controller type like 'cube', 'sphere', etc.
        passUI (QCheckBox): pass the QCheckBox for replace controller on or off query.

    Returns:
            bool.
    """
    with ar_qui.ar_undoChunkOpen('controller maker'):
        myObj = pm.ls(sl=True)
        ctl = ar_controllers.Ar_CtlShapes('controller')
        ctlTyp = {
            'cube': ctl.ar_cubeCtl,
            'sphere': ctl.ar_sphereCtl,
            'diamond': ctl.ar_diamondCtl,
            'cone': ctl.ar_coneCtl,
            'arrowBall': ctl.ar_arrowBallCtl,
            'arrow1': ctl.ar_arrow1Ctl,
            'arrow4': ctl.ar_arrow4Ctl,
            'circle': ctl.ar_circleCtl
        }
        if myObj:
            for each in myObj:
                pm.select(cl=True)
                newCtl = ctlTyp[ctlType]()
                ar_gen.ar_matchPositionOrientation(sel=[newCtl, each])
                if passUI.shapeReplace_cb.isChecked():
                    if not each:
                        ar_qui.ar_displayMessage(
                            'error',
                            'please select object to replace the shape.')
                        return False
                    oldShape = each.getShape()
                    if oldShape:
                        oldShapeName = oldShape.name()
                        pm.delete(oldShape)
                    else:
                        oldShapeName = each + 'Shape'
                    newShape = newCtl.getShape()
                    pm.select(each, r=True)
                    mel.eval("parent -r -s " + newShape)
                    newShape.rename(oldShapeName)
                    pm.delete(newCtl)
                    pm.select(each)
            return True
        else:
            pm.select(cl=True)
            ctlTyp[ctlType]()
            return True
Exemple #14
0
def selectInfluenceObjConn():
    """
    @ getInfluenceJoint UI Connections.
    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('selectInfluenceObj'):
        sel = cmds.ls(sl=True)
        if sel:
            infObj = ar_skin.ar_getInfluenceJoint(sel)
            cmds.select(infObj, r=True)
            ar_qui.ar_displayMessage(
                'success', '%s influence objects is selected..' % len(infObj))
        else:
            ar_qui.ar_displayMessage('warning', 'your selection is empty')
Exemple #15
0
 def asFkInIkSpineConn(self):
     with ar_qui.ar_undoChunkOpen('FkInIkSpine'):
         startCtl = self.fkInIkSp_StartCtl_LE.text()
         endCtl = self.fkInIkSp_EndCtl_LE.text()
         ctlName = self.fkInIkSp_ctlName_LE.text()
         ctlNumber = self.fkInIkSp_ctlNum_spbx.value()
         hipCtlGrps = ar_uiFill.ar_extractLineEditList(
             self.fkInIkSp_HipCtls_LE)
         if self.fkInIkSp_hipBase_cBox.isChecked():
             ar_asTools.ar_fkCtlInIkSpine(startCtl,
                                          endCtl,
                                          ctlName=ctlName,
                                          hipCtlGrps=hipCtlGrps,
                                          ctlNum=ctlNumber)
         else:
             ar_asTools.ar_fkCtlInIkSpine(startCtl,
                                          endCtl,
                                          ctlName=ctlName,
                                          ctlNum=ctlNumber)
Exemple #16
0
def fkChainConn(passUI):
    """
    fkChain UI connections.
    Args:
        passUI: 

    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('multiParentConstraint'):
        # get axis from ui
        axis = list()
        if passUI.ctlAxis_X_rb.isChecked():
            axis = [1, 0, 0]
        if passUI.ctlAxis_Y_rb.isChecked():
            axis = [0, 1, 0]
        if passUI.ctlAxis_Z_rb.isChecked():
            axis = [0, 0, 1]
        ar_fk.ar_addFk(axis)
Exemple #17
0
def aimConstraintParentConn(passUI):
    """
    @ aimConstraintParent UI connections.
    Args:
        passUI: 

    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('aimConstraintParent'):
        aimAxis = str()
        objectUpAxis = str()
        aimValue = list()
        objValue = list()
        # radio checks.
        if passUI.aimX_rb.isChecked():
            aimAxis = 'X'
        if passUI.aimY_rb.isChecked():
            aimAxis = 'Y'
        if passUI.aimZ_rb.isChecked():
            aimAxis = 'Z'
        if passUI.aimObX_rb.isChecked():
            objectUpAxis = 'X'
        if passUI.aimObY_rb.isChecked():
            objectUpAxis = 'Y'
        if passUI.aimObZ_rb.isChecked():
            objectUpAxis = 'Z'
        if aimAxis == 'X':
            aimValue = [1, 0, 0]
        if aimAxis == 'Y':
            aimValue = [0, 1, 0]
        if aimAxis == 'Z':
            aimValue = [0, 0, 1]
        if objectUpAxis == 'X':
            objValue = [1, 0, 0]
        if objectUpAxis == 'Y':
            objValue = [0, 1, 0]
        if objectUpAxis == 'Z':
            objValue = [0, 0, 1]
        sel = cmds.ls(sl=True, type='joint')
        ar_constraint.ar_aimConstraintParent(aimValue, objValue, sel)
Exemple #18
0
def orientChainConn(passUI):
    """
    @ orientChain UI connections.
    Args:
        passUI: 

    Returns:
            none.
    """
    with ar_qui.ar_undoChunkOpen('orient chain'):
        aimAxis = str()
        objectUpAxis = str()
        aimValue = list()
        objValue = list()
        if passUI.aimX_rb.isChecked():
            aimAxis = 'X'
        if passUI.aimY_rb.isChecked():
            aimAxis = 'Y'
        if passUI.aimZ_rb.isChecked():
            aimAxis = 'Z'
        if passUI.aimObX_rb.isChecked():
            objectUpAxis = 'X'
        if passUI.aimObY_rb.isChecked():
            objectUpAxis = 'Y'
        if passUI.aimObZ_rb.isChecked():
            objectUpAxis = 'Z'
        if aimAxis == 'X':
            aimValue = [1, 0, 0]
        if aimAxis == 'Y':
            aimValue = [0, 1, 0]
        if aimAxis == 'Z':
            aimValue = [0, 0, 1]
        if objectUpAxis == 'X':
            objValue = [1, 0, 0]
        if objectUpAxis == 'Y':
            objValue = [0, 1, 0]
        if objectUpAxis == 'Z':
            objValue = [0, 0, 1]
        sel = cmds.ls(sl=True, type='joint')
        ar_joint.ar_orientChain(aimValue, objValue, sel)
Exemple #19
0
 def skinCopyConn(self):
     with ar_qui.ar_undoChunkOpen('skin copy'):
         source = self.sourceMesh_LE.text()
         destination = self.destMesh_LE.text()
         ar_skin.ar_copySkinOnMultiObjects(source, [destination])
Exemple #20
0
 def _addAsPlacement():
     with ar_qui.ar_undoChunkOpen('add_placement controller.'):
         ar_asTools.ar_addPlacementController()
Exemple #21
0
 def _addAsVis():
     with ar_qui.ar_undoChunkOpen('add visibility controller on Main.'):
         ar_asTools.ar_visAttrs()
Exemple #22
0
 def asIKCtlOriChangeConn(self):
     with ar_qui.ar_undoChunkOpen('Ik Orient Change'):
         jnt = self.aspIkOriJnt_LE.text()
         ctl = self.aspIkOriCtl_LE.text()
         ar_asTools.ar_asIKCtlOriChange(jnt, ctl)
Exemple #23
0
 def skinAndCopySkin(self):
     with ar_qui.ar_undoChunkOpen('skin and copy skin'):
         source = self.sourceMesh_LE.text()
         destination = self.destMesh_LE.text()
         ar_skin.ar_skinAndCopySkin(source, destination)
 def asFingerAttributeConn(self):
     with ar_qui.ar_undoChunkOpen('add Finger Attributes'):
         driver = self.aspFaDriverControllers_LE.text()
         controllers = ar_uiFill.ar_extractLineEditList(
             self.aspFaFingerControllers_LE)