Ejemplo n.º 1
0
def triangulateMesh(isObj, simplify, smoothe):
	if isObj and not cmds.objExists('triObj'):
		cmds.select(baseObject)
		cmds.duplicate(baseObject, name = "triObj")
		cmds.select('triObj')

		if smoothe:
			cmds.polySmooth('triObj', c=smoothe)
			cmds.polyReduce(ver = 1)
			cmds.polyReduce(ver = 1)

		if simplify > 0:
			cmds.polyReduce(ver = 1, p = simplify)

		num_faces = cmds.polyEvaluate('triObj', f=True)
		
		print "Triangulating faces..."
		#iterate over faces
		face_i = 0
		while face_i < num_faces:
			if ((num_faces - face_i) % 5 == 0):
				print "Triangulate check: Approximately " + str(num_faces - face_i) + " faces remaining...."
			face = cmds.select('triObj.f['+ str(face_i)+']')		
			verts = getCorners(isObj,face_i)
			if not isCoplanar(verts):
				cmds.polyTriangulate('triObj.f['+ str(face_i)+']')
				num_faces = cmds.polyEvaluate('triObj', f=True)
			face_i +=1
Ejemplo n.º 2
0
def mSmoothMesh(ves, subdivLevel):
	"""
	"""
	cmds.polySmooth(ves, mth= 0, sdt= 2, ovb= 1, ofb= 3, ofc= 0, ost= 1,
							ocr= 0, dv= subdivLevel, bnr= 1 ,c= 1, kb= 1, ksb= 1,
							khe= 0, kt= 1, kmb= 1, suv= 1, peh= 0, sl= 1,
							dpe= 1, ps= 0.1, ro= 1, ch= 0)
Ejemplo n.º 3
0
def smoothGeo(*args):
	'''
	Smooths the selected geometry
	'''
	# Get Division value.
	myDiv = cmds.intField("mecRigDiv", q=True, value=True)
	
	cmds.polySmooth( dv=myDiv )
Ejemplo n.º 4
0
	def smoothTool(self):
		X = self.getSelection()
		if self.getType(0) == 'face':
			cmds.polySubdivideFacet
			self.setAttributes( attrs = [ ('U', '.divisionsU') , ('V', '.divisionsV') ]  )
			self.Dragger(X, 'polySubdFace')
		elif self.getType(0) == 'mesh':
			print "can't use this for smoothing because t's tied to the more important pivot positioning tool."
			cmds.polySmooth(X, mth=1, dv=1, bnr=1,c=1, kb=1, ksb=1, khe=0, kt=1, kmb=0, suv=1, peh=0, sl=1, dpe=1, ps=0.1, ro=1, ch=1)
Ejemplo n.º 5
0
def proxyShape(myDiv=1):
	'''
	ProxyShape function is the main function for this script.
	- Select a poly object in the scene.
	- then call proxyShape.
	
	Arguments
	myDiv(int) == Divisions the proxy will be smoothed.
		- defaults to 1	
	'''
	
	# getShapeNodes of selected.
	selected = cmds.ls(sl=True)[0]
	sourceShape = cmds.ls(selected, shapes=True, dag=True)[0]
	
	# Create a mesh
	targShape = cmds.createNode('mesh')
	targObj = cmds.listRelatives( targShape, p=True )[0]
	
	
	
	'''
	# Selected position
	selPos = cmds.xform(selected, q=True, ws=True, piv=True ) 
	cmds.xform( targObj, ws=True, piv=selPos[0:3] )
	
	selTrans = cmds.xform(selected, q=True, ws=True, piv=True )
	cmds.xform( targObj, t=selTrans[0:3] )	
	'''
	# Connect the outMesh to the inMesh
	cmds.connectAttr( "%s.outMesh" %sourceShape, "%s.inMesh" %targShape )
	
	cmds.xform(targObj, cp=True)
	
	selTrans = cmds.xform(selected, q=True, ws=True, t=True )
	cmds.xform( targObj, t=selTrans[0:3] )	
	
	# Smooth (optional)
	cmds.polySmooth( targObj, dv=myDiv )
	
	
	
	# cmds.sets("initialShadingGroup", e=True, forceElement=True )
	cmds.sets(targObj, e=True, forceElement="initialShadingGroup")
	
	cmds.select(targObj, r=True )
	cmds.rename( targObj, selected + "_hRez" )
Ejemplo n.º 6
0
def tieOff():
	global balloonRadius, balloonQuantity
	knotVals = mc.pointPosition('balloonTemp.vtx[96]', w=True)
	knotThickness = balloonRadius * .05
	endHeight = balloonRadius * .15
	knotRadius = knotVals[0]
	knotPos = ( knotVals[1] - (.5 * knotThickness))

	mc.polyCylinder( n="knotTemp", r=knotRadius, h=knotThickness, sx=12, sy=3, sz=0, rcp=0, cuv=3)
	mc.delete( 'knotTemp.f[36:37]')
	mc.setAttr( 'knotTemp.translateY', knotPos )
	mc.scale(1.25, 1.75, 1.25, 'knotTemp.vtx[12:35]', r=True )
	mc.lattice( n='knot', cp=True,  dv =(2, 2, 2), objectCentered=True, ldv=(2,2,2))
	mc.move( (.75 * knotThickness), 'knotLattice.pt[1][0][0:1]', r=True, y=True)
	mc.move( (.25 * knotThickness), 'knotLattice.pt[0][0][0:1]', r=True, y=True)

	mc.duplicate('knotTemp')
	mc.rotate(180, 'knotTemp1', z=True)

	mc.polyCone( n="endTemp", r=knotRadius*2, h=endHeight, sx=12, sy=6, sz=3, rcp=0, cuv=3)
	mc.delete( 'endTemp.f[60:83]', 'endTemp.f[96:107]')
	mc.setAttr( 'endTemp.translateY', knotPos - knotThickness/2 )	
	mc.scale( 1.15, 1, 1.15, 'endTemp.vtx[36:59]') 
	mc.move((.5 * endHeight), 'endTemp.vtx[0:11]', 'endTemp.vtx[72]', y=True, r=True)
	mc.polyUnite( 'balloonTemp', 'knotTemp', 'knotTemp1', 'endTemp', ch=True )
	mc.polySoftEdge( a = 180 )
	mc.polyMergeVertex( d=.001)

	mc.polyEditUV('polySurface1.map[0:126]', pu=0.5, pv=1, su=1, sv=0.575)
	mc.polyEditUV('polySurface1.map[127:230]', pu=0.5, pv=0.35, su=2, sv=.25)
	mc.polyEditUV('polySurface1.map[267:318]', u=0, v=-0.1, pu=0.5, pv=0, su=1, sv=.5)
	mc.polyEditUV('polySurface1.map[231:266]', 'polySurface1.map[319]', u=0, v=-.175, pu=0.5, pv=0.25, su=0.25, sv=0.25)
	mc.polyMergeUV('polySurface1.map[103:126]', d=0.5, ch=True )
	mc.polyEditUV('polySurface1.map[104]',  r=False, u=0)
	mc.polyEditUV('polySurface1.map[103]', r=False, u=1)
	mc.polySmooth('polySurface1',  mth=0, dv=1, c=1, kb=0, ksb=1, khe=0, kt=1, kmb=0, suv=0, peh=0, sl=1, dpe=1, ps=0.1 , ro=1, ch=True)

	mc.DeleteHistory()
	mc.delete( 'knotTemp1')
	mc.rename('polySurface1', 'balloon1')
	mc.select(cl=True)
	return
Ejemplo n.º 7
0
def smooth_connectAttr(*args):	
	ploy_n=cmd.ls(selection=True)
	cmd.select(cl=True)
	if cmd.objExists("smooth_ctrl_G"):
		cmd.delete("smooth_ctrl_G")
	mel.eval("smoothRig")
	sm_ctrl="smooth_ctrl"
	sm_ctrl_G="smooth_ctrl_G"
	sm_ctrl_attr="smooth_ctrl.smooth"
	HeadJoint_n=cmd.textFieldButtonGrp("s_UI_tfbg1",query=True,text=True)
	moveCtrl_n=cmd.textFieldButtonGrp("s_UI_tfbg2",query=True,text=True)
	
	cmd.parentConstraint(HeadJoint_n,sm_ctrl_G,weight=1,mo=1)
	cmd.parent(sm_ctrl_G,moveCtrl_n)
	
	
	if (len(ploy_n)==0):
		print "请选择已经smooth模型"
	else:
		num=len(ploy_n)
		i=1
		for one in ploy_n:
			str_num=str(num)
			str_i=str(i)
			polySmooth_n=cmd.polySmooth(one,mth=0,dv=1,bnr=1,c=1,kb=1,ksb=1,khe=0,kt=1,kmb=1,suv=1,peh=0,sl=1,dpe=1,ps=0.1,ro=1,ch=1)
			smooth_attr1=polySmooth_n[0]+".continuity"
			smooth_attr2=polySmooth_n[0]+".divisions"
			cmd.connectAttr(sm_ctrl_attr,smooth_attr1)
			cmd.connectAttr(sm_ctrl_attr,smooth_attr2)
			print("////完成smooth关联 "+str_i+" 个,共 "+str_num + " 个")
			i=i+1
		
	cmd.setAttr((sm_ctrl+".tx"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".ty"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".tz"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".rx"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".ry"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".rz"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".sx"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".sy"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".sz"),lock=True,keyable=False,channelBox=False)
	cmd.setAttr((sm_ctrl+".v"),lock=True,keyable=False,channelBox=False)
	mel.eval('setAttr -keyable false -channelBox true "smooth_ctrl.smooth";')
	
	cmd.select(cl=True)
	print"///////完成工作"
Ejemplo n.º 8
0
    def createSmoothNodes(self):
        rendertime = self.rendertime_checkBox.checkState()
        if not rendertime == 2:
            for asset in self.label:
                index = self.label.index(asset)
                val = self.spinbox[index].value()

                if not val == 0:
                    if cmds.objExists("%s:Rig_Grp.smooth" % asset.text()):
                        smoothedMesh = []
                        smoothNode = cmds.listConnections("%s:Rig_Grp.smooth" % asset.text(), s=False, d=True, type="polySmoothFace")
                        if smoothNode:
                            for node in smoothNode:
                                meshSmoothed = cmds.listConnections("%s.output" % node, s=False, d=True, type="mesh")[0]
                                smoothedMesh.append(meshSmoothed)

                        mesh = cmds.ls("%s:mesh_*" % asset.text(), l=True, type="transform")
                        for m in mesh:
                            if cmds.objectType(m, isType='transform') == 1:
                                if not m.rsplit("|",1)[-1] in smoothedMesh:
                                    smoothNode = cmds.polySmooth(m, mth=0, bnr=1, c=1, kb=1, ksb=1, kt=1, kmb=1, suv=1, peh=1, sl=1, ps=0.1, ro=1, ch=1)[0]
                                    cmds.connectAttr("%s:Rig_Grp.smooth" % asset.text(), "%s.divisions" % smoothNode )
 def ApplySmooth(self):
     cmds.displaySmoothness(divisionsU = 0, divisionsV = 0, pointsWire = 4, pointsShaded = 1, polygonObject = 1)
     
     for mesh in cmds.listRelatives(cmds.getAttr("CMSettings.ModelName"), allDescendents = True, type = "mesh"):
         #If the mesh is an intermediate object ignore it
         try:
             if cmds.getAttr( mesh + ".intermediateObject"):
                 continue;
         except:
             pass
         
         #Try to delete smooth on the current mesh
         try:
             cmds.setAttr(mesh + "Smooth.divisions", 0)
             cmds.delete(mesh + "Smooth")
         except:pass
         
         #Try to apply smooth on the mesh
         try:
             Smooth = cmds.polySmooth(mesh, dv = 0)
             cmds.rename(Smooth, mesh+"Smooth")
         except:pass
Ejemplo n.º 10
0
 def createArcAnimation(self, baseCurve, arcCurveGroup, translate, rotate, scale, rotateWire, dropoff):
     
     mesh = cmds.polyPlane(n="arcSystem_"+baseCurve[0]+"_card", w=24, h=24, sx=4, sy=20)[0]
     cmds.delete(ch = True)
     
     # create new curve and hide it
     wireMeshCurve = cmds.curve(d=3, p=[(0, 0, -12), (0, 0, -6), (0, 0, 0), (0, 0, 6), (0, 0, 12)])
     cmds.setAttr(wireMeshCurve+".v", False)
     
     # rebuild curve
     cmds.rebuildCurve(wireMeshCurve, baseCurve, ch=1, rpo=1, rt=2, end=1, kr=0, kcp=0, kep=1, kt=0, s=26, d=3, tol = 0.01)
     cmds.select(mesh, r=True)
     # smooth the mesh
     smooth = cmds.polySmooth(dv=0)
     cmds.select(mesh, r=True)
     
     # create wire of the mesh on the new curve
     wire = cmds.wire(mesh, gw=True, en=1.0, ce=0.0, li=0.0, w=wireMeshCurve)
     cmds.pickWalk(d="up")
     wireGroup = cmds.ls(sl=True)
     # parent to the spiral curve
     cmds.parent(wireGroup, arcCurveGroup)
     # set wire values
     cmds.setAttr(wire[0]+".dropoffDistance[0]", dropoff)
     cmds.setAttr(wire[0]+".rotation", rotateWire)
     
     # create blendshape of the new curve on the base curve
     blendshape = cmds.blendShape(baseCurve, wireMeshCurve)
     cmds.setAttr(blendshape[0]+"."+baseCurve[0], 1)
     
     # tranform a bit the mesh
     cmds.setAttr(mesh+".tz", translate[0])
     cmds.setAttr(mesh+".rz", rotate[0])
     cmds.setAttr(mesh+".sz", scale[0])
     
     return mesh, blendshape, wireMeshCurve, smooth
Ejemplo n.º 11
0
 def modelLeftArm(self):
     cmds.polyCube(name="leftArm", w=2, h=0.25)
     cmds.scale(0.3, z=True)
     cmds.move(1.3, 9, 0)
     cmds.polySmooth('leftArm.f[0:5]', dv=1)
Ejemplo n.º 12
0
 def modelRightArm(self):
     cmds.polyCube(name="rightArm", w=2, h=0.25)
     cmds.scale(0.3, z=True)
     cmds.move(-1.3, 9, 0)
     cmds.polySmooth('rightArm.f[0:5]', dv=1)
Ejemplo n.º 13
0
def Chaise():

    Chaisewidthz = cmds.intSliderGrp(slider4, q=True, value=True)
    ChaiseWidthx = cmds.intSliderGrp(slider5, q=True, value=True)
    ChaiseHeight = cmds.intSliderGrp(slider6, q=True, value=True)
    Distance = cmds.intSliderGrp(slider7, q=True, value=True)

    #mesa
    cmds.polyCube(h=1, w=ChaiseWidthx, depth=Chaisewidthz, n='Chaise')
    cmds.move(0, ChaiseHeight / 2.0 - 0.3, 0)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)

    #patas

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata1')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, -4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata2')
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, 4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata3')
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, 4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata4')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, -4)
    cmds.polyBevel(offset=0.1)

    #espaldar

    cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5, n='Espaldar_1')
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, Chaisewidthz / 2.0 - 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5, n='Espaldar_2')
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, -Chaisewidthz / 2.0 + 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=2.5, w=1, depth=Chaisewidthz, n='Espaldar_3')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, ChaiseHeight * 1.4, 0)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)
    cmds.group('Chaise',
               'pata1',
               'pata2',
               'pata3',
               'pata4',
               'Espaldar_1',
               'Espaldar_2',
               'Espaldar_3',
               n='Chaise1')

    cmds.select('Chaise1')
    cmds.move(Distance, -1, 0)
    cmds.duplicate('Chaise1')
    cmds.move(-Distance, -1, 0)
    cmds.rotate(0, -180, 0)

    cmds.select('Chaise1')
    cmds.duplicate('Chaise1')
    cmds.move(0, -1, -Distance)
    cmds.rotate(0, 90, 0)

    cmds.select('Chaise1')
    cmds.duplicate('Chaise1')
    cmds.move(0, -1, Distance)
    cmds.rotate(0, -90, 0)
Ejemplo n.º 14
0
def chair():

    Chaisewidthz = cmds.intSliderGrp(slider4, q=True, value=True)
    ChaiseWidthx = cmds.intSliderGrp(slider5, q=True, value=True)
    ChaiseHeight = cmds.intSliderGrp(slider6, q=True, value=True)
    Distance = cmds.intSliderGrp(slider7, q=True, value=True)

    #silla
    mainC = cmds.polyCube(h=1, w=ChaiseWidthx, depth=Chaisewidthz)
    cmds.move(0, ChaiseHeight / 2.0 - 0.3, 0)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)

    #patas

    pataUno = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, -4)
    cmds.polyBevel(offset=0.1)

    pataDos = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, 4)
    cmds.polyBevel(offset=0.1)

    pataTres = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, 4)
    cmds.polyBevel(offset=0.1)

    pataCuatro = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, -4)
    cmds.polyBevel(offset=0.1)

    #espaldar

    e_uno = cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5)
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, Chaisewidthz / 2.0 - 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    e_dos = cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5)
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, -Chaisewidthz / 2.0 + 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    e_tres = cmds.polyCube(h=2.5, w=1, depth=Chaisewidthz)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, ChaiseHeight * 1.4, 0)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)
    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    rName = 'Chair' + str(mir) + str(crazyR)
    cmds.group(mainC,
               pataUno,
               pataDos,
               pataTres,
               pataCuatro,
               e_uno,
               e_dos,
               e_tres,
               n=rName)
Ejemplo n.º 15
0
def tableChaise():

    tablewidthz = cmds.intSliderGrp(slider1, q=True, value=True)
    tableWidthx = cmds.intSliderGrp(slider2, q=True, value=True)
    tableHeight = cmds.intSliderGrp(slider3, q=True, value=True)
    #Roundness = cmds.intSliderGrp(slider4, q=True, value=True)

    #mesa
    table = cmds.polyCube(h=0.7, w=tableWidthx, depth=tablewidthz)
    rtable = cmds.ls(table[0])
    print(rtable)
    cmds.move(0, tableHeight / 2.0 - 0.3, 0)
    cmds.select(str(rtable[0]) + '.e[4:5]')
    cmds.select(str(rtable[0]) + '.e[8:9]', add=True)
    # cmds.select('table.e[4:5]')
    # cmds.select('table.e[8:9]', add=True)
    cmds.polyBevel3(offset=1, segments=3)
    cmds.polyBevel3(rtable[0], offset=0.1)

    #patas

    pataUno = cmds.polyCube(h=tableHeight, w=1, depth=1)
    cmds.move(-tableWidthx / 2.0 + 1, 0, tablewidthz / 2.0 - 1)
    cmds.polyBevel(offset=0.1)

    pataDos = cmds.polyCube(h=tableHeight, w=1, depth=1)
    cmds.move(tableWidthx / 2.0 - 1, 0, tablewidthz / 2.0 - 1)
    cmds.polyBevel(offset=0.1)

    pataTres = cmds.polyCube(h=tableHeight, w=1, depth=1)
    cmds.move(tableWidthx / 2.0 - 1, 0, -tablewidthz / 2.0 + 1)
    cmds.polyBevel(offset=0.1)

    pataCuatro = cmds.polyCube(h=tableHeight, w=1, depth=1)
    cmds.move(-tableWidthx / 2.0 + 1, 0, -tablewidthz / 2.0 + 1)
    cmds.polyBevel(offset=0.1)
    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    tName = 'Table' + str(mir) + str(crazyR)
    cmds.group(table, pataUno, pataDos, pataTres, pataCuatro, n=tName)

    Chaisewidthz = cmds.intSliderGrp(slider4, q=True, value=True)
    ChaiseWidthx = cmds.intSliderGrp(slider5, q=True, value=True)
    ChaiseHeight = cmds.intSliderGrp(slider6, q=True, value=True)
    Distance = cmds.intSliderGrp(slider7, q=True, value=True)

    mainC = cmds.polyCube(h=1, w=ChaiseWidthx, depth=Chaisewidthz)
    cmds.move(0, ChaiseHeight / 2.0 - 0.3, 0)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)

    #patas

    pataUno = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, -4)
    cmds.polyBevel(offset=0.1)

    pataDos = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, 4)
    cmds.polyBevel(offset=0.1)

    pataTres = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, 4)
    cmds.polyBevel(offset=0.1)

    pataCuatro = cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, -4)
    cmds.polyBevel(offset=0.1)

    #espaldar

    e_uno = cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5)
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, Chaisewidthz / 2.0 - 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    e_dos = cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5)
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, -Chaisewidthz / 2.0 + 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    e_tres = cmds.polyCube(h=2.5, w=1, depth=Chaisewidthz)
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, ChaiseHeight * 1.4, 0)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)
    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    rName = 'Chair' + str(mir) + str(crazyR)
    cmds.group(mainC,
               pataUno,
               pataDos,
               pataTres,
               pataCuatro,
               e_uno,
               e_dos,
               e_tres,
               n=rName)

    cmds.select(rName)
    cmds.move(Distance, -1, 0)
    cmds.duplicate(rName)
    cmds.move(-Distance, -1, 0)
    cmds.rotate(0, -180, 0)

    cmds.select(rName)
    cmds.duplicate(rName)
    cmds.move(0, -1, -Distance)
    cmds.rotate(0, 90, 0)

    cmds.select(rName)
    cmds.duplicate(rName)
    cmds.move(0, -1, Distance)
    cmds.rotate(0, -90, 0)
Ejemplo n.º 16
0
    def reshapeD(*pArgs):
        name = cmds.textField(fileName, q=True, text=True)
        if len(name) > 0:
            try:
                '''The returned amount for smoothing and strength modifier'''
                smooth = cmds.intSliderGrp(smoothSlider, q=True, value=True)
                strength = cmds.intSliderGrp(
                    strengthSlider, q=True, value=True) + 1
                if (smooth > 0):
                    cmds.polySmooth(selection, dv=smooth + 1)
                if (strength == 0):
                    strength = .5
                '''The number of vertices in the selected object'''
                numOfVertex = cmds.polyEvaluate(v=True)
                print('The number of vertices for ' + str(selection[0]) +
                      ' is ' + str(numOfVertex))
                cmds.delete(ch=True)
                '''For each vertex'''
                for i in range(numOfVertex):
                    '''defines the vertex'''
                    vertex = cmds.ls(str(selection[0]) + '.vtx[' + str(i) +
                                     ']',
                                     fl=1)
                    print('Current vertex: ' + str(vertex))
                    '''The location/coordinates of the vertex'''
                    vertexLocation = cmds.pointPosition(vertex)
                    x = vertexLocation[0]
                    y = vertexLocation[1]
                    z = vertexLocation[2]
                    #print('X: '+ str(x))
                    #print('Y: '+ str(y))
                    #print('Z: '+ str(z))
                    '''The UV value of the specific vertex'''
                    UVValues = cmds.polyEditUV(
                        cmds.polyListComponentConversion(vertex, toUV=True)[0],
                        query=True)
                    #print('The UV location ' + str(UVValues))
                    '''Color for the height map of the found vertex'''
                    color = 0
                    color = cmds.colorAtPoint(name,
                                              u=UVValues[0],
                                              v=UVValues[1])
                    #print('color: '+str(color[0]))
                    #print(x+color[0])
                    #print(y+color[0])
                    #print(z+color[0])
                    '''Adjusts the location of the vertex based on the heighmap color 0-1'''
                    cmds.polyMoveVertex(
                        vertex,
                        translate=(x + (x * color[0] * strength),
                                   y + (y * color[0] * strength),
                                   z + (z * color[0] * strength)))
                    #print('.........')
                '''Deletes the history and deletes the UI menu'''
                cmds.delete(ch=True)
                cmds.deleteUI(HeightWindow)

            except:
                cmds.deleteUI(HeightWindow)
                cmds.confirmDialog(
                    title='Incorrect File Name',
                    message='The file name for the material is incorrect',
                    button=['Ok'])
Ejemplo n.º 17
0
def smth(*args):
	div = cmds.intField("smoothField", q=True, v=True)
	selected = cmds.ls(sl=True)
	for sel in selected:
		cmds.polySmooth(sel, dv=div, ksb=1)
Ejemplo n.º 18
0
def polySmooth(*args, **kwargs):
    res = cmds.polySmooth(*args, **kwargs)
    if not kwargs.get('query', kwargs.get('q', False)):
        res = _factories.maybeConvert(res, _general.PyNode)
    return res
