ColourCode – submission guidelines
CourseWork – 40% of total grade
Your submission for the coursework is focussed around each of you writing a single MEL script that interprets at least 3 different images to create 3 different animations. The goal is that you investigate new ways that you can interact with fixed script data by altering the images rather than the code. As stated above you will be responsible for each image to create an animation that uses at least 1000 objects. You must also submit a document which explains your ideas and intentions for the animation.
1 CD containing:
1. Maya Script you developed
2. 3 – 30 second animations (using min. 1000 objects each animation)
3. 3 – maya files (one for each animation)
4. 3- images used to create the animations
1 A4 document (wire bound)
1. Outlining the goal of the animations
2. diagrams explaining the relationship of the image to the object / time
3. script used for the animation and an explanation of how it was applied
unitWork – 50% of total grade
The criteria of your unit work for the course is much more open. I will meet with each of you individually to discuss it.
Previous Assignments – 10% of total grade
Wednesday, 10 December 2008
Wednesday, 19 November 2008
Assignment and Next session
Hi everyone,
As I mentioned- There will NOT be a session next week [26 November]
So at the next session [3 December] everyone should hand in a cd with the following:
An animation which utilizes colour fields as the means of controlling a large number of objects-
- This animation must consist of at least 500 objects: each containing at least 2 parts
-Ie. the object must have sub object parented to it
- The animation should run for 200 frames
-------On the disk you should put the:
Maya File
Animation File (.avi or .mov)
Any images that you drew to control the animations
As I mentioned- There will NOT be a session next week [26 November]
So at the next session [3 December] everyone should hand in a cd with the following:
An animation which utilizes colour fields as the means of controlling a large number of objects-
- This animation must consist of at least 500 objects: each containing at least 2 parts
-Ie. the object must have sub object parented to it
- The animation should run for 200 frames
-------On the disk you should put the:
Maya File
Animation File (.avi or .mov)
Any images that you drew to control the animations
Wednesday, 12 November 2008
text editors
Here is a link to the text editor I use in class- its free and works on Mac and PC
http://www.jedit.org/index.php?page=download
and here is a link on how to set up the syntax files for maya
http://www.highend3d.com/maya/tutorials/using_tools_scripts/Configuring-jEdit-with-Maya-319.html
For PC only you can try editPLus
http://www.editplus.com/
and then add the syntax / autocomplete files here
http://www.editplus.com/dn.cgi?mel70.zip
http://www.jedit.org/index.php?page=download
and here is a link on how to set up the syntax files for maya
http://www.highend3d.com/maya/tutorials/using_tools_scripts/Configuring-jEdit-with-Maya-319.html
For PC only you can try editPLus
http://www.editplus.com/
and then add the syntax / autocomplete files here
http://www.editplus.com/dn.cgi?mel70.zip
fixedSession5
//colourCode - CodeSet 5
//npuckett - 2008 www.colourcodedarch.blogspot.com
proc string newRamp()
{
//create a new material and attach a ramp to its colour output
string $shader = `shadingNode -asShader lambert`;
string $ramp = `shadingNode -asTexture ramp`;
string $place = `shadingNode -asUtility place2dTexture`;
connectAttr ($place+".outUV") ($ramp+".uv");
connectAttr ($place+".outUvFilterSize") ($ramp+".uvFilterSize");
connectAttr -force ($ramp+".outColor") ($shader+".color");
removeMultiInstance -break true ($ramp+".colorEntryList[1]");
setAttr ($ramp+".colorEntryList[2].color") -type double3 0 0 0 ;
setAttr ($ramp+".colorEntryList[2].position") 1;
setAttr ($ramp+".colorEntryList[0].position") 0;
setAttr ($ramp+".colorEntryList[0].color") -type double3 1 1 1 ;
return $ramp;
}
//show colour values on the surface
int $totX = 10;
int $totZ = 10;
//change the name of the controller to correspond to the ones that you have
float $scale = 0.1;
string $controller = "ramp1";
string $surface = "plane1";
for ($x=0;$x<=$totX;$x++)
{
for ($z=0;$z<=$totZ;$z++)
{
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
float $position[] = `pointOnSurface -p -u $you -v $vee $surface`;
string $hInfo[] = `textCurves -ch 0 -f "Arial-Regular" -t $heights[0]`;
scale -r $scale $scale $scale $hInfo[0];
move -a $position[0] $position[1] $position[2] $hInfo[0];
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
///create a grid
proc boxGrid(int $totalX, int $totalZ, float $factor)
{
//create the grid of boxes
for($x=0;$x<=$totalX;$x++)
{
for($z=0;$z<=$totalZ;$z++)
{
string $name = ("box_"+$x+"_"+$z);
polyCube -n $name;
move -r ($x*$factor) 0 ($z*$factor);
}
}
}
boxGrid(20,20,2.5);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
///moving a system of boxes using the colour value
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp1";
//the name of the object system being affected
string $baseName = "box";
float $factor = 5;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to move the boxes
move -r 0 ($heights[0]*$factor) 0 $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//animate the movement
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp2";
//the name of the object system being affected
string $baseName = "box";
float $factor = 50;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at translateY -v 0 -t 1 $name;
setKeyframe -at translateY -v ($heights[0]*$factor) -t (($x+1)+($x*$z)) $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//using 2 inputs
//animate the movement
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "file2";
string $controller2 = "ramp1";
//the name of the object system being affected
string $baseName = "box";
float $factor = 20;
float $timeFactor = 200;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
float $time[] = `colorAtPoint -u $you -v $vee $controller2`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at scaleY -v 0 -t 1 $name;
setKeyframe -at scaleY -v ($heights[0]*$factor) -t ($time[0]*$timeFactor) $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//controlling the output range
//using 2 inputs
//animate the movement
int $totX = 10;
int $totZ = 12;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp1";
string $controller = "ramp2";
//the name of the object system being affected
string $baseName = "box";
float $factor = 5;
float $timeFactor = 20;
float $outputMin = -30;
float $outputMax =30;
float $timeMin = 30;
float $timeMax = 300;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $cVal[] = `colorAtPoint -u $you -v $vee $controller`;
float $time[] = `colorAtPoint -u $you -v $vee $controller2`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
float $adjCval = $outputMin + ((($cVal[0]-0)/(1-0)) * ($outputMax-$outputMin));
float $adjTval = $outputMin + ((($time[0]-0)/(1-0)) * ($outputMax-$outputMin));
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at translateY -v 0 -t 1 $name;
setKeyframe -at translateY -v $adjCVal -t $adjTval $name;
}
}
//npuckett - 2008 www.colourcodedarch.blogspot.com
proc string newRamp()
{
//create a new material and attach a ramp to its colour output
string $shader = `shadingNode -asShader lambert`;
string $ramp = `shadingNode -asTexture ramp`;
string $place = `shadingNode -asUtility place2dTexture`;
connectAttr ($place+".outUV") ($ramp+".uv");
connectAttr ($place+".outUvFilterSize") ($ramp+".uvFilterSize");
connectAttr -force ($ramp+".outColor") ($shader+".color");
removeMultiInstance -break true ($ramp+".colorEntryList[1]");
setAttr ($ramp+".colorEntryList[2].color") -type double3 0 0 0 ;
setAttr ($ramp+".colorEntryList[2].position") 1;
setAttr ($ramp+".colorEntryList[0].position") 0;
setAttr ($ramp+".colorEntryList[0].color") -type double3 1 1 1 ;
return $ramp;
}
//show colour values on the surface
int $totX = 10;
int $totZ = 10;
//change the name of the controller to correspond to the ones that you have
float $scale = 0.1;
string $controller = "ramp1";
string $surface = "plane1";
for ($x=0;$x<=$totX;$x++)
{
for ($z=0;$z<=$totZ;$z++)
{
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
float $position[] = `pointOnSurface -p -u $you -v $vee $surface`;
string $hInfo[] = `textCurves -ch 0 -f "Arial-Regular" -t $heights[0]`;
scale -r $scale $scale $scale $hInfo[0];
move -a $position[0] $position[1] $position[2] $hInfo[0];
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
///create a grid
proc boxGrid(int $totalX, int $totalZ, float $factor)
{
//create the grid of boxes
for($x=0;$x<=$totalX;$x++)
{
for($z=0;$z<=$totalZ;$z++)
{
string $name = ("box_"+$x+"_"+$z);
polyCube -n $name;
move -r ($x*$factor) 0 ($z*$factor);
}
}
}
boxGrid(20,20,2.5);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
///moving a system of boxes using the colour value
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp1";
//the name of the object system being affected
string $baseName = "box";
float $factor = 5;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to move the boxes
move -r 0 ($heights[0]*$factor) 0 $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//animate the movement
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp2";
//the name of the object system being affected
string $baseName = "box";
float $factor = 50;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at translateY -v 0 -t 1 $name;
setKeyframe -at translateY -v ($heights[0]*$factor) -t (($x+1)+($x*$z)) $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//using 2 inputs
//animate the movement
int $totX = 20;
int $totZ = 20;
//change the name of the controllers to correspond to the ones that you have
string $controller = "file2";
string $controller2 = "ramp1";
//the name of the object system being affected
string $baseName = "box";
float $factor = 20;
float $timeFactor = 200;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $heights[] = `colorAtPoint -u $you -v $vee $controller`;
float $time[] = `colorAtPoint -u $you -v $vee $controller2`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at scaleY -v 0 -t 1 $name;
setKeyframe -at scaleY -v ($heights[0]*$factor) -t ($time[0]*$timeFactor) $name;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//controlling the output range
//using 2 inputs
//animate the movement
int $totX = 10;
int $totZ = 12;
//change the name of the controllers to correspond to the ones that you have
string $controller = "ramp1";
string $controller = "ramp2";
//the name of the object system being affected
string $baseName = "box";
float $factor = 5;
float $timeFactor = 20;
float $outputMin = -30;
float $outputMax =30;
float $timeMin = 30;
float $timeMax = 300;
for ($x=0;$x<$totX;$x++)
{
for ($z=0;$z<$totZ;$z++)
{
//the U and V values are the texture's internal coordinate system
//it runs from 0 -> 1 in both directions
//this is how we define a specific point on the texture to sample from
float $you = ((1.0/$totX)*$x);
float $vee = ((1.0/$totZ)*$z);
//use colorAtPoint to return the value of the colour
float $cVal[] = `colorAtPoint -u $you -v $vee $controller`;
float $time[] = `colorAtPoint -u $you -v $vee $controller2`;
//since we used a set naming system the boxes name matches up to the
//coordinates that we sample on the texture
float $adjCval = $outputMin + ((($cVal[0]-0)/(1-0)) * ($outputMax-$outputMin));
float $adjTval = $outputMin + ((($time[0]-0)/(1-0)) * ($outputMax-$outputMin));
string $name = ($baseName+"_"+$x+"_"+$z);
//use the value from the texture to set the keyframe value
setKeyframe -at translateY -v 0 -t 1 $name;
setKeyframe -at translateY -v $adjCVal -t $adjTval $name;
}
}
Tuesday, 11 November 2008
session 4 Files
I think most of you copied them from the PC, but just in case here is the material from last session.
FILES
FILES
Wednesday, 29 October 2008
Session 4 Assignment
For Next time everyone needs to complete the following:
Write a single Maya script which:
-utilizes at least 3 loops
-animates objects over time
From this single script you must generate 4 different animations only by changing the variables.
Everyone should have the 4 animation files (.avi or .mov) and the script on a disk at the begining of class November 3
Write a single Maya script which:
-utilizes at least 3 loops
-animates objects over time
From this single script you must generate 4 different animations only by changing the variables.
Everyone should have the 4 animation files (.avi or .mov) and the script on a disk at the begining of class November 3
Tuesday, 28 October 2008
Session 3
Hi everyone
here are the files that I worked on during class last time
session2Files
And here is the file we'll be looking at tomorrow
session3Files
Also if any of you are having trouble installing it on your laptop bring them with you tomorrow.
Nick
here are the files that I worked on during class last time
session2Files
And here is the file we'll be looking at tomorrow
session3Files
Also if any of you are having trouble installing it on your laptop bring them with you tomorrow.
Nick
Tuesday, 21 October 2008
Session 2
Hi everyone,
Tomorrow we'll be going through the script file that I gave out for the last session as well as looking at this:
//tower maker
//create and closed curve and select it
//input: height of the tower
// number of floors
// amount of twist
global proc makeTower(float $height, float $floors, float $twist)
{
int $increment = 100/$floors;
int $i;
string $sel[] = `ls -sl`;
string $top[] = `duplicate -rr $sel[0]`;
xform -cp $sel[0] $top[0];
move -r 0 $height 0 $top[0];
rotate -r 0 $twist 0 $top[0];
string $blendName[] = `blendShape -origin world -tc 0 $top[0] $sel[0]`;
setKeyframe -at $top -v 0 -t 0 $blendName[0];
setKeyframe -at $top -v 1 -t 100 $blendName[0];
string $snaps[] = `snapshot -increment $increment -constructionHistory 1 -startTime 1 -endTime 100 -update animCurve $sel[0]`;
setAttr ($snaps[1]+".update") 1;
string $floorCurves[] = `listRelatives $snaps[0]`;
for($curve in $floorCurves)
{
string $floorPlate[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $curve`;
rename $floorPlate[0] ("floor_"+$i);
parent ("|floor_"+$i) $snaps[0];
$i++;
}
string $roof[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $top[0]`;
rename $roof[0] "roof";
parent "|roof" $snaps[0];
select $top[0];
}
Tomorrow we'll be going through the script file that I gave out for the last session as well as looking at this:
//tower maker
//create and closed curve and select it
//input: height of the tower
// number of floors
// amount of twist
global proc makeTower(float $height, float $floors, float $twist)
{
int $increment = 100/$floors;
int $i;
string $sel[] = `ls -sl`;
string $top[] = `duplicate -rr $sel[0]`;
xform -cp $sel[0] $top[0];
move -r 0 $height 0 $top[0];
rotate -r 0 $twist 0 $top[0];
string $blendName[] = `blendShape -origin world -tc 0 $top[0] $sel[0]`;
setKeyframe -at $top -v 0 -t 0 $blendName[0];
setKeyframe -at $top -v 1 -t 100 $blendName[0];
string $snaps[] = `snapshot -increment $increment -constructionHistory 1 -startTime 1 -endTime 100 -update animCurve $sel[0]`;
setAttr ($snaps[1]+".update") 1;
string $floorCurves[] = `listRelatives $snaps[0]`;
for($curve in $floorCurves)
{
string $floorPlate[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $curve`;
rename $floorPlate[0] ("floor_"+$i);
parent ("|floor_"+$i) $snaps[0];
$i++;
}
string $roof[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $top[0]`;
rename $roof[0] "roof";
parent "|roof" $snaps[0];
select $top[0];
}
Tuesday, 14 October 2008
Session 1
Below are links to the example files we will be using in session 1 as well as a general reference and several useful links:
Session 1: Example Files + general reference
Books:
General Introduction to Maya
Another good overview book
MEL Scripting:
in order of usefulness:
Best for Starting out learning MEL
Also good for beginners
More Advanced, But a good reference
The second volume
Websites
This site is a wiki I began building last year that has several links / scripts
MEL wiki Innsbruck
Session 1: Example Files + general reference
Books:
General Introduction to Maya
Another good overview book
MEL Scripting:
in order of usefulness:
Best for Starting out learning MEL
Also good for beginners
More Advanced, But a good reference
The second volume
Websites
This site is a wiki I began building last year that has several links / scripts
MEL wiki Innsbruck
Subscribe to:
Posts (Atom)