• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python cmds.sphere函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中maya.cmds.sphere函数的典型用法代码示例。如果您正苦于以下问题:Python sphere函数的具体用法?Python sphere怎么用?Python sphere使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sphere函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: joint

def joint(side, lowerJoint, upperJoint, useSphere=0, sharedUpper=0, sharedLower=0, show=1, heightScale=1):
    name = lowerJoint + "_" + upperJoint

    upperName = "SKEL_"
    if sharedUpper == 0:
        upperName += side + "_"
    upperName += upperJoint

    lowerName = "SKEL_"
    if sharedLower == 0:
        lowerName += side + "_"
    lowerName += lowerJoint

    print name
    cmds.spaceLocator(name="%s_%s" % (side, name))
    cmds.pointConstraint(lowerName, "%s_%s" % (side, name))
    cmds.pointConstraint(upperName, "%s_%s" % (side, name))
    cmds.aimConstraint(upperName, "%s_%s" % (side, name))
    if useSphere:
        cmds.sphere(name="%s_%s_C" % (side, name), radius=1)
    else:
        cmds.cylinder(name="%s_%s_C" % (side, name), radius=0.5, heightRatio=6 * heightScale)

    cmds.setAttr("%s_%s_C.doubleSided" % (side, name), 0)
    if show == 0:
        cmds.setAttr("%s_%s_C.primaryVisibility" % (side, name), 0)

        # cmds.rotate( 0, 0, 90, '%s_FOREARM_C' % (side) )
        # cmds.makeIdentity( '%s_FOREARM_C' % (side), apply = 1, rotate = 1 )
    cmds.select("%s_%s" % (side, name), "%s_%s_C" % (side, name))
    cmds.parentConstraint()
    return
开发者ID:torbensko,项目名称:Kinect-to-Maya-motion-capture,代码行数:32,代码来源:mayaKinectAutoRig.py


示例2: newGrp

def newGrp(name):
    #Create a clean group
    try:
        cmds.select(name)
    except:
        cmds.sphere(n="temp")
        cmds.group("temp",n = name,world=True)
        cmds.delete("temp")
开发者ID:davidwilliamsDK,项目名称:maya,代码行数:8,代码来源:dsCamClean.py


示例3: testStaticNurbsSurfacePropReadWrite

 def testStaticNurbsSurfacePropReadWrite(self):
     nodeName = 'nSphere'
     shapeName = 'nSphereShape'
     MayaCmds.sphere(name=nodeName)
     self.setProps(shapeName)
     self.__files.append(util.expandFileName('staticPropNurbs.abc'))
     MayaCmds.AbcExport(j='-atp SPT_ -root %s -file %s' % (nodeName, self.__files[-1]))
     self.verifyProps(shapeName, self.__files[-1])
开发者ID:GameFusion,项目名称:alembic,代码行数:8,代码来源:staticProp_test.py


示例4: create_world_button

 def create_world_button( self, *args  ):
     if( cmds.objExists( "OurSampleWorld" ) ):
         return 0
     else:
         cmds.sphere( r=10, sections=40, spans=30, name="OurSampleWorld" )
         cmds.setAttr( "OurSampleWorld.scale", 9.599, 9.599, 9.599 )
         cmds.makeIdentity( apply=True, t=1, r=1, s=1 )
         self.wbbox = cmds.exactWorldBoundingBox( "OurSampleWorld" )
         cmds.move((self.wbbox[0] + self.wbbox[3])/2, self.wbbox[4], (self.wbbox[2] + self.wbbox[5])/2, "OurSampleWorld.scalePivot", "OurSampleWorld.rotatePivot", absolute=True)
         cmds.move( 0, 0, 0, "OurSampleWorld", rpr=True )
         cmds.connectControl( "world_size_slider", "OurSampleWorld.scaleX", "OurSampleWorld.scaleY", "OurSampleWorld.scaleZ" )
