Jnt = mc.joint(p=(0, 0, 0))
        Loc = mc.spaceLocator(p=(0, 0, 0))[0]
        uValue = 0.0

        if not uValuezerotoone:
            uValue = i
        else:
            uValue = (float(i) - 0) / (float(JointCounts - 1) - 0) * (1.0 - 0.0) + 0.0

        _Attach(UppathCus, Loc, uValue, None, uValuezerotoone)
        _Attach(basePathCus, Jnt, uValue, Loc, uValuezerotoone)




UIwndClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'makeAttachJoints.ui'))
class makeAttachJoints(UIwndClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('makeAttachJointsWindow'):
            return

        super(makeAttachJoints, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #-------------


    def on_actionLoadBaseCurve_triggered(self, clicked=None):
        if clicked==None:return
        SelOBJ = mc.ls(sl=True)
        if len(SelOBJ) == 1:
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Wed, 29 Apr 2015 10:09:50
#========================================
import os.path
from mpUtils import scriptTool, uiTool
from core import MDL, SUR, RIG, ANI, LGT, FX, CMP
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'MPToolkitUI.ui'))


class MPToolkitUI(windowClass, baseClass, MDL.Mdl_Class, SUR.Sur_Class,
                  RIG.Rig_Class, ANI.Ani_Class, LGT.Lgt_Class, FX.Fx_Class,
                  CMP.Cmp_Class):
    '''
    '''
    def __init__(self, parent=uiTool.getMayaWindow()):
        #-----------------------------------------------------
        if uiTool.windowExists('magicpowerToolKit'): return
        #-----------------------------------------------------
        super(MPToolkitUI, self).__init__(parent)
        self.setupUi(self)
        self.__initUI()
        self.show()

    def __initUI(self):
        #- hide tabwidget tabbar...
        self.tabWidget.tabBar().setVisible(False)
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Thu, 30 Apr 2015 10:43:13
#========================================
import os.path
from mpUtils import scriptTool, uiTool
import maya.cmds as mc
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'createControlSet.ui'))
class CreateControlSetUI(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('makeControlSetUI'):
            return
        super(CreateControlSetUI, self).__init__(parent)
        self.setupUi(self)
        self.show()

    #=============================================================================================
    def __createSet(self, name):
        if not mc.objExists(name):
            mc.sets(n=name, em=True)
        if name != 'Allctrls': return

        if mc.objExists('body_Ctrls'):
            mc.sets('body_Ctrls', add=name)

        if mc.objExists('facial_Ctrls'):
            mc.sets('facial_Ctrls', add=name)
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Tue, 05 May 2015 11:32:39
#========================================
import os.path
import maya.cmds as mc
from mpUtils import scriptTool, uiTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

UIwndClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'quickSDKTool.ui'))
class quickSDK(UIwndClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('quickSDKwindow'):
            return

        super(quickSDK, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #-------------


    def on_actionLoadAttributes_triggered(self, clicked=None):
        if clicked==None:return


        mainChannelBox = 'mainChannelBox'
        ChannelBoxs = mc.lsUI(typ='channelBox')
        ChannelBoxs.remove(mainChannelBox)
        if len(ChannelBoxs) == 0:return
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Tue, 05 May 2015 11:35:34
#========================================
import os
import maya.cmds as mc
from mpUtils import scriptTool, uiTool, mayaTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

UIClass, BaseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'quickSetDrivenKey.ui'))