Ejemplo n.º 19
0
    def createCollider (self, *arg):
        
        
        
        objList = cmds.ls(sl=1)
        if objList == []:
            cmds.warning('Please select an object')
        
        self.createShader()

        if cmds.objExists('sim_GRP') == 0:
            cmds.group(em=1, name='sim_GRP')

        smoothDiv = cmds.optionMenu(self.smoothMenu, q=1, v=1)
        
        for obj in objList :
            if ':' in obj:newObj=obj.split(':')[-1]
            else: newObj=obj
            choosenNucleus = cmds.optionMenu(self.nucleusMenu, q=1, v=1) 
            
            objColGrp = cmds.group(empty = 1, name = '{}_collider_GRP'.format(obj), parent = 'sim_GRP')
            colObj = cmds.duplicate(obj, name = '{}_collider'.format(obj))
            self.assignShader(colObj)
            cmds.parent(colObj, objColGrp)
            cmds.setAttr(obj+'.visibility', 0)      
            blendShapeName = '{}_blendShape'.format(obj)
            cmds.blendShape(obj, colObj, origin='world', name=blendShapeName )
            cmds.setAttr(blendShapeName+'.'+ newObj, 1)
            cmds.polySmooth(colObj, dv=int(smoothDiv))
            nRigidShape = mel.eval('makeCollideNCloth;')
            nRigidNode = cmds.listRelatives(nRigidShape, parent=1)
            nRigidNode = cmds.rename(nRigidNode, '{}_nRigid'.format(obj))
            cmds.parent(nRigidNode, objColGrp)
            cmds.select(colObj, replace=1)
            
            self.guffCollider()
            cmds.select(nRigidNode, replace=1)
            if choosenNucleus == 'New solver' and self.nucleusList != []:
                nucleusName = cmds.textFieldGrp(self.nucleusNameField, q=1, text=1)
                nucleusNode = cmds.createNode('nucleus', n=nucleusName)
                cmds.select(nRigidNode)
                cmds.connectAttr('time1.outTime', nucleusNode + '.currentTime') 
                mel.eval('assignNSolver {};'.format(nucleusNode))
                self.addNucleusNode(nucleusNode)
                self.assignNucleusParam(nucleusNode)
                self.startFrame(nucleusNode)
            elif choosenNucleus == 'New solver' and self.nucleusList == []:
                nucleusName = cmds.textFieldGrp(self.nucleusNameField, q=1, text=1)
                if nucleusName != '':
                    nucleusNode = cmds.createNode('nucleus', n=nucleusName)
                    cmds.select(nRigidNode)
                    cmds.connectAttr('time1.outTime', nucleusNode + '.currentTime') 
                    mel.eval('assignNSolver {};'.format(nucleusNode))
                    cmds.delete('nucleus1')
                    self.addNucleusNode(nucleusNode)
                    self.assignNucleusParam(nucleusNode)
                    self.startFrame(nucleusNode)
                else:
                    self.addNucleusNode('nucleus1')
                    self.assignNucleusParam('nucleus1')
                    self.startFrame('nucleus1')
            else:
                mel.eval('assignNSolver {};'.format(choosenNucleus))
Ejemplo n.º 20
0
def smoothPoly():

    divVal = cmds.intField("sDivsVal", q=True, value=True)
    cmds.polySmooth(dv=divVal, oc=True)
Ejemplo n.º 21
0
def runBed():

    # matela_Widthx = 12
    # matela_widthz = 8
    # matela_Height = 2
    # lit_extrude_y = 0.8
    # lit_extrude_Z = 0.85
    matela_Widthx = cmds.intSliderGrp(slider1, q=True, value=True)
    matela_widthz = cmds.intSliderGrp(slider2, q=True, value=True)
    matela_Height = cmds.intSliderGrp(slider3, q=True, value=True)
    lit_extrude_y = cmds.floatSliderGrp(slider4, q=True, value=True)
    lit_extrude_Z = cmds.floatSliderGrp(slider5, q=True, value=True)
    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    gName = 'lit_complete' + str(mir) + str(crazyR)
    cmds.group(n=gName, em=True)

    #matelas
    matela = cmds.polyCube(h=matela_Height,
                           w=matela_Widthx,
                           depth=matela_widthz)
    cmds.polyBevel3(matela, offset=0.1)
    cmds.polySmooth(matela, divisions=3)
    cmds.parent(matela, gName, relative=True)

    #laterales
    lateralUno = cmds.polyCube(h=matela_Height, w=matela_Widthx, depth=0.4)
    cmds.move(0, -matela_Height / 2.0, -matela_widthz / 2.0)
    lateralInstance = cmds.instance(lateralUno)
    cmds.move(0, -matela_Height / 2.0, matela_widthz / 2.0)
    cmds.polyBevel3(offset=0.05)
    cmds.parent(lateralUno, gName, relative=True)
    cmds.parent(lateralInstance, gName, relative=True)

    #tete
    tete = cmds.polyCube(h=matela_Height * 2.0, w=0.5, depth=matela_widthz)
    cmds.move(-matela_Widthx / 2.0, 0, 0)
    rtete = cmds.ls(tete)
    cmds.polyExtrudeFacet(str(rtete[0]) + '.f[4]',
                          kft=False,
                          ls=(lit_extrude_Z, lit_extrude_y, 0))
    cmds.polyExtrudeFacet(str(rtete[0]) + '.f[4]', kft=False, ltz=-0.2)
    cmds.polyBevel3(offset=0.05)
    cmds.parent(tete, gName, relative=True)

    #pieds
    pied = cmds.polyCube(h=matela_Height, w=0.4, depth=matela_widthz)
    cmds.move(matela_Widthx / 2.0, -matela_Height / 2.0, 0)
    rpied = cmds.ls(pied)
    cmds.polyExtrudeFacet(str(rpied[0]) + '.f[4]',
                          kft=False,
                          ls=(lit_extrude_Z, lit_extrude_y - 0.2, 0))
    cmds.polyExtrudeFacet(str(rpied[0]) + '.f[4]', kft=False, ltz=-0.2)
    cmds.polyBevel3(offset=0.05)
    cmds.parent(pied, gName, relative=True)

    #coussin

    coussin = cmds.polyCube(h=0.7,
                            w=matela_widthz / 3.0,
                            depth=matela_widthz / 2.0)
    cmds.move(-matela_Widthx / 2.0 + 1.8, (matela_Height / 2.0) + 0.1,
              (matela_widthz / 2.0) / 2.0)
    cmds.polyBevel3(offset=0.3)
    cmds.polySmooth(divisions=2)
    coussinInstance = cmds.instance(coussin)
    cmds.move(-matela_Widthx / 2.0 + 1.8, (matela_Height / 2.0) + 0.1,
              (-matela_widthz / 2.0) / 2.0)
    cmds.parent(coussin, gName, relative=True)
    cmds.parent(coussinInstance, gName, relative=True)
Ejemplo n.º 22
0
import maya.cmds as cmds
import random

selected_items = cmds.ls(selection=True)
if selected_items:
    shapes = cmds.listRelatives(selected_items[0], shapes=True)

for shape in shapes:

    smoothnode = cmds.polySmooth(shape)
    cmds.polyBevel(shape, offset=0.040, worldSpace=True)

    vertexPositionList = cmds.getAttr(shape + ".vrts", multiIndices=True)
    for i in vertexPositionList:
        if random.random() > 0.8:
            brick = cmds.polyCube(w=0.2 + (random.random() * 0.4),
                                  h=0.3,
                                  d=0.2 + (random.random() * 0.4))
            vtxPos = cmds.xform(str(shape) + ".pnts[" + str(i) + "]",
                                query=True,
                                translation=True,
                                worldSpace=True)
            cmds.move(vtxPos[0] + (random.random() - 0.5) * 0.1,
                      vtxPos[1] + (random.random() - 0.5) * 0.05,
                      vtxPos[2] + (random.random() - 0.5) * 0.1,
                      brick,
                      absolute=True)
            cmds.rotate((random.random() - 0.5) * 5.0,
                        (random.random() - 0.5) * 5.0,
                        (random.random() - 0.5) * 5.0, brick)
