sub-layers: tips on best use?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

sub-layers: tips on best use?

Postby brynn » Mon Aug 16, 2010 6:13 pm

Hi Friends,
I haven't used sublayers thus far in Inkscape, and have set about to learn. But something about it seems....confusing, let's put it that way. And I'm hoping someone can exlain the logic or reasoning. So it's not a huge problem, it just helps to understand how Inkscape works.

Let's say I have Layers "1 - sketch", "2 - colors", and "3 - shading". If I select Layer 2 - colors, and create a sublayer, there appears a new layer in the Layers dialog which lies below Layer 2, and indented. And I assume that in the image itself, the new sublayer, let's call it Layer "2.1 - gradients", lies below its parent Layer 2. And I also want another sublayer of Layer "2 - colors" called Layer "2.2 - blurs", which I assume lies below Layer 2.1 in the image.

Ok, I would set it up this way because it makes sense to me to have the layers involving the basic coloring of my sketch, all grouped together in this organized manner. However, Layer "2 - colors" contains my base colors, "2.1 - gradients" obviously contains the gradients, and "2.2 - blurs" also obviously blurs. Therefore, I would want Layer 2.1 to lie above Layer 2, and 2.2 above 2.1.

The way the Layers dialog works, I can't do that. It won't let me move sublayers above their parent layer. So what do I need to do here -- forget about using sublayers; make "2.1 - gradients" and "2.2 - blurs" to be sublayers of Layer "3 - shading" (which seems illogical); or adopt a different understanding of sublayers (which I'm hoping you can describe for me)? Or another option that occurs to me -- use the parent layer "2 - colors" just as a descriptor, but not to really contain anything. Then I would have a 3rd sublayer containing the base colors. Because I do find that I can change the order of layers within the parent layer, but not move them above it.

Hopefully you can understand what I'm describing? I could put up a screen shot, but not sure it would help.
So it seems like I'm missing something in the understanding of sublayers. I have read the manual, but it didn't clear anything up for me. Possibly following a detailed tutorial would help, but I haven't searched one out yet. If anyone knows of one that covers sublayers - beyond the general how-to's, that would be great.

But otherwise, what or how is the best use of sublayers?
Thanks for your help :D

Edit - Well now it appears that my Layer 2.1 does lie on top of Layer 2 -- which is what I wanted to happen, so that's good. But it makes it more confusing, since 2.1 can only be listed below Layer 2 in the dialog!

Edit #2 - topic title

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: sub-layers: tips on best use?

Postby tomh » Tue Aug 24, 2010 9:27 pm

The thing to remember when dealing with any inkscape layers is that they are just svg groups. and that which comes out on top just depends on the order of those groups in the svg file. Sub layers are just groups within the group that makes the main layer. This makes sub layers more confusing as you normally don't have to think about paths outside of a layer, but you do with sublayers.

eg: (in sudo code)

Code: Select all

<svg>
<group inkscape=layer 1>
<path>   (will be at bottem)
</group>

<group inkscape=layer 2>
  <path ...>
    <group inkscape = sub-layer 1>
        <path 2...> (in sub-layer, will be below path 3, but above path 1, eg is in middle of  layer 2)
    </group>
  <path 3> (in layer 2, will be on top)
</group>


The other thing about sub-layers is that the z-order multiplication (the lower/raise selection by one step thing) is split between the layers dialogue and the main toolbar which can give some unpredictable results

vwanweb
Posts: 169
Joined: Sun Jun 06, 2010 1:48 pm

Re: sub-layers: tips on best use?

Postby vwanweb » Wed Aug 25, 2010 12:54 am

one use, Before converting text to paths, I create a sub-layer. Ctrl+A all my Text objects on the parent layer, then go to the sublayer and ctl+alt+v (>Paste >In Place) then hide the sublayer. I do this as a quick on canvas backup of the reference text's setting, font, size, bold, etc.

So one use is to backup your work, text, shapes, etc until you have 'finalized' your drawing, then you can delete the sub-layers.

Great for using blending on offset, blurred, filtered or unfiltered items below the parent layer too.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: sub-layers: tips on best use?

Postby brynn » Wed Aug 25, 2010 3:06 am

Thanks tomh and vwanweb, I'm driving myself crazy trying to sort out sublayers.
Ok, I can understand that layers really are just groups, and that sublayers are really "sub-groups". And it may be that if I continue to apply that logic as I work, I will eventually have the "aha" (really understand it). But I'm afraid the "sudo SVG code" is even more confusing :( (not because it's "sudo" but because it's SVG code, lol)

This makes sub layers more confusing as you normally don't have to think about paths outside of a layer, but you do with sublayers.

I don't know what you mean by "paths outside of a layer".

The other thing about sub-layers is that the z-order multiplication (the lower/raise selection by one step thing) is split between the layers dialogue and the main toolbar which can give some unpredictable results

Do you mean that the Layers dialog isn't necessarily a visual "map" of the z-order?

I'm sorry I couldn't following your code example, because I just haven't become familiar with SVG code yet. So if you could explain it without using SVG, I think it would be easier for me to understand. Unless an understanding of SVG is integral to understanding sublayers? If that's the case, then I guess it's time for me to start learning :D

Thanks again.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: sub-layers: tips on best use?

Postby tomh » Wed Aug 25, 2010 6:56 am

Opps, sorry for confussing you!


The layers dialogue only shows the order of the layers, not objects within the layers (like sub layers)

What I was trying to get across is this:

normally, all objects belong to a layer:

Eg:

Code: Select all

Layer 1
---- Object 1
---- Object 2
Layer 2
---- Object 3
---- Object 4

so the objects in the top layer (layer 1) appear above those in layer 2

when you have sub-layers, not all objects belong to a sub-layer, so confessing things can happen

eg: Case 1

Code: Select all

Layer 1
----Sub layer
--------Object 5
---- Object 1
---- Object 2
Layer 2
---- Object 3
---- Object 4

here object 5 will be on top

but this can also happen: Case 2

Code: Select all

Layer 1
---- Object 1
----Sub layer
--------Object 5
---- Object 2
Layer 2
---- Object 3
---- Object 4

So now object 1 is on top followed by 5,2 e.t.c.

Yet both case 1 and case 2 will look like this in the layers dialogue:

Code: Select all

Layer 1
----Sub layer
Layer 2

Which of these cases happens in your svg file depends on the order you create the objects / layers in!

To reorder object 1 and the sub layer you have to use a combination of the raise/lower selection options from the tool bar and the raise/lower layer options in the layer dialogue, which is what gives such unpredictable behaviour.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: sub-layers: tips on best use?

Postby brynn » Wed Aug 25, 2010 8:46 am

Oh ok, I understand that. And I think we might be saying the same thing in different ways. Let me try a more graphic approach.
This is what the Layers dialog looks like:

Layer 3 - shading
Layer 2 - colors (contains base colors)
- sublayer 2.1 - gradients (contains gradients)
- sublayer 2.2 - blurs (contains blurs)
Layer 1 - sketch

However, that's not the z-order in which the paths/objects appear in the image. This appears to be the z-order:

Layer 3
sublayer 2.1
sublayer 2.2
Layer 2
Layer 1

The latter is exactly how I want it to work, so that's great. But because the sublayers appear below the parent layer in the Layers dialog, it becomes confusing. You can't move sublayer 2.1 and 2.2 above Layer 2 in the layers dialog. So I'm asking if, when using sublayers, it might be less confusing to use Layer 2 simply as a title, and not have anything actually in that layer. Then I would create a 3rd sublayer to contain whatever would have been in Layer 2. I can rearrange the sublayers within their parent layer, so that my numbering scheme is consistent with the z order. And I'm also wondering how others utilize sublayers, and how they handle the fact that organization of layers in the Layers dialog doesn't mirror the actual z-order in the image/on the canvas.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: sub-layers: tips on best use?

Postby tomh » Wed Aug 25, 2010 9:46 pm

However, that's not the z-order in which the paths/objects appear in the image. This appears to be the z-order:

Layer 3
sublayer 2.1
sublayer 2.2
Layer 2
Layer 1


What I am trying to warn you about is that this is not how it always is, as it depends on when you create the sublayers / change order of the sub layers / create objects in layer 2.

Sometimes this will be the z-order:

Layer 3
sublayer 2.1
Layer 2
sublayer 2.2
Layer 1

...and it will look the same in the layers dialogue. :twisted:

have a look atTav's page on z-order on this. I have n example svg file, but nowhere to put it at the moment...

Oh, and learning the basics of svg or xml hierarchy would help a lot! in explaining this...


Return to “Help with using Inkscape”