Swapping Curves: Here's the solution

Date : Mon, 28 Jan 2008 10:07:13 -0600
To : XSI(at)Softimage.COM
From : "Bradley Gabe" <withanar(at)gmail.com>
Subject : Swapping Curves: Here's the solution
Thanks to Sergei and Ciaran for their help, I was able to built the custom tools I needed for swapping Animation Control icons. I've posted the important block of code info below in jscript that allows you to grab the entire curvelist set of data from a source and build the same curve data set on a target curve object. The same basic technique should work for polygon and nurbs meshes as well:

// Get curve data from geometry source

var vbArgs = new VBArray(sourceObj.ActivePrimitive.Geometry.Get2(siSINurbs));
var args = vbArgs.toArray();

// Freeze target and copy all curve info at the Geometry level
FreezeObj(targetObj);
targetObj.ActivePrimitive.Geometry.Set(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], siSINurbs);

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.