class QuickSetDrivenKey(UIClass, BaseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('quickSetDrivenKeywindow'):
            return

        super(QuickSetDrivenKey, self).__init__(parent)
        self.setupUi(self)
        self.show()


    def _loadAttribute(self, LineEdit):
        SelectOBJ = mc.ls(sl=True)
        if len(SelectOBJ) == 0:return

        SelectAttriBute = mc.channelBox('mainChannelBox', q=True, sma=True)
        if SelectAttriBute == None:return

        LineEdit.setText('%s.%s'%(SelectOBJ[-1], SelectAttriBute[0]))
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Thu, 16 Oct 2014 10:31:59
#========================================
import os.path
from mpUtils import scriptTool, uiTool
import maya.cmds as mc
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
baseClass, windowClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'clusterWeightsUI.ui'))
class ClusterWeightsUI(baseClass, windowClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('MirrorClusterWindow'):
            return
        super(ClusterWeightsUI, self).__init__(parent)
        self.setupUi(self)
        self.show()


    def on_btn_Geometry_clicked(self, args=None):
        if args == None:return
        sel = mc.ls(sl=True)
        if len(sel) < 1:return
        if not mc.listRelatives(sel[0], s=True, type='mesh'):return
        self.let_Geometry.setText(sel[0])


    def on_btn_Source_clicked(self, args=None):
        if args == None:return
        sel = mc.ls(sl=True)
        if len(sel) < 1:return
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Thu, 20 Nov 2014 17:10:31
#========================================
import os.path, time, findCoincidentGeometry
from mpUtils import scriptTool, uiTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'findCoincidentGeometry.ui'))
class findCoincidentGeometryUI(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('findCoincidentGeometryUI'):
            return
        super(findCoincidentGeometryUI, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #------------------

    def on_pushButton_clicked(self, args=None):
        if args == None:return
        self.plainTextEdit.setPlainText('')
        self.plainTextEdit.appendPlainText('------ %s ------'%time.strftime("%H:%M:%S", time.localtime()))

        geometrys = findCoincidentGeometry.findCoincidentGeometrys()

        self.plainTextEdit.appendPlainText('\n'.join(geometrys))
        self.plainTextEdit.appendPlainText('------ %s ------'%time.strftime("%H:%M:%S", time.localtime()))
ICON_OK       = uiTool.QtGui.QIcon()
ICON_DEFAULT  = uiTool.QtGui.QIcon()
ICON_WARNING  = uiTool.QtGui.QIcon()

IMAGE_OK      = uiTool.QtGui.QPixmap(os.path.join(scriptTool.getScriptPath(), 'icon', 'check.png'))
IMAGE_DEFAULT = uiTool.QtGui.QPixmap(os.path.join(scriptTool.getScriptPath(), 'icon', 'question.png'))
IMAGE_WARNING = uiTool.QtGui.QPixmap(os.path.join(scriptTool.getScriptPath(), 'icon', 'exclamation.png'))

ICON_OK.addPixmap(IMAGE_OK, uiTool.QtGui.QIcon.Disabled, uiTool.QtGui.QIcon.Off)
ICON_DEFAULT.addPixmap(IMAGE_DEFAULT, uiTool.QtGui.QIcon.Disabled, uiTool.QtGui.QIcon.Off)
ICON_WARNING.addPixmap(IMAGE_WARNING, uiTool.QtGui.QIcon.Disabled, uiTool.QtGui.QIcon.Off)

SEARCH_ICON = uiTool.QtGui.QIcon(os.path.join(scriptTool.getScriptPath(), 'icon', 'search.png'))


UIwndClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'inspectScene.ui'))

class InspectSceneUI(UIwndClass, baseClass):

    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('inspectSceneWindow'):
            uiTool.wrapInstance('inspectSceneWindow').__initUI__()
            return

        super(InspectSceneUI, self).__init__(parent)
        self.setupUi(self)
        #-+-+-+-+-+-+-+-+-
        self.btn_InspectScene.setIcon(SEARCH_ICON)
        self.__initUI__()
        #-+-+-+-+-+-+-+-+-
        self.show()
#=============================================
# author: changlong.zang
#   mail: [email protected]
#   date: Wed, 16 Jul 2014 09:31:17
#=============================================
import os.path
import maya.cmds as mc
import maya.mel as mel
from mpUtils import scriptTool, uiTool, mayaTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'blendShapeWeights.ui'))


