Showing posts with label maya. Show all posts
Showing posts with label maya. Show all posts

Friday, April 17, 2009

Maya rotating cubes

Here's a little script that'll rotate an x,y array of cubes, based on an input textures u,v colors.

A friend of mine showed me this neat effect, and we talked over various ways to do this, I proceeded to try replicating it in Maya; this is what I came up with finally. Basicly a script which does everything needed for the basic effect. It can be improved further for more advanced settings. What it does now is create a grid of cubes along the x and y axis, binds an expression on each cube to drive it's x-rotation by an input textures' color at given u,v coordinate. It's meant to be used with an animated texture to make them rotate over time.

I'll post a clip of how this looks on youtube this weekend.

The (quickly hacked together) basic mel-snippet is as follows :

$p = `polyCube -ch on -o on -cuv 4`;

$countCur = 0;
$mx = 64;
$my = 48;

for($y = 0; $y < $my; $y++)
{
$prevsel = `ls -sl`;

for($x = 0; $x < $mx; $x++)
{
$countCur++;

string $sel[] = `ls -sl`;

float $u = (1.0 / $mx) * $x;
float $v = (1.0 / $my) * $y;
$v = -$v;

$string = ("float $col[] = `colorAtPoint -u "+$u+
" -v "+$v+" "+$animNodeTexName+"`; rotateX =
20.0 * ($col[0]+$col[1]+$col[2]);");

for($sa in $sel)
{
expression -o $sa -s $string;
}

duplicate -rr;
move -r 1 0 0;
}

select $prevsel;

duplicate -rr;
move -r 0 -1 0;
}

Tuesday, November 11, 2008

DeeSymphony startup

I've started development on DeeSymphony. Currenly doing some GUI and basic greeble tests in Maya 2009. I'll post updates here as I progress.

One major change from DeeGreebler is that DeeSymphony will be split into several scripts for easy maintenance; and it wont be as experimental.

Friday, October 10, 2008

Dee...Symphony?

DeeGreebler is returning, under a different name which I haven't decided yet. It'll be a complete re-write and will support Maya 8.5; though I intend to make it as backwards-compatible as I can, it'll be virtually impossible for me to make it work with every version spanning from 6.0 and up.


A plug-in based version has also crossed my mind, but it'll have a larger maintenance overhead and it's harder to make a plug-in work for more versions since it needs a fresh compile afaik from previous experience.


As for a name, DeeSymphony is probably the name of the development version, since I intend to include some other scripts as a "toolset" of sorts.