ScriptSpot

Forum topic · General Scripting

Max unhide all command

By xXDambielXx · 2017-09-27

Description

I'm sure I'm just using the wrong keyword to search and the answer is readily available, but how do I run:

Max unhide all

from a script and have it either not prompt about unhiding hidden layers, or feed it the answer no from the script? Everything I try #nopompt, with quiet true, either fails or does nothing.

thanks in advance.

Comments (4)

Thanks but..

xXDambielXx · 2017-09-28

Hey guys, thanks for the replies, both commands do unhide all objects, unfortunately that includes unhiding hidden layers which I didn't really want. After some fiddling (I hate the layermanager functions) I came up with this:

for o in objects where o.ishidden do
(
if (LayerManager.getLayerfromname (o.layer.name)).ishidden == false then
o.ishidden = false
)

Which seems to unhide objects that aren't on hidden layers as required. Is there anything wrong with that script or something that would make it better, faster, w/e?

Thanks again.

.

jahman · 2017-09-28

Why not iterate over layers instead?


nodesToUnhide = #()
for i=0 to layerManager.count-1 where not (_layer = layerManager.getLayer i).isHidden do
(
    local tmpArray
    _layer.nodes &tmpArray
    join nodesToUnhide tmpArray
)
nodesToUnhide.isHidden = false

`

pixamoon · 2017-09-28

Hi,

try this:


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

.

jahman · 2017-09-28

objects is a collection so you can simplify it to:


objects.isHidden = false