From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

What is Grease Pencil?

The ability to annotate/scribble directly onto a viewing plane (and optionally have it projected onto arbitary 3D-drawing planes) is particularly useful for artists. This can be linked back to 2d-workflows with pen/pencil and paper, where rough ‘guideline’ sketches were often used for planning and also for communicating ideas quickly. It is often useful to be able to directly annotate on to a work in progress, instead of having to do so in a separate place (i.e. another part of the window, or even in a different application altogether).


In particular, this is especially useful for the following scenarios (there are more that may not have been mentioned):

  • Animators blocking out shots – rough timing and choice of poses
  • Animators drawing motion paths for later reference
  • Modellers planning topology or overall contours of model
  • Layout artists testing out rough mockups before trying out the concepts in 3d
  • Directors/teachers providing feedback on an artist’s work – parts of the poses which may not be working that well


This feature has been built into a limited subset of 3d-software (most notably Reflex, though it’s only used in a limited(?) rollout at CalArts), however, users often need to resort to using various standalone annotation software which is clumsier to use.


It has also implemented by users of other softwares (see hackish script for Maya from jonandhisdog.com – i.e. Jason Schleifer). In the latter example, this feature has received the nomenclature: “grease pencil”, in homage to the wax crayons/pencils that early CG artists used to draw temporary notes (i.e. paths, poses, etc.) on their screens with.


A number of copycat scripts have appeared for XSI and 3DS-Max too, based on this hackish script. However, there is still a great difference between scripts which accomplish this sort of functionality via clever-hacks, and built-in methods. With built-in methods, users can have more confidence that the functionality can integrate nicely into their workflows, and also that there is better performance.