Ejemplo n.º 23
0
    def createPine(self, p_depth,  # tree depth,
                   p_length, p_length_inc, p_r, p_rate,
                   p_l,  # last segment tip
                   p_ll,  # last segment base
                   branch_turn, branch_shift,
                   polygons, num_branches, branch_ang, foliage_sze, foliage_res, turn, branch, foliage_num, foliage_spr,
                   first_segment_l, pine_level, branch_chance, angle_chance, turn_chance, turn_amount, angle_amount):
        if p_depth > 0:
            branch_length = p_length * first_segment_l
            lv = [p_l[0] - p_ll[0], p_l[1] - p_ll[1], p_l[2] - p_ll[2]]
            m = math.sqrt(math.pow(lv[0], 2) + math.pow(lv[1], 2) + math.pow(lv[2], 2))
            u = [lv[0] / m, lv[1] / m, lv[2] / m]
            v = [lv[0] + p_ll[0] + (u[0] * branch_length), lv[1] + p_ll[1] + (u[1] * branch_length),
                 lv[2] + p_ll[2] + (u[2] * branch_length)]
            if pine_level == 3 or pine_level == 2:
                newP = [p_l[0] + 0.1, p_l[1], p_l[2]]
                p = self.get_sp_point(p_l, p_ll, newP)
                points = self.point_rotate_3d(p[0], p[1], p[2],
                                         newP[0], newP[1], newP[2],
                                         v[0], v[1], v[2],
                                         branch_turn)
                yTurn = self.point_rotate_3d(p_l[0], p_l[1], p_l[2],
                                        v[0], v[1], v[2],
                                        points[0], points[1], points[2],
                                        branch_shift)

                p_n = yTurn
            else:
                p_n = v

            self.polytube(
                p_l[0], p_l[1], p_l[2],  # base point
                p_n[0], p_n[1], p_n[2],  # top point
                p_ll[0], p_ll[1], p_ll[2],
                p_r, p_r * p_rate,  # base and top radius
                polygons)
            p_length = (p_length * p_length_inc)
            p_r = p_r * p_rate
            p_depth = p_depth - 1.0
            if pine_level == 1:
                self.createPine(p_depth, p_length, p_length_inc, p_r, p_rate,
                           p_n,
                           p_l,
                           branch_turn, branch_shift,
                           polygons, num_branches, branch_ang,
                           foliage_sze, foliage_res, turn, branch, foliage_num, foliage_spr, 1, 1, branch_chance,
                           angle_chance, turn_chance, turn_amount, angle_amount)
            c = 0
            if p_depth > 0:
                branch_turn = branch_ang
                turn = turn + math.pi / 2.0
                for i in range(0, num_branches):
                    branch = True
                    p_length = p_length + random.uniform(-0.5, 0.5)
                    if random.uniform(0, 1) < turn_chance:
                        turn = turn + random.uniform(-turn_amount, turn_amount)
                    if random.uniform(0, 1) < angle_chance:
                        branch_turn = branch_turn + random.uniform(-angle_amount, angle_amount)
                    if random.uniform(0, 1) < 1.0 - branch_chance:
                        branch = False
                        c = c + 1
                    branch_shift = (i * ((math.pi * 2.0) / num_branches)) + turn
                    if branch:
                        self.createPine(p_depth * 0.5, p_length * 0.7, p_length_inc, p_r, p_rate,
                                   p_n,
                                   p_l,
                                   branch_turn, branch_shift,
                                   polygons, num_branches, branch_ang,
                                   foliage_sze, foliage_res, turn, branch, foliage_num, foliage_spr, 1, 2,
                                   branch_chance,
                                   angle_chance, turn_chance, turn_amount, angle_amount)

            if c == num_branches or p_depth <= 0:
                randx = []
                randy = []
                randz = []
                for r in range(0, 20):
                    randx.append(random.uniform(-foliage_spr, foliage_spr))
                    randy.append(random.uniform(-foliage_spr, foliage_spr))
                    randz.append(random.uniform(-foliage_spr, foliage_spr))
                for j in range(0, foliage_num):
                    my_sphere = cmds.polyPlatonicSolid(l=foliage_sze, name='leaves#')
                    for i in range(0, foliage_res):
                        cmds.polySmooth(my_sphere)
                    cmds.move(p_n[0] + randx[j],
                              p_n[1] + randy[j],
                              p_n[2] + randz[j], my_sphere)
Ejemplo n.º 24
0
 def modelRightLeg(self):
     cmds.polyCube(name="rightLeg", w=0.3, h=3.5)
     cmds.scale(0.3, z=True)
     cmds.move(0.3, 6, 0)
     cmds.polySmooth('rightLeg.f[0:5]', dv=1)
Ejemplo n.º 25
0
 def generate(self, nombre, headVal, bodyVal, leftArmVal, rightArmVal, leftLegVal, rightLegVal):
 #model head:
     headName = 'head' + randomNaming
     cmds.polyCube(name=headName,d = headVal, h = headVal, w = headVal)
     cmds.move(10, y=True)
     cmds.polySmooth( headName + '.f[0:5]', dv=headVal )
 #model body:
     bodyName = 'body' + randomNaming
     bodyJ1 = 'bodyJ1' + randomNaming
     bodyJ2 = 'bodyJ2' + randomNaming
     bodyJ3 = 'bodyJ3' + randomNaming
     cmds.polyCube(name=bodyName, w = bodyVal, h = bodyVal*3, d= bodyVal)
     cmds.move(8, y=True)
     cmds.polySmooth( bodyName+'.f[0:5]', dv=bodyVal )
     cmds.select( d=True )
     cmds.joint(n=bodyJ1, p=(0, 9, 0) )
     cmds.joint(n=bodyJ2, p=(0, 8, 0) )
     cmds.joint(n=bodyJ3, p=(0, 7, 0) )
     cmds.ikHandle( sj=bodyJ1, ee=bodyJ3)
     cmds.bindSkin( bodyName, bodyJ1)
 #model leftArm:
     leftArm = 'leftArm' + randomNaming
     leftArmJ = 'leftArmJ' + randomNaming
     leftElbowJ = 'leftElbowJ'+randomNaming
     leftWristJ = 'leftWristJ'+randomNaming
     cmds.polyCube(name=leftArm, w = leftArmVal*2, h = leftArmVal*0.25, d = leftArmVal)
     cmds.scale(0.3, z = True)
     cmds.move(1,8.5,0)
     cmds.xform(r= True, ro=(0, 0, -45) )
     cmds.polySmooth( leftArm+'.f[0:5]', dv=leftArmVal )
     cmds.select( d=True )
     cmds.joint(n=leftArmJ, p=(0.5, 9, 0) )
     cmds.joint(n=leftElbowJ, p=(1, 8.5, 0) )
     cmds.joint(n=leftWristJ, p=(1.5, 8, 0) )
     cmds.ikHandle( sj=leftArmJ, ee=leftWristJ)
     cmds.bindSkin( leftArm, leftArmJ)
 #model rightArm:
     rightArm = 'rightArm' + randomNaming
     rightArmJ = 'rightArmJ'+ randomNaming
     rightElbowJ = 'rightElbowJ'+randomNaming
     rightWristJ = 'rightWristJ'+randomNaming
     cmds.polyCube(name=rightArm, w =rightArmVal*2, h = rightArmVal*0.25, d = rightArmVal)
     cmds.scale(0.3, z = True)
     cmds.move(-1,8.5,0)
     cmds.xform(r= True, ro=(0, 0, 45) )
     cmds.polySmooth( rightArm + '.f[0:5]', dv=rightArmVal )
     cmds.select( d=True )
     cmds.joint(n=rightArmJ, p=(-0.5, 9, 0) )
     cmds.joint(n=rightElbowJ, p=(-1, 8.5, 0) )
     cmds.joint(n=rightWristJ, p=(-1.5, 8, 0) )
     cmds.ikHandle( sj=rightArmJ, ee=rightWristJ)
     cmds.bindSkin( rightArm, rightArmJ)
 #model leftLeg:
     leftLeg = 'leftLeg' + randomNaming
     leftLegJ = 'leftLegJ' + randomNaming
     leftLegKneeJ = 'leftLegKneeJ'+randomNaming
     leftLegCalvesJ = 'leftLegCalvesJ' +randomNaming
     cmds.polyCube(name=leftLeg, w =leftLegVal*0.3, h = leftLegVal*3.5, d = leftLegVal)
     cmds.scale(0.3, z = True)
     cmds.move(-0.3,6,0)
     cmds.polySmooth( leftLeg + '.f[0:5]', dv=leftLegVal )
     cmds.select( d=True )
     cmds.joint(n=leftLegJ, p=(-0.3, 7, 0) )
     cmds.joint(n=leftLegKneeJ, p=(-0.3, 6, 0) )
     cmds.joint(n=leftLegCalvesJ, p=(-0.3, 5, 0) )
     cmds.ikHandle( sj=leftLegJ, ee=leftLegCalvesJ)
     cmds.bindSkin( leftLeg, leftLegJ)
 #model rightLeg:
     rightLeg = 'rightLeg' + randomNaming
     rightLegJ = 'rightLegJ'+ randomNaming
     rightLegKneeJ = 'rightLegKneeJ'+randomNaming
     rightLegCalvesJ = 'rightLegCalvesJ'+randomNaming
     cmds.polyCube(name=rightLeg, w = rightLegVal*0.3, h = rightLegVal*3.5, d = rightLegVal)
     cmds.scale(0.3, z = True)
     cmds.move(0.3,6,0)
     cmds.polySmooth( rightLeg +'.f[0:5]', dv=rightLegVal )
     cmds.select( d=True )
     cmds.joint(n=rightLegJ, p=(0.3, 7, 0) )
     cmds.joint(n=rightLegKneeJ, p=(0.3, 6, 0) )
     cmds.joint(n=rightLegCalvesJ, p=(0.3, 5, 0) )
     cmds.ikHandle( sj=rightLegJ, ee=rightLegCalvesJ)
     cmds.bindSkin( rightLeg, rightLegJ)
 #group everything:
     cmds.group(headName, bodyName, leftArm, rightArm, leftLeg, rightLeg, n=nombre)
