Posts Tagged ‘SI’

Medical Animation – Stent

Monday, August 16th, 2010

Back in June, while helping Dave Spamer with the Tron remake, he asked for some help creating a medical animation.  Now that all the secret parts have been removed from the animation, here’s the part that I worked on.  My contribution was  rigging and shaders for the vessel animation.

Medical Animation

Tron

Tuesday, 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

Monday, 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

Sunday, 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);
}

Illustrator File to 3D – Extract All Subcurves

Saturday, 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

Monday, 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

Adaptive Rigging

Friday, 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.

Red, the Ball with a Tail

Wednesday, March 17th, 2010

After reading the request of a starving animator on cgtalk.com, I present to you, free of charge:

Red, the Ball with a Tail! (XSI)

Red

Red, the Ball with a Tail

When you load the scene you can see the default controls; translation and rotation controls for the ball and rotation controls for the tail.  From here, you should have everything you need to make a traditional bouncing ball with a tail.  No need to do anything else!  Start animating.   However, the tail is more than meets the eye!

Red's Tools

Red's Tools

If you haven’t already, load the xsiaddon I included in the zip file.  In there you have a set of basic tools for hiding and showing the rig, as well as resetting the whole rig, rig selections, or your current selection.  The toggle_tail and toggle_sqsrt are to swap between different sets of controls.  Clicking on toggle_tail reveals a new set of free deformers for the tail.  The orange controllers are to change the shape of curve running through the tail.  The teal/blue controls are for completely warping the form of the tail as you see fit.  The red one is for twisting the tail (though without a texture or hair this is hard to see).  The yellow is special as it has sliders (using the keying panel to the right) for animating the tails compression along the curve, tapering, scaling (I love scaling options), and wave controls; frequency, amplitude, offset and noise.  These can be used by hitting Play at the time slider, and increase the frequency to see the waves.  Perhaps you can find interesting ways to use these controls to create unique emotion for Red, the Ball with a Tail.

A few more things about this rig and scene.

  1. Place both the scene and scntoc file into your scenes folder.  Install the addon by dragging and dropping the file into an empty viewport.
  2. Keyframes can be saved using “Key All Keyable” (default in the scene) or by “Key Character Key Set”.  I think Key All Keyable is a good way to work, but I included the Character Key Sets for your convenience.
  3. After closing red_theballwithatail toolbar you can find it under view > toolbars.
  4. A minor irritation, after using hide_rig, toggle_sqsrt has to be clicked twice to show the ball translation and rotation controls.
  5. A couple things are not completely implemented.  For example, the OPTIONS > Scale_of_Rig works fairly well, but the tail will need the scale compensated.  I’m still fleshing out the answer for that.  Another problem is when squashing and stretching the ball, well, the tail doesn’t “follow” the deformation.  I’m working on that, too.  I don’t think these are critical issues.  It’s a very usable and friendly rig.

If you have any questions, concerns, complaints, or “bugs” to report, then please post it here.  I’ll answer as best as I can, and as fast as I am able.

Please send me a video (720×480) or a link of your final results animating with my rig.  I’d love to include your work in my demo reel and website!  Thank you!!

Sketching Waves and Dynamics

Sunday, March 14th, 2010
cactus

Waves Experiment

In August 2008, I was experimenting with building sine waves into my rigs, and I used this weird cactus object for the testing grounds.  Click the image to see the results and the control panel.  I was able to offset each wave to a unique object along the branch.  In case you’re wondering what the weird surface is, it’s a cube instanced onto the surface using a hair object.  It’s all very simple and fun to play with.

Later, around April 2009, I created dynamic tree branches that had secondary animation.  As the root was oscillated with a sine wave the branches would respond dynamically.  Each branch can be animated manually and can have the dynamics blend in and out.  I never did get to the stage where I could build these things automatically.  At least, not this dynamic branch.  This branch was made in an hour, so it’s not very usable.  It’s purely for experimental purposes; sketching, if you will.

dynamics

Dynamic Branches Experiment

Thera-P-Fin, by Maria Sclafani

Thursday, March 11th, 2010

Here’s work completed for my client, Maria Sclafani, in 2006.  Maria asked me to create a visualization of her invention.  She came to me with a homemade modified swimming fin.  It had cloth super clued to a cut rubber fin to demonstrate to me what it should look like.  In addition she had a few crude drawings I then interpreted to create the visual below.  It’s fun and challenging to create something from another person’s mind’s eye.  Maria is seeking a manufacturer to build her product, and uses this visual to promote her ideas.  She now owns the patent to her invention, and has given me permission to share the work I’ve done.  I look forward to seeing her make her first sale, and look forward to the next invention!

I’ve included the three variations of Maria’s design from 2004 – 2006.  Click the images for the movies.  The first, 2004, was modeled in Lightwave and rigged, animated, and rendered in Messiah (back in my “test-every-software” days).  The second, from 2005, was rendered, modeled, and animated in Lightwave.  The last, from 2006, was completed in XSI 4.2.

thera-p-fin

The Thera-P-Fin, by Maria Sclafani, 2006

aqua thera p fin 2005

Aqua-Thera-P-Fin, by Maria Sclafani, 2005

fin 2004

Aqua Thera-p-fin, by Maria Sclafani, 2004