View Full Version : how to do this ?????
bmlokesh 01-02-2008, 08:11 AM I am trying ot write a script for unhiding and unfreezing all the objects including layers
my code is like this
It should basically select every object including helpers, shapes, geometry ......
Here I am trying on simple boxes
for o in selection where not(o.layer.on) and (o.layer.unfreeze ) do o.layer.on = true
(
select $box*
unhide selection dolayer:true
unfreeze selection dolayer:true
)
This is working fine but I have to run the same code for 3 times to get what I desire
anything wrong with this code???????
Thanks in advance
|
|
U.S.S. Speed
01-02-2008, 04:47 PM
I've just check this :
Everything = ($objects) as array
for o in Everything do
(
unhide o doLayer:True
unfreeze o
)
And it appears to work fine.
Little note, I learned the hard way to not use "select" in a maxscript. Maybe I was doing it wrong, but it always slowed my script to hell when it was called too often.
RustyKnight
01-02-2008, 09:49 PM
I am trying ot write a script for unhiding and unfreezing all the objects including layers
my code is like this
It should basically select every object including helpers, shapes, geometry ......
Here I am trying on simple boxes
for o in selection where not(o.layer.on) and (o.layer.unfreeze ) do o.layer.on = true
(
select $box*
unhide selection dolayer:true
unfreeze selection dolayer:true
)
This is working fine but I have to run the same code for 3 times to get what I desire
anything wrong with this code???????
Thanks in advanceU.S.S. Speed approach is correct, but I might also add
unfreeze o doLayer:true
as well, just to be sure.
The reason, I think, your original code is having problems is the fact that you are only look at layers that are off and unfrozen, which may be limiting your results...
Shane
Gravey
01-03-2008, 12:33 AM
just to add a bit more to what has already been said:
i think the simplest and fastest way would take only 2 lines unfreeze objects doLayer:true
unHide objects doLayer:true if you also want to select everything, use select objects
CGTalk Moderation
01-03-2008, 12:33 AM
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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.