Curve Cube Script

I wrote a quick script that creates a combined cube shape out of curves. It’s very helpful for rigging.

Super simple.

import maya.cmds as cmds

class curveCube(object):
    def __init__(self):
        self.myCube = cmds.curve(d=1,p=[(0,0,0),(1,0,0),(1,0,1),(0,0,1),(0,0,0),
                                   (0,1,0),(1,1,0),(1,0,0),(1,1,0),
                                   (1,1,1),(1,0,1),(1,1,1),
                                   (0,1,1),(0,0,1),(0,1,1),(0,1,0)])

        cmds.CenterPivot()
        cmds.xform(self.myCube,t=(-.5,-.5,-.5))
        cmds.select(self.myCube)
        cmds.FreezeTransformations()
        cmds.rename("curveCube#")
        cmds.delete(ch=1)
        
myCube = curveCube()

 

Advertisements
Image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s