PDA

View Full Version : Boolean for Named Selection Sets?


cganimator
07-18-2006, 01:50 AM
Is there any special function for boolean between selection sets?

For example, when I subtract the member of selection set A from selection set B.

If there is not a special function, should I use for loop?

j-man
07-18-2006, 10:07 AM
you cannot boolean selection sets, or multiple objects in one go.

Attched them together, or use multiple booleans but remember to collapse them between booleans!

BTW you can use


msh=$myobject1+$myobject2


Josh.

Bobo
07-18-2006, 04:02 PM
Is there any special function for boolean between selection sets?

For example, when I subtract the member of selection set A from selection set B.

If there is not a special function, should I use for loop?


*Create two boxes, create a named sel. set "Boxes"
*Create two spheres, create a named sel. set "Spheres"

Now execute:

array1 = for o in selectionSets["Boxes"] collect o --collect into an array
#($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000])

array2 = for o in selectionSets["Spheres"] collect o --collect into another array
#($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

join array1 array2 --union!
#($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

SelectionSets["Union"] = array1 --create a new sel. set
#($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])


For Subtraction, go the other way:


array3 = for o in SelectionSets["Union"] collect o --turn sel.set into array
#($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

--for every object in "Boxes" which is also in the Union array3,
--delete the item from the array3
for o in SelectionSets["Boxes"] where findItem array3 o > 0 do deleteItem array3 (findItem array3 o)
OK

SelectionSets["Union"] = array3 --then assign the reduced array3 to the same sel.set
#($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

SelectionSets["UnionMinusBoxes"] = array3 --or create a new sel.set
#($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

j-man
07-19-2006, 09:39 AM
ooh - I see I've mis-understood the question! booleans on the brain.

J.

CGTalk Moderation
07-19-2006, 09:39 AM
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.