• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python mel.meval函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中maya.mel.meval函数的典型用法代码示例。如果您正苦于以下问题:Python meval函数的具体用法?Python meval怎么用?Python meval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了meval函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setupScene

 def setupScene():
     if rad:
         m.setAttr("perspShape.farClipPlane", 1000000)
         meval('source createPrefWndUI; changeLinearUnit("meter")')
         
     # force bg gradient all the time! (maya doesnt save the prefs for it!)
     meval('displayPref -displayGradient true;')
开发者ID:hradec,项目名称:pipeVFX,代码行数:7,代码来源:hradecCustomization.py


示例2: snapToPosition

def snapToPosition(sourceObj, targetObj):
    '''
    wrapper function for abRTSnapToPosition
    
    snaps targetObj to sourceObj
    '''
    meval('abRTSnapToPosition("%(sourceObj)s", "%(targetObj)s")' % locals())
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:7,代码来源:abRiggingTools.py


示例3: test_setitem_str

    def test_setitem_str(self):
        meval("global string $melGlobals_test_setitem_str1")

        lang.melGlobals["melGlobals_test_setitem_str1"] = "monkey"
        self.assertEqual(meval("melGlobals_test_str_getter($melGlobals_test_setitem_str1)"), "monkey")
        lang.melGlobals["$melGlobals_test_setitem_str1"] = "apple"
        self.assertEqual(meval("melGlobals_test_str_getter($melGlobals_test_setitem_str1)"), "apple")
开发者ID:josbalcaen,项目名称:pymel,代码行数:7,代码来源:test_language.py


示例4: movePolysFromObj

def movePolysFromObj():
    """
    # 1. Select faces
    # 2. Shift-select targetObj
    # 3. Run
    """
    selFaces = mc.ls(os=1, fl=1)[:-1]
    selFacesIds = [int(faceName.split("[")[1][:-1]) for faceName in selFaces]

    # target object is the last selected item
    targetObj = mc.ls(os=1, fl=1)[-1]
    targetObjParent = mc.listRelatives(targetObj, p=1)[0]

    # delete the parentConstraint if necessary
    targetObjChildren = mc.listRelatives(targetObj, c=1, type="parentConstraint")
    if not targetObjChildren == None:
        mc.delete(targetObjChildren)

    srcObj = selFaces[0].split(".")[0]
    tempObj = mc.duplicate(srcObj, n="tempObj")[0]
    mc.delete(selFaces)

    facesToCopy = [faceName.replace(srcObj, tempObj) for faceName in selFaces]
    mc.select(facesToCopy, r=1)
    meval("InvertSelection;")
    mc.delete()

    combinedGeo = mc.polyUnite(tempObj, targetObj, ch=0, n="combinedGeo")[0]
    mc.rename(combinedGeo, targetObj)
    mc.parent(targetObj, targetObjParent)
    mc.polyMergeVertex(targetObj, d=0.001, ch=0)
    mc.delete(tempObj)
    mc.select(srcObj, r=1)
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:33,代码来源:proxy.py


示例5: fxCombine

def fxCombine(merge=False):
    targets = m.ls(sl=True, l=True)

    if not targets:
        return

    parent = m.listRelatives(targets[0], p=True, pa=True)

    try:
        combineResult = m.polyUnite(targets)
    except RuntimeError:
        m.error('Invalid selection for combine operation.')
        return

    if parent:
        combineResult = m.parent(combineResult[0], parent[0])

    m.delete(combineResult[0], ch=True)

    for t in targets:
        if m.objExists(t):
            m.delete(t)

    finalObject = m.rename(combineResult[0], getShortName(targets[0]))
    m.select(finalObject)

    if merge:
        meval('performPolyMerge 0')
        m.polyOptions(finalObject, displayBorder=True, sizeBorder=4)
        m.select(finalObject)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:30,代码来源:fx_combine.py


示例6: test_setitem_int

    def test_setitem_int(self):
        meval("int $melGlobals_test_setitem_int1")

        lang.melGlobals["melGlobals_test_setitem_int1"] = 37
        self.assertEqual(meval("melGlobals_test_int_getter($melGlobals_test_setitem_int1)"), 37)
        lang.melGlobals["$melGlobals_test_setitem_int1"] = 47
        self.assertEqual(meval("melGlobals_test_int_getter($melGlobals_test_setitem_int1)"), 47)
开发者ID:josbalcaen,项目名称:pymel,代码行数:7,代码来源:test_language.py


示例7: doDuplicateExtract

def doDuplicateExtract():
    selection = m.ls(sl=True, l=True)
    if not selection:
        raise RuntimeError('Bad selection. Select some polygons.')

    components = defaultdict(list)
    for s in selection:
        split = s.split('.')
        if (len(split) != 2) or (not split[1].startswith('f[')):
            raise RuntimeError('Bad selection. Only polygons allowed: {}'.format(s))
        components[split[0]].append(split[1])

    originalObjects = components.keys()
    newObjects = []
    wholeDuplicatedObjects = []

    for obj in originalObjects:
        dup = m.duplicate(obj)[0]
        newObjects.append(dup)

        newSelection = [dup + '.' + c for c in components[obj]]
        m.select(newSelection, r=True)
        meval('InvertSelection')

        if m.ls(sl=True):
            m.delete()
        else:
            wholeDuplicatedObjects.append(obj)

    m.select(selection, r=True)

    return newObjects, wholeDuplicatedObjects
开发者ID:theetcher,项目名称:fxpt,代码行数:32,代码来源:fx_duplicate_extract.py


示例8: createIKCtrlsOnJnts

def createIKCtrlsOnJnts(ikCrv, parentCtrl, size=1):
    ikCVNum = ll.getCurveCVCount(ikCrv)
    prev=parentCtrl
    for i in range(1, ikCVNum):
        clus = mc.cluster('%s.cv[%d]'%(ikCrv, i), n=parentCtrl.replace('masterctrl','ikClus%d')%i)
        cvPos = mc.xform('%s.cv[%d]'%(ikCrv, i), q=1, ws=1, t=1)
        mc.select(parentCtrl)
        meval('wireShape("plus")')
        ikCtrl = mc.rename(masterCtrl.replace('masterctrl','ikCtrl%d'%i))
        mc.xform(ikCtrl, t=cvPos, ws=1)
        mc.scale(size, size, size, ikCtrl, ocp=1)
        mc.makeIdentity(ikCtrl, a=1, s=1)
        mc.parent(ikCtrl, parentCtrl)
        lsZeroOut(ikCtrl)
        ctrlPR = lsZeroOut(ikCtrl, 'PR')
        mc.addAttr(ikCtrl, ln='SPACE', at='bool', k=1)
        mc.setAttr(ikCtrl+'.SPACE', l=1)
        mc.addAttr(ikCtrl, ln='parent', at='float', dv=0, min=0, max=1, k=1)
        mc.addAttr(ikCtrl, ln='master', at='float', dv=1, min=0, max=1, k=1)
        mc.addAttr(ikCtrl, ln='world', at='float', dv=0, min=0, max=1, k=1)
        mc.parentConstraint(ikCtrl, clus)
        cons = mc.parentConstraint(prev, parentCtrl, ctrlPR, mo=1)[0]
        wal = mc.parentConstraint(cons, q=1, wal=1)
        if len(wal) > 1:
            mc.connectAttr(ikCtrl+'.parent', '%s.%s'%(cons, wal[0]), f=1)
            mc.connectAttr(ikCtrl+'.master', '%s.%s'%(cons, wal[1]), f=1)
        prev=ikCtrl
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:27,代码来源:hair.py


示例9: makeIKStretchy

def makeIKStretchy(aJnts, aIkJnts, aFkJnts, ikCtrl, statCtrl, stretchTarget, grp, limbName):
    '''
    '''
    
    aJnts = formatStrArray(aJnts)
    aIkJnts = formatStrArray(aIkJnts)
    aFkJnts = formatStrArray(aFkJnts)
    
    meval('abRTMakeIKStretchy(%(aJnts)s, %(aIkJnts)s, %(aFkJnts)s, "%(ikCtrl)s", "%(statCtrl)s", "%(stretchTarget)s", "%(grp)s", "%(limbName)s")' % locals())
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:9,代码来源:abRiggingTools.py


示例10: test_setitem_int

    def test_setitem_int(self):
        meval('int $melGlobals_test_setitem_int1')

        lang.melGlobals['melGlobals_test_setitem_int1'] = 37
        self.assertEqual(meval('melGlobals_test_int_getter($melGlobals_test_setitem_int1)'),
                         37)
        lang.melGlobals['$melGlobals_test_setitem_int1'] = 47
        self.assertEqual(meval('melGlobals_test_int_getter($melGlobals_test_setitem_int1)'),
                         47)
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:9,代码来源:test_language.py


示例11: test_setitem_str

    def test_setitem_str(self):
        meval('global string $melGlobals_test_setitem_str1')

        lang.melGlobals['melGlobals_test_setitem_str1'] = 'monkey'
        self.assertEqual(meval('melGlobals_test_str_getter($melGlobals_test_setitem_str1)'),
                         'monkey')
        lang.melGlobals['$melGlobals_test_setitem_str1'] = 'apple'
        self.assertEqual(meval('melGlobals_test_str_getter($melGlobals_test_setitem_str1)'),
                         'apple')
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:9,代码来源:test_language.py


示例12: set_project

def set_project( shot, task = False):
	path	= '{0}{1}/{2}/{3}'.format( '/jobs/tr/users/', os.getlogin(),  shot[:-5], shot)

	if not task:
		path	+= '/trackwork/scenes/maya'
	else:
		path	+= '/animwork/maya'
	
	meval('setProject "{0}"'.format( path))
开发者ID:danielforgacs,项目名称:code-dump,代码行数:9,代码来源:ford_projectSelector.py


示例13: run

def run(deleteOriginals=True):
    newObjects, wholeDuplicatedObjects = doDuplicateExtract()

    if deleteOriginals:
        m.delete()
        if wholeDuplicatedObjects:
            m.delete(wholeDuplicatedObjects)

    meval('changeSelectMode -object')
    m.select(newObjects, r=True)
开发者ID:theetcher,项目名称:fxpt,代码行数:10,代码来源:fx_duplicate_extract.py


示例14: test_get_dict

 def test_get_dict(self):
     self.assertEqual(lang.melGlobals.get_dict('melGlobals_test_get_dict'),
                      None)
     self.assertEqual(lang.melGlobals.get_dict('melGlobals_test_get_dict',
                                               'foo'),
                      'foo')
     meval('global int $melGlobals_test_get_dict = 3')
     self.assertEqual(lang.melGlobals.get_dict('melGlobals_test_get_dict'),
                      3)
     self.assertEqual(lang.melGlobals.get_dict('melGlobals_test_get_dict',
                                               'foo'),
                      3)
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:12,代码来源:test_language.py


示例15: massCopySkinWeightsGo

def massCopySkinWeightsGo():
    '''
    select all destGeos,
    shift-select srcGeo,
    run
    '''
    sel = mc.ls(os=True)
    destGeos = sel[:-1]
    srcGeo = sel[-1]
    srcSkn = meval('findRelatedSkinCluster %s' % srcGeo)
    for geo in destGeos:
        destSkn = meval('findRelatedSkinCluster %s' % geo)
        mc.copySkinWeights(ss=srcSkn, ds=destSkn, ia='oneToOne', sa='closestPoint', nm=1)
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:13,代码来源:__init__.py


示例16: test_get_int

    def test_get_int(self):
        meval("global int $melGlobals_test_get_int1")

        meval("$melGlobals_test_get_int1 = 37")
        self.assertEqual(lang.melGlobals.get("melGlobals_test_get_int1"), 37)

        meval("$melGlobals_test_get_int1 = 47")
        self.assertEqual(lang.melGlobals.get("$melGlobals_test_get_int1"), 47)

        meval("$melGlobals_test_get_int1 = 57")
        self.assertEqual(lang.MelGlobals.get("melGlobals_test_get_int1"), 57)

        meval("$melGlobals_test_get_int1 = 67")
        self.assertEqual(lang.MelGlobals.get("$melGlobals_test_get_int1"), 67)
开发者ID:josbalcaen,项目名称:pymel,代码行数:14,代码来源:test_language.py


示例17: test_getitem_str

    def test_getitem_str(self):
        meval('global string $melGlobals_test_getitem_str1')

        meval('$melGlobals_test_getitem_str1 = "waldo"')
        self.assertEqual(lang.melGlobals.get('melGlobals_test_getitem_str1'), 'waldo')

        meval('$melGlobals_test_getitem_str1 = "marcy"')
        self.assertEqual(lang.melGlobals.get('$melGlobals_test_getitem_str1'), 'marcy')

        meval('$melGlobals_test_getitem_str1 = "may"')
        self.assertEqual(lang.MelGlobals.get('melGlobals_test_getitem_str1'), 'may')

        meval('$melGlobals_test_getitem_str1 = "marlene"')
        self.assertEqual(lang.MelGlobals.get('$melGlobals_test_getitem_str1'), 'marlene')
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:14,代码来源:test_language.py


示例18: test_get_int_arr

    def test_get_int_arr(self):
        meval("global int $melGlobals_test_get_int_arr1[]")

        meval("$melGlobals_test_get_int_arr1 = {1, 2}")
        self.assertEqual(lang.melGlobals.get("melGlobals_test_get_int_arr1"), [1, 2])

        meval("$melGlobals_test_get_int_arr1 = {3, 4}")
        self.assertEqual(lang.melGlobals.get("$melGlobals_test_get_int_arr1"), [3, 4])

        meval("$melGlobals_test_get_int_arr1 = {5, 6}")
        self.assertEqual(lang.MelGlobals.get("melGlobals_test_get_int_arr1"), [5, 6])

        meval("$melGlobals_test_get_int_arr1 = {7, 8}")
        self.assertEqual(lang.MelGlobals.get("$melGlobals_test_get_int_arr1"), [7, 8])
开发者ID:josbalcaen,项目名称:pymel,代码行数:14,代码来源:test_language.py


示例19: test_get_str_arr

    def test_get_str_arr(self):
        meval('global string $melGlobals_test_get_str_arr1[]')

        meval('$melGlobals_test_get_str_arr1 = {"waldo", "funk"}')
        self.assertEqual(lang.melGlobals.get('melGlobals_test_get_str_arr1'), ["waldo", "funk"])

        meval('$melGlobals_test_get_str_arr1 = {"marcy", "jazz"}')
        self.assertEqual(lang.melGlobals.get('$melGlobals_test_get_str_arr1'), ["marcy", "jazz"])

        meval('$melGlobals_test_get_str_arr1 = {"may", "rock"}')
        self.assertEqual(lang.MelGlobals.get('melGlobals_test_get_str_arr1'), ["may", "rock"])

        meval('$melGlobals_test_get_str_arr1 = {"marlene", "trip-hop"}')
        self.assertEqual(lang.MelGlobals.get('$melGlobals_test_get_str_arr1'), ["marlene", "trip-hop"])
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:14,代码来源:test_language.py


示例20: setUp

    def setUp(self):
        meval(
            """global proc int melGlobals_test_int_getter(int $inValue)
                {
                    return $inValue;
                }"""
        )

        meval(
            """global proc string melGlobals_test_str_getter(string $inValue)
                {
                    return $inValue;
                }"""
        )

        meval(
            """global proc int[] melGlobals_test_int_arr_getter(int $inValue[])
                {
                    return $inValue;
                }"""
        )

        meval(
            """global proc string[] melGlobals_test_str_arr_getter(string $inValue[])
                {
                    return $inValue;
                }"""
        )
开发者ID:josbalcaen,项目名称:pymel,代码行数:28,代码来源:test_language.py



注:本文中的maya.mel.meval函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python standalone.initialize函数代码示例发布时间:2022-05-27
下一篇:
Python mel.eval函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap