当前位置: 首页>>代码示例>>Python>>正文


Python cmds.polyCube方法代码示例

本文整理汇总了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")
        ] 
开发者ID:chadmv,项目名称:cmt,代码行数:26,代码来源:test_skeleton.py

示例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]]) 
开发者ID:ryusas,项目名称:maya_greenCageDeformer,代码行数:23,代码来源:createGreenCageDeformer.py

示例3: polyCube

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import polyCube [as 别名]
def polyCube():
    cmds.polyCube() 
开发者ID:minoue,项目名称:rush,代码行数:4,代码来源:Create.py

示例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() 
开发者ID:theodox,项目名称:mGui,代码行数:5,代码来源:formExamples.py

示例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)] 
开发者ID:theodox,项目名称:mGui,代码行数:8,代码来源:test_Bindings.py

示例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 
开发者ID:theodox,项目名称:mGui,代码行数:8,代码来源:test_Bindings.py

示例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) 
开发者ID:theodox,项目名称:mGui,代码行数:9,代码来源:test_Bindings.py

示例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')) 
开发者ID:theodox,项目名称:mGui,代码行数:6,代码来源:test_Bindings.py

示例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 
开发者ID:theodox,项目名称:mGui,代码行数:12,代码来源:test_Bindings.py

示例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 
开发者ID:theodox,项目名称:mGui,代码行数:9,代码来源:test_Bindings.py

示例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 
开发者ID:theodox,项目名称:mGui,代码行数:9,代码来源:test_Bindings.py

示例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) 
开发者ID:chadmv,项目名称:cmt,代码行数:14,代码来源:test_cmt_blendshape.py

示例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) 
开发者ID:chadmv,项目名称:cmt,代码行数:7,代码来源:test_cmt_blendshape.py

示例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],
            },
        } 
开发者ID:chadmv,项目名称:cmt,代码行数:39,代码来源:test_cmt_skinio.py

示例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())) 
开发者ID:dgovil,项目名称:AdvancedPythonForMaya,代码行数:10,代码来源:createdNodesContext.py


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