Ejemplo n.º 26
0
 def modelTete(self):
     cmds.polyCube(name="tete")
     cmds.move(10, y=True)
     cmds.polySmooth('tete.f[0:5]', dv=1)
Ejemplo n.º 27
0
def lamp():

    # height_lamp = 10
    # radius_lamp = 4
    # Thickness_lamp = 0.1
    height_lamp = cmds.intSliderGrp(slider1, q=True, value=True)
    radius_lamp = cmds.intSliderGrp(slider2, q=True, value=True)
    Thickness_lamp = cmds.floatSliderGrp(slider3, q=True, value=True)
    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    topLamp = 'TOP_LAMP' + str(mir) + str(crazyR)
    lamp = 'LAMP' + str(mir) + str(crazyR)
    cmds.group(n=topLamp, em=True)
    cmds.group(n=lamp, em=True)

    # TOP_LAMP
    tLamp = cmds.polyPipe(h=height_lamp,
                          r=radius_lamp,
                          thickness=Thickness_lamp,
                          sh=10,
                          sa=40)

    soporteCentroArriba = cmds.polyCylinder(r=radius_lamp / 3.0, h=0.30)

    traversoCentro = cmds.polyCylinder(r=0.08,
                                       h=(radius_lamp * 2.0) - Thickness_lamp)
    cmds.rotate(0, 0, '90deg', r=True)
    traversoCentroD = cmds.duplicate(traversoCentro)
    cmds.rotate(0, '90deg', 0, r=True)

    cmds.parent(tLamp,
                soporteCentroArriba,
                traversoCentro,
                traversoCentroD,
                topLamp,
                relative=True)

    cmds.select(topLamp)
    cmds.move(0, height_lamp / 5.0, 0)

    # CENTRO Y BASE

    soporteCentral = cmds.polyCylinder(r=radius_lamp / 12.0,
                                       h=height_lamp / 1.5)

    soporteBase = cmds.polyCylinder(r=radius_lamp, h=radius_lamp / 5.0, sa=40)
    rSoporteBase = cmds.ls(soporteBase)
    cmds.move(0, -height_lamp / 3.0, 0)
    cmds.polyBevel3(rSoporteBase[0] + '.e[40:79]',
                    rSoporteBase[0] + '.e[0:39]',
                    offset=0.02,
                    segments=3)
    cmds.polySmooth(dv=1)

    decor = cmds.polySphere(r=radius_lamp / 12.0)
    cmds.move(0, height_lamp / 3.0, 0)

    #cmds.parent('TOP_LAMP', 'soportecentral_'+str(i), 'soporteBase', 'decor', 'LAMP', relative=True)
    cmds.parent(topLamp,
                soporteCentral,
                soporteBase,
                decor,
                lamp,
                relative=True)
Ejemplo n.º 28
0
 def generate(self, nombre):
 #model head:
     headName = 'head' + randomNaming
     cmds.polyCube(name=headName)
     cmds.move(10, y=True)
     cmds.polySmooth( headName + '.f[0:5]', dv=1 )
 #model body:
     bodyName = 'body' + randomNaming
     cmds.polyCube(name=bodyName, w = 1, h = 3)
     cmds.move(8, y=True)
     cmds.polySmooth( bodyName+'.f[0:5]', dv=1 )
 #model leftArm:
     leftArm = 'leftArm' + randomNaming
     cmds.polyCube(name=leftArm, w = 2, h = 0.25)
     cmds.scale(0.3, z = True)
     cmds.move(1.3,9,0)
     cmds.polySmooth( leftArm+'.f[0:5]', dv=1 )
 #model rightArm:
     rightArm = 'rightArm' + randomNaming
     cmds.polyCube(name=rightArm, w = 2, h = 0.25)
     cmds.scale(0.3, z = True)
     cmds.move(-1.3,9,0)
     cmds.polySmooth( rightArm + '.f[0:5]', dv=1 )
 #model leftLeg:
     leftLeg = 'leftLeg' + randomNaming
     cmds.polyCube(name=leftLeg, w = 0.3, h = 3.5)
     cmds.scale(0.3, z = True)
     cmds.move(-0.3,6,0)
     cmds.polySmooth( leftLeg + '.f[0:5]', dv=1 )
 #model rightLeg:
     rightLeg = 'rightLeg' + randomNaming
     cmds.polyCube(name=rightLeg, w = 0.3, h = 3.5)
     cmds.scale(0.3, z = True)
     cmds.move(0.3,6,0)
     cmds.polySmooth( rightLeg +'.f[0:5]', dv=1 )
 #group everything:
     cmds.group(headName, bodyName, leftArm, rightArm, leftLeg, rightLeg, n=nombre)
Ejemplo n.º 29
0
            'TOP_LAMP',
            relative=True)

cmds.select('TOP_LAMP')
cmds.move(0, height_lamp / 5.0, 0)

# CENTRO Y BASE

cmds.polyCylinder(r=radius_lamp / 12.0,
                  h=height_lamp / 1.5,
                  n='soportecentral_' + str(i))

cmds.polyCylinder(r=radius_lamp, h=radius_lamp / 5.0, sa=40, n='soporteBase')
cmds.move(0, -height_lamp / 3.0, 0)
cmds.polyBevel3('soporteBase.e[40:79]',
                'soporteBase.e[0:39]',
                offset=0.02,
                segments=3)
cmds.polySmooth(dv=1)

cmds.polySphere(r=radius_lamp / 12.0, n='decor')
cmds.move(0, height_lamp / 3.0, 0)

cmds.parent('TOP_LAMP',
            'soportecentral_' + str(i),
            'soporteBase',
            'decor',
            'LAMP',
            relative=True)

#, 'lamp.e[720:759]', 'lamp.e[640:679]','lamp.e[560:599]','lamp.e[480:519]' )
Ejemplo n.º 30
0
def create_blob(size=2):
    obj_name, _ = cmds.polyPlatonicSolid(st=1, r=size)
    cmds.polySmooth(mth=1)  # Linear smooth
    randomize_faces(move_bias=[2, 1, 3])
    return obj_name
Ejemplo n.º 31
0
def smth(*args):
	div = cmds.intField("smoothField", q=True, v=True)
	selected = cmds.ls(sl=True)
	for sel in selected:
		cmds.polySmooth(sel, dv=div, ksb=1)
Ejemplo n.º 32
0
def runCanape():

    moduleNames = [
        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
        'o', 'p', 'q', 'r', 's', 't'
    ]
    mir = random.randint(0, 19)
    groupName = cmds.group(n='canape' + str(mir + mir), em=True)
    # default values:
    # module1_height = 4
    # module1_weigth = 10
    # module1_depth = 8
    # module1_number = 3

    module1_height = cmds.intSliderGrp(slider1, q=True, value=True)
    module1_weigth = cmds.intSliderGrp(slider2, q=True, value=True)
    module1_depth = cmds.intSliderGrp(slider3, q=True, value=True)
    module1_number = cmds.intSliderGrp(slider4, q=True, value=True)

    for i in range(module1_number):
        mir = random.randint(0, 19)
        crazyR = random.randint(0, 1000)
        rName = 'module1_' + str(mir) + moduleNames[mir] + str(crazyR) + str(i)
        cmds.polyCube(h=module1_height,
                      w=module1_weigth,
                      depth=module1_depth,
                      n=rName)
        cmds.move(i * module1_weigth / 1.02, 0, 0)
        cmds.polyBevel3(offset=0.5)
        cmds.polySmooth(divisions=2)
        cmds.parent(rName, groupName, relative=True)

    #cojines encima

    for i in range(module1_number):
        mir = random.randint(0, 19)
        crazyR = random.randint(0, 1000)
        rName = 'module2_' + str(mir) + moduleNames[mir] + str(crazyR) + str(i)
        cmds.polyCube(h=module1_height,
                      w=module1_weigth,
                      depth=module1_depth,
                      n=rName)
        cmds.rotate('73deg', 0, 0)
        cmds.move(i * module1_weigth / 1.02, module1_depth / 1.8,
                  -module1_depth / 1.5)
        cmds.polyBevel3(offset=0.5)
        cmds.polySmooth(divisions=2)
        cmds.parent(rName, groupName, relative=True)

    #laterales ?

    mir = random.randint(0, 19)
    crazyR = random.randint(0, 1000)
    rName = 'lateral1_' + str(mir) + moduleNames[mir] + str(crazyR) + str(i)
    cmds.polyCube(h=(module1_height + module1_depth) / 1.5,
                  w=module1_height,
                  depth=module1_depth * 1.5,
                  n=rName)
    cmds.move(-module1_weigth / 2.0, 0, -0.5)
    b = cmds.instance(rName)
    cmds.move((module1_weigth * module1_number) - (module1_weigth / 2.0), 0,
              -0.5)
    cmds.polyBevel3(offset=0.5)
    cmds.polySmooth(divisions=2)
    cmds.parent(rName, groupName, relative=True)
    cmds.parent(b, groupName, relative=True)
