PDA

View Full Version : Lock a gaggle of items


PixelFarmer
09-29-2006, 10:07 AM
Hello:
I haven't done much LScripting, but I'm starting to.
I have a gaggle of objects that I want to lock so I can hide them using the item filter in the dope sheet. I have created scripts to change their display properties (hidden, bbox, etc.), but I'm not able to figure out how to lock them. Say I have 100 objects named Image001.lwo, Image002.lwo etc). Below is what I have, I'd imagine its a simple thing to do.
Thanks.
Mitch
----------------------------------------------------------
@warnings

generic
{
SelectItem("Image001");
ItemLock();
SelectItem("Image002");
ItemLock();
SelectItem("Image003");
ItemLock();
...
}

Dodgy
09-29-2006, 10:29 AM
Hello:
I haven't done much LScripting, but I'm starting to.
I have a gaggle of objects that I want to lock so I can hide them using the item filter in the dope sheet. I have created scripts to change their display properties (hidden, bbox, etc.), but I'm not able to figure out how to lock them. Say I have 100 objects named Image001.lwo, Image002.lwo etc). Below is what I have, I'd imagine its a simple thing to do.
Thanks.
Mitch
----------------------------------------------------------
@warnings

generic
{
SelectItem("Image001");
ItemLock();
SelectItem("Image002");
ItemLock();
SelectItem("Image003");
ItemLock();
...
}

Well you could use my layers MC script, it allows grouping of items for locking/display control.

Otherwise I'd do this:

mysel=Scene().getSelect();
for(i=1;i<=mysel.size();i++)
{
myitem=mysel[i];
SelectItem(myitem.id);
if(!myitem.locked)
ItemLock();
}

PixelFarmer
09-29-2006, 11:58 AM
Thanks a lot Dodgy:
That script is useful.

Does the load/save function work w/item names or item ID?

Thanks again.

Mitch

Dodgy
09-29-2006, 12:26 PM
It uses item IDs so in theory it won't get confused with same name objects, or load from scene issues.