Re: script anyone?

Date : Mon, 18 Feb 2008 14:47:48 +0100
To : XSI(at)Softimage.COM
From : André Adam <a_adam(at)49games.de>
Subject : Re: script anyone?
This should do what you want; select a bunch of objects and execute the script. All selected objects are tested against each other and sorted into groups beneath the scene root if their global position is the same.

Cheers!

   -André

var cObjs = new ActiveXObject("XSI.Collection");
cObjs.AddItems(Selection);

while(cObjs.Count != 0){
 var cOut = new ActiveXObject("XSI.Collection");
 cOut.Add(cObjs(0));
 vBase = cObjs(0).Kinematics.Global.Transform.Translation;
 for(var i=1; i<cObjs.Count; i++){
   vTest = cObjs(i).Kinematics.Global.Transform.Translation;
   if(vBase.Equals(vTest)){
     cOut.Add(cObjs(i));
   }
 }
 if(cOut.Count > 1){
   ActiveSceneRoot.AddGroup(cOut, "PosGroup");
 }
 cObjs.RemoveItems(cOut);
}




Matt Lowery wrote:
Hi all,
I need a script that will select objects that have the same global transforms. Basicly objects that are on top of one another. Anyone happen to have a script like that lying around?


m(at)

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi

  • References:

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.