Back to plugins

Layer for AC3D

Released under the GNU LESSER GENERAL PUBLIC LICENSE.

Download Windows version 1.0.2
Download Linux (Debian) version 1.0.2*
Download Linux (RedHat) version 1.0.3 **
Download source code

* NOTE: The Linux Debian version was compiled and linked on a Debian 3.0 install. If this does not work for you, the source code has been proven to compile/link under Linux, so you may wish to download the source code and compile for your system.

**NOTE: Courtesy of Eldon Brown. From the enclosed Readme:
This port of "layer" was compiled on RedHat 7.3 with gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113).
It has been tested and known to work using "ac3ds" (ac3d static) on RedHat 7.3 and Fedora 3.0
To install; copy "layer.p" and "layer.tcl" to the ac3d plugin directory, then restart ac3d.

History

Version 1.0.2

  • FIX: Corrected code to recognize newer versions of AC3D.
  • CHANGED: When "Save layer info in AC3D data" was checked, "ddhlayerx" strings were saved in your objects' Data property, which caused conflicts with POV-Ray renders. This string has been changed to "//dlayerx", which is ignored by POV-Ray.

Version 1.0.1

  • FIX: When adding a group of objects to a layer, all child objects are added.

Other history

  • Jul 12, 2005: Introduced source code courtesy of AJ MacLeod to allow compilation under Linux.

NOTE: By default, the AC3D Layers plugin uses each object's data field to store layer info. This storage does not overwrite any existing data in the object's Data field. See below for more info.

This plugin allows you to arrange your AC3D objects into layers, letting you show/hide/select/deselect entire layers at a time.

This plugin and code are freely distributable

AC3D versions prior to version 5 have not been tested with this script, and should not be used with this plugin.

Description

Layers are an additional way of organizing data beyond groups. A layer is simply a collection of groups/objects that you may show/hide/select/deselect as a unit.

Selecting/deselecting layers is an additive/subtractive process. This means that if you have some objects selected, then you perform a "deselect" on a layer, only the objects in the layer are deselected - objects outside the layer are left alone.

There are 10 layers available.

Interface

The layer interface (as shown above in the screenshot) allows you to add objects to layers, or show/hide or select/deselect objects already in layers. Each "row" in the layer interface displays the layer number followed by the number of objects in the layer. This is then followed by layer controls. Controls/elements for each layer are as follows:

Number (0-9) This is the layer number.
Number (arbitrary) The number of objects in the layer.
+ (add) Adds the currently selected groups/objects to the layer. Note that you may add groups and their children to separate layers.
S (Show) Shows all hidden objects in the layer.
H (Hide) Hides all visible objects in the layer.
s (Select) Adds all objects in the layer to the current selection.
d (Deselect) Deselects all objects in the layer.

Further options include:

Save layer info in AC3D data If this is checked, the "Data" property of each object added/removed to/from a layer will be updated. Please see notes on using this feature later in this document.
Autorefresh If this is checked, the "number of objects" in each layer are updated dynamically as you work.
Refresh If Autorefresh is disabled, this refreshes the object counts/data in the layers interface.

Installation

Copy the layer.tcl and layer.p files to your AC3D plugins folder (for example, if using Windows, C:\Program Files\AC3D5\plugin) and (re)start AC3D.

You will find the "Layers..." menu item under the "Tools" menu.

Usage

Add objects to layers by clicking the "+" button while groups or objects are selected in AC3D. Once objects are added to a layer, you may show or hide them by clicking the "S" and "H" buttons for that layer, and you may select or deselect them by clicking the "s" and "d" buttons for that layer.

Saving layer data

If you check the "Save layer info in AC3D data" checkbox on the layers form, the plugin will write layer info to the Data field of each AC3D group/object contained within a layer. This allows you to save layer info with your AC3D document.

Layer info is appended to any existing data you may have, so no existing data is destroyed.

WARNING: if you need the data element of each group/object to be pure, do not enable this checkbox. NOTE: For most people, this should not be an issue. If you're not sure whether this is an issue or not for your own work, then it very likely isn't.

The layer info that is added to the Data field when this option is enabled is the text "//dlayer", followed immediately by a single character. Therefore, if an object's Data field contains the following text:

This is text about my object.
blah blah blah.

... and the object is added to layer 2, the text would become:

This is text about my object.
blah blah blah.
//dlayer2

NOTE: Unchecking the "Save layer info in AC3D data" checkbox does not remove "//dlayer#" entries in your Data fields.

Known issues

If the "Save layer info in AC3D data" checkbox is not enabled, and you delete an object in a layer then "undo" the deletion, the object may not get re-registered as being part of the original layer. You may need to manually add it back.

Advanced options

Checkbox defaults

If you find yourself wanting the "Save layer info in AC3D data" field to be unchecked by default when the layers window comes up, edit the "layers.tcl" file and change this line:

set g_ddhlayer_usedata 1

to:

set g_ddhlayer_usedata 0
You may also turn off autorefresh by default by changing this line:
set g_ddhlayer_autorefresh 1

to:

set g_ddhlayer_autorefresh 0

Back to plugins



All content Copyright © 2006 Dennis Hawthorne, except where explicitly noted
supercoldmilk © 2006 Dennis Hawthorne