Posts Tagged ‘rigging’

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