Lost an old script for adding nulls to selected meshes and enveloping to them.


#1

Howdy guys.

So a long time ago, I had a very short script for adding nulls to every selected mesh in the scene, then it would weight the mesh to those nulls at 100%.

Unfortunately I can’t find that script anymore, and the place where I got it from originally is long gone (XSIBase.com)

I was hoping that body knew of a script that did that same thing. I don’t mean to sound lazy, if this request is bigger than I remember, or if nobody is able to help me, then I’ll relearn XSI scripting. but I (maybe mistakenly) feel like this is something that someone could whip of very quickly, opposed to all the time it’d take me to learn and do it myself.

Any help is appreciated.


#2

Select objects and run (Jscript):


var oSelected = new ActiveXObject("XSI.Collection") ;
oSelected.AddItems(Selection);
for (var i=0;i<oSelected.Count;i++)
{
 var oNull = GetPrim("Null", oSelected(i).name+"_Null", null, null);
 MatchTransform(oNull, oSelected(i), siTrn, null);
 ApplyFlexEnv(oSelected(i)+";"+oNull, null, 2);
}

it matches the null’s translation to the object’s center, so make sure the object’s center is where you want it to be…


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.