本文整理汇总了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)