Ceci est une ancienne révision du document !
1
Last time I introduced Inkscape's notion of clones – duplicate objects that maintain a link to their parent. I also demonstrated that clones can be independently transformed whilst still maintaining that link, so you can set the basic shape, fill and stroke on a parent object, but then additionally skew, scale and rotate the clone. Keep that capability in your mind, as we'll be returning to it later in this article, but first I need to talk to you about cloning groups. It's possible to clone almost any type of object in Inkscape. Previously I used rectangles, text and images, but the same rules apply to stars, spirals and paths. The exception is 3D boxes, which don't behave at all well when cloned, and tend to disappear when the parent is modified. You can 'ungroup' a 3D box to convert it into normal paths; if you then group those together again, you can clone that group, but you'll have lost the ability to edit the parent using the 3D Box tool.
La dernière fois, j'ai introduit la notion de clones dans Inkscape - des objets dupliqués qui conservent un lien avec leur parent. J'ai aussi montré que les clones peuvent être transformés indépendament tout en conservant ce lien ; ainsi vous pouvez construire une forme de base, trait et fond sur un objet parent, puis en complément incliner le clone, le changer d'échelle et le tourner. Garder cette capacité en tête car nous y reviendrons plus loin dans cet article, mais pour commencer j'ai besoin de vous parler de clonage de groupes.
Il est possible de cloner à peu près n'importe quel objet dans Inkscape. Précédemment, j'ai utilisé des rectangles, du texte et des images mais les mêmes règles s'appliquent aux étoiles, aux spirales et aux chemins. La boîte 3D est l'exception dont le clone ne se comporte pas normalement et qui a tendance à disparaître quand on modifie le parent. Vous pouvez « dégrouper » une boîte 3D pour la convertir en chemins normaux ; si vous regrouper l'ensemble ensuite, vous pouvez cloner ce groupe mais vous aurez perdu la possibilité d'éditer le parent avec l'outil Boîte 3D.
Whether created from a 3D box, or via any other mechanism, groups are a prime target for cloning. Having drawn a complex object made up of several different parts, it's useful to be able to clone it in its entirety, rather than having to clone each part separately. Let's use this technique to create a clone army using the snowman we last saw in part 14. The parent object here is the snowman at the front, which has been cloned multiple times, and the clones scaled. The parent is a group which contains other groups – one for the hat, one for each arm, and so on. It's only when you drill down a couple of levels deep that you finally get to real paths and shapes, but cloning a group automatically includes all of that structure, no matter how deep it goes.
Qu'ils soient créés à partir d'une boîte 3D ou par une quelconque autre mécanisme, les groupes sont une cible de premier ordre pour le clonage. Ayant construit un objet complexe fait de plusieurs parties variées, c'est utile de pouvoir le cloner dans son intégralité, plutôt que de devoir cloner chaque élément séparément. Utilisons cette technique pour créer une armée de clones en utilisant le bonhomme de neige vu dans la partie 14.
L'objet parent ici est le bonhomme de neige du premier plan, qui a été cloné de multiples fois et les clones ont été changés d'échelle. Le parent est un groupe qui contient d'autres groupes - un pour le chapeau, un pour chaque bras, etc. Ce n'est qu'en défaisant un bon nombre de niveaux de groupage que vous accédez aux vrais chemins et formes, mais le clonage d'un groupe inclue automatiquement toute la structure, quelque soit le nombre de niveaux de regroupement.
2
Creating lots of clones like this can be time consuming, but there are a couple of tricks to speed up the process. The first is to use Inkscape's Tiled Clones feature (Edit > Clone > Create Tiled Clones…) which is a hugely powerful, but extremely complicated, tool. I'll be covering some aspects of it later in this series. The other approach – and the one I took here – is to create the first clone, then drag it around the screen, 'stamping' it in place by pressing the spacebar. Each copy that you stamp is a duplicate of the object you're dragging, and, as we found out last time, a duplicate of a clone retains a link to the original parent object. By working from the back to the front, pausing occasionally to re-scale the clone that's being dragged, it took only a few moments to create all the clones in the image. One big problem with clones is that they can appear too similar. Our clone army loses some menace through all being exactly identical, right down to their arm positions. One way to deal with this is to break your group apart into smaller sections, and clone them separately. For example, if we break the snowman apart to separate his hat, arms, pipe, scarf and nose from the main group, we can create an army with a little more individuality by simply omitting or transforming them on some of the characters.
Créer un grand nombre de clones comme cela peut prendre beaucoup de temps, mais il y a quelques astuces qui accélèrent l'opération. La première est d'utiliser la fonction de Pavage de Clones d'Inkscape (Éditer > Cloner > Créer un pavage avec des clones…) qui est un outil très puissant mais aussi très compliqué. Je traiterai quelques uns de ses aspects plus tard dans la série. L'autre approche - et celle utilisée ici - est de créer un premier clone, puis de le tirer un peu partout sur la scène en appuyant sur la barre d'espace pour le « tamponner » de place en place. Chaque objet tamponné est un clone de l'objet tiré et, comme nous l'avons vu la dernière fois, un clone garde un lien avec l'objet parent original. En allant du fond vers l'avant, en faisant parfois une pause pour augmenter l'échelle du clone tiré, ça ne prend pas longtemps pour créer tous les clones de l'image.
Un gros problème avec les clones, c'est qu'ils apparaissent vraiment trop semblables. Notre armée de clones ne semble pas menaçante, tous bien droits, les bras le long du corps. Pour résoudre cet aspect, il y a la solution de couper le groupe en plus petites sections, et de les cloner séparément. Par exemple si, sur un bonhomme de neige, nous détachons son chapeau, ses bras, sa pipe, son cache-nez et son nez du groupe principal, nous pouvons créer une armée avec un peu plus de personnages en omettant ou en transformant l'une ou l'autre des caractéristiques.
This technique is one that I use frequently when creating comic strips. A character's body is often cloned directly from one panel to the next, but the arms or legs are cloned separately so they can 'move' between scenes to add a little dynamism to the strip. Often I'll also scale and crop the clones, to give the impression of a camera zooming into or out of the scene. Don't forget that you can still draw extra elements on top of your clones to truly make each one individual. That's how I deal with a cloned character that may be speaking in one panel and silent in another: the original parent has no mouth, then it's drawn on the clones separately for each scene. When cloning a group, it's important to realise that the clone is not a group itself. You can't enter the clone to make changes. You can, of course, still enter the parent and make changes there. They will propagate to the clones as usual. When dealing with groups, though, you not only have the option of changing fills, strokes, filters and transformations, but also the possibility to delete objects in the group, or create new ones. Even those changes will propagate to the clones, offering up one rather nice way to use clones which isn't immediately obvious.
J'utilise fréquemment cette technique dans la création des bandes dessinées. Un tronc de personnage est souvent cloné directement d'un panneau à l'autre, mais les bras et les jambes sont clonés séparément pour les « bouger » d'une scène à l'autre pour donner du dynamisme au dessin. Souvent j'adapte l'échelle ou je tronque les clones, pour donner l'impression que la caméra zoome ou dézoome la scène. N'oubliez pas que vous pouvez toujours dessiner des éléments supplémentaires sur vos clones pour les individualiser. C'est ce que j'utilise pour un personnage cloné qui parle dans un panneau et se tait dans l'autre. le parent original n'a pas de bouche ; elle est rajoutée individuellement aux clones sur chaque scène.
3
For this technique, we'll need a group. Ideally it would be empty, but Inkscape won't let you create an empty group, so we'll have to put something in it. A good starting point is to draw a large square, almost filling the canvas, with a stroke but no fill. Then immediately group it using the icon on the main toolbar, the Object > Group menu, or by pressing CTRL-G. Select the square and check the status bar: it should confirm that you've got a group of one object. With the group selected, press ALT-D to clone it. With the clone now selected, press the 'H' key, select the Object > Flip Horizontal menu, or use the toolbar button to mirror the clone horizontally. You shouldn't see any obvious change as you've mirrored it directly on top of the parent. Next, send the clone to the back of the Z-order using the toolbar button, Object > Lower to Bottom, or by pressing the END key. Finally, double-click on the parent (remember, it's now at the top of the Z-order, so you can just double-click on its stroke) to enter the original group. Now switch to the Pencil or Calligraphy tool and draw something.
If you've set everything up correctly, you should find that each time you release the mouse button, the line you've drawn is immediately reproduced as a mirror image at the opposite side of the canvas. All that's actually happening, of course, is that the objects you're adding to your group are being reflected (in every sense) in the clone of the group. Because the square you drew has no fill, the clone shows through as a mirroring of your every stroke. You're not limited to the Pencil and Calligraphy tools, of course. Anything you draw, regardless of the tool (except the problematic 3D boxes, of course) will be mirrored, making it a useful way of making symmetric designs. It's surprising how readily a few random paths will become a person, alien, insect or plant once you introduce a little symmetry, making it a great way to get started when inspiration has left you. As soon as you have drawn another object in the group, there's no need for the square any more, so delete it if you wish. I prefer to leave it in place for reference until I've finished drawing, then remove it as a final step. Either way, don't feel constrained by it – the square is only there to provide some initial content for the group, so don't be shy about drawing beyond its limits.
4
Once you've got the hang of the basic technique, it shouldn't be hard to see that extending it to three clones lets you create drawings that are mirrored both horizontally and vertically. Flipping the clones like this is a good start, but why not try other transformations on them? Rotating them is a great option and holding down CTRL to lock the rotation to the fixed steps defined in Inkscape's preferences can quickly produce kaleidoscopic effects. Try setting different opacities for each group, or blurring some of them. Within a few minutes, you'll be creating works of abstract computer art with just a couple of squiggles of the mouse. This example was made by rotating the original square about its bottom right corner. By moving the center of rotation for the original, it was already in the correct place as each clone was created. Then I simply cloned the original group and rotated it whilst holding CTRL. I reduced the opacity and increased the blur a little. Pressing CTRL-D created the next clone, and the cycle was repeated until I had completed a full circle of clones. Bringing the original to the front, double clicking on it, then drawing a single shape with the Pencil tool (with the Shape control set to “Ellipse”) produced this abstract image, spiralling away to nothingness.
If you do try this technique and decide to use blurring on your clones as I have done here, you'll soon find that Inkscape can slow down to a crawl. It's not just blurring that has this effect – any of Inkscape's filter functions can result in the rendering engine having to perform copious calculations, slowing it down considerably. If you find this to be a problem, you can try turning off the display of filters using the View > Display Mode > No Filters option. Any changes you make to filtered elements will still be stored, saved and applied if you export a bitmap – they just won't show up on screen. Use View > Display Mode > Normal to see the page in its fully rendered glory. You can press CTRL+5 (on the numeric keypad) to cycle through the view modes, including the “outline” mode which is great for finding rogue elements that have become invisible due to too much blurring or too low an opacity. This is a useful shortcut to learn if you find yourself plagued by slow redraws as you can press it at any time – even in the middle of a redraw – if you don't need to see the fully filtered version of the image for the particular edit you're making at the time.
Whether you're creating swirly patterns or armies of characters, there will come a time when you want to break the link between a clone and its parent. Perhaps your snowman needs a completely different smile to its comrades, or your soft, pastel spiral needs a single bright red segment to draw the eye. What you really want is a copy of the parent object that you can modify as much as you want without being constrained by that pesky linkage. You could, of course, just create a copy as normal, but if you've already got a clone in the right place, it seems a shame not to use it. The Edit > Clone > Unlink Clone menu item will do what you want, turning any selected clone into a plain, old fashioned copy. Use it wisely because although it's easy to convert a clone into a copy, you can't go back in the opposite direction.