PDA

View Full Version : scene objects controler


loran
02-19-2004, 05:55 PM
I have to visually control hundreds objects of a scene one by one (all at the same position 0,0,0)

I would do a script that show each objects of the scene individually by pressing a button "next".

the script unhide the first object, then by pressing the button hide the first and show the next object...etc

any suggestion?

here is my test that failed ://

-------------------------------------------------------------------------------
utility massexport "object controler"
(
button doit "show NEXT"
on doit pressed do
(
testok = false
for obj in objects do
(
if testok == true then
(
max unhide all
select obj
max hide inv
)
if obj.name == selection[1].name then
(
testok = true
)

)
)
)

Cthulhu
02-19-2004, 08:48 PM
you simply forgot to exit the loop after selecting the new object. also you do have to do some checks if you want to restart at the first object when the last one is selected.

this would be an easier way to doit:

on doit pressed do
(
curSel = finditem (objects as array) selection[1]
if curSel == objects.count then curSel -= 1 -- or curSel = 0 if you want to loop
max unhide all
select objects[cursel+1]
max hide inv
)

;)

loran
02-20-2004, 07:41 AM
that 's ok!!
thanks for your help Cthulhu

:)))

CGTalk Moderation
01-17-2006, 12:00 PM
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.