本文整理匯總了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
示例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()
#アトリビュートの桁數を丸める
示例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)
示例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)
示例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)
示例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)
示例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)