开发者ID:cwilmot,项目名称:maya-bulge-deformer-tool,代码行数:11,代码来源:MayaBulgeTool.py


示例5: drawCurve

def drawCurve( target,start,end,colour,samples ):
	# print target,start,end,samples,colour
	# make locator, constrain to target
	cmds.spaceLocator( name="myLocator" )
	cmds.select( target )
	cmds.select( "myLocator", add=True )
	cmds.pointConstraint()

	# make a new render layer with locator, and change display colour
	cmds.select( "myLocator" )
	exists = cmds.objExists( "AnimationCurves" )
	if ( exists==False ):
		cmds.createDisplayLayer( name="AnimationCurves", number=1, nr=True )
		cmds.createDisplayLayer( name="Spheres", number=1, nr=True )
		cmds.setAttr( "AnimationCurves.color", colour )
		cmds.setAttr( "Spheres.color", 16 )		

	# make a list of all the frames where points for the curve will be created
	frameList = []
	frameList.append( start )
	length = end - start
	samples = cmds.intField( samplesField, q=1, v=1 )
	interval = int( length / (samples-1) ) # using int() to ensure integer frame numbers
	for i in range( 1,samples ):
		frameList.append( start+interval*i )
	frameList.append( end )

	# make a list of tuples containing the locations of the target/locator for every frame needed
	xFormList = []
	n = 0
	for frame in ( frameList ):
		x = cmds.getAttr( "myLocator.tx",time=frame )
		y = cmds.getAttr( "myLocator.ty",time=frame )
		z = cmds.getAttr( "myLocator.tz",time=frame )
		currentXForm = ( x,y,z )
		xFormList.append( currentXForm )
		cmds.sphere( n="sphere"+str(n), r=0.2 )
		cmds.move( x,y,z, "sphere"+str(n), a=True )
		n+=1
		# print frame, "= ", x,y,z
	cmds.editDisplayLayerMembers( "Spheres", "sphere*", nr=True )

	# create curve using list of tuples
	cmds.curve( p=xFormList, d=1, ws=True )
	cmds.rename( target+"_animation_curve" )
	cmds.group( target+"_animation_curve", "sphere*", n="curve" )
	# add curve to animation curves layer
	cmds.editDisplayLayerMembers( "AnimationCurves", "curve", nr=True )
	cmds.delete("myLocator")
	cmds.button( ccButton, e=1, en=0 )
	cmds.frameLayout( buttonGroup, e=1, l="Delete curve before creating another" )
开发者ID:LewisHaley,项目名称:BitsAndPieces,代码行数:51,代码来源:animationCurve.py


示例6: addModification

def addModification( meshObjs ):
    
    import sgBFunction_attribute
    import sgBFunction_dag
    
    meshObjs = sgBFunction_dag.getChildrenMeshExists( meshObjs )
    softMod = cmds.deformer( meshObjs, type='softMod' )[0]
    
    ctlGrp = cmds.createNode( 'transform' )
    cmds.setAttr( ctlGrp+'.dh', 1 )
    dcmp   = cmds.createNode( 'decomposeMatrix' )
    ctl = cmds.sphere()[0]
    ctl = cmds.parent( ctl, ctlGrp )[0]
    sgBFunction_attribute.addAttr( ctl, ln='__________', at='enum', enumName = ':Modify Attr', cb=1 )
    sgBFunction_attribute.addAttr( ctl, ln='falloffRadius', min=0, dv=1, k=1 )
    sgBFunction_attribute.addAttr( ctl, ln='envelope', min=0, max=1, dv=1, k=1 )
    
    cmds.connectAttr( ctlGrp+'.wim', softMod+'.bindPreMatrix' )
    cmds.connectAttr( ctlGrp+'.wm', softMod+'.preMatrix' )
    cmds.connectAttr( ctl+'.wm', softMod+'.matrix' )
    cmds.connectAttr( ctl+'.m',  softMod+'.weightedMatrix' )
    
    cmds.connectAttr( ctlGrp+'.wm', dcmp+'.imat' )
    
    cmds.connectAttr( dcmp+'.ot', softMod+'.falloffCenter' )
    for i in range( len( meshObjs ) ):
        cmds.connectAttr( meshObjs[i]+'.wm', softMod+'.geomMatrix[%d]' % i )
    
    cmds.connectAttr( ctl+'.envelope', softMod+'.envelope' )
    cmds.connectAttr( ctl+'.falloffRadius', softMod+'.falloffRadius' )
    
    cmds.xform( ctlGrp, ws=1, t=cmds.getAttr( meshObjs[0]+'.wm' )[-4:-1] )
    cmds.select( ctlGrp )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:33,代码来源:sgBFunction_rigObject.py