Pixar also have an implementation (see http://www.animationmeat.com/pdf/featureanimation/ToolTimeAtPixar.pdf) although that mainly functions on sequences of 2D-images or such, not actually in the 3D-software it seems.


Introducing: Grease Pencil for Blender

Blender now joins the ranks of 3d-softwares with in-built grease-pencil functionality. Currently, the functionality is still in development, but is generally stable for usage (although some aspects of the file format may still be subject to drastic changes).

The current feature-set includes:

  • Ability to have a different set of Grease-Pencil annotations per view, that can be turned on/off
  • Multiple layers that can be shown/hidden, locked, and named independently
  • 'Animatable' sketches (i.e. in 2d/flipbook style), with each frame for a layer holding on until the next available frame with a sketch
  • Onionskinning of sketches
  • Sketches stored as smoothed + AA'ed polylines
  • Customisable colour (red, green, blue, alpha/opacity) and stroke thickness per layer
  • Ability to draw strokes that are glued to screen or glued in 3d-space/2d-space (whichever is relevant)
  • Pressure sensitivity (for tablets) when drawing strokes, is reflected in variations in the thickness of strokes
  • Tools to manage (i.e. delete) layers, frames, and strokes
  • Inclusion in OpenGL renders/playblasts
  • Ability to manage sketch-frames from the Action Editor in a special mode (allowing for retiming of sketches among other abilities)
  • Availability from Nodes, Image/UV, and Sequencer Editors in addition to 3D-View.
  • Realtime eraser
  • Strokes can be converted to 3d-curves and bone chains

Features not yet available, but may be made available at a later date:

  • "Billboard" style notes for objects

Using Grease-Pencil

See the following video for a demonstration of the possibilities:

Preparation

1. The first step when using Grease Pencil is to enable the display of Grease Pencil drawings for the relevant view. To do this, locate the 'Grease Pencil...' entry in the 'View' menu; click on the 'Use Grease Pencil' toggle that appears in the panel.

2. At this point, click on 'Add New Layer' to add a new layer to draw on. This step is not necessary when you are starting off a new drawing (as a new layer will automatically be created for you), unless you want to customise the line width, colour, and opacity before drawing. However, if you want to draw on a new layer once layers already exist, it is necessary to click on the button.

Additional Notes:

  • Please note that Grease Pencil data is currently unique to the particular screen area that it was created for.
  • Grease Pencil is available for the following spacetypes- 3d-View, Nodes Editor, Image Editor, Sequence Editor

Drawing

Quick usage (for just a few strokes):

  • To draw a stroke: While holding Shift-LMB, start dragging the mouse to draw a new stroke. The stroke will finish when you release the mouse button.
  • To erase stroke(s): While holding Alt-RMB, start dragging the mouse to erase segments of strokes that fall within the radius of the eraser 'brush'.


Easier usage (for drawing more complex sketches):

1. Enable the 'Draw Mode' toggle in top right-hand corner of the 'Grease Pencil' panel.

2. As for quickly drawing a few strokes, use the same mouse buttons to draw and erase, BUT without needing to use the modifier keys too (i.e. LMB to draw, RMB to erase).


Special Tricks in 'Draw Mode':

  • Drawing a straight line: Hold CtrlKey while dragging with the LMB to draw a straight line. Although a wavy line will still appear on screen, only the endpoints of that stroke will be used for the final stroke that gets stored. This is a useful feature for architectural uses.
  • Drawing a dot: Simply click on a spot. This is mentioned here because it is not available when 'Draw Mode' is not enabled.


For Tablet users:

  • The thickness of a stroke at a particular point is affected by the pressure used when drawing that part of the stroke
  • The 'eraser' end of the stylus can be used to erase strokes too


Sensitivity of when drawing:

The default settings for the sensitivity to mouse/stylus movement when drawing, have been set so that there shouldn't be too much jitter while still allowing for fine details to be made. However, sometimes these settings may not be appropriate, in which case, the defaults can be found in the User Preferences under Edit Methods.

  • Manhatten Distance: the minimum number of pixels the mouse should have moved either horizontally or vertically before the movement is recorded. Decreasing this should work better for curvy lines
  • Euclidean Distance: the minimum distance that mouse should have travelled before movement is recorded. Imagine this as length of imaginary string between last recorded position and mouse-cursor.
  • Eraser Radius: this is self-explanatory. It is simply the size of the eraser 'brush', so changing this will affect how likely strokes are going to be covered within the eraser brush and thus erased
  • Smooth Stroke: this turns the post-processing step of smoothing the stroke to remove jitter. It is only relevant when not drawing straight lines. By default this is off, as it can often cause 'shrinking' of drawings, which is sometimes not that desirable.


Additional notes:

  • When 'Draw Mode' is enabled, many of the other events that are attached to the LMB and RMB are blocked.
  • If 'Swap mouse buttons' is enabled, this has no effect on the mapping of mouse-buttons to drawing/erasing operations. However, it may become difficult to select using Shift-LMB in such a situation, in which case the tiny 'Lock' icon beside the 'Draw Mode' button should be enabled to help alleviate the problems (that will simply disable drawing from occurring with Shift-LMB).

Drawing Planes

Sketches are only relevant for the view/view-angle (referred to here as the 'drawing plane') that they were drawn at. There are several different options for how individual strokes (determined by the settings in use when the stroke was created) will be displayed.

  • Screen-Aligned: This is the default drawing plane for the 3D-View, and is also the viewing plane that gets used for the other editors when 'Stick to View' is disabled. All new strokes that get drawn in this mode appear to be 'stuck' to the screen-surface (much like markers on a monitor), and will therefore stay unaffected by zooming/translating/rotating the view
  • View aligned (default for all 2D Views): New strokes are affected by manipulating the view. This can be turned on/off using 'Stick to View' option.
  • Drawing in 3D-Space (only available in the 3D-View): New strokes are drawn in 3D-space, with the position of their points being determined by the position of the 3D-cursor and the view rotation at the time.

Converting sketches to other forms

In the 3D-view, sketches on the active layer can be converted to geometry, based on the current view settings. Sketches are converted into geometry by transforming the points recorded when drawing (which make up the strokes) into 3D-space (based on the current view settings). Currently, all points will be used, so it may be necessary to simplify or subdivide parts of the created geometry for standard use.

Sketches can currently be converted into one of three types:

  • Armature: Each stroke is converted into a bone chain, which is assigned to an armature named after the active layer. The bones in each chain are connected and parented to each other. Also, bones inherit their envelope radii from the thickness of their stroke at each recorded point.
  • Bezier Curve and Path: Each stroke is converted into a separate curve within a curve object that's named after the active layer. Handles are automatically set to be 'free' handles (i.e. the black type), and are set to be in the same places as the control-points. The weight/radius of the curve at each control-point is set to equal the thickness of the stroke at each recorded point. However, in order to see that, you need to set the 'BevOb' field to use a CurveCircle or similar curve.

Layers

Grease Pencil sketches are organised in layers, much like those you could find in the GIMP or Photoshop. These layers are not related to any of the other layer systems in Blender, and also do not have an upper limit on the maximum number of layers that can be used. Like the layers in the aforementioned apps, these layers can also be renamed, locked, hidden, and deleted.

Their main purpose is to collect together a bunch of sketches that belong together in some meaningful way (i.e. "blocking notes", "director's comments on blocking", or "guidelines"). For this reason, all the strokes on a layer (not just those made after a particular change) are affected by that layer's colour, opacity, and stroke thickness settings.

By default, most operations occur only on the 'active' layer. The active layer can be identified as the one with the different panel colour (in the default set, an light orangy-brown colour). Clicking on a layer, or changing any of its settings will make it the new active layer.

The active layer can also be identified by looking at the status indicator (in the top right-hand corner of every view with Grease Pencil data being shown).

Animated Sketches

Grease Pencil can be used to do basic pencil tests (i.e. 2D animation in flipbook style). Sketches are stored on the frame that they were drawn on, as a separate drawing (only on the layer that they exist on). Each drawing is visible until the next drawing for that layer is encountered. The only exception to this is the first drawing for a layer, which will also be visible before the frame it was drawn on.

Therefore, it is simple to make a pencil-test/series of animated sketches: 1) Go to first relevant frame. Draw. 2) Jump to next relevant frame. Draw some more. 3) Keep repeating proccess, and drawing until satisfied. Voila! Animated sketches.

