Need a little help...

Hey, ok so i have created all a bunch of boxes on a plane but now i need to have each box as an editable poly and then delete some random faces on each box.

Would I use a loop to go through every box and perform these actions? Ive been looking at the help but cant seem to piece it all together :(

Cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Vapourise's picture

Ah yes I seen now, I forgot

Ah yes I seen now, I forgot that it is a FOR loop and im used to seeing the generic 'i' used. I am pretty un-experienced also but it is nice for people to share and learn so thanks again :)

K

Vapourise's picture

P.s can I ask what the 'c'

P.s can I ask what the 'c' stands for in the 'allboxes' variable you defined?

Cheers again :)

K

lucky_lowell's picture

allBoxes= (for c in geometry

allBoxes= (for c in geometry where (isKindOf c box) collect c) -- gets boxes

I'm not very experienced and there are probably better ways, but when I find something that works i generally stick with it until it doesn't.
the above statement selects or loops through just geometry in the scene and places each piece of geometry in the "c" variable one at a time to test whether its a box or not. You can replace c with anything you want like "tempobj" or "i" or whatever
If it is a box it uses the collect function to place them in an array, which in this case is "allBoxes"

You could replace box with sphere to get an array of spheres in the scene etc.

allBoxes = $Box* as array -- this gives all the boxes as well or rather anything with the name box in it, It could be a light that you renamed with the word box in it. In this case probably not what you want.

this goes on...

Vapourise's picture

Hey, thanks lucky that seems

Hey, thanks lucky that seems exactly what I need! Your effort is much appreciated :)

Cheers, K

lucky_lowell's picture

this could work

allBoxes= (for c in geometry where (isKindOf c box) collect c) -- gets boxes

for i = 1 to allboxes.count do ( -- loop through all the boxes
p = convertToPoly allboxes[i] -- converts each to poly
polyop.deleteFaces p #(random 1 6) --select a random face and delete it
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.