Ejemplo n.º 33
0
 def modelCorp(self):
     cmds.polyCube(name="corp", w=1, h=3)
     cmds.move(8, y=True)
     cmds.polySmooth('corp.f[0:5]', dv=1)
Ejemplo n.º 34
0
 def kmPlaneDisk(self):
     myPlane = mc.polyPlane(w=10, h=10, sx=1, sy=1, ax=[0, 1, 0], cuv=2, ch=1)
     mc.polySmooth(myPlane, method=1)
     mc.select(myPlane)
Ejemplo n.º 35
0
def Chaise(f_Chaisewidthz, f_ChaiseWidthx, f_ChaiseHeight, f_Distance):

    Chaisewidthz = f_Chaisewidthz
    ChaiseWidthx = f_ChaiseWidthx
    ChaiseHeight = f_ChaiseHeight
    Distance = f_Distance

    #mesa
    cmds.polyCube(h=1, w=ChaiseWidthx, depth=Chaisewidthz, n='Chaise')
    cmds.move(0, ChaiseHeight / 2.0 - 0.3, 0)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)

    #patas

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata1')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, -4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata2')
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, Chaisewidthz / 2.0 - 0.5)
    cmds.rotate(-4, 0, 4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata3')
    cmds.move(ChaiseWidthx / 2.0 - 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, 4)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.7, depth=0.7, n='pata4')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, 0, -Chaisewidthz / 2.0 + 0.5)
    cmds.rotate(4, 0, -4)
    cmds.polyBevel(offset=0.1)

    #espaldar

    cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5, n='Espaldar_1')
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, Chaisewidthz / 2.0 - 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=ChaiseHeight, w=0.5, depth=0.5, n='Espaldar_2')
    cmds.move(-ChaiseWidthx / 2.0 + 0.2, ChaiseHeight, -Chaisewidthz / 2.0 + 1)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.1)

    cmds.polyCube(h=2.5, w=1, depth=Chaisewidthz, n='Espaldar_3')
    cmds.move(-ChaiseWidthx / 2.0 + 0.5, ChaiseHeight * 1.4, 0)
    cmds.rotate(0, 0, 7)
    cmds.polyBevel(offset=0.2)
    cmds.polySmooth(dv=1)
    cmds.group('Chaise',
               'pata1',
               'pata2',
               'pata3',
               'pata4',
               'Espaldar_1',
               'Espaldar_2',
               'Espaldar_3',
               n='Chaise1')

    cmds.select('Chaise1')
    cmds.move(Distance, -1, 0)
    cmds.duplicate('Chaise1')
    cmds.move(-Distance, -1, 0)
    cmds.rotate(0, -180, 0)

    cmds.select('Chaise1')
    cmds.duplicate('Chaise1')
    cmds.move(0, -1, -Distance)
    cmds.rotate(0, 90, 0)

    cmds.select('Chaise1')
    cmds.duplicate('Chaise1')
    cmds.move(0, -1, Distance)
    cmds.rotate(0, -90, 0)


#def Base():

#Base = cmds.intSliderGrp(slider8, q=True, value=True)

#Base
#cmds.polyCube(h=1, w=tableWidthx*2, depth=tablewidthz*2, n='Base')
#cmds.move(0,-tableHeight/2.0-0.3,0)
#cmds.select('Base.e[4:5]')
#cmds.select('Base.e[8:9]', add=True)
#cmds.polyBevel3(offset=1, segments=3)
#cmds.polyBevel3('Base', offset=0.1)

# cmds.window(title = 'table')
# cmds.columnLayout()
# slider1= cmds.intSliderGrp( field=True, label='tablewidthz', minValue=4, maxValue=20, value=10 )
# slider2= cmds.intSliderGrp( field=True, label='tableWidthx', minValue=2, maxValue=20, value=10 )
# slider3= cmds.intSliderGrp( field=True, label='tableHeight', minValue=2, maxValue=20, value=6 )

# slider4= cmds.intSliderGrp( field=True, label='Chaisewidthz', minValue=4, maxValue=6, value=4 )
# slider5= cmds.intSliderGrp( field=True, label='ChaiseWidthx', minValue=2, maxValue=6, value=5 )
# slider6= cmds.intSliderGrp( field=True, label='ChaiseHeight', minValue=2, maxValue=10, value=4 )
# slider7= cmds.intSliderGrp( field=True, label='Distance', minValue=-10, maxValue=10, value=-5 )

# #slider8= cmds.intSliderGrp( field=True, label='Base', minValue=-10, maxValue=10, value=-5 )

# cmds.button(label = 'Create Table', c='table()')
# cmds.button(label = 'Create Chaise', c='Chaise()')
# cmds.button(label = 'Base', c='Base()')
# cmds.separator(style='none', h=10, w=10)
# cmds.showWindow()
Ejemplo n.º 36
0
matela_Widthx = 12
matela_widthz = 8
matela_Height = 2
lit_extrude_y = 0.8
lit_extrude_Z = 0.85

cmds.group(n='lit_complete', em=True)

#matelas
cmds.polyCube(h=matela_Height,
              w=matela_Widthx,
              depth=matela_widthz,
              n='matela')
cmds.polyBevel3('matela', offset=0.1)
cmds.polySmooth('matela', divisions=3)
cmds.parent('matela', 'lit_complete', relative=True)

#laterales
cmds.polyCube(h=matela_Height,
              w=matela_Widthx,
              depth=0.4,
              n='lateral_lit1_' + str(i))
cmds.move(0, -matela_Height / 2.0, -matela_widthz / 2.0)
cmds.instance('lateral_lit1_' + str(i))
cmds.move(0, -matela_Height / 2.0, matela_widthz / 2.0)
cmds.polyBevel3(offset=0.05)
cmds.parent('lateral_lit1_' + str(i), 'lit_complete', relative=True)

#tete
cmds.polyCube(h=matela_Height * 2.0, w=0.5, depth=matela_widthz, n='tete_lit1')
Ejemplo n.º 37
0
 def kmPolycubeSphere(self):
     myCube = mc.polyCube(w=10, h=10, d=10, sx=1, sy=1, sz=1, ax=[0, 1, 0], cuv=4, ch=1)
     mc.polySmooth(myCube, method=1)
     mc.select(myCube)
