Modelspace Layers in Workspace

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Modelspace Layers in Workspace

Post by clintonman »

Attached is a script and modelspace plugin for controlling modelspace layers from workspace. The installer makes a button that displays the control panel. Push the update button to populate the panel. It's best to create all the needed layers in modelside before using the layer panel.
wsLayersPanel.jpg
The 3 dots shows the layer status - visible, locked and hidden. The button next to the dots switches between hidden and visible. The middle dot is just for show since workspace can't lock items. Next is the color swatch of the layer. It's also just for show since workspace doesn't seem to get wireframe color updates from modelside. The "r" button changes the object render attributes for all objects in the layer. It cycles from object mode off, solid wire, transparent, transparent wireframe, wireframe and finally back to object mode off.
The "sel" button selects all objects in the layer, "add" adds the selected items to the layer and "x" clears the layer by moving all the objects in the layer to layer 0.
The name field is to the right of the layer id. The layers can be renamed by typing in the field and pushing the button to the right of the name. The number to the right of the name is the number of objects in the layer.
The slider determines the first layer that will show in the panel. Eight layers are shown at one time.

If you have the protect materials script installed this script will use it. If they are not installed you may want to put lightworks materials on everything, otherwise they will turn black.

That's the good stuff. Now for the bad and buggy part.

It runs a little slow because it switches the main window to modelspace when it runs the modelspace plugin then switches back to workspace.
Wireframe colors don't communicate through the bridge well. If you change the color of a layer in modelspace, workspace won't update.
The lights and camera's layer index doesn't update properly through the bridge. They only appear as layer 1 even if changed in the modelside. They also tend to jump around to different layers for no reason. This makes layer object counts inaccurate. I throw all the cameras and lights into layer 1, move objects around in the other layers and if the counts go off I put the cameras and lights back into layer 1. Once everything stabilizes I leave that layer alone and everything seems to work ok.

Clinton
Attachments
LayersPanel.zip
(90.52 KiB) Downloaded 283 times
Clinton Reese

http://clintons3d.com
Benji
Senior Chief Petty Officer
Posts: 280
Joined: 22 May 2009, 01:23

Re: Modelspace Layers in Workspace

Post by Benji »

This is really cool, thanks. :)

One question: is this script for 7.61, or can it be used in 7.6 as well?
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Modelspace Layers in Workspace

Post by clintonman »

It's for 7.61 full version only. 7.6 doesn't do multiple selections properly in script and 7.61Std doesn't have a model side.
Clinton Reese

http://clintons3d.com

Return to “Repositorium”