class BlendShapeWeightUI(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('blendShapeWeightsTool'): return
        super(BlendShapeWeightUI, self).__init__(parent)
        self.setupUi(self)
        self.show()

    def on_btn_mirrorE_clicked(self, clicked=None):
        if clicked == None: return
        doMirrorBlendShapeWeights(envelope=True)

    def on_btn_mirrorT_clicked(self, clicked=None):
        if clicked == None: return
        doMirrorBlendShapeWeights(envelope=False)

    def on_btn_inverE_clicked(self, clicked=None):
        if clicked == None: return
Exemple #10
0
#=================================
# author: changlong.zang
#   date: 2014-05-05
#=================================
import os, re, string
import maya.cmds as mc
from mpUtils import uiTool, scriptTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

WindowClass, BaseClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'buildTargents.ui'))


class BuildTargents(WindowClass, BaseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('buildTargentsWindow'):
            return

        super(BuildTargents, self).__init__(parent)
        self.setupUi(self)
        self.show()

    def on_actionLoad_Object_triggered(self, args=None):
        if args == None: return
        selOBJ = mc.ls(sl=True)
        if selOBJ == []: return

        self.LET_Geometry.setText(selOBJ[0])

        blendShapes = mc.ls(mc.listHistory(selOBJ[0]), type='blendShape')
        if blendShapes == []:
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Mon, 22 Sep 2014 10:35:13
#========================================
import os.path
import maya.cmds as mc
import maya.mel as mel
from mpUtils import scriptTool, uiTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

bodywndClass, bodybaseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'transWeights.ui'))
class transWeightsUI(bodywndClass, bodybaseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('transSkeletonToClusters'):
            return

        super(transWeightsUI, self).__init__(parent)
        self.setupUi(self)
        self.show()

    def on_btn_LoadGeometry_clicked(self, clicked=None):
        if clicked == None:return
        sel = mc.ls(sl=True)
        if len(sel) < 1:
            return

        self.LET_Geometry.setText(sel[0])


    def on_btn_LoadSkeleton_clicked(self, clicked=None):
Exemple #12
0
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Thu, 30 Apr 2015 10:43:13
#========================================
import os.path
from mpUtils import scriptTool, uiTool
import maya.cmds as mc
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

windowClass, baseClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'createControlSet.ui'))


class CreateControlSetUI(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('makeControlSetUI'):
            return
        super(CreateControlSetUI, self).__init__(parent)
        self.setupUi(self)
        self.show()

    #=============================================================================================
    def __createSet(self, name):
        if not mc.objExists(name):
            mc.sets(n=name, em=True)
        if name != 'Allctrls': return

        if mc.objExists('body_Ctrls'):
            mc.sets('body_Ctrls', add=name)
        f.close()

        #- set Data
        for ctl in selectControl:
            if ctl in controlDT.get(self.Button, []):
                controlDT.get(self.Button, []).remove(ctl)

        #- save Data
        f = open(os.path.join(getScriptPath(), 'ControlNameData.json'), 'w')
        json.dump(controlDT, f, indent=4)
        f.close()




windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'ControlSelecterUI.ui'))
class ControlSelecterWnd(windowClass, baseClass):
    selectAdd = False
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('ControlSelecterWindow'):
            return
        super(ControlSelecterWnd, self).__init__(parent)
        self.setupUi(self)
        self.show()

        #- connect Signal
        for btn in self.groupBox.findChildren(QtGui.QPushButton):
            btn.clicked.connect(self.SelectControl)

        for btn in self.groupBox_2.findChildren(QtGui.QPushButton):
            btn.clicked.connect(self.SelectControl)
Exemple #14
0
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Thu, 16 Oct 2014 10:31:59
#========================================
import os.path
from mpUtils import scriptTool, uiTool
import maya.cmds as mc
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
baseClass, windowClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'clusterWeightsUI.ui'))


