AtrusDni
01-05-2007, 02:37 AM
Ok so what i am trying to do is this, image that you have 2 spheres, offset from eachother so they aren't intersecting, and you combine them, delete history etc. You are left with "technically" 1 object, but its composed of 2. Ok this is what we will call "object1".
Next you just have a normal sphere. "object2".
What I am trying to do is break apart all objects that arent connected, and return the names in an array for both objects.
I already have both objects names stored in strings like so:
string $obj1 = "object1";
string $obj2 = "object2";
what im trying to do is get 2 arrays to gather the contents after seperation like so:
string $multiObjLst1[] = `polySeperate $obj1`;
string $multiObjLst2[] = `polySeperate $obj2`;
then combine the arrays to have a master list:
string $allObjs[] = stringArrayCatenate($multiObjLst1,$multiObjLst2);
From what I can tell, the first one works fine because it is the two combined sphere objects, but the second one just errors out saying that its just one object. I know its one object, but is there anyway to run the polySeperate command and even if its just 1 object store that into the array and catenate them? Am I going about this all wrong? Any info would be mucho appreciated. Thanks.
P.S. - with this example obviously we know which should be seperated and which shouldnt, but imagine a scene thats hundreds of objects and maya needs to figure out if its really one object or if it can break it apart, if that makes sense . . .
Next you just have a normal sphere. "object2".
What I am trying to do is break apart all objects that arent connected, and return the names in an array for both objects.
I already have both objects names stored in strings like so:
string $obj1 = "object1";
string $obj2 = "object2";
what im trying to do is get 2 arrays to gather the contents after seperation like so:
string $multiObjLst1[] = `polySeperate $obj1`;
string $multiObjLst2[] = `polySeperate $obj2`;
then combine the arrays to have a master list:
string $allObjs[] = stringArrayCatenate($multiObjLst1,$multiObjLst2);
From what I can tell, the first one works fine because it is the two combined sphere objects, but the second one just errors out saying that its just one object. I know its one object, but is there anyway to run the polySeperate command and even if its just 1 object store that into the array and catenate them? Am I going about this all wrong? Any info would be mucho appreciated. Thanks.
P.S. - with this example obviously we know which should be seperated and which shouldnt, but imagine a scene thats hundreds of objects and maya needs to figure out if its really one object or if it can break it apart, if that makes sense . . .
