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.

Grease Pencil: Revamp

Introduction

The current Grease Pencil functionality was created with the aim to make it a tool for on-screen annotations, but after improving stroke editing and the new sculpt tools, it became a real alternative to 2D animators. The idea behind this proposal is to adapt Blender to work in a similar way that other market software works just like Photoshop or Toon Boom Animate/Harmony, and to create the foundation for future improvements in order to get a production ready 2D animation tool.

Current Status

Currently, the grease pencil works using layers as main attribute container. The layer stores the width of the line, the color and the filling options.

In order to draw a stroke the following logic is used:

Layer color->Layer width * pressure = Draw line

If we change the thickness in the layer, all lines change, but if we want different color, we need create a new layer.

The problem with this approach is that you need a lot of layers for any character or drawing. For example, if you draw a background with 5 different colors, you need 5 layers, and this is not intuitive.


Dev-gp-old-layers.jpg

In the image above, a simple scene with two characters and a background. The artist needs a lot of layers and it is impossible determine what colors correspond to what character.

Another limitation of the current Blender implementation is the impossibility to create strokes with different saturation of color. If the artist needs different saturation for the same color, needs to create a set of layers for each color saturation. This also limits future brushes development.

Details of the change

The current implementation, links the layer with the stroke, so any variation in the stroke must be controlled by the layer, and this reduces the possible options.

Now, the thickness was moved to stroke, and color to a new palette color instead of saving this information in layer. With this approach, the layer would be only a container, and same stroke could manage different colors and thickness.

Layer----> Strokes(thickness and color) ----> Point (Position, pressure and strength)

Some benefits for the artist:

  • Easy layer management (background, character 1, foreground, etc).
  • Ability to have multiple colors per layer.
  • Ability to have multiple thickness values per layer.
  • Ability to have different color saturation in the same stroke.

Note: Some of the current layer functionalities will be moved to the new color area.

With the new design, the brush is independent and it will allow new developers to create brushes that implement new features to simulate different types of pencils.

The new workflow is the following:

  1. Create a layer.
  2. Create a palette.
  3. Add colors to palette.
  4. Set brush preferences.
  5. Select color->Draw stroke.
  6. Select color->Draw stroke.

Some of the steps are automatic. For example, if the user press D in an empty scene and draw, an automatic brush, palette and color are created.

For each stroke, the artist can change brush settings and/or color. All strokes remain in the same current layer.  

Layer panel

As result of the redesign, the layer panel must be changed.

Dev-gp-layerpanel.jpg

Now, the layer doesn't have color information and only works as a container of strokes.

The new available parameters are:

  • Opacity: Level of opacity of all strokes of the layer.
  • Thickness: Works as a modifier. All strokes of the layer are changed with a thickness of +/- value. If the apply button is pressed, the thickness change is applied and the value is set to 0.
  • Tint: Apply a color tint to all strokes of the layer. The level is defined by the factor value.
  • Parent: Allows to parent the layer to any object or bone. The logic used is the same that Blender uses with other objects.

Palette panel

The color are grouped in palettes. A palette is a set of color that can define a mood for the scene, for example the same color can be defined in "Day palette" and "Night palette" and a simple palette switch, will change all strokes color in all layers.

Dev-gp-palettes.jpg

The available parameters are:

  • Stroke color: Color used in the stroke. Can be used in any layer.
  • Opacity: Default opacity of the color. This value can be adjust with the brush strength, so depending of the pressure, the saturation of the color will be from 0 to the opacity set.
  • Fill: Filling color.
  • Fill Opacity: Opacity for filling color. This opacity is not affected by brush strength.

Drawing brushes panel

This panel defines the parameters used when drawing new strokes. A set of predefined brushes is created automatically.

In order to get these brushes work properly, a drawing tablet device with pressure sensitivity is mandatory.

Dev-gp-drawingbrushes.jpg

The new available parameters are:

  • Thickness: Number of pixels for full pressure strokes. The thickness can be lower depending of the pressure.
  • Sensibility: Adjust the sensibility of the thickness to the pressure of the pencil on the tablet. This pressure can be disabled using the right small button.

Additionally, a randomness factor can be enabled using the right button.

  • Strength: Similar to sensibility, but affect the saturation of the color. This parameter allows to get effects as color fading or watercolor.

The strength can be changed using the new "strength" sculpt brush.

  • Randomness: Defines the level of randomness (if enabled) for sensibility and strength.
  • Jitter: Define a jitter randomness in the stroke.
  • Angle: Defines the angle when the thickness of the stroke will be 100%. Any change in the direction will change the thickness.
  • Angle factor: Defines the effect for drawing angle changes in the thickness.

The Angle and Angle Factor parameters allow to create drawing brushes as markers that change the thickness depending of the angle of drawing. This gets a more artistic drawing and less "computer" lines.


Dev-gp-newbrushes.jpg

Smooth, iterations and subdivision parameters define the quality of the new strokes.

Curves panel

This panel allows to adjust the parameters used with tablets to get personal preferences.

When the user draws a stroke, the system get the brush information and combined with color information and pressure, generates the stroke.

Arrange strokes

The new design creates a new request for arrange strokes in the layer. With the old system, each layer contained only one color, so using the layer up/down operator, the strokes could be arranged.

With the new design the same layer can use several colors, so it requires a new set of operators to arrange the strokes. These operators apply only to the same layer. To arrange the layers, the old up/down operator can be used as usual.

New arrange operators are:

  • Bring to Front: Set the selected strokes in front of all strokes..
  • Bring Forward: Set the selected strokes one step forward.
  • Send Backward: Set the selected strokes one step backward.
  • Send to Back: Set the selected strokes behind all strokes.

Note: If any of the strokes selected is in the top/bottom and try to move in the same direction the strokes will not be moved in order to preserve drawing integrity.

Palette workflow

In this section we describe the workflow corresponding to palettes and colors.

A palette must contain at least 1 color. The interface will not allow to delete the last color of the palette. The interface will avoid that the user delete all the palettes. Any GP Data must have at least one palette with one color.

Delete palette

The user will press a button to delete a palette, but if there is only a palette, the operation will be disabled.

If there are more than one palette, all colors of the old palette will be transferred to the new selected palette.

There are two options:

  • If the color exist in the new palette (same name), the stroke is linked to new color.
  • If the color does not exist in the new palette, a new color is added to the palette in order to keep the stroke.

Delete palette color

Delete a color will remove the color from the palette.

A palette must contain at least one color, so the last one cannot be deleted. If a color with strokes is removed, all strokes of this color are removed.

Change palette color

Any change to line color or fill color, will change any stroke of any layer using this color.

Set stroke color

The user will be able to select several strokes, and pressing a button set the current selected color as new color to all selected strokes.