示例7: createImpactHelper

 def createImpactHelper(self):
     '''
     Creates IS Sphere Helper
     '''
     mImpact = cmds.sphere(r = 0.00001, n = 'IS_Impact')
     mImpactShape = cmds.listRelatives(mImpact[0])[0]
     
     self._mVoroImpactTrs = mImpact[0]
     self._mVoroImpactShape = mImpact[1]
     
     cmds.setAttr(mImpact[0] + '.visibility', False)
     cmds.setAttr(mImpact[0] + '.overrideEnabled', True)
     cmds.setAttr(mImpact[0] + '.overrideColor', 14)
     cmds.setAttr(mImpact[1] + '.sections', 2)
     cmds.setAttr(mImpact[1] + '.spans', 2)
     cmds.setAttr(mImpactShape + '.curvePrecisionShaded', 20)
     
     self._mVoroImpactShader = cmds.shadingNode('lambert', name = 'IS_ImpactMat', asShader = True)
     cmds.setAttr(self._mVoroImpactShader + '.diffuse', 0.0)
     cmds.setAttr(self._mVoroImpactShader + '.translucence', 0.3)
     cmds.setAttr(self._mVoroImpactShader + '.translucenceDepth', 0.75)
     cmds.setAttr(self._mVoroImpactShader + '.color', 0.0, 1.0, 0.0, type = 'double3')
     cmds.setAttr(self._mVoroImpactShader + '.incandescence', 0.0, 0.15, 0.0, type = 'double3')
     cmds.setAttr(self._mVoroImpactShader + '.transparency', 0.55, 0.55, 0.55, type = 'double3')
     
     cmds.select(mImpact, replace = True)
     cmds.hyperShade(assign = self._mVoroImpactShader)
     mel.eval('hyperShadePanelMenuCommand("hyperShadePanel1", "deleteUnusedNodes")')
     
     if (cmds.attributeQuery('hiddenInOutliner', node = self._mVoroImpactTrs, exists = True)):
         cmds.setAttr(self._mVoroImpactTrs + '.hiddenInOutliner', True)
     
     cmds.select(clear = True)
     cmds.scriptEditorInfo (clearHistory = True)
开发者ID:jeffhong21,项目名称:scripts,代码行数:34,代码来源:IShatterCTX.py