Ejemplo n.º 38
0
def transferBlendShape(source,
                       target,
                       deformer,
                       differentTopology=0,
                       connections=1):
    """
    This will transfer blendShape from one mesh to another. If the target doesn't have a
    blendShape on it, it will create a new blendShape. Then once there is a blendShape
    We will copy weights over.

    :param source: The geomertry you are transfer from
    :type source:  str

    :param target: The geometry you want to transfer to
    :type target: str | list

    """
    # do some error checking
    if not mc.objExists(source):
        raise RuntimeError(
            'The source mesh "{}" does not exist in the current Maya session.'.
            format(source))

    # first we will turn the target into a list if it's not already a list
    targetMeshList = rigrepo.libs.common.toList(target)

    # make sure we have a blendShape on the source mesh
    sourceBlendShapes = getBlendShapes(source)
    blendShapeList = list()
    if deformer not in sourceBlendShapes:
        mc.warning('The source mesh "{}" is missing "{}"'.format(
            source, deformer))
        return

    # Loop through target meshes
    for targetMesh in targetMeshList:
        if not mc.objExists(targetMesh):
            mc.warning(
                'The target mesh "{}" does not exist in the current Maya session.'
                .format(target))
            continue

        # check to see if there is a blendShape already  on the target mesh
        hist = getBlendShapes(targetMesh)
        if deformer in hist:
            mc.warning(
                'The target mesh "{}" is being deformed by "{}", aborting.'.
                format(targetMesh, deformer))
            continue

        name = "{}_bs".format(targetMesh)

        # =================
        # Same Topology
        # =================
        if not differentTopology:
            # Build blendShape
            target_bs = mc.blendShape(targetMesh, n=deformer)[0]
            targets = getTargetNames(deformer)

            for target in targets:
                # Get target data
                deltas, indices = getTargetDeltas(deformer, target)
                targetWeight = getTargetWeight(deformer, target)
                # Add target
                target = addTarget(target_bs, name=target)
                # Set target data
                setTargetWeight(target_bs, target, targetWeight)
                setTargetDeltas(target_bs, deltas, indices, target)
            blendShapeList.append(target_bs)

        # =================
        # Different Topology
        # =================
        if differentTopology:

            # Dup Source - Make duplicate of source mesh and bs so it can be
            #              wrapped to and the targets can to turned on and off
            #              without interfering with any connections that may exist
            #              on the original source meshes blendshape.
            #              Build blendShape
            wrap_target_dup = mc.duplicate(source,
                                           n=source + '_wrap_target')[0]
            wrap_target_bs = transferBlendShape(source, wrap_target_dup,
                                                deformer)[0]
            mc.polySmooth(wrap_target_dup)

            # Dup Target - Make a duplicated of the target mesh and wrap it to the
            #              target dup.
            wrap_source_dup = mc.duplicate(targetMesh,
                                           n=targetMesh + '_wrapped')[0]
            # Dup Target Get Deltas - Make another dup of the tafget that is
            #                         blendshaped to the wrapped dup target.
            #                         This is the blendShape we will get the deltas from
            get_deltas_from_wrap_dup = mc.duplicate(targetMesh,
                                                    n=targetMesh +
                                                    '_get_deltas')[0]
            mc.select(get_deltas_from_wrap_dup)
            get_deltas_from_wrap_bs = mc.blendShape(wrap_source_dup,
                                                    get_deltas_from_wrap_dup,
                                                    w=[0, 1])[0]
            mm.eval('performDeltaMush 0')

            # Wrap the source dup to the target dup
            wrap_node = rigrepo.libs.wrap.createWrap(wrap_source_dup,
                                                     wrap_target_dup,
                                                     exclusiveBind=1)

            # Build target blendShape
            target_bs = mc.blendShape(targetMesh, n=deformer)[0]

            targets = getTargetNames(deformer)
            connectionsList = list()
            for target in targets:
                # Turn on the target
                setTargetWeight(wrap_target_bs, target, 1)

                # Get target data
                deltas, indices = getTargetDeltas(get_deltas_from_wrap_bs, 0)
                targetWeight = getTargetWeight(deformer, target)
                connection = mc.listConnections(deformer + '.' + target,
                                                p=1) or []
                connectionsList.append(connection)

                # Add target
                target = addTarget(target_bs, name=target)

                # Set target data
                setTargetWeight(target_bs, target, targetWeight)
                setTargetDeltas(target_bs, deltas, indices, target)

                # Turn off the target
                setTargetWeight(wrap_target_bs, target, 0)

            # Hook up connections
            if connections:
                for target, con in zip(targets, connectionsList):
                    if con:
                        mc.connectAttr(con[0], target_bs + '.' + target)

            # Garbage collection
            mc.delete(wrap_target_dup, wrap_source_dup,
                      get_deltas_from_wrap_dup)

            blendShapeList.append(target_bs)

    return blendShapeList
Ejemplo n.º 39
0
def smoothing_one():
    mc.polySmooth("Landscape_0",c=0.5,dv=1)
    mc.select("Landscape_0") 
    return True
Ejemplo n.º 40
0
def make_cubes(place_string, animation, height_scale, time_scale):
    #RUN ON STATE OR COUNTRY
    #places=get_state_data(place_string)
    places = get_country_data(place_string)

    #CREATE NEW PLANE NAMED AFTER LOCATION
    for location in places:
        #NEED GROUPING FUNCTION
        new_cube = cmds.polyCube(n=location[0] + "-BAR",
                                 height=.25,
                                 width=.25,
                                 depth=.25,
                                 axis=[0, 0, 1],
                                 ch=False)

        #ADD ATTRIBUTE DEATHS TO DRIVE ANIMATION AND COLOR
        cmds.addAttr(shortName='d',
                     longName='deaths',
                     defaultValue=0.0,
                     minValue=0.0,
                     maxValue=1000000)
        cmds.setAttr(new_cube[0] + ".deaths", float(location[-1][-1]))
        cmds.polySmooth(new_cube[0], dv=2, ch=False)

        #MOVE PLANE TO EDGE OF EARTH (57.2965067401 MAYA UNITS)
        cmds.polyMoveVertex(new_cube[0] + ".vtx[0:97]",
                            tz=earth_scale,
                            ch=False)

        #ROTATE TO LAT LON POSITION
        #cmds.rotate(-1*float(location[1]), float(location[2]), 0, new_cube[0], objectSpace=True)
        #cmds.expression( string = new_cube[0]+".rx ="+str(-1*float(location[1])))
        #cmds.expression( string = new_cube[0]+".ry ="+str(float(location[1])))

        cmds.setAttr(new_cube[0] + ".rx", -1 * float(location[1]))
        cmds.setAttr(new_cube[0] + ".ry", float(location[2]))
        cmds.xform(new_cube[0], cp=1, a=1)

        #2*(((3V)/(4.0*3.1415926))**(1.0/3.0))
        #death_scalar = 1.611661654
        death_scalar = 2
        cmds.expression(string=new_cube[0] + ".sx = " + str(death_scalar) +
                        " * pow(((.75)*" + new_cube[0] +
                        ".deaths/3.141592654),(1.0/3.0))")
        cmds.expression(string=new_cube[0] + ".sy = " + str(death_scalar) +
                        " * pow(((.75)*" + new_cube[0] +
                        ".deaths/3.141592654),(1.0/3.0))")
        cmds.expression(string=new_cube[0] + ".sz = " + str(death_scalar) +
                        " * pow(((.75)*" + new_cube[0] +
                        ".deaths/3.141592654),(1.0/3.0))")

        #GROUP GEOMETRY BASED ON STATE
        #CHECK TO SEE IF STATE GROUP ALREADY EXISTS
        bar_location = location[0].split(", ")[1].replace(" ", "_")
        if cmds.ls(str(bar_location)):
            cmds.parent(new_cube, bar_location)
        else:

            cmds.group(new_cube, name=bar_location)

        #GET DAILY CASE DATA FROM LIST
        case_numbers = location[5]
        timer = 0

        #TO RUN IF ANIMATION ARG SET IN FUNCTION CALL
        if animation:
            #ITERATE OVER DAILY NUMBERS AND SET EXTRUSION KEYFRAMES
            for number in case_numbers:
                #CHECK TO SEE IF NEW KEYFRAME NEEDED
                index = timer
                #BASE CASE
                if index == 0:
                    cmds.setKeyframe(new_cube[0] + ".deaths",
                                     time=0,
                                     value=(float(case_numbers[(timer)])))
                    timer = timer + 1
                else:
                    cmds.setKeyframe(new_cube[0] + ".deaths",
                                     time=(timer) * time_scale,
                                     value=(float(case_numbers[(timer)])))
                    timer = timer + 1
Ejemplo n.º 41
0
def smoothing_two():
    mc.polySmooth("Landscape_0",c=3,dv=2)
    mc.select("Landscape_0")  
    return True
Ejemplo n.º 42
0
module1_height = 4
module1_weigth = 10
module1_depth = 8
module1_number = 3

cmds.group(n='canape', em=True)

for i in range(module1_number):
    cmds.polyCube(h=module1_height,
                  w=module1_weigth,
                  depth=module1_depth,
                  n='module1_' + str(i))
    cmds.move(i * module1_weigth / 1.02, 0, 0)
    cmds.polyBevel3(offset=0.5)
    cmds.polySmooth(divisions=2)
    cmds.parent('module1_' + str(i), 'canape', relative=True)

#cojines encima

for i in range(module1_number):
    cmds.polyCube(h=module1_height,
                  w=module1_weigth,
                  depth=module1_depth,
                  n='module2_' + str(i))
    cmds.rotate('73deg', 0, 0)
    cmds.move(i * module1_weigth / 1.02, module1_depth / 1.8,
              -module1_depth / 1.5)
    cmds.polyBevel3(offset=0.5)
    cmds.polySmooth(divisions=2)
    cmds.parent('module2_' + str(i), 'canape', relative=True)
Ejemplo n.º 43
0
from maya import standalone as std
std.initialize()

from maya import cmds

cube = cmds.polyCube(ch=0)[0]
cmds.polySmooth(cube,sdt=2)
cmds.polySmooth(cube,sdt=2)
cmds.polyReduce(cube)


import os
import sys
DIR = os.path.dirname(__file__)
file_path = os.path.realpath(os.path.join(DIR,"a.ma"))
cmds.file(rename=file_path)
cmds.file(save=1,type="mayaAscii")

# mel.eval("$temp = $gMainWindow")