Onion Skinning

Onion-skinning (also known as ghosting), is a useful tool for animators, as neighboring frame(s) are lightly drawn by Blender. It allows animators to make judgments about movements, by comparing movement from different frames.

Usage Notes:

  • Onion-skinning is enabled per layer by clicking on the 'Onion Skinning' button.
  • The 'GStep' field controls how many frames will be drawn. When 'GStep' is 0, only the drawing on either side of the current frame will be visible. Otherwise, it this field specifies the maximum number of frames on either side of the current frame that will result in a neighbouring drawing being included.

Adjusting Timing of Sketches

It is possible to set a Grease-Pencil block to be loaded up in the Action Editor for editing of the timings of the drawings. This is especially useful for animators blocking out shots, where the ability to re-time blocking poses is one of the main purposes of the whole exercise.

1. In an Action Editor window, change the mode selector (found beside the menus) to 'Grease Pencil' (by default, it should be set to 'Action Editor').

2. At this point, the Action Editor should now display a few 'channels' with some 'keyframes' on them. These 'channels' are the layers, and the 'keyframes' are the frames that each layer has. They can be manipulated like any other data in the Action Editor can be.

All the available Grease-Pencil blocks for the current screen layout will be shown. The Area/Grease-Pencil datablocks are drawn as green channels, and are named with relevant info from the views. They are also labelled with the Area index (which is currently not shown anywhere else though).

Tutorials Valid for Older Versions of Patch

Some of the information given here may not still be valid, but will still be useful

Additional Links