OMG I love python…

What I allways disliked about working with functions (procs) in MEL, is that you have to have a certain amount of arguments, specified in the right orden when calling them.
When you make your own functions in Python, you can make them take zero or several arguments, in random order, making them work similar to the way that Maya Mel or Python commands do.. So, something Like this:


import maya.cmds as mc

def MySweepedSphere(radius=5, sections=20):
    mc.sphere(radius=size , sections=divisions , startSweep=180)

MySweepedSphere()
MySweepedSphere(radius=30)
MySweepedSphere(sections=1)
MySweepedSphere(radius=30,sections=1)
MySweepedSphere(sections=1,radius=30)
MySweepedSphere(1, 30)

I think that’s very nice indeed 🙂

Leave a Reply

Your email address will not be published.