|
This LED light cube is pretty cool, but I didn’t feel like spending a few weeks soldering. I just wanted to play around with animating the resulting cube.
http://www.instructables.com/id/Led-Cube-8x8x8/
So I threw together this set of python utilities to build it and animate it in Maya. If someone else is interested in having fun with this idea, hopefully this helps get you started. If I get time to clean this up some more, I may turn this into a tutorial.
This cube has two geometry objects at each grid point. One is for when the light is “on”, and the other is for when the light is “off”. I’ve animated it by just keying the visibility curves for these objects.
There are utilities to
1) Set up the light cube, using your own geometry or my default cubes.
2) Key the visibility of the “on” and “off” geometry at each grid point
3) Reset the cube back to its starting point with no animation.
4) Show how to setup some simple animations on the cube.
To get started, drop the attached lightcube.py file into your maya/scripts directory and run the example code:
import maya.cmds as c
import lightcube as L
reload(L) c.file(f=1,new=1)
L.setBoxSize(8) L.createLightCube()
L.createGrid() # you can substitute custom geometry L.loadOnObjects() # you can substitute custom geometry L.loadOffObjects() # you can substitute custom geometry
L.reset() currTime = L.testWalls(delay=3) L.keyAllAt(currTime) L.cycleAnimation()
|