class ClusterWeightsUI(baseClass, windowClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('MirrorClusterWindow'):
            return
        super(ClusterWeightsUI, self).__init__(parent)
        self.setupUi(self)
        self.show()

    def on_btn_Geometry_clicked(self, args=None):
        if args == None: return
        sel = mc.ls(sl=True)
        if len(sel) < 1: return
        if not mc.listRelatives(sel[0], s=True, type='mesh'): return
        self.let_Geometry.setText(sel[0])

    def on_btn_Source_clicked(self, args=None):
        if args == None: return
        sel = mc.ls(sl=True)
Exemple #15
0
#   date: Tue, 29 Jul 2014 09:29:32
#=============================================
import math, re, os
import maya.cmds as mc
from mpUtils import uiTool, scriptTool, mayaTool, mathTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#- Refresh Characters                                           +
#- Guess Character Type                                         +
#- Left arm, Right arm, Left leg, Right leg                     +
#- Left foreleg, Right foreleg, Left hindleg, Right hindleg     +
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Uiwnd, UiClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'IKFKSwitch.ui'))
class IKFKSwitch(Uiwnd, UiClass):
    def __init__(self, parent =uiTool.getMayaWindow()):
        if uiTool.windowExists('DDikfkSwitchWindow'):
            return

        super(IKFKSwitch, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #--------
        self.on_actionRefreshCharacter_triggered(True)


    def on_actionRefreshCharacter_triggered(self, args=None):
        if args==None:return
        self.Controls = ' '.join(mc.ls())
Exemple #16
0
    def data(self, index, role=QtCore.Qt.DisplayRole):
        if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
            return self.LIST_DATA[index.row()]


    def changeData(self, inputData):
        self.beginRemoveRows(QtCore.QModelIndex(), 0, self.rowCount())
        del self.LIST_DATA[:]
        self.endRemoveRows()

        self.beginInsertRows(QtCore.QModelIndex(), 0, self.rowCount())
        self.LIST_DATA = inputData
        self.endInsertRows()


windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'weightsTool.ui'))

class WeightsTool(windowClass, baseClass):
    SOURCE_DEFORM_TYPE = 'cluster'
    TARGET_DEFORM_TYPE = 'cluster'

    def __init__(self, parent=uiTool.getMayaWindow()):
        super(WeightsTool, self).__init__(parent)
        self.setupUi(self)
        self.show()

        self.SOURCE_MODEL = ListModel()
        self.TARGET_MODEL = ListModel()
        self.VIW_Source.setModel(self.SOURCE_MODEL)
        self.VIW_Target.setModel(self.TARGET_MODEL)
#=============================================
# author: changlong.zang
#   mail: [email protected]
#   date: Wed, 16 Jul 2014 09:31:17
#=============================================
import os.path
import maya.cmds as mc
import maya.mel as mel
from mpUtils import scriptTool, uiTool, mayaTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'blendShapeWeights.ui'))
class BlendShapeWeightUI(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('blendShapeWeightsTool'):return
        super(BlendShapeWeightUI, self).__init__(parent)
        self.setupUi(self)
        self.show()


    def on_btn_mirrorE_clicked(self, clicked=None):
        if clicked == None:return
        doMirrorBlendShapeWeights(envelope=True)


    def on_btn_mirrorT_clicked(self, clicked=None):
        if clicked == None:return
        doMirrorBlendShapeWeights(envelope=False)


    def on_btn_inverE_clicked(self, clicked=None):
        if clicked == None:return
Exemple #18
0
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Tue, 05 May 2015 10:40:33
#========================================
import os.path
from PyQt4 import QtGui
import maya.cmds as mc
import maya.mel as mel
from mpUtils import scriptTool, uiTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

UIClass, BaseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'DynControlUI.ui'))

