本文整理汇总了Python中maya.cmds.polyCube方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.polyCube方法的具体用法?Python cmds.polyCube怎么用?Python cmds.polyCube使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.cmds
的用法示例。
在下文中一共展示了cmds.polyCube方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def setUp(self):
self.group = cmds.createNode("transform", name="skeleton_grp")
cmds.select(cl=True)
j1 = cmds.joint(p=(0, 10, 0))
cmds.joint(p=(1, 9, 0))
cmds.joint(p=(2, 8, 0))
j = cmds.joint(p=(3, 9, 0))
cmds.joint(p=(4, 6, 0))
cmds.joint(p=(5, 5, 0))
cmds.joint(p=(6, 3, 0))
self.cube = cmds.polyCube()[0]
cmds.parent(self.cube, j)
cmds.parent(j1, self.group)
cmds.joint(j1, e=True, oj="xyz", secondaryAxisOrient="yup", ch=True, zso=True)
self.translates = [
cmds.getAttr("{0}.t".format(x))[0] for x in cmds.ls(type="joint")
]
self.rotates = [
cmds.getAttr("{0}.r".format(x))[0] for x in cmds.ls(type="joint")
]
self.orients = [
cmds.getAttr("{0}.jo".format(x))[0] for x in cmds.ls(type="joint")
]
示例2: doit
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def doit(cage_tgt=None):
if not cage_tgt:
cage_tgt = cmds.ls(sl=True, o=True)
cage = cage_tgt[0]
tgt = cage_tgt[1:]
cmds.loadPlugin('greenCageDeformer.py', qt=True)
deformer = cmds.deformer(tgt, type='greenCageDeformer')[0]
freezer = cmds.createNode('transformGeometry')
cmds.connectAttr(cage + '.o', freezer + '.ig')
cmds.connectAttr(cage + '.wm', freezer + '.txf')
cmds.connectAttr(freezer + '.og', deformer + '.bc')
cmds.disconnectAttr(freezer + '.og', deformer + '.bc')
cmds.delete(freezer)
cmds.connectAttr(cage + '.w', deformer + '.ic')
cmds.dgeval(cmds.listConnections(deformer + '.og', s=False, d=True, sh=True, p=True))
#doit([cmds.polyCube(w=2.5, d=2.5, h=2.5)[0], cmds.polySphere()[0]])
示例3: polyCube
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def polyCube():
cmds.polyCube()
示例4: create_cube
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def create_cube(*args, **kwargs):
print "create my cube"
cmds.polyCube()
示例5: test_cmds_accessor_get
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_cmds_accessor_get(self):
cmds.file(new=True, f=True)
test_obj, _ = cmds.polyCube()
cmds.xform(test_obj, rotation=(10, 10, 10))
ac = bindings.CmdsAccessor(test_obj, 'r')
assert ac.pull() == [(10, 10, 10)]
示例6: test_py_accessor_get
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_py_accessor_get(self):
cmds.file(new=True, f=True)
test_obj, _ = cmds.polyCube()
pynode = pm.PyNode(test_obj)
ac = bindings.PyNodeAccessor(pynode, 'rx')
assert ac.pull() == 0
示例7: test_pynode_accessor
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_pynode_accessor(self):
cmds.file(new=True, f=True)
cube, shape = pm.polyCube()
ac = bindings.get_accessor(cube, 'rx')
assert isinstance(ac, bindings.PyNodeAccessor)
ac2 = bindings.get_accessor(shape, 'width')
assert isinstance(ac2, bindings.PyNodeAccessor)
示例8: test_pynode_accessor_excepts_for_nonexistent_attrib
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_pynode_accessor_excepts_for_nonexistent_attrib(self):
cmds.file(new=True, f=True)
cube, _ = pm.polyCube()
self.assertRaises(bindings.BindingError, lambda: bindings.get_accessor(cube, 'xyz'))
示例9: test_bind_to_cmds_string
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_bind_to_cmds_string(self):
ex = self.Example('cube', 45)
cmds.file(new=True, f=True)
cmds.polyCube()
tester = ex & 'val' > bindings.bind() > ('pCube1', 'tx')
tester()
assert cmds.getAttr('pCube1.tx') == 45
tester2 = ex & 'val' > bindings.bind() > 'pCube1.ty'
tester2()
assert cmds.getAttr('pCube1.ty') == 45
示例10: test_bind_to_pyAttr
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_bind_to_pyAttr(self):
ex = self.Example('cube', 45)
cmds.file(new=True, f=True)
cube, shape = pm.polyCube()
tester = ex & 'val' > bindings.bind() > cube.tx
tester()
assert cmds.getAttr('pCube1.tx') == 45
示例11: test_bind_to_pyNode
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_bind_to_pyNode(self):
ex = self.Example('cube', 45)
cmds.file(new=True, f=True)
cube, shape = pm.polyCube()
tester = ex & 'val' > bindings.bind() > (cube, 'tx')
tester()
assert cmds.getAttr('pCube1.tx') == 45
示例12: test_get_blendshape_on_new_shape
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_get_blendshape_on_new_shape(self):
shape = cmds.polyCube()[0]
blendshape = bs.get_or_create_blendshape_node(shape)
self.assertTrue(cmds.objExists(blendshape))
blendshapes = cmds.ls(type="blendShape")
self.assertEqual(len(blendshapes), 1)
self.assertEqual(blendshapes[0], blendshape)
blendshape = bs.get_or_create_blendshape_node(shape)
blendshapes = cmds.ls(type="blendShape")
self.assertEqual(len(blendshapes), 1)
self.assertEqual(blendshapes[0], blendshape)
示例13: test_get_blendshape_on_existing_blendshape
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test_get_blendshape_on_existing_blendshape(self):
shape = cmds.polyCube()[0]
blendshape = cmds.blendShape(shape)[0]
existing_blendshape = bs.get_or_create_blendshape_node(shape)
self.assertEqual(blendshape, existing_blendshape)
示例14: setUp
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def setUp(self):
self.joint1 = cmds.joint(p=(-0.5, -0.5, 0))
self.joint2 = cmds.joint(p=(0, 0.0, 0))
self.joint3 = cmds.joint(p=(0.5, 0.5, 0))
self.shape = cmds.polyCube()[0]
cmds.delete(self.shape, ch=True)
self.skin = cmds.skinCluster(self.joint1, self.joint2, self.joint3, self.shape)[
0
]
self.expected = {
"bindMethod": 1,
"blendWeights": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"dropoffRate": 4.0,
"heatmapFalloff": 0.0,
"maintainMaxInfluences": False,
"maxInfluences": 2,
"name": u"skinCluster1",
"normalizeWeights": 1,
"shape": u"pCube1",
"skinningMethod": 0,
"useComponents": False,
"weightDistribution": 0,
"weights": {
"joint1": [0.9, 0.5, 0.5, 0.0, 0.5, 0.0, 0.9, 0.5],
"joint2": [
0.10000000000000002,
0.5,
0.5,
0.5,
0.5,
0.5,
0.10000000000000002,
0.5,
],
"joint3": [0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0],
},
}
示例15: test
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def test():
cmds.file(new=True, force=True)
with CreatedNodesContext() as cnc:
cubes = cmds.polyCube()
cmds.polySphere()
cmds.spaceLocator()
cmds.delete(cubes)
print "Created the following nodes:\n\t%s" % ('\n\t'.join(cnc.nodes()))