Tron

June 22nd, 2010

The CGTalk FX Wars are held about every two months, and this time they held a competition in honor of the new Tron 2.0. Dave Spamer invited me to help him participate in the challenge. We have created the Tron style light cycle battle (part of it). Dave has been interested in Tron for years, and saw the CGTalk FX Wars as an opportunity to finish what he started years ago. I was responsible for the light trails effect and the setup of multi-pass rendering. I designed a tool that would allow Dave to draw the curves that he needs, select the curves, and generate the trails. I also created the material effect for the glow in the trail.
Click the image to see the animation.

Segment Curve

May 31st, 2010

This script will segment an entire curve from knot to knot. I needed something like this tool for my current project. I found this most useful for linear curves, but I added the code to segment a CV curve, as well.

/*
SEGMENTS A CURVE FROM KNOT TO KNOT
*/
var oSel = Application.Selection(0);
if(oSel.Type != “crvlist”)
{
fTrace(“Select a curve”);
}
else
{
if(Application.Selection.Count > 1)
{
fTrace(“Select only one curve.”);
}
else
{
fSegmentCurve(oSel);
}
}
/*———–
FUNCTIONS
————*/
function fTrace(m){
Application.LogMessage(m);
}
function fSegmentCurve(oSel){
var oSelName = oSel.FullName;
var oType = oSel.Type;
var oGeometry = oSel.ActivePrimitive.Geometry;
var oNumKnots = oGeometry.Curves(0).Knots.Count;
fTrace(oNumKnots + ” – Knots”);
//FOR CUBIC CURVES – DEGREE 3
if(oGeometry.Curves(0).Degree == 3){
fTrace(oSelName + ” is a cubic cv curve.”)
for(i=0; i < oNumKnots-1; i++)
{
//SKIP FIRST THREE KNOTS & LAST THREE KNOTS
if(i < oNumKnots-5){
ApplyGenOp(“CrvExtractSeg”, “”, oSelName +”.knot[" +i+ ","+ (i+1) +" ];”+ oSelName +”.knot["+ (i+1) +"]“);
}
}
}
//FOR LINEAR CURVES – DEGREE 1
if(oGeometry.Curves(0).Degree == 1){
fTrace(oSelName + ” is a linear curve.”)
for(i=0; i < oNumKnots-1; i++)
{
ApplyGenOp(“CrvExtractSeg”, “”, oSelName +”.knot[" +i+ ","+ (i+1) +" ];”+ oSelName +”.knot["+ (i+1) +"]“);
}
}
}

Two Rigging Tools

May 30th, 2010

I wish I made these tools a long time ago.     Script #1 is “Create Null as Parent”.  I especially like this one.  You can make fast hierarchies with this.

Script #1


/*
SELECT THE OBJECTS YOU WANT PARENTED TO A NULL, THEN RUN.
MATCHES THE NULL TO THE FIRST CHILD'S POSITION AND ROTATION.
*/
/*--------------------
User Input
--------------------*/
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oSel = Application.Selection;
/*--------------------
FUNCTIONS
--------------------*/
fRun(oSel);
function fRun(oSel){
var oNull = oRoot.AddPrimitive("Null", oSel(0).Name+"_null")
oNull.Kinematics.Local.PosX.Value = oSel(0).Kinematics.Local.PosX.Value;
oNull.Kinematics.Local.PosY.Value = oSel(0).Kinematics.Local.PosY.Value;
oNull.Kinematics.Local.PosZ.Value = oSel(0).Kinematics.Local.PosZ.Value;
oNull.Kinematics.Local.RotX.Value = oSel(0).Kinematics.Local.RotX.Value;
oNull.Kinematics.Local.RotY.Value = oSel(0).Kinematics.Local.RotY.Value;
oNull.Kinematics.Local.RotZ.Value = oSel(0).Kinematics.Local.RotZ.Value;
oNull.AddChild(oSel)
SelectObj(oNull);
}



Script #2

Create Null as Parent at First Point on Curve


/*--------------------
SELECT CURVE(S) AND RUN
User Input
--------------------*/
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oSel = Application.Selection;
var oCurveList = XSIFactory.CreateActiveXObject("XSI.Collection");
/*--------------------
FUNCTIONS
--------------------*/
fCollectCurves(oSel);
function fCollectCurves(oSel){

for(var en = new Enumerator (oSel); !en.atEnd(); en.moveNext())
{
oEn = en.item()
oCurveList.Add(oEn);
}

for(k=0; k < oCurveList.Count; k++)
{
fTranslateNull(oCurveList(k));
}
}