class DynControl(UIClass, BaseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('dynControlWindow'):return

        super(DynControl, self).__init__(parent)
        self.setupUi(self)
        self.show()



    def refreshHairSystems(self):
        for checkBox in self.HairSystemList.children():
            checkBox.deleteLater()

        HairSysTem = mc.listRelatives(mc.ls(type='hairSystem'), p=True)
        HairSysTem = {}.fromkeys(HairSysTem, None).keys()
        HairSysTem.sort()
Exemple #19
0
#=============================================
# author: changlong.zang
#   mail: [email protected]
#   date: Wed, 09 Jul 2014 10:49:27
#=============================================
import os, math, re
from mpUtils import scriptTool, uiTool, ioTool
from PyQt4 import QtCore, QtGui
import maya.cmds as mc
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'FixShape.ui'))

class ListModel(QtCore.QAbstractListModel):
    def __init__(self, L=[], parent=None):
        super(ListModel, self).__init__(parent)
        self.__data = L[:]


    def rowCount(self, index=QtCore.QModelIndex()):
        return len(self.__data)


    def data(self, index, role):
        if role == QtCore.Qt.DisplayRole:
            return self.__data[index.row()]


    def refresh(self):
        self.beginRemoveRows(QtCore.QModelIndex(), 0, self.rowCount())
        del self.__data[:]
        self.endRemoveRows()
            return
        if not mc.attributeQuery(attribute, n=obj, ex=True):
            print 'Error -> attributes  %s  was not Exists...'%arg
            return

    mc.delete(mc.keyframe(dsn, q=True, n=True))

    driverValues = mc.keyframe(src, q=True, fc=True)
    drivenValues = mc.keyframe(src, q=True, vc=True)
    for drv, dnv in zip(driverValues, drivenValues):
        mc.setDrivenKeyframe(dsn, cd=dsr, dv=drv, v=dnv * mirror)




windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'mirrorDrivenKeys.ui'))
class MirrorDrivenKeysUI(windowClass, baseClass):

    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('mirrorDrivenkeysWindow'):
            return

        super(MirrorDrivenKeysUI, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #----------------------------------------------------------------
        self.__SrcOBJ = None
        self.__DstOBJ = None

        self.__model_SrcDriver = ListModel()
        self.__model_SrcDriven = ListModel()
Exemple #21
0
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Wed, 29 Apr 2015 10:09:50
#========================================
import os.path
from mpUtils import scriptTool, uiTool
from core    import MDL, SUR, RIG, ANI, LGT, FX, CMP
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'MPToolkitUI.ui'))
class MPToolkitUI(windowClass, baseClass, MDL.Mdl_Class, SUR.Sur_Class, RIG.Rig_Class, ANI.Ani_Class, LGT.Lgt_Class, FX.Fx_Class, CMP.Cmp_Class):
    '''
    '''
    def __init__(self, parent=uiTool.getMayaWindow()):
        #-----------------------------------------------------
        if uiTool.windowExists('magicpowerToolKit'):return
        #-----------------------------------------------------
        super(MPToolkitUI, self).__init__(parent)
        self.setupUi(self)
        self.__initUI()
        self.show()


    def __initUI(self):
        #- hide tabwidget tabbar...
        self.tabWidget.tabBar().setVisible(False)

        #- connect all of radiobuttons...
        self.__buttonGroup = uiTool.QtGui.QButtonGroup()
        for i, rdn in enumerate(self.wgt_rdnbox.findChildren(uiTool.QtGui.QRadioButton)):
            self.__buttonGroup.addButton(rdn, i)
Exemple #22
0
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Tue, 05 May 2015 11:39:42
#========================================
import os.path, pymel.core
import maya.cmds as mc
from PyQt4 import QtGui
from mpUtils import scriptTool, uiTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'addGroups.ui'))
class AddGroup(windowClass, baseClass):
    '''
    user control pannel...
    '''
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('addGroupWindow'):
            return

        super(AddGroup, self).__init__(parent)
        self.setupUi(self)
        self.show()

    def on_btn_append_clicked(self, args=None):
        if args == None:return
        lineEdit = QtGui.QLineEdit(self.scrollArea)
        font = QtGui.QFont()
        font.setPointSize(10)
        lineEdit.setFont(font)
        lineEdit.setMinimumHeight(25)

    def insertRow(self, row, value, index=QtCore.QModelIndex()):
        self.beginInsertRows(index, row, row)
        self.__attributes.insert(row, value)
        self.endInsertRows()


    def clear(self):
        self.beginRemoveColumns(QtCore.QModelIndex(), 0, self.rowCount())
        del self.__attributes[:]
        self.endRemoveRows()



