DisplayLayersMC LScript version 2.5.1)
(Tested with 2.5.1 but may work with versions 2.3 and above.)
written by faulknermano, Lernie Ang

 

BRIEF

This is a script that controls the visibility and the locked/unlocked statuses of items. Furthermore, it also enables to control a limited subset of an item's render options. Specifically, you can toggle the states of Self Shadow, Cast Shadow, Receive Shadow, Unseen by Camera, and Unseen by Rays.

Items are assigned to layers which contain either visibility or render attributes. Any item placed under a layer will obey these atributes.

 

INTERFACE

The interface is resizable.

The interface you see above is the Display Layer porton. It is divided into five parts:

1.) Layer List: the list contains the layer name, the visibility attribute and the locked/unlocked attribute. The following are the acronyms and their respective meanings:

a.) HD - Hidden
b.) WF - Wireframe

c.) FF - Front Face
d.) SS - Smooth Solid
e.) TX - Textured Solid
f.) LCKD - Locked
g.) UNLK - Unlocked

Note that the attribute of locked/unlocked is independent of the visibility attributes.

2.) Visibility Buttons: these five buttons control the visibility of the selected layer. Note that you must have a selected layer for this to function. The acronyms are similar to ones listed above.

3.) Lock/Unlocked Buttons: these two buttons control the lock/unlocked attributes of the layer.

4.) Add To Layer: this takes the selected item in Layout and puts it under the selected layer. If this button is unavailble, you either do not have an item selected in Layout, or you do not have a layer selected.

5.) Layer Menu: this is a menu control relating to the aspects of manipulating or using the layers.

a.) New Layer: this create a new layer by prompting you for a name.

b.) Rename Layer: this renames the currently selected layer. It will prompt you for a new name.

c.) Release Layout Item from Its Layer: this takes the selected item(s) in Layout and releases them from any layer they happen to belong to. This frees them from any effects of changing the layers' attributes.

d.) Select Items in Layer: this will select the Layout items that is contained in the layer you have selected on the interface. See BUGS & LIMITATIONS below.

e.) Clear Items in Layers: this clears all entries in the selected layer(s). You can have multiple layers selected.

f.) Delete Layer: this deletes the selected layer(s). Multiple layers can deleted at the same time.

This is the Render Layers portion.

1.) Layer List: the list contains the layer name and their corresponding Render statuses. They are namely:

a.) S - Self Shadow
b.) C - Cast Shadow

c.) R - Receive Shadow
d.) UC - Unseen By Camera
e.) UR - Unseen By Rays

The Y and N signifies "yes" and "no" which denote the state of each particular attribute.

2.) State Buttons: on the left side, just like in the Display Layers portion, are the buttons to toggle the particular mode.

3.) Add To Layer and Layer Menu: this is identical to the Display Layers, except that the commands only affect the Render Layers list.

Note that some items may be unavailable at one time or another. This will be most likely due to either not selecting anything in Layout or having no layer selected, as some commands require both to have selections.

 

BUGS & LIMITATIONS

There are currently some interface display problems associated with putting up multiple requesters. When you use commmands which bring up another requester other than the main UI (e.g. New Layer, Rename Layer, Delete Layer, etc), take care not to move the second requester. If you do, the main UI will display OK and CANCEL buttons and will block some of the buttons located below. If you need to move the second requester to a more convenient place you can do so. However, when the display gets garbled, simply close the main UI and and open it back again; this will, more often than not, fix the UI. There are no known consequences of this other than a display problem.

Please take note regarding the way DLMC operates regarding item names. DLMC stores and refers to item names only. If you rename an item after it has been assigned a layer, it will be removed from that layer. Furthermore, to avoid confusion, always rename multiple instances of objects, like null objects, explicitly. So, instead of "Null (2)", rename it to "Null_02" or something like that to ensure that deleting a fellow Null item will not inadvertedly rename their instance 'ranking.'

***APPENDANT TO BUGS & LIMITATION (11.15.02)***

There is an unworkable LightWave bug regarding proper referencing of names of bones. This is the description of the bug: When you name a bone, say, "R_Foot", and name a another bone (anywhere in the LightWave scene) "R_FootDir", the SelectByName function of LightWave (and consequently LScript's) will not reference properly when you use the name "R_Foot" if "R_FootDir" is listed above "R_Foot". This is how it seems to operate: LightWave goes through a matching scheme for every letter of the item. If you had used Select By Item Name and inputted "R_Fo", it would have looked for the first item to have that those sequence of letters. So in this case, if "R_FootDir" supercedes "R_Foot" in the Scene Editor, "R_FootDir" is selected because it qualifies as "R_Fo" and it is the first of the qualifiers. Consequently, DisplayLayersMC will not be able to counteract this behavior (and it truly depends on this command to function properly) and items that qualify for this bug will not be affected by any of the functions of DLMC. While they are technically stored inside the layer, the system by which the layers operate will not be able to access and change that particular item's attributes.

Remember, this bug is thankfully limited to bones.

 

*** APPENDANT (03.10.03) ***

Fixed a layer renaming bug as well as some multi-requester handling.

Bug report, comments, etc... contact me at: faulknermano1@yahoo.com