function fTranslateNull(inPath)
{
var oPntX = new Array();
var oPntY = new Array();
var oPntZ = new Array();
var oNull = oRoot.AddPrimitive("null");
oVB = new VBArray(inPath.ActivePrimitive.Geometry.Points.PositionArray);
oPntArray = oVB.toArray();
for(i=0; i < oPntArray.length; i += 3)
{
oPntX[i] = oPntArray[i];
oPntY[i] = oPntArray[i+1];
oPntZ[i] = oPntArray[i+2];
if(i == 0){

oNull.Kinematics.Local.PosX.Value = oPntX[0];
oNull.Kinematics.Local.PosY.Value = oPntY[0];
oNull.Kinematics.Local.PosZ.Value = oPntZ[0];
}
}

oNull.AddChild(inPath);
}

Home Studio Complete

May 29th, 2010

Several months after moving into our new home, my wife and I are very proud to finish one of our rooms.  It’s the room where we spend most of our time.  We installed the blinds, the floating shelves, and the little wooden drawers on the left and right.  We have matching desks for a large drawing space and general work table.   The keyboard shelf can be pushed underneath, and I expanded them further to get a little more keyboard space.  The monitors are on the bottom shelf and the extra monitor is wall mounted.  The only things that are years out of date are the computers.  :-)   That will have to wait a few more years.

New Home Studio

What’s not in the room yet, and will be on the back wall, is a large 92″ tall wardrobe.  It will be used as a flat file system to hold all of our drawings and art supplies.  It’s a great feeling to finish a space in the home, and empty those damn cardboard boxes.   Very inspiring!

Illustrator File to 3D – Extract All Subcurves

May 29th, 2010

I’m working on a logo for a local singing group (which I’ll talk about more in the future), and I was frustrated with extracting one curve at a time from the .EPS import from Adobe Illustrator.  So, I made a small tool to extract all the subcurves from a curve.  Again, this is really handy if you’re importing designs from AI for use in Softimage.

To use this, copy and paste the code below into the Script Editor, select your curve, and run.


var oSel = Application.Selection(0);
var oSelName = oSel.FullName;
var oAP = oSel.ActivePrimitive.Geometry;
var oCrvCount = oAP.Curves.Count;
for(i=0; i < oCrvCount; i++)
{
ExtractFromComponents("ExtractSubCrvOp",
oSelName +".subcrv["+ i +"]", "crv_0"+i);
}


Real-time 3D in Flash

May 10th, 2010

Courtesy of the David Laser Scanner project there’s a way to do real-time 3d in Flash.  It’s called Mesh2Flash.  This tool was originally designed to showcase polygon meshes generated using the David Laser Scanner software, but I think this is great way to show off models made in any software.  All you need is the .obj or .dae format, and the Mesh2Flash.swf takes care of the rest.  You can find more information about Mesh2Flash here.

My biggest problem with this is that the .obj file must sit on the server with the Mesh2Flash.swf.  I’ve very little means to protect these objects from being stolen.  I tried password protecting the directory, but this only protected the directory.  With a direct link to the .obj file a person could read the file with a simple text editor, and take the object.  I think this is a dead end until I can find a means to secure my objects.  My objects are far too valuable to have hanging out on the server for someone to take and use or sell.  My understanding of the web is, “If you don’t want it stolen, then don’t put it on the web.”

Regardless of my fears, just imagine the possibilities of being able to pre-vis the 3d models a vendor might sell online.  What a fantastic way to “see” the mesh before purchasing it.   The Unity game engine would also be a viable way of showcasing real-time work in the browser, perhaps even more secure.

This model is not a scan, but is a primitive from XSI.  It’s was then triangulated, and exported as an “.obj” format for use with Mesh2Flash.

Click the image to launch the Mesh2Flash.

Example of Real-time 3d in Flash

Click and drag in the view to rotate it.
Arrow keys: Rotate view
+/-: Zoom in/out
Z/z: Zoom in/out
f/F: Decrease/increase camera focal length
s: Start/stop continuous rotation
a,r: Reset camera
q,e: Roll camera

Fountains, Fireflies, and Bucket of Balls

May 4th, 2010

More AS3 fun.

Fireflies.  Ok.  Not fireflies, but it reminds me of them.

Fountain.

Notice the scale change from birth to death.  It adds a nice dimension.

Dump Bucket.  I imagined a bucket of bouncing balls dumped onto the floor.  Classic bouncing ball from traditional animation ramped up.

Asteroids Ship

May 3rd, 2010

Lately, I’ve been doing A LOT of administrative work, and I’m tired of it.  Even though I have a shit ton of work to do for ARC, I decided to have some fun and chill out this Sunday.  I loaded up some old flash files of mine.  After having a conversation with an artist in town, it looks like I’ll be doing more AS3 work this summer, so I thought I’d warm up.  This one uses OOP!  The ship drawing, the ship animation, and the ships bullets are all independent.  This work is a rebuild of the great work taught by Keith Peters in the book, Actionscript 3.0 Animation – Making Things Move.  Mr. Peters didn’t teach how to combine the independent files, but I figured it out after a while.  Have fun spraying bullets!  Not that spraying bullets is much fun, but this is just the beginning.

