We've got the most important part of layers implemented now; a group can be turned into a layer by setting its inkscape:groupmode attribute to "layer" (it defaults to "group").
For now, all this does is permit the objects in a group to be directly selected, rather than selecting the group itself (i.e. by clicking or rubber-banding). To fulfill all the expectations for layers, there are still some things we need to take into account:
- There needs to be a notion of a "current layer", where e.g. the drawing tools and paste operate.
- At present, this "current layer" is always the root SVG element.
- The current layer should probably be determined by the most recent object selected -- the object's first layer ancestor (or the object itself, if it is a layer) becomes the current layer until another object is selected. Deselection should probably not alter the current layer.
- We need to handle the case where the current layer is removed from the document (either directly, or because one of its ancestors was removed) or stops being a layer (due to an inkscape:groupmode change).
- To find a new layer to become the current, we need to walk up the (pre-removal) hierarchy to find a layer, as if the parent of the removed/unlayered object had been selected.
- We need a layer dialog -- an ObjectTree window (operating on SVG objects) similar to the XMLEditor (which operates on XML nodes) should fulfill this requirement.
- I personally lean towards the latter, though I think the former is what many apps with layers do. I think it depends on how much we think layers should break with their fundamental group-nature. -- MenTaLguY
- The main venefit from layers is being able to toggle visibility and editability of a layer. That's what layer palettes in most apps focus on, and what we must provide. As for selecting all objects within a layer, that may be useful too, but is of secondary importance IMHO. --bb
- Similarly, if a group's descendents are directly selected, should that group temporarily behave like a layer? Yes, options and dragging/copying should feel the same as if they were layers. Also de ObjectTree should reflect each action inmediatly.
- The schema should be something like this:
From another point of view we can reflect the schema like this: ObjectProperties LocalProperties (shape, color, etc) GroupProperties (Group/s the Object belongs to) LayerProperties PageProperties DocumentProperties
Styles, in both views are floating above everything as a PropertiesGroup that affects the Elements the user decide to assign to that Style. The mechanism could be as simple as CSS.
Adobe seems to export their layers as simple groups with id's
One of the nice things about illustrator is that it automaticly creates sublayers
When a new layer is created, Inkscape demands that I create a name for it. Most of the time, I don't care what it will be called. Suggesting names such as "layer 1", "layer 2", etc, would really be helpful, and you could still type in descriptive name if you were so inclined. Axiom 19:47, 21 September 2006 (UTC)
- I see now that is does work this way, sort of, but is not inherently obvious.
- How it should work (my thoughts): Click new layer button>Dialog comes up, the default name (layer2) is already in the input box and highlight. Since it is highlighted, if you start typing a layername, it will overwrite the default name with whatever you type, else you can just hit enter.
- How it should work, even better: You click the new layer button and it immediatly creates a new layer with the default name (layer3) and you can start drawing on it. If you want to change the layer name you can always click on that layer in the layers dialog. Axiom 14:23, 5 October 2006 (UTC)