Saturday, October 12, 2013

Here's the collection of my scripts, first starting out in python is quite daunting, but it is simply what must be done, these are very basic. Due to me having some experience in MEL it isn't an alien concept to me but the syntax is still fundamentally different.
For my tutorials I looked at the first 7 videos and followed along.
From now on I'll start making modeling scripts and exporters, ill continue my research and hopefully have a nice script to show for it soon.
The main thing is getting the exporter to work (very difficult task)
 

 
python

code 2013

print 12.0/5

hash mark + notes (#) on script

 
import maya. cmds

import maya. cmds

maya.cmds.polySphere()

 comp

import maya. cmds as mc

mc.polySphere(r=1, sx=20, sy=20, ax=(0, 1, 0), cuv=2, ch=1)

mc.setAttr("polySphere.radius", 25)

movement

mc.move( -2, -2, -2, r=True)

mc.rotate( 0, 90, 0, r=True)

mc.scale( 4, 4, 4, r=False)

constraint

mc.parentConstraint("polyCube2", "polyCubeGRP", mo=True, weight=1)

mc.scaleConstraint("polyCube2", "polyCubeGRP", mo=True, weight=1)

Variable

weapCtrl = "aim_weapon01"

weapoGRP = "weapGRp"

mc.parentConstraint (weapCtrl, weapGRP, mo=True

mc.scaleconstraint (weapCtrl, weapGRP)

 concatioate script

that = "cool "

print that + "is the value of that"

 thisNum = 5.3

print "%f is the value of thisNum. "% thisNum + that

 
thisVal=1

mc.rename("pCube1, "coolCube_%d" % thisVal)

 
lists

this = mc.ls (sl=True)

ourFirstList =["awesome"], 9.8 this[1]]

mc.select(ourFirstList[2])

mc.select(this[2, tgl=True)

No comments:

Post a Comment