From Inkscape Wiki
Revision as of 13:04, 22 August 2010 by Touringlonewulf (talk | contribs) (suggestions for handling layers from a user point of view)
Jump to navigation Jump to search

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.
    • What behavior should result from selecting a layer in the ObjectTree or XMLEditor? Should that actually select all of the layer's children, or should the layer (temporarily) behave like a group in terms of dragging/rotation/whatever?
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:

MasterDocument Document Layers Page RightPage LeftPage Groups Objects

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

Adobe Developer Knowledgebase document #50557

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)

From a User Point of View: adding Selection to Layer Inkscape 0.47

Hi, seems this wiki-article on layers needs to be redone. A lot of old entry could be deleted, thing's already are working...!!??? Since I'm new I would prefer to leave this to the more experienced ones... (please delete this sentence when article is redone!)

in 0.47 the "Layers" are working quite good, but it still is a bit uncomfortable to move Objects/Groups/Selections between Layers, since you can only move them up or down by one layer each step.


  • 1) in the main menu under the point "Layers" having another point under "move up/down one Layer" which is "move selection to layer" then have a pop up menu where you can select from the layers you've created or create a new one.
  • 2) right click option by click on the layer widget in the status bar at the bottom: "move selection to layer" then have a pop up where you can select from the layers you've created or create a new one.
  • 3) in the layer-dialog(right hand side), where one can add and change layers/layer-order have three more buttons: two with the already existing function "move selection up/down one layer" (like in the menu) and a third one, when pushing it, you can choose a layer, the selection is moved to that layer you click on next in the layer-dialog box.
  • 4) drag & drop: simply make a selection, go to the Layer-dialog (as in point 3) ) and then just drag&drop the layer you want the selection to be moved to on the selection.
  • 5) importing/copying/open another .svg/bitmap file directly in one existing-/new layer. maybe even with drag and drop: e.g. two instances of inkscape are running, with two different .svg's. now you want to import a selection from "ab.svg" to "xy.svg", so select it in the one window and drag&drop it to the other one, when dropped it is dropped directly in the active layer.

(((since I'm using the german version menu and object names might be different))) --Touringlonewulf 13:04, 22 August 2010 (UTC)