script speed is not good

mysel = selection as array
for obj in selection do obj.layer.select true
$.ishidden = true
mysel.ishidden = false

in big scene , speed is very slow
is that good idea ?

Comments

Comment viewing options

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

Use with redraw off

with redraw off
(
-- code here.
)

or use disableSceneredraw()/enbleSceneRedraw()

barigazy's picture

...hide unselected nodes in the own layer

Yup. As Kostadin said "with redraw off (/*...your code...*/)"

layNames = #()
for o in selection do appendIfUnique layNames o.layer.name
with redraw off
(
	for i = 1 to layNames.count do
	(
		(LayerManager.getLayerFromName layNames[i]).nodes &theNodes
		hide (for o = 1 to theNodes.count where not theNodes[o].isSelected collect theNodes[o])
	)
	free layNames
)

bga

dussla's picture

pls i use max9 32bit, that is not work

perpect
good good good
thank you really really

barigazy's picture

...

If you have problem then change 2nd line to

for o in selection where finditem layNames o.layer.name == 0 do append layNames o.layer.name

bga

barigazy's picture

wow man ... max 9

I did not know anything about mxs when I used this version. Maxscript is changed a lot since max9. You will have more problems with newer code.

bga

miauu's picture

Hey, Branko, if I remember

Hey, Branko, if I remember correctly for CheckMate tools contest(TurboSquid), one of the requirements was the tools to support max7. :)
Max 9 with AVG extension is good enough.

barigazy's picture

:)

are you kidding me. That's the challange more then contest.:) Sure max9 is more powerful then max7. Do you remember last comment on these thread on first page :)
http://forums.cgsociety.org/showthread.php?f=98&t=1070669 Denis put very nice(funny) message for max9 and below users.

bga

Comment viewing options

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