shapeBaseClass, shapeWindowClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'ShapeBuilderUI.ui'))
class ShapeBuilderUI(shapeBaseClass, shapeWindowClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('ShapeBuilderWindow'):
            return

        super(ShapeBuilderUI, self).__init__(parent)
        self.setupUi(self)
        #---------------------------------------------------
        self.__AttributeModel = BlendShapeModel()
        self.listView_attributeList.setModel(self.__AttributeModel)
        #---------------------------------------------------
        self.widget_Bs.setEnabled(True)
        self.widget_BsBs.setEnabled(False)
        self.widget_SkinBs.setEnabled(False)
Exemple #24
0

    def clear(self):
        self.beginRemoveRows(QtCore.QModelIndex(), 0, self.rowCount())
        del self.__modelData[:]
        self.endRemoveRows()

    def change(self, L=[]):
        self.beginInsertRows(QtCore.QModelIndex(), 0, self.rowCount())
        self.__modelData = L[:]
        self.endInsertRows()




windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'replaceUV.ui'))
class ReplaceUV(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('replaceUVwindow'):return

        super(ReplaceUV, self).__init__(parent)
        self.setupUi(self)
        #----------------
        self.__listModel = ListModel()
        self.listView.setModel(self.__listModel)
        #----------------
        self.show()


    def on_btn_setFilePath_clicked(self, clicked=None):
        if clicked == None:return
#========================================
# author: changlong.zang
#   mail: [email protected]
#   date: Tue, 05 May 2015 11:44:00
#========================================
import os.path, re, pymel.core
import maya.cmds as mc
from mpUtils import scriptTool, uiTool, mayaTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
windowClass, baseClass = uiTool.loadUi(os.path.join(scriptTool.getScriptPath(), 'mirrorCtlShp.ui'))
class MirrorControlShp(windowClass, baseClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('mirrorControlShapeUI'):return
        super(MirrorControlShp, self).__init__(parent)
        self.setupUi(self)
        self.show()


    def on_btn_mirror_clicked(self, click=None):
        if click == None:return
        controlType = str(self.fld_controlType.text())

        flipAxis = 'X'
        if self.rdn_filpX.isChecked():
            flipAxis = 'X'
        elif self.rdn_filpY.isChecked():
            flipAxis = 'Y'
        else:
            flipAxis = 'Z'

#   mail: [email protected]
#   date: Tue, 29 Jul 2014 09:29:32
#=============================================
import math, re, os
import maya.cmds as mc
from mpUtils import uiTool, scriptTool, mayaTool, mathTool
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#- Refresh Characters                                           +
#- Guess Character Type                                         +
#- Left arm, Right arm, Left leg, Right leg                     +
#- Left foreleg, Right foreleg, Left hindleg, Right hindleg     +
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Uiwnd, UiClass = uiTool.loadUi(
    os.path.join(scriptTool.getScriptPath(), 'IKFKSwitch.ui'))


class IKFKSwitch(Uiwnd, UiClass):
    def __init__(self, parent=uiTool.getMayaWindow()):
        if uiTool.windowExists('DDikfkSwitchWindow'):
            return

        super(IKFKSwitch, self).__init__(parent)
        self.setupUi(self)
        self.show()
        #--------
        self.on_actionRefreshCharacter_triggered(True)

    def on_actionRefreshCharacter_triggered(self, args=None):
        if args == None: return