# File: cube5x5.py # Author: Petr Sorfa # Desc: A 3D Artist code eample. A 5x5 matrix of cubes. # Note that this works only with the version 0.1 # A:M Python Script plug-in as it assumes # that translate() is absolute. import am # import the Animation Master extension am.begin() # Initialize the AM session for x in range(5): # First loop 0 to 4 for the x position for y in range(5): # Second loop 0 to 4 for the y position for z in range(5): # Third loop 0 to 4 for the z position am.translate(x*3,y*3,z*3) # Set the current position to x,y,z am.colour_diffuse (x/4.0, y/4.0, z/4.0) # Set the diffuse colour am.colour_specular (x/4.0, y/4.0, z/4.0) # Set the specular colour am.cube() # Create the cube at the current position am.end() # Finish the AM session