#iMpoRt mAya.CmdS aS mC
Explore tagged Tumblr posts
Text
do you think they're into Weezer's Pinkerton
#had a full week of Python for rigging in Maya & it made me think of sollux#ft dave bc why not#Homestuck#Sollux Captor#Dave Strider#DaveSol#if you SQUINT#Humanstuck#My Art#i used to be rlly into this ship when i was in fucking middle school#anyway im so tired#bitch do i look like im built for using the script editor in maya??#iMpoRt mAya.CmdS aS mC#suck my nuts im going back to animating
17 notes
·
View notes
Photo
import maya.cmds as mc import math
c1 = mc.curve( d=3, p=( (-8, 2, 0), ( -6, 2, 0), ( -4, -2, 0), ( -1, 4, 0), ( 1, -2, 0), ( 3, 2, 0), ( 5, 2, 0) ) )
c2 = mc.curve( d=3, p=( ( -16, 2, -10), ( -16, 2, -10), ( -15, 1, -10), ( -1, 4, -10), ( 5, 2, -10), ( 9, 1, -10) ) )
c3 = mc.curve( d=3, p=( ( 8, 2, -0.25), ( 8, 2, -1), ( 8, 2, -1), ( 8, 0, -5), ( 8, 1, -8), ( 8, 1, -9), ( 8, 1, -10) ) )
c4 = mc.curve( d=3, p=( ( -10, 2, -0.25), ( -10, 2, -1), ( -10, 2, -1), ( -10, 0, -5), ( -10, 1, -8), ( -10, 1, -9), ( -10, 1, -10) ) )
c = [ c1, c2, c3, c4 ]
b = mc.boundary( c2, c3, c1, c4, order=True, ep=0 )
s = mc.nurbsToPoly('boundarySurface1')
m = mc.polyMirrorFace (ws=1, direction=4)
mySelect = mc.ls(selection = True) print mySelect
vtxIndexList = mc.getAttr(mySelect[0]+".vrts", multiIndices=True) print vtxIndexList
vtxWorldPosition=[] for i in vtxIndexList : curPointPosition = mc.xform( str(mySelect[0])+".vtx["+str(i)+"]", query=True, translation=True, worldSpace=True ) vtxWorldPosition.append( curPointPosition) print vtxWorldPosition
for each in vtxWorldPosition: myCube=mc.polyCube() mc.move(each[0],each[1],each[2],myCube[0]) mc.scale(0.3,0.3,0.3)
mc.hide( c, b, s, m)
def createCube(itemA): myList = [] for each in range (itemA): for eachA in range (itemA): myCube=mc.polyCube() form = math.cos(each*0.2+0.5)*2 mc.move(each-30,form+2.5,-0.3,myCube[0]) mc.scale(0.3,0.3,0.3)
cubelist = createCube(20)
0 notes
Text
Sử dụng plusMinusAverage trong Maya Node bằng Python
import maya.cmds as mc
sel = mc.ls(sl=True)
# chọn 2 đối tượng và connect với nhau bằng cả 3 hệ trục
source = sel[0] target = sel[1]
mc.connectAttr(source+".t",target+".t") mc.connectAttr(source+".r",target+".r") mc.connectAttr(source+".s",target+".s")
# Chọn đối tượng và tạo Locator tự động
sel = mc.ls(sl=True) for each in sel: loc = mc.spaceLocator(n=each.replace("cc","locWS"))
# Chọn 3 đối tượng liên tiếp kết nối với nhau bằng +-A
sel = mc.ls(sl=True)
csLoc = sel[0] cc = sel[1] offset = sel[2] pmaT = mc.createNode("plusMinusAverage",n="pma_"+cc+"_tr") mc.setAttr(pmaT+".operation",2)
mc.setAttr(csLoc+".t",pmaT+".input3D[0]") mc.setAttr(cc+".t",pmaT+".input3D[1]") mc.setAttr(pmaT+".output3D",offset+".t")
0 notes