Hi to everyone! I am starting with Class a few days, and there are many
examples on the internet, but not practical examples (Maya), so this is my
first class and of course I don't know what is wrong. I hope someone can
give me a hand. Greetings!
import maya.cmds as cmds
import maya.mel as mel
class Control(object):
def __init__(self, name, shape, size):
self.name = name
self.shape = shape
self.size = size
def create_me(self):
if self.shape == 'box':
mel.eval( 'curve -d 1 -p -0.5 0.5 0.5 -p 0.5 0.5 0.5;' )
if self.shape == 'circle':
cmds.circle( radius=1 )
if self.shape == 'square':
mel.eval( 'curve -d 1 -p -0.5 0 -0.5 -p 0.5 0 -0.5 -p 0.5 0 0.5 -p -0.5 0
0.5 -p -0.5 0 -0.5' )
cmds.scale( self.size, self.size, self.size )
cmds.makeIdentity( apply=True, t=0, r=0, s=1 )
cmds.rename( self.name )
cmds.select( clear=True )
legControl = Control.create_me('L_leg1_control', 'box', 2)
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/b6eddbbc-8d18-415e-85c7-b3d15c423c14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.