Use the spacebar to shoot bullets, the up arrow to move forward, left and right arrow to rotate.  Be sure to click in the flash block to activate it.

Bag Rig

April 17th, 2010

Ulysses Unzueta is a student at Animation Mentor, and was a student of mine.  He needed the bag rigged for his scene, so I helped him out.  After studying his blocked shot I decided it was best to treat the bag as though it were a spine rig.  Only thing missing is FK joint chain for the spine.  I’ll add it later.  Here is Uly’s work in the refining stage.

Bag Rig

In this shot, the bag and the rig for the bag is my contribution.  The character, Stewie, is a product of the Animation Mentor online school.

You all can have the bag, too.  Cheers.  :-)    Download it.

Here’s a demo on the rig.

Bag Rig Demo

Adaptive Rigging

April 16th, 2010

After a conversation with my student, Jake, I was reminded of some old research and experiments I did between April and July 2007.  I spent my summer off from teaching trying to recreate Bernard Haux’s excellent rigging work.  I don’t think my work was nearly as clean as Mr. Haux’s, but I was tapping into some good ideas for character freedom.  The traditional animators of Disney were free to draw and not be limited by the technology’s or the technical director’s limitations.  They could make marks on paper, over and over again.  Their two primary tools are the pencil and the paper.  Simple.  Of course, I’m oversimplifying the traditional animation methods, but it is clear they were not bogged down by lists of tools or the failed design of a rig.  One of the most challenging principles to include in a rigid 3d character is appeal; I’ll refer to appeal as the quality of the contour lines.  Another challenging principle to include is squash and stretch; both automatic and manual S & S controls.  In fact, most 3d I see floating around the web lacks this essential principle.  In fact, often the animator is blamed for the lack of principles.  Yet, it’s not necessarily the animator’s fault, and is most likely the rigger’s engineering of the character’s movement failed.  It took me years to realize I was leaving out squash, even though I had achieved stretch.  Sigh.

This rig design would adapt to the needs of the shot and scene.  Allowing an animator to stay true to the storyboard and character designs.  This gives tools for the animator to “free” the character from conventional methods of animating a rig.

In this concept demo I had a laundry list of options I was trying to achieve.  Again, inspired by Bernard Haux’s demos.  The arm had to have:  1. IK/FK switching for the whole arm,  2. Independent IK/FK blending for upper arm and lower arm,  3. Independent scaling of upper and lower arm,  4. Each node can be “torn away” from it’s parent,  5. Reshape the arm with a curve and objects along the curve,  6. A free elbow achieved by having IK enabled for both upper and lower arm ,  7.  Blend in standard corrective shapes,  8. Independent stretch for upper and lower arm.  9. Finally, Re-sculpt the mesh at any point during animation and key the sculpt.  Take a look.

Adaptive Rig Prototype

The most successful outcome from studying Mr. Haux’s work, which I didn’t originally intend, was my step into object oriented programming or OOP.  After creating my first successful “arm” rig I decided to automate the creation of this complex problem, so I could modify and recreate it without the need to repeat a list of steps in the software.  Unable to automate the entire rig due to time constraints I completed one facet of this problem.  That facet being the rig that runs along the curve.  The “back bone” of my rig.  Curve rigging has led me to some wonderful work, and has even changed the way I model.  Now it’s possible for me to draw any curve or curves, and apply a rig to the curve with the click of a button.  I build several features into this rig, and more recently have added sine wave auto-animation feature into it.  Probably the strongest feature is the built in squash and stretch based on the length of the curve, and based on the compression of the object along the curve.  Take a look at the curve auto-rig.

Rig From Curve

Programming the remaining rig setup was the next step, but I lost steam and time.  Why did I lose energy?  Well, I attended SIGGRAPH 2007 shortly after completing the demo reel.  While there I learned from a few Dreamworks and Lucas Arts riggers that Python is THE programming language of choice in the 3d entertainment industries.  That’s when I lost steam.  I was doing ALL of my programming in J-script.  Pfft.  (I discovered years later, after trying to find info on how to use OOP in J-script that it simply is impossible to have true OOP in J-script).   I stopped pushing this rig after running out of energy, and running out of time, and a new semester was about to begin.  Regardless, here’s my demo reel from July 2007.

Demo Reel 2007

My dream is to return to this problem, and complete it in both XSI and Maya.

My most recent use of the curve rig is in Red, the Ball with a Tail.  You’ll find superior squash and stretch with both the ball and the tail.