2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-08-26 12:01:15 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-08-26 12:01:15 +00:00
|
|
|
*
|
2019-02-01 17:20:05 +01:00
|
|
|
* The Original Code is Copyright (C) 2009, Blender Foundation
|
2009-08-26 12:01:15 +00:00
|
|
|
* This is a new part of Blender
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup edgpencil
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <stdlib.h>
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2013-05-28 19:35:26 +00:00
|
|
|
#include "BLI_sys_types.h"
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BKE_context.h"
|
2018-11-12 09:56:33 +11:00
|
|
|
#include "BKE_paint.h"
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
#include "DNA_brush_types.h"
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
#include "DNA_gpencil_types.h"
|
2018-07-31 10:22:19 +02:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
#include "WM_api.h"
|
2018-11-09 17:05:32 +11:00
|
|
|
#include "WM_toolsystem.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "WM_types.h"
|
2009-08-26 12:01:15 +00:00
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
2011-02-14 17:55:27 +00:00
|
|
|
#include "ED_gpencil.h"
|
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
#include "gpencil_intern.h"
|
|
|
|
|
|
|
|
/* ****************************************** */
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
/* Grease Pencil Keymaps */
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Generic Drawing Keymap - Annotations */
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
|
2009-08-26 12:01:15 +00:00
|
|
|
{
|
2018-11-08 15:59:51 +11:00
|
|
|
WM_keymap_ensure(keyconf, "Grease Pencil", 0, 0);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ==================== */
|
|
|
|
|
|
|
|
/* Poll callback for stroke editing mode */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_editmode_poll(bContext *C)
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
return (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE));
|
|
|
|
}
|
|
|
|
|
2020-11-13 21:43:00 +01:00
|
|
|
/* Poll callback for stroke curve editing mode */
|
|
|
|
static bool gpencil_stroke_editmode_curve_poll(bContext *C)
|
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
return (GPENCIL_EDIT_MODE(gpd) && GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd));
|
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Poll callback for stroke painting mode */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_poll(bContext *C)
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
{
|
2018-07-31 10:22:19 +02:00
|
|
|
/* TODO: limit this to mode, but review 2D editors */
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE));
|
|
|
|
}
|
2016-09-07 09:54:50 +02:00
|
|
|
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_poll_with_tool(bContext *C, const char gpencil_tool)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
|
|
|
/* TODO: limit this to mode, but review 2D editors */
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
2019-08-05 12:33:00 +10:00
|
|
|
if (!gpd) {
|
2019-07-31 12:13:29 -07:00
|
|
|
return false;
|
2019-08-05 12:33:00 +10:00
|
|
|
}
|
2019-07-31 12:13:29 -07:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
ToolSettings *ts = CTX_data_tool_settings(C);
|
2019-08-05 12:33:00 +10:00
|
|
|
if (!ts || !ts->gp_paint) {
|
2019-07-31 12:13:29 -07:00
|
|
|
return false;
|
2019-08-05 12:33:00 +10:00
|
|
|
}
|
2019-07-31 12:13:29 -07:00
|
|
|
|
2018-11-12 09:56:33 +11:00
|
|
|
Brush *brush = BKE_paint_brush(&ts->gp_paint->paint);
|
2019-07-31 12:13:29 -07:00
|
|
|
return ((gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) &&
|
2018-11-09 17:18:38 +11:00
|
|
|
WM_toolsystem_active_tool_is_brush(C) && (brush->gpencil_tool == gpencil_tool));
|
|
|
|
}
|
|
|
|
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_poll_with_tool(bContext *C, const char gpencil_vertex_tool)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
if (!gpd) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolSettings *ts = CTX_data_tool_settings(C);
|
|
|
|
if (!ts || !ts->gp_vertexpaint) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Brush *brush = BKE_paint_brush(&ts->gp_vertexpaint->paint);
|
|
|
|
return ((gpd->flag & GP_DATA_STROKE_VERTEXMODE) && (brush && brush->gpencil_settings) &&
|
|
|
|
WM_toolsystem_active_tool_is_brush(C) &&
|
|
|
|
(brush->gpencil_vertex_tool == gpencil_vertex_tool));
|
|
|
|
}
|
|
|
|
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_poll_with_tool(bContext *C, const char gpencil_sculpt_tool)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
if (!gpd) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolSettings *ts = CTX_data_tool_settings(C);
|
|
|
|
if (!ts || !ts->gp_sculptpaint) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Brush *brush = BKE_paint_brush(&ts->gp_sculptpaint->paint);
|
|
|
|
return ((gpd->flag & GP_DATA_STROKE_SCULPTMODE) && (brush && brush->gpencil_settings) &&
|
|
|
|
WM_toolsystem_active_tool_is_brush(C) &&
|
|
|
|
(brush->gpencil_sculpt_tool == gpencil_sculpt_tool));
|
|
|
|
}
|
|
|
|
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_weightmode_poll_with_tool(bContext *C, const char gpencil_weight_tool)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
if (!gpd) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolSettings *ts = CTX_data_tool_settings(C);
|
|
|
|
if (!ts || !ts->gp_weightpaint) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Brush *brush = BKE_paint_brush(&ts->gp_weightpaint->paint);
|
|
|
|
return ((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) && (brush && brush->gpencil_settings) &&
|
|
|
|
WM_toolsystem_active_tool_is_brush(C) &&
|
|
|
|
(brush->gpencil_weight_tool == gpencil_weight_tool));
|
|
|
|
}
|
|
|
|
|
2018-11-09 17:18:38 +11:00
|
|
|
/* Poll callback for stroke painting (draw brush) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_draw_poll(bContext *C)
|
2018-11-09 17:18:38 +11:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_DRAW);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Poll callback for stroke painting (erase brush) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_erase_poll(bContext *C)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_ERASE);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Poll callback for stroke painting (fill) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_fill_poll(bContext *C)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_FILL);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/* Poll callback for stroke painting (tint) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_paintmode_tint_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_TINT);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Poll callback for stroke sculpting mode */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_poll(bContext *C)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
Object *ob = CTX_data_active_object(C);
|
2020-04-03 13:25:03 +02:00
|
|
|
ScrArea *area = CTX_wm_area(C);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* if not gpencil object and not view3d, need sculpt keys if edit mode */
|
2020-04-03 13:25:03 +02:00
|
|
|
if (area->spacetype != SPACE_VIEW3D) {
|
2018-07-31 10:22:19 +02:00
|
|
|
return ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
|
|
|
|
}
|
2020-07-03 14:38:26 +02:00
|
|
|
|
|
|
|
if ((ob) && (ob->type == OB_GPENCIL)) {
|
|
|
|
return GPENCIL_SCULPT_MODE(gpd);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Poll callback for stroke weight paint mode */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_weightmode_poll(bContext *C)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
Object *ob = CTX_data_active_object(C);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
if ((ob) && (ob->type == OB_GPENCIL)) {
|
2020-03-09 16:27:24 +01:00
|
|
|
return GPENCIL_WEIGHT_MODE(gpd);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/* Poll callback for stroke vertex paint mode */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
|
|
|
bGPdata *gpd = CTX_data_gpencil_data(C);
|
|
|
|
Object *ob = CTX_data_active_object(C);
|
|
|
|
|
|
|
|
if ((ob) && (ob->type == OB_GPENCIL)) {
|
|
|
|
return (gpd && (gpd->flag & GP_DATA_STROKE_VERTEXMODE));
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for vertex painting (draw) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_draw_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_vertexmode_poll_with_tool(C, GPVERTEX_TOOL_DRAW);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for vertex painting (blur) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_blur_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_vertexmode_poll_with_tool(C, GPVERTEX_TOOL_BLUR);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for vertex painting (average) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_average_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_vertexmode_poll_with_tool(C, GPVERTEX_TOOL_AVERAGE);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for vertex painting (smear) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_smear_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_vertexmode_poll_with_tool(C, GPVERTEX_TOOL_SMEAR);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for vertex painting (replace) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_vertexmode_replace_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_vertexmode_poll_with_tool(C, GPVERTEX_TOOL_REPLACE);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Smooth) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_smooth_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_SMOOTH);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* Poll callback for sculpt (Thickness) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_thickness_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_THICKNESS);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Strength) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_strength_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_STRENGTH);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Grab) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_grab_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_GRAB);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Push) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_push_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_PUSH);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Twist) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_twist_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_TWIST);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Pinch) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_pinch_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_PINCH);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* Poll callback for sculpt (Randomize) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_randomize_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_RANDOMIZE);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for sculpt (Clone) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_sculptmode_clone_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_sculptmode_poll_with_tool(C, GPSCULPT_TOOL_CLONE);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Poll callback for weight paint (Draw) */
|
2020-06-29 15:28:38 +02:00
|
|
|
static bool gpencil_stroke_weightmode_draw_poll(bContext *C)
|
2020-03-09 16:27:24 +01:00
|
|
|
{
|
2020-06-29 15:28:38 +02:00
|
|
|
return gpencil_stroke_weightmode_poll_with_tool(C, GPWEIGHT_TOOL_DRAW);
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Stroke Editing Keymap - Only when editmode is enabled */
|
|
|
|
static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
|
|
|
|
{
|
2018-08-31 13:40:10 +10:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_editmode_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
2020-11-13 21:43:00 +01:00
|
|
|
/* Stroke Curve Editing Keymap - Only when editmode is enabled and in curve edit mode */
|
|
|
|
static void ed_keymap_gpencil_curve_editing(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Curve Edit Mode", 0, 0);
|
|
|
|
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when curve editmode is enabled */
|
|
|
|
keymap->poll = gpencil_stroke_editmode_curve_poll;
|
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* keys for draw with a drawing brush (no fill) */
|
|
|
|
static void ed_keymap_gpencil_painting_draw(wmKeyConfig *keyconf)
|
|
|
|
{
|
2018-08-31 13:40:10 +10:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Draw brush)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_paintmode_draw_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* keys for draw with a eraser brush (erase) */
|
|
|
|
static void ed_keymap_gpencil_painting_erase(wmKeyConfig *keyconf)
|
|
|
|
{
|
2018-08-31 13:40:10 +10:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Erase)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_paintmode_erase_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* keys for draw with a fill brush */
|
|
|
|
static void ed_keymap_gpencil_painting_fill(wmKeyConfig *keyconf)
|
|
|
|
{
|
2018-08-31 13:40:10 +10:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Fill)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_paintmode_fill_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/* keys for draw with a tint brush */
|
|
|
|
static void ed_keymap_gpencil_painting_tint(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Tint)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_paintmode_tint_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Stroke Painting Keymap - Only when paintmode is enabled */
|
|
|
|
static void ed_keymap_gpencil_painting(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when stroke paintmode is enabled */
|
2018-11-08 15:59:51 +11:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint Mode", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_paintmode_poll;
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
}
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Stroke Sculpting Keymap - Only when sculptmode is enabled */
|
|
|
|
static void ed_keymap_gpencil_sculpting(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when stroke sculptmode is enabled */
|
2018-11-08 15:59:51 +11:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt Mode", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Stroke Weight Paint Keymap - Only when weight is enabled */
|
|
|
|
static void ed_keymap_gpencil_weightpainting(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when stroke sculptmode is enabled */
|
2018-11-08 15:59:51 +11:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Weight Mode", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_weightmode_poll;
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
static void ed_keymap_gpencil_vertexpainting(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
/* set poll callback - so that this keymap only gets enabled when stroke vertex is enabled */
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex Mode", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* keys for vertex with a draw brush */
|
|
|
|
static void ed_keymap_gpencil_vertexpainting_draw(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Draw)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_draw_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* keys for vertex with a blur brush */
|
|
|
|
static void ed_keymap_gpencil_vertexpainting_blur(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Blur)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_blur_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for vertex with a average brush */
|
|
|
|
static void ed_keymap_gpencil_vertexpainting_average(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Average)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_average_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for vertex with a smear brush */
|
|
|
|
static void ed_keymap_gpencil_vertexpainting_smear(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Smear)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_smear_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for vertex with a replace brush */
|
|
|
|
static void ed_keymap_gpencil_vertexpainting_replace(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Replace)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_vertexmode_replace_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a smooth brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_smooth(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Smooth)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_smooth_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a thickness brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_thickness(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Thickness)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_thickness_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a strength brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_strength(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Strength)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_strength_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a grab brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_grab(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Grab)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_grab_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a push brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_push(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Push)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_push_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a twist brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_twist(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Twist)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_twist_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a pinch brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_pinch(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Pinch)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_pinch_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a randomize brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_randomize(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Randomize)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_randomize_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for sculpt with a clone brush */
|
|
|
|
static void ed_keymap_gpencil_sculptpainting_clone(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Clone)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_sculptmode_clone_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
/* keys for weight with a draw brush */
|
|
|
|
static void ed_keymap_gpencil_weightpainting_draw(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Weight (Draw)", 0, 0);
|
2020-06-29 15:28:38 +02:00
|
|
|
keymap->poll = gpencil_stroke_weightmode_draw_poll;
|
2020-03-09 16:27:24 +01:00
|
|
|
}
|
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
/* ==================== */
|
|
|
|
|
|
|
|
void ED_keymap_gpencil(wmKeyConfig *keyconf)
|
|
|
|
{
|
|
|
|
ed_keymap_gpencil_general(keyconf);
|
2020-11-13 21:43:00 +01:00
|
|
|
ed_keymap_gpencil_curve_editing(keyconf);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
ed_keymap_gpencil_editing(keyconf);
|
2018-07-31 10:22:19 +02:00
|
|
|
ed_keymap_gpencil_painting(keyconf);
|
|
|
|
ed_keymap_gpencil_painting_draw(keyconf);
|
|
|
|
ed_keymap_gpencil_painting_erase(keyconf);
|
|
|
|
ed_keymap_gpencil_painting_fill(keyconf);
|
2020-03-09 16:27:24 +01:00
|
|
|
ed_keymap_gpencil_painting_tint(keyconf);
|
2018-07-31 10:22:19 +02:00
|
|
|
ed_keymap_gpencil_sculpting(keyconf);
|
2020-03-09 16:27:24 +01:00
|
|
|
ed_keymap_gpencil_sculptpainting_smooth(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_thickness(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_strength(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_grab(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_push(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_twist(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_pinch(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_randomize(keyconf);
|
|
|
|
ed_keymap_gpencil_sculptpainting_clone(keyconf);
|
2018-07-31 10:22:19 +02:00
|
|
|
ed_keymap_gpencil_weightpainting(keyconf);
|
2020-03-09 16:27:24 +01:00
|
|
|
ed_keymap_gpencil_weightpainting_draw(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting_draw(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting_blur(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting_average(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting_smear(keyconf);
|
|
|
|
ed_keymap_gpencil_vertexpainting_replace(keyconf);
|
2009-08-26 12:01:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ****************************************** */
|
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
void ED_operatortypes_gpencil(void)
|
2009-08-26 12:01:15 +00:00
|
|
|
{
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Annotations -------------------- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_annotate);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
/* Drawing ----------------------- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_draw);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_fill);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_paint);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_color_brightness_contrast);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_color_hsv);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_color_invert);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_color_levels);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_color_set);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-11 19:15:23 +01:00
|
|
|
/* Guides ----------------------- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-11 19:15:23 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_guide_rotate);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
/* Editing (Strokes) ------------ */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_editmode_toggle);
|
2018-09-20 11:56:41 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_selectmode_toggle);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_paintmode_toggle);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_sculptmode_toggle);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_weightmode_toggle);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_vertexmode_toggle);
|
2016-08-03 23:31:48 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_selection_opacity_toggle);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_select_all);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_select_circle);
|
2018-10-05 10:27:04 +10:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_box);
|
2014-12-02 13:52:48 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_lasso);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_linked);
|
2016-01-22 15:31:20 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_grouped);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_more);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_select_less);
|
2016-05-09 17:23:15 +12:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_first);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_select_last);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_alternate);
|
2020-03-14 10:33:33 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_select_vertex_color);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_duplicate);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_delete);
|
2015-07-05 14:34:17 +10:00
|
|
|
WM_operatortype_append(GPENCIL_OT_dissolve);
|
2015-01-01 12:36:01 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_copy);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_paste);
|
2019-03-04 19:31:36 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_extrude);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_move_to_layer);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_change);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_active);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-05 13:28:42 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_set_active_material);
|
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_snap_to_grid);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_snap_to_cursor);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_snap_cursor_to_selected);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-08-29 03:03:09 +12:00
|
|
|
WM_operatortype_append(GPENCIL_OT_reproject);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_recalc_geometry);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-18 18:07:16 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_sculpt_paint);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_weight_paint);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-11-13 21:43:00 +01:00
|
|
|
/* Edit stroke editcurve */
|
|
|
|
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_enter_editcurve_mode);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_editcurve_set_handle_type);
|
|
|
|
|
2009-08-27 01:57:09 +00:00
|
|
|
/* Editing (Buttons) ------------ */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-01-07 11:29:42 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_annotation_add);
|
2009-08-29 06:50:32 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_data_unlink);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-29 06:50:32 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_add);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_remove);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_move);
|
2020-01-07 11:29:42 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_annotation_add);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_annotation_remove);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_annotation_move);
|
2014-12-31 14:20:44 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_duplicate);
|
2018-08-27 16:29:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_duplicate_object);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_mask_add);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_mask_remove);
|
|
|
|
|
2015-04-02 17:26:43 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_hide);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_reveal);
|
2015-12-13 21:03:13 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_lock_all);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_unlock_all);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_isolate);
|
2016-08-03 23:31:48 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_layer_merge);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-01-19 02:11:51 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_blank_frame_add);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-31 01:58:11 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_active_frame_delete);
|
2020-01-07 11:29:42 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_annotation_active_frame_delete);
|
2016-06-18 12:58:26 +12:00
|
|
|
WM_operatortype_append(GPENCIL_OT_active_frames_delete_all);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_frame_duplicate);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_frame_clean_fill);
|
2018-08-15 17:01:27 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_frame_clean_loose);
|
2020-07-27 10:41:21 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_frame_clean_duplicate);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-31 01:58:11 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_convert);
|
2020-06-16 15:28:46 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_bake_mesh_animation);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_image_to_grease_pencil);
|
2020-09-21 19:53:36 +02:00
|
|
|
#ifdef WITH_POTRACE
|
|
|
|
WM_operatortype_append(GPENCIL_OT_trace_image);
|
|
|
|
#endif
|
2016-08-03 23:31:48 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_arrange);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_change_color);
|
2020-03-17 18:29:18 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_material_lock_unused);
|
2016-08-03 23:31:48 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_apply_thickness);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_cyclical_set);
|
2019-01-11 19:15:23 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_caps_set);
|
2016-08-03 23:31:48 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_join);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_flip);
|
2016-09-15 13:29:26 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_subdivide);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_simplify);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_simplify_fixed);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_separate);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_split);
|
2018-12-13 19:49:13 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_smooth);
|
2019-08-08 16:12:13 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_sample);
|
2018-12-30 13:08:04 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_merge);
|
2019-01-11 19:15:23 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_cutter);
|
2019-02-26 16:04:27 +00:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_trim);
|
2019-08-08 10:23:05 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_merge_by_distance);
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_merge_material);
|
2020-11-25 17:04:22 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_stroke_reset_vertex_color);
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_to_vertex_color);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_extract_palette_vertex);
|
|
|
|
|
|
|
|
WM_operatortype_append(GPENCIL_OT_transform_fill);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_reset_transform_fill);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_brush_reset);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_brush_reset_all);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* vertex groups */
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_assign);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_remove_from);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_select);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_deselect);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_invert);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_smooth);
|
2019-04-16 10:47:30 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_normalize);
|
2019-04-16 12:12:35 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_vertex_group_normalize_all);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* color handle */
|
|
|
|
WM_operatortype_append(GPENCIL_OT_lock_layer);
|
2020-03-17 18:29:18 +01:00
|
|
|
WM_operatortype_append(GPENCIL_OT_material_isolate);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_hide);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_reveal);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_lock_all);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_unlock_all);
|
2020-04-30 16:12:34 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_material_select);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_material_set);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-27 01:57:09 +00:00
|
|
|
/* Editing (Time) --------------- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-09-07 09:54:50 +02:00
|
|
|
/* Interpolation */
|
|
|
|
WM_operatortype_append(GPENCIL_OT_interpolate);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_interpolate_sequence);
|
2017-01-18 19:40:48 +13:00
|
|
|
WM_operatortype_append(GPENCIL_OT_interpolate_reverse);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Primitives */
|
2020-08-11 15:26:15 +02:00
|
|
|
WM_operatortype_append(GPENCIL_OT_primitive_box);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_primitive_line);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_primitive_polyline);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_primitive_circle);
|
|
|
|
WM_operatortype_append(GPENCIL_OT_primitive_curve);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* convert old 2.7 files to 2.8 */
|
|
|
|
WM_operatortype_append(GPENCIL_OT_convert_old_files);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-08-30 12:22:55 +02:00
|
|
|
/* armatures */
|
|
|
|
WM_operatortype_append(GPENCIL_OT_generate_weights);
|
2009-08-26 12:01:15 +00:00
|
|
|
}
|
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
void ED_operatormacros_gpencil(void)
|
|
|
|
{
|
|
|
|
wmOperatorType *ot;
|
|
|
|
wmOperatorTypeMacro *otmacro;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
/* Duplicate + Move = Interactively place newly duplicated strokes */
|
2019-03-06 10:51:11 +11:00
|
|
|
ot = WM_operatortype_append_macro(
|
|
|
|
"GPENCIL_OT_duplicate_move",
|
|
|
|
"Duplicate Strokes",
|
|
|
|
"Make copies of the selected Grease Pencil strokes and move them",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
WM_operatortype_macro_define(ot, "GPENCIL_OT_duplicate");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2014-12-01 02:28:41 +13:00
|
|
|
RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true);
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2019-03-05 15:11:55 +01:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-04 19:31:36 +01:00
|
|
|
/* Extrude + Move = Interactively add new points */
|
2019-03-06 10:51:11 +11:00
|
|
|
ot = WM_operatortype_append_macro("GPENCIL_OT_extrude_move",
|
|
|
|
"Extrude Stroke Points",
|
|
|
|
"Extrude selected points and move them",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2019-03-04 19:31:36 +01:00
|
|
|
WM_operatortype_macro_define(ot, "GPENCIL_OT_extrude");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true);
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2019-03-05 15:11:55 +01:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
}
|
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
/* ****************************************** */
|