21/11/22


This week I tried to create a simple class for a poly cube and have cubes of different dimensions spawn into the scene simultaneously. It isn't completely polished as an error code pops up regarding line 15 and having height as an unexpected keyword.

import maya.cmds

class myCube:

    def __init__(self, height, width, depth):

        self.height = height

        self.width = width

        self.depth = depth

    def createCube(self):

        cmds.polyCube()     

Cube1 = myCube(20, 10, 10) 

Cube2 = myCube(40, 10, 10) 

Cube1.createCube(height = 20, width = 10, depth = 10)

Cube2.createCube(height = 40, width = 10, depth = 10)

Leave a comment

Log in with itch.io to leave a comment.