Ceci est une ancienne révision du document !
A frequently requested feature, particularly from users coming to Inkscape from other vector tools, is a dialog that shows a hierarchical tree of the objects in a drawing. This is now present, as of version 0.92, via the Object > Objects… menu entry. This feature was actually back-ported from Ponyscape, a fork of Inkscape that is no longer being developed, so bravo to the Inkscape developers for merging it back into the program, and thanks to the original Ponyscape developer for creating it in the first place. Here’s what the dialog looks like, with a few objects in a drawing: It shares some similarities with the Layers dialog (see part 9 of this series), and can largely be used as a replacement for it if you wish – although I prefer the simplicity of the old dialog. At the top is the hierarchy of objects in your drawing, with groups and layers displayed as collapsible entries that can be opened to reveal the objects within them, or closed to hide the clutter. The lower section provides buttons for adding layers, deleting selected objects, “Collapse All” (more on that in a moment), and buttons for moving individual objects up or down in the list (which, in turn, moves them up and down in the z-order). There’s a pop-up for selecting a blend mode – which can now be easily applied to any object. Previously, only layers could easily have blend modes applied; other objects required a trip to the filter editor, so this is a welcome addition. It’s also possible to set the blur and opacity of the selected object, group or layer.
Une fonctionnalité souvent demandée, particulièrement pour les utilisateurs passant d'autres outils vectoriels à Inkscape, est une boîte de dialogue qui montre la structure hiérarchiques des objets dans un dessin. Elle est maintenant présente, dans la version 0.92, par l'entrée de menu Objet > Objets… Cette fonctionnalité est en fait récupérée de Ponyscape, un fork d'Inkscape qui n'est plus développé ; aussi, bravo aux développeurs d'inkscape de l'avoir fusionné dans le programme et merci au développeur à l'origine de Ponyscape de l'avoir créé le premier. Voici à quoi ressemble ce dialogue , avec les quelques objets d'un dessin :
Il partage quelques similitudes avec le dialogue des Calques (voir la partie 9 de cette série) et peut largement être utilisé pour le remplacer si vous le voulez - bien que je préfère la simplicité de l'ancien dialogue. Au sommet de la hiérarchie de vos objets se trouve le dessin, avec les groupes et les entrées affichées comme des entrées déroulables dont l'ouverture révèle les objets qu'elle contient ; sa fermeture cache le fatras. La partie basse fournit des boutons pour ajouter des calques, supprimer les objets sélectionnés. « Tout réduire » (plus là dessus dans un moment) et les boutons pour monter et descendre les objets individuels de la liste ( qui, en retour, bougent sur l'axe z). Il y a un pop-up pour la sélection d'un mode mixte, que nous pouvons appliquer facilement maintenant à n'importe quel objet. Précédemment, on ne pouvait facilement appliquer des modes mixtes qu'aux seuls calques ; les autres objets nécessitaient un tour dans l'éditeur de filtre ; aussi, c'est un ajout bienvenu. Il est aussi possible de régler le flou et l'opacité de l'objet sélectionné, du groupe ou du calque.
As for that “Collapse All” button, what it actually does is collapse every top level layer or group except the one that the currently selected object is in. This is a common theme for this dialog – right-click on an object in the tree and you’ll be presented with a wide range of options in a context menu, in which several choices (those from the “Solo” and “Lock All” sections) actually work on top-level layers and groups, regardless of how deeply nested the object is that you clicked on. Each object is listed by its “Label”, which was previously only settable in the Object Properties dialog or the XML Editor. Now you can simply double-click on the entry in this new dialog to change the label – a significant usability improvement. But unless you’re fastidious about changing the default labels assigned by Inkscape (as I have done in the case of “Orange Circle”) you could well be in for some surprises. Take another look at the screenshot of the Objects dialog, considering the labels of the objects there. Now take a look at the canvas that produced that list: Notice that the stars are labelled as “paths”, as is the (clipped) spiral. The 3D box has a label of “g3700”, because in SVG terms it’s actually a group, so Inkscape labels it as such. Which path corresponds to which star? The only way to tell is to select each one and see which object becomes selected on the canvas. I hope that a future release of Inkscape will add an extra column to show the “Inkscape type” of the object (e.g. star, spiral or 3D box), and preferably a small preview image of the object as well.
Pour ce qui est du bouton « Réduire tout », ce qu'il fait vraiment est de réduire chaque calque ou groupe de plus haut niveau, sauf celui dans lequel se trouve l'objet actuellement sélectionné. C'est un thème commun dans ce dialogue - faites un clic droit sur un objet de la structure et une grande variété d'options vous sera proposée dans le menu contextuel, dans lequel plusieurs choix (ceux des sections « Un seul » et « Verrouiller ») travaillent vraiment avec les couches et les groupes de niveau le plus haut.
Chaque objet est nommé par son « Étiquette », qui n'était précédemment réglable que dans le dialogue Propriétés de l'objet ou l'éditeur XML. Maintenant, d'un simple double-clic sur l'entrée du nouveau dialogue, vous pouvez changer l'étiquette – une amélioration significative. Mais, sauf si vous êtes fatigué de changer les étiquettes attribuées par défaut par Inkscape (comme je l'ai fait dans le cas du « Cercle orange »), vous pourriez bien avoir quelques surprises. Regardez aussi la copie d'écran du dialogue Objets, en les comparant aux étiquettes des objets ici. Maintenant, regardez sur le canevas qui produit cette liste :
Notez que les étoiles sont étiquetées « Path » tout comme la spirale (découpée). La boîte 3D est étiquetée « g3700 », car en termes SVG, c'est un fait un groupe et donc Inkscape l'étiquette comme tel. Quel chemin correspond à quelle étoile ? La seule façon de le savoir est d'en sélectionner un et de voir quel objet devient sélectionné sur le canevas. J'espère que dans une future publication d'Inkscape une colonne supplémentaire sera ajoutée pour montrer le « Type Inkscape » de l'objet (par ex., étoile, spirale ou boîte 3D) et de préférence avec aussi une image miniature de l'objet.
To the left of the object tree, you’ll have noticed that there are five other columns, with terse titles that only make sense once you’ve hovered over each of them to read the tooltip. The first and second should be familiar from the Layers dialog – they toggle the visibility and locked state of each object. At last there’s an easy way to unlock individual objects: many new users have found themselves tempted by the Lock option in the Object Properties dialog, only to then find that they could no longer select the object to unlock it! The third column, nominally “Type”, holds an icon to indicate whether the item is an object, layer or group. As you may recall, SVG doesn’t actually have a concept of layers, so Inkscape implements them as groups with some extra metadata. An interesting extra in this dialog is the ability to click on the Type icon of a layer to turn it into a group, or vice versa. The next column is supposed to show an icon to indicate whether an object is clipped and/or masked. In my screenshot, you can see the effect on the clipped spiral, however my copy of Inkscape does not show an icon there for masked objects, despite the claim of the tooltip. In this case the icon is purely informative; the dialog doesn’t provide any additional capabilities for working with clipping paths or masks, so there’s still no way to edit masks or some types of clip paths without releasing them first. The last column is rather specialised, and will probably be rarely used. Within the Inkscape Preferences (Edit > Preferences), in the Tools > Node section, you can set the default color used to draw the path outline when the Node tool is active. Typically this is set to 100% red on a standard installation. The swatches in this column can be used to set the path color on a per-object basis. Clicking on a swatch, then setting a color with a non-zero opacity, will change the color; set the opacity to zero, regardless of the color, to revert to the default set in the preferences. This may occasionally be useful if you’re editing an object whose color is similar to the default, and you want to set it to something contrasting, but that’s really the only sensible use for this option. You can see the effect on the top two stars which I have converted to paths, and changed the outline color on the second to blue:
Let’s take a look at the context menu that appears when you right-click on any entry in the object tree. The first two entries let you rename the selected item (more easily done by double clicking on the label) and duplicate it (the same as pressing CTRL-D). The third item should probably be called “New Layer” for clarity, as it opens the new layer dialog regardless of what type of object was clicked on in the tree. This seems like a pointless addition to the context menu given that there’s a dedicated button for this on the dialog. The “Solo” option takes its name from music software, in which it is used to mute all the other tracks so that you can easily work on just one. In Inkscape, it hides all the top level layers and groups, except for the one that the selected item is in. It doesn’t hide other elements that are in the same group, so it acts as a literal “solo” option only if each of your objects is in its own group or layer. It should probably also be renamed to “Hide Others” for consistency with the “Lock” options that follow in the next group. “Up”, “Down”, “Group” and “Ungroup” are fairly self-evident, but it is worth noting that “Ungroup” is available even if the selected object is not a group or layer. The same lack of context awareness exists for the “Set Clip” and “Set Mask” options, which are available even if you have only a single object selected – they require at least two objects in order to work. Thankfully in all these cases, the result of selecting an option that is not valid is for no change to take place, but it would still be better if invalid options were hidden or disabled in this menu.
The new “Create Clip Group” option is also present on the context menu for an object but, despite experimenting with it myself and searching online, it appears that nobody really seems to know what it’s for, artistically speaking. Choosing this option will group any selected objects, then clip them with a clone of the group. Quite why you would want to do this – and especially why anyone wants to do it so frequently that it needs an entry on the context menu – is beyond me. I can think of a couple of esoteric situations in which this kind of structure is useful, but nothing that isn’t made clearer by creating it step-by-step. If anyone has any good ideas about this one, please let me know! Moving on from the Objects dialog, 0.91 also introduced some small UI improvements that can have a big effect on how you use Inkscape. The first is the ability to enter simple calculations into spinboxes (the numeric fields with up/down arrows next to them). You can use the usual symbols for the main arithmetic operations of addition (+), subtraction (-), multiplication (*) and division (/), as well as brackets to group parts of the calculation. Any simple numbers will be used in the current units that are set for the field, but you can also append a unit name (e.g. “pt”, “mm” or “px”) to individual numbers to have them converted for you. For example the following, when applied to a field set as “mm”, will result in a value of 45.4mm: 10 + 1in + 1cm
Because the spinbox typically shows the current value of the parameter, you can often just tack bits of a calculation onto the end, then hit the RETURN key. Do you need a field to be 50% wider? Just add “*1.5” to the end of its value. Want to reduce it by 1cm, regardless of the current value? Just append “-1cm”. One place where I find this feature invaluable is when setting guides. The Guideline dialog has had a “Relative change” checkbox for some time (see part 16 of this series), but now there’s really no need to ever use it, as you can just append a relative offset to the end of the existing value inside the X, Y or Angle spinbox. I’d really like to have a way to duplicate guides in a future release, as this would make it much easier to create a series of them by just setting the first in place then repeatedly duplicating and adding an offset. Although there’s no Duplicate button, the Guideline dialog has gained a few other features. It’s now possible to name your guides (the label appears in small text by the anchor point), give them individual colors, and lock them against accidental movement. This can make guides much more useful when setting up a common template page that might be used as the basis of multiple similar documents in future.
Another UI addition that is particularly welcome is a new section in the Inkscape preferences for setting keyboard shortcuts. You can get to it by opening the preferences from Edit > Preferences (or SHIFT-CTRL-P by default), then drilling down to Interface > Keyboard Shortcuts. There’s a drop-down list at the top to let you select from a range of preset options, which could be especially useful if you’re coming to Inkscape from another product. As has become the norm with these kinds of dialogs in GTK programs, setting a new shortcut is done by highlighting the row you wish to modify, then clicking in the “Shortcut” column – either on the existing shortcut, or the blank space if there isn’t a shortcut defined for the operation you’ve selected. The field will populate with some text that says “New accelerator…” or something similar, which is your cue to press the keyboard shortcut you wish to assign. Note that there’s no warning if you use a shortcut that’s currently assigned to another operation – it will just be removed from the old command and assigned to the new one – so you may wish to choose your shortcuts carefully. If you want to remove a shortcut entirely, press the BACKSPACE key when prompted for the new accelerator. If things go completely awry, you can change the shortcuts back to the defaults using the Reset button at the bottom of the dialog – where you’ll also find options for importing and exporting shortcut configurations, so that you can back-up your highly customised settings somewhere safe.