itch.io is community of indie game creators and players

Devlogs

week 7

programming for animation
A downloadable game for Windows, Linux, and Android

today we learned how to create basic objects (Maya primitive shapes) using python commands. 

this was done using the cmds module within the Maya version of python.  

Polycubes 

today I learned how to create a polycube using Python within Maya. 

cmds.polyCube(name=whatevernamehere, h=whateverheight, w=whateverwidth, d=whateverdepth)

the command above is how you create a polycube using python. the polycube is Mayas primitive cube shape that can be used and rendered within Maya. 

Parenting 

you can parent  one object to another within python by using the cmds.parent command.  

cmds.parent(CHILD, PARENT,  add=True)

you can remove an object from the hierarchy by using:

cmds.parent( 'PARENT|CHILD', removeObject=True )

Selecting 

you can select an object from the scene with :

cmds.select(NAME, add = True)

This will add the object to the current selected list.  you can make this object the only one selected by changing True to False

This is a new concept to me, I am familiar with parenting as a concept as it happens a lot in programming, but its interesting to see how this works in a 3D environment.

Files

  • week 6 quiz.pdf 64 kB
    Dec 05, 2022
Download programming for animation
Leave a comment