PDA

View Full Version : hide unhide speed in maxscript?


bkravi
10-24-2009, 04:43 PM
Hi,

I am hidding unhiding objects in my scene using maxscript (using for loop) by simply checking the ISHIDDEN property of each object, but it is performing very slow compared to standard max hide unhide, I have more than a 6 million face count of my scene. how can I make it perform more faster?


Thanks
Ravi

denisT
10-24-2009, 04:58 PM
Hi,

I am hidding unhiding objects in my scene using maxscript (using for loop) by simply checking the ISHIDDEN property of each object, but it is performing very slow compared to standard max hide unhide, I have more than a 6 million face count of my scene. how can I make it perform more faster?


Thanks
Ravi
you have to hide/unhide by collection of nodes. Collect all nodes that have to be hidden/unhidden and hide/unhide...

unhide (for obj in objects where obj.ishidden collect obj)

if you want to speed it up a bit do it with UNDO OFF
There are no special-magic-hidden techniques to speed these operations up...

bkravi
10-25-2009, 03:51 AM
Hi denisT,

I was doing it another way by checking ishidden property of each object and also setting it to true or false without using collections may be that is the reason of slow speed, collection method is much much much faster.
below is the timestamp results for 6400 standard spheres with 6144000 faces.


for obj in objects where obj.ishidden do obj.ishidden = false

this takes a long 27.39 sec to unhide , very very slow


unhide (for obj in objects where obj.ishidden collect obj)


this takes only 0.406 sec to unhide




Thanks again
ravi

PEN
10-26-2009, 12:23 PM
You could also disable the scene redraw which the loop is working. I'm guessing that is what is slowing everything down. Once complete you can enable scene redraw and then redraw the whole scene.

CGTalk Moderation
10-26-2009, 12:23 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.