示例8: createPetals

 def createPetals(self):
     '''This method creates the petals of flower. '''
     
     # create the petal
     mc.sphere( ax=(0, 1, 0) );
     mc.move( 0, 0, -1.6 );
     mc.scale( 0.7, 0.3, 1.7 );    
     self.currentPetal = mc.ls( sl=True );
     currentPetal0 = self.currentPetal[0]
 
     # reset the coordinates
     mc.makeIdentity( apply=True, t=1, r=1, s=1, n=0 );
     mc.move( 0, 0, 0, currentPetal0 + '.scalePivot' )
     mc.move( 0, 0, 0, currentPetal0 + '.rotatePivot' )
      
     # move the tip of the petal
     mc.select( currentPetal0 + ".cv[3] [7]" )
     mc.move( 0, 1.5, 0, r=True )
   
     # select the inner part of the petal
     # move them down
     for uCV in range (5,7):  
         for vCV in range (0, 8):
             mc.select( currentPetal0 + ".cv[" + str(uCV) + "] [" + str(vCV) + "]" );
             mc.move( 0, -0.3, 0, r=True )
     
     # delete history
     mc.select( currentPetal0 )
     maya.mel.eval( "DeleteHistory" )
     
     # create the rest of the petals
     numPetals = random.randrange (10, 20);
     mc.select( currentPetal0 )
     degreeApart = ( 360 / numPetals );
     for i in range (0, numPetals):    
         newPetal = mc.duplicate ( rr=True );
         self.currentPetal.append(newPetal)
         mc.rotate( 0, degreeApart, 0, r=True );
         
         # randomly rotate the petals
         petalRX = random.randrange( -5, 5 );
         petalRY = random.randrange( -5, 5 );
         petalRZ = random.randrange( -5, 5 );
         mc.makeIdentity(apply=True, t=1, r=1, s=1, n=0)
         mc.rotate( petalRX, petalRY, petalRZ, r=True )
         
     return self.currentPetal
开发者ID:remusvrm,项目名称:plugins,代码行数:47,代码来源:Flower_v03.py


