當前位置: 首頁>>代碼示例>>Python>>正文


Python cmds.move方法代碼示例

本文整理匯總了Python中maya.cmds.move方法的典型用法代碼示例。如果您正苦於以下問題:Python cmds.move方法的具體用法?Python cmds.move怎麽用?Python cmds.move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在maya.cmds的用法示例。


在下文中一共展示了cmds.move方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testPyCmds

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def testPyCmds():

    start = time.time()

    helix = cmds.polyHelix(**HELIX_OPTS)
    pHelix = helix[0]

    size = cmds.polyEvaluate(v=True)

    for i in xrange(size):
        x = RAND.uniform(LOW, HIGH)
        attrib = '%s.vtx[%s]' % (pHelix, i)
        cmds.move(x, attrib, x=True)
    
    cmds.delete(pHelix)

    end = time.time()
    return end-start 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:20,代碼來源:benchmark.py

示例2: trs_matching

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def trs_matching(node=None, sel_org=True):
    global matching_obj
    global matching_mode
    global child_comp_flag
    #print matching_mode, matching_obj
    mode = matching_mode
    if node is None:
        mached_obj = cmds.ls(sl=True, l=True, type='transform')
    else:
        #print 'muched obj', node
        mached_obj = node
    if not mached_obj:
        if sel_org:
            finish_matching()
        return
    else:
        if isinstance(mached_obj, list):
            mached_obj = mached_obj[0]
    #print 'trs matching :', mached_obj
    scl = cmds.xform(mached_obj, q=True, s=True, ws=True)
    rot = cmds.xform(mached_obj, q=True, ro=True, ws=True)
    pos = cmds.xform(mached_obj, q=True, t=True, ws=True)
    for obj in matching_obj:
        if mode == 'scale' or mode == 'all':
            cmds.scale(1.0, 1.0, 1.0, obj, pcp=True)
            ws_scl = cmds.xform(obj, q=True, s=True, ws=True)
            cmds.scale(scl[0]/ws_scl[0], scl[1]/ws_scl[1], scl[2]/ws_scl[2], obj, pcp=child_comp_flag)
        if mode == 'rotate' or mode == 'all':
            cmds.rotate(rot[0], rot[1], rot[2], obj, ws=True, pcp=child_comp_flag)
        if mode == 'translate' or mode == 'all':
            cmds.move(pos[0], pos[1], pos[2], obj, ws=True, pcp=child_comp_flag)
    if sel_org:
        finish_matching()
    
#アトリビュートの桁數を丸める 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:37,代碼來源:transform.py

示例3: setTranslation

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def setTranslation(self, x=None, y=None, z=None):
        for name in ('x','y','z'):
            val = locals()[name]
            if val is not None:
                opts = {name:True, 'objectSpace':True, 'absolute':True}
                cmds.move(val, self.name, **opts) 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:8,代碼來源:mayaSphere2.py

示例4: setTranslation

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def setTranslation(self, x=None, y=None, z=None):
        self._doTransform(cmds.move, x, y, z) 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:4,代碼來源:mayaSphere4.py

示例5: setTranslation

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def setTranslation(self, x=None, y=None, z=None):
        if x is not None:
            cmds.move(x, self.name, x=True, objectSpace=True, absolute=True)
        if y is not None:
            cmds.move(y, self.name, y=True, objectSpace=True, absolute=True)
        if z is not None:
            cmds.move(z, self.name, z=True, objectSpace=True, absolute=True) 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:9,代碼來源:mayaGeom.py

示例6: setTranslation

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def setTranslation(self, x=None, y=None, z=None):
        
        for name in ('x','y','z'):
            val = locals()[name]
            if val is not None:
                opts = {name:True, 'objectSpace':True, 'absolute':True}
                cmds.move(val, self.name, **opts) 
開發者ID:justinfx,項目名稱:tutorials,代碼行數:9,代碼來源:mayaSphere3.py

示例7: dragMult

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import move [as 別名]
def dragMult(self, mult):
        #as the mouse is dragging, update the position of each object by muliplying
        #the vector and adding to the original position
        for obj, v, n in zip(self.objs,self.vector,self.normalized):
            vector = (n * self.x * mult) + v + self.cameraVector

            mc.move(vector[0],vector[1],vector[2], obj, absolute=True, worldSpace=True) 
開發者ID:morganloomis,項目名稱:ml_tools,代碼行數:9,代碼來源:ml_cameraDepthDragger.py


注:本文中的maya.cmds.move方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。