示例9: runTest

    def runTest(self):
        # create a nurbs sphere
        mySphere = cmds.sphere()[0]
        # a default sphere should have u/v
        # parameter ranges of 0:4/0:8
        
        # The following selections should
        # result in one of these:
        desiredResults = ('nurbsSphere1.u[2:3][0:8]',
                          'nurbsSphere1.u[2:3][*]',
                          'nurbsSphere1.u[2:3]',
                          'nurbsSphere1.uv[2:3][0:8]',
                          'nurbsSphere1.uv[2:3][*]',
                          'nurbsSphere1.uv[2:3]',
                          'nurbsSphere1.v[0:8][2:3]',
                          'nurbsSphere1.v[*][2:3]')

                
        # Passes
        cmds.select('nurbsSphere1.u[2:3][*]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)
        
        # Passes
        cmds.select('nurbsSphere1.v[*][2:3]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)        

        # Fails! - returns 'nurbsSphere1.u[2:3][0:1]'
        cmds.select('nurbsSphere1.u[2:3]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)
        
        # Fails! - returns 'nurbsSphere1.u[2:3][0:1]'
        cmds.select('nurbsSphere1.uv[2:3][*]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)

        # The following selections should
        # result in one of these:
        desiredResults = ('nurbsSphere1.u[0:4][2:3]',
                          'nurbsSphere1.u[*][2:3]',
                          'nurbsSphere1.uv[0:4][2:3]',
                          'nurbsSphere1.uv[*][2:3]',
                          'nurbsSphere1.v[2:3][0:4]',
                          'nurbsSphere1.v[2:3][*]',
                          'nurbsSphere1.v[2:3]')
                
        # Passes
        cmds.select('nurbsSphere1.u[*][2:3]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)

        # Passes
        cmds.select('nurbsSphere1.v[2:3][*]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)

        # Fails! - returns 'nurbsSphereShape1.u[0:1][2:3]'
        cmds.select('nurbsSphere1.v[2:3]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)

        # Fails! - returns 'nurbsSphereShape1.u[0:4][0:1]'
        cmds.select('nurbsSphere1.uv[*][2:3]')
        self.assertTrue(cmds.ls(sl=1)[0] in desiredResults)
开发者ID:CountZer0,项目名称:pymel,代码行数:59,代码来源:test_mayaBugs.py


示例10: test_create_node_and_compile

    def test_create_node_and_compile(self):
        sphere = cmds.sphere()
        node = cmds.shadingNode("dl_uberLightShape", asLight=True)
#        cmds.select(sphere, replace=True)
#        node_sg = cmds.sets(renderable=True, noSurfaceShader=True, empty=True, name=node);
#        cmds.defaultNavigation(connectToExisting=True, source=node, destination=node_sg)
#        mel.eval('connectNodeToNodeOverride("%s", "%s")' % (node, node_sg))
#        cmds.sets(edit=True, forceElement=node_sg)
        mel.eval("delightRender %s" % self.renderpass)
开发者ID:mjmvisser,项目名称:3deluxe,代码行数:9,代码来源:testuberlight.py


示例11: setUp

 def setUp(self):
     cmds.file(f=1, new=1)
     cmds.namespace(add="FOO")
     cmds.namespace(add="BAR")
     cmds.namespace(add="FRED")
     cmds.namespace(add="BAR", parent=":FOO")
     cmds.namespace(add="CALVIN", parent=":FOO:BAR")
     cmds.sphere(n="FOO:sphere1")
     cmds.sphere(n="FOO:sphere2")
     cmds.sphere(n="BAR:sphere1")
     cmds.sphere(n="FOO:BAR:sphere1")
开发者ID:Khenu,项目名称:PipelineConstructionSet,代码行数:11,代码来源:test_system.py


示例12: main

def main():
    for e in range(COUNT):
        name = "sphere" + str(e)
        shader_name = "sphereShader" + str(e)

        ep = [rp2(5), rp2(5), rp2(5)]
        circle = cmds.sphere(name=name, p=ep, r=rp(.5))

        #color = (int(rp(120)), int(rp(120)), int(rp(120)))
        color = (rp(1), rp(1), rp(1))

        assignNewMaterial(shader_name, color, 'lambert', name)
开发者ID:chirs,项目名称:studio5,代码行数:12,代码来源:render.py


示例13: __setup_plugin

 def __setup_plugin(self):
     rivet = cmds.createNode(self._plugin)
     obj = cmds.sphere()[0]
     shape = cmds.listRelatives(obj, allDescendents=True)[0]
     cmds.connectAttr(shape + ".local", rivet + ".inSurface")
     cmds.connectAttr(obj + ".worldMatrix", rivet + ".inMatrix")
     for num in range(12):
         loc = cmds.spaceLocator()[0]
         cmds.setAttr(rivet + ".parameterUV[%s].parameterU" % num, 0.5)
         cmds.setAttr(rivet + ".parameterUV[%s].parameterV" % num, 0.0)
         cmds.connectAttr(rivet + ".outTranslate[%s]" % num, loc + ".translate")
         cmds.connectAttr(rivet + ".outRotate[%s]" % num, loc + ".rotate")
开发者ID:jonntd,项目名称:Public,代码行数:12,代码来源:goe_nurbsrivet.py


示例14: setUp

 def setUp(self):
     OpenMaya.MFileIO.newFile(True)
     master = cmds.group(name='master', empty=True)
     for i in (1, 2):
         root = cmds.group(name='root_%d' % i, parent=master, empty=True)
         child = cmds.group(name='child_%d' % i, parent=root, empty=True)
         node = cmds.group(name='node', parent=child, empty=True)
     
     cmds.group('|master|root_2|child_2|node', name='grandchild', parent='|master|root_2|child_2')
     cmds.group(name='node', parent='|master', empty=True)
     cmds.group(name='awesome_node', parent='|master', empty=True)
     cmds.group(name='node_awesome', parent='|master', empty=True)
     cmds.group(name='n0de', parent='|master', empty=True)
     cmds.polyCube(name='cube')
     cmds.parent('cube', '|master')
     cmds.sphere(name='sphere')
     cmds.parent('sphere', '|master')
     cmds.circle(name='circle')
     cmds.parent('|circle', '|master')
     cmds.projectCurve('|master|circle', '|master|sphere')
     cmds.namespace(add='awesome')
     cmds.pointLight(name='awesome:light')
     cmds.parent('|awesome:light', '|master')
开发者ID:jonntd,项目名称:banana.maya,代码行数:23,代码来源:test_MDagPath.py


示例15:

def	createSpherical4Arrowhead	():
	_controlled		=	cmds.ls		(	long	=	True,	selection	=	True	)
	_baseCurve		=	cmds.curve	( 	degree	=	1,	point	=	[	(0,1,1),(0,3,1),(0,3,2),(0,6,0),(0,3,-2),(0,3,-1),
										(0,1,-1),(0,1,-3),(0,2,-3),(0,0,-6),(0,-2,-3),(0,-1,-3),(0,-1,-1),(0,-3,-1),
										(0,-3,-2),(0,-6,0),(0,-3,2),(0,-3,1),(0,-1,1),(0,-1,3),(0,-2,3),(0,0,6),(0,2,3),
										(0,1,3),(0,1,1)	]	)
	_tempSphere		=	cmds.sphere	(	radius	=	7,	axis	=	(	0,	1,	0	),	sections	=	4,
										startSweep	=	270,	endSweep	=	90,	constructionHistory	=	0	)
	_control 		=	cmds.projectCurve	(	_baseCurve,	_tempSphere,
												constructionHistory	=	False,	direction	=	(	1,	0,	0	),	)
	_control		=	cmds.duplicateCurve	(	_control,	constructionHistory	=	True,	object	=	True	)
		
	cmds.delete		(	_tempSphere	)
	cmds.delete		(	_baseCurve	)
	
	postProcessControl	(	_control[0],	'rotate',	_controlled	)
开发者ID:danielforgacs,项目名称:code-dump,代码行数:16,代码来源:ford_riggingAid.py


示例16: test_create_node_and_compile

    def test_create_node_and_compile(self):
        mel.eval("source createRenderNode")
        test_void_input = cmds.shadingNode("test_void_input", asShader=True)
        test_void_output = cmds.shadingNode("test_void_output", asUtility=True)

        sphere = cmds.sphere()
        cmds.select(sphere, replace=True)
        node_sg = cmds.sets(renderable=True, noSurfaceShader=True, empty=True, name="test_void_inputSG1");
        cmds.defaultNavigation(connectToExisting=True, source=test_void_input, destination=node_sg)
        mel.eval('connectNodeToNodeOverride("%s", "%s")' % (test_void_input, node_sg))
        cmds.sets(edit=True, forceElement=node_sg)

        cmds.connectAttr(test_void_output + ".voidOutput", test_void_input + ".voidInput[0]", force=True)
        cmds.connectAttr(test_void_output + ".param3", test_void_input + ".param3", force=True)

        
        mel.eval("delightRender %s" % self.renderpass)
开发者ID:mjmvisser,项目名称:3deluxe,代码行数:17,代码来源:testvoid.py


示例17: createLimb

def createLimb(bones=1):
    xPos= 10
    #joints
    for i in range(0,bones,1):
        limbJnt = cmds.sphere(n='joint_'+str(i))
        cmds.move(i*xPos,0,0,limbJnt)
    #bones
    for i in range(0,bones-1,1):
        bone = cmds.polyCylinder(n='bone_'+str(i),height=10,radius=0.2)
        cmds.move(i*xPos + xPos/2,0,0,bone)
        cmds.rotate(0,0,-90,bone)
    #clusters
    cmds.select(clear=True)    
    for i in range(0,bones,1):
        jntCluster = cmds.cluster()
        cmds.move(i*xPos,0,0,jntCluster)
        cmds.select(clear=True)
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:17,代码来源:csCreateLimb.py


示例18: createCtlSys

def createCtlSys(nodeName, drvLocs, size=1, addGrp=1):
    '''
    Adds controls under drvLocs, to be used as offset controls
    size - [float] radius of nurbs sphere control
            if size=1, radius will be 0.2 of distance between first 2 locators
    addGrp - [int] number of offset grps above the control
    Returns ctlSysGrp, and a list of controls
    '''
    # calculate size
    pos1 = pm.dt.Point(mc.xform(drvLocs[0], q=True, ws=True, t=True))
    pos2 = pm.dt.Point(mc.xform(drvLocs[1], q=True, ws=True, t=True))
    vec = pos2 - pos1
    dist = vec.length()
    size = dist * 0.2 * size
    
    # create controls
    ctls = []
    for eachLoc in drvLocs:
        
        grp = eachLoc
        # add offset grps
        for grpId in range(addGrp):
            grp = mc.group(em=True, n=eachLoc.replace('_wireOffset_drvLoc', '_wireOffset_offset%d_grp'%grpId).replace('Orig',''), p=grp)
            mc.xform(grp, os=True, a=True, t=(0,0,0), ro=(0,0,0))
            
        # create control
        ctl = mc.sphere(r=size, n=eachLoc.replace('_wireOffset_drvLoc', '_wireOffset_ctl').replace('Orig',''))[0]
        mc.delete(ctl, ch=True)
        rt.parentSnap(ctl, grp)
        
        # assign color
        # first, break connection to shader
        ctlShape = mc.listRelatives(ctl, c=True, s=True)[0]
        shdConn = mc.listConnections(ctlShape+'.instObjGroups', p=True)[0]
        mc.disconnectAttr(ctlShape+'.instObjGroups', shdConn)
        # assign color override
        mc.setAttr(ctlShape+'.overrideEnabled', 1)
        mc.setAttr(ctlShape+'.overrideColor', 6)
        
        ctls.append(ctl)
    
    ctlSysGrp = mc.group(em=True, n=nodeName+'_wireOffset_ctlSys_grp')
    rt.connectVisibilityToggle(ctls, ctlSysGrp, 'ctlVis', True)
    
    return ctlSysGrp, ctls
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:45,代码来源:create.py


示例19: square

def square(x, y, size, offset):# top	 # right	 # bottom	 # left
    tmpAverage = avgElements([  queryArrayElement(x, y - size), queryArrayElement(x + size, y), queryArrayElement(x, y + size),  queryArrayElement(x - size, y) ]);
    editArrayElement(x, y, tmpAverage + offset);
    print 'square'
    s=cmds.sphere()
    cmds.scale(0.1,0.1,0.1)
    curPointPosition = cmds.xform( p[0]+".vtx[%d]"%(x + initSize * y), query=True, translation=True, worldSpace=True )
    cmds.move(curPointPosition[0],curPointPosition[1],curPointPosition[2]) 
      
    #select plane current corresponding edited plane vertex
    #cmds.xform(p[0]+".vtx[%d]"%(i) , translation=[x,y/40,z], worldSpace=True)
    
    #cmds.select(p[0]+".vtx[%d]"%(x + initSize * y))
    global initSize
    print x,y,initSize       
    print p[0]+".vtx[%d]"%(x + initSize * y)
    
    cmds.refresh()
    time.sleep(0.5)
开发者ID:yanioaioan,项目名称:DSTerrainGen,代码行数:19,代码来源:diamondSquaretestDEBUG2_SHOW-HowVertsAreSelectedPerLevel.py


示例20: sphereCtrl

    def sphereCtrl(self):

        """
        This procedure creates a coloured sphere
        
        """

        self.__buildName()

        if not self.controlName:
            return

        control = cmds.sphere(n=self.controlName)
        shape = cmds.listRelatives(control[0], s=1)
        cmds.disconnectAttr("%s.instObjGroups[0]" % shape[0], "initialShadingGroup.dagSetMembers[0]")

        self.control = control[0]

        self.__finaliseCtrl()
        common.colorize(self.color, nodeList=[self.control])
开发者ID:jbrodskytd,项目名称:anomalia,代码行数:20,代码来源:controls.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmds.symbolButton函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.spaceLocator函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap