2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2009-01-14 16:13:50 +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-01-14 16:13:50 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008, Blender Foundation
|
|
|
|
|
* This is a new part of Blender
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_GPENCIL_H__
|
|
|
|
|
#define __ED_GPENCIL_H__
|
2009-01-14 16:13:50 +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
|
|
|
struct ID;
|
2009-01-14 16:13:50 +00:00
|
|
|
struct ListBase;
|
2018-07-31 10:22:19 +02:00
|
|
|
struct PointerRNA;
|
|
|
|
|
struct rcti;
|
|
|
|
|
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Brush;
|
2009-01-14 16:13:50 +00:00
|
|
|
struct bGPDframe;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bGPDlayer;
|
2018-07-31 10:22:19 +02:00
|
|
|
struct bGPDspoint;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bGPDstroke;
|
|
|
|
|
struct bGPdata;
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
struct ARegion;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Depsgraph;
|
|
|
|
|
struct EvaluationContext;
|
|
|
|
|
struct Main;
|
2018-07-31 10:22:19 +02:00
|
|
|
struct RegionView3D;
|
2018-08-30 12:22:55 +02:00
|
|
|
struct ReportList;
|
2017-11-09 13:11:20 -02:00
|
|
|
struct Scene;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ScrArea;
|
2018-07-31 10:22:19 +02:00
|
|
|
struct ToolSettings;
|
|
|
|
|
struct View3D;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ViewLayer;
|
|
|
|
|
struct bContext;
|
2016-09-07 09:54:50 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
struct Material;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Object;
|
2016-09-07 09:54:50 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
struct KeyframeEditData;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bAnimContext;
|
2016-09-07 09:54:50 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
struct wmKeyConfig;
|
|
|
|
|
struct wmOperator;
|
|
|
|
|
struct wmWindow;
|
|
|
|
|
struct wmWindowManager;
|
2016-09-07 09:54:50 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* ------------- Grease-Pencil Runtime Data ---------------- */
|
2009-01-14 16:13:50 +00:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* Temporary 'Stroke Point' data (2D / screen-space)
|
2009-08-28 12:41:45 +00:00
|
|
|
*
|
|
|
|
|
* Used as part of the 'stroke cache' used during drawing of new strokes
|
|
|
|
|
*/
|
2009-01-14 16:13:50 +00:00
|
|
|
typedef struct tGPspoint {
|
2018-12-18 15:51:46 +00:00
|
|
|
float x, y; /* x and y coordinates of cursor (in relative to area) */
|
2012-05-12 20:39:39 +00:00
|
|
|
float pressure; /* pressure of tablet at this point */
|
2016-08-03 23:31:48 +02:00
|
|
|
float strength; /* pressure of tablet at this point for alpha factor */
|
"Dynamic Sketch" patch, which adds timing data to GP strokes, by storing an inittime in each stroke (value returned by PIL_check_seconds_timer() func), and then a delta time for each of its points, relative to that inittime.
These timing data can then be used during conversion to Curve objects, to create a path animation (i.e. an Evaluation Time F-Curve) exactly reproducing the drawing movements.
Aside from this "main feature", the patch brings several fixes/enhancements:
* Stroke smoothing/simplifying will no more move the start/end points of a stroke (this was rather annoying sometimes!).
* Also optimized smoothing code (even though not really noticeable on a modern computer, it now uses less memory and runs faster).
* When converting to curve, you now have the following new possibilities:
** Normalize the weight values (currently, they will get "stroke width * 0.1", i.e. would range by default from 0.0 to 0.3...).
** Scale the radius values to your liking (again, currently they are set from stroke width times 0.1)!
** Link all strokes into a single curve, using zero-radius sections (this is mandatory to use the dynamic feature!).
Here is a small demo video: http://youtu.be/VwWEXrnQAFI
Will update user manual later today.
2012-11-11 14:48:58 +00:00
|
|
|
float time; /* Time relative to stroke start (used when converting to path) */
|
2018-07-31 10:22:19 +02:00
|
|
|
float uv_fac; /* factor of uv along the stroke */
|
|
|
|
|
float uv_rot; /* uv rotation for dor mode */
|
2018-12-21 18:47:51 +00:00
|
|
|
float rnd[3]; /* rnd value */
|
2018-12-18 15:51:46 +00:00
|
|
|
bool rnd_dirty; /* rnd flag */
|
2009-01-14 16:13:50 +00:00
|
|
|
} tGPspoint;
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* used to sort by zdepth gpencil objects in viewport */
|
|
|
|
|
/* TODO: this could be a system parameter in userprefs screen */
|
|
|
|
|
#define GP_CACHE_BLOCK_SIZE 16
|
|
|
|
|
typedef struct tGPencilSort {
|
|
|
|
|
struct Base *base;
|
|
|
|
|
float zdepth;
|
|
|
|
|
} tGPencilSort;
|
Grease Pencil Todos: "Sketching Sessions"
Due to popular request and usability considerations, this commit
reintroduces functionality similar to 2.4's "Draw Mode" for Grease
Pencil.
In the toolbar under the Draw/Line/Eraser buttons, you can find the
"Use Sketching Sessions" toggle, which enables this feature. This is a
per-scene setting, and defaults to off, so that the current 2.5
behaviour is still the default (i.e. the Grease Pencil operator will
only do a single stroke at a time).
With this option enabled, drawing with Grease Pencil will enter a
semi-modal state where you can draw multiple strokes without needing
to keep holding the DKEY throughout (though you'll still need to do so
to start the strokes, unless you use some toolbar buttons), while
still being able to manipulate the viewport. Header help-text prints
show the appropriate keybindings (i.e. press ESCKEY or ENTER to end
the sketching session).
Notes:
- To aid maintainability of the 3D-View toolbar code, I've taken the
liberty to factor out the groups of widgets which commonly occur in
most of the toolbars into separate functions (namely "Repeat" and
"Grease Pencil"). Perhaps it might make it slightly harder to newbies
to the toolbar code to grasp, though the physics panels are far worse
;)
- I've reshuffled some code in the Grease Pencil code to separate out
the various states of operation again more clearly, though some more
work is still needed there (TODO)
- There can now be only one Grease Pencil operator running at a time
- Redoing Grease Pencil operations where sketching sessions was
enabled still needs work. Namely, a way of delimiting the set of
points recorded into strokes is still needed (TODO)
- Ultimately, it should be possible to switch tools midway through a
session. Currently sessions are limited to only being able to be used
with a single drawing mode (TODO)
- After ending a drawing session, the titlebar contols may not work on
Windows without manually making the main window lose focus and then
regain (i.e. click on some other window in toolbar, then come back).
This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
|
|
|
|
2009-08-28 12:41:45 +00:00
|
|
|
/* ----------- Grease Pencil Tools/Context ------------- */
|
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
|
|
|
/* Context-dependent */
|
2018-07-31 10:22:19 +02:00
|
|
|
struct bGPdata **ED_gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *r_ptr);
|
|
|
|
|
|
2014-06-14 02:54:17 +10:00
|
|
|
struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C);
|
2018-07-31 10:22:19 +02:00
|
|
|
struct bGPdata *ED_gpencil_data_get_active_evaluated(const struct 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
|
|
|
|
|
|
|
|
/* Context independent (i.e. each required part is passed in instead) */
|
2018-07-31 10:22:19 +02:00
|
|
|
struct bGPdata **ED_gpencil_data_get_pointers_direct(
|
|
|
|
|
struct ID *screen_id,
|
|
|
|
|
struct ScrArea *sa,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct PointerRNA *r_ptr);
|
|
|
|
|
struct bGPdata *ED_gpencil_data_get_active_direct(
|
|
|
|
|
struct ID *screen_id,
|
|
|
|
|
struct ScrArea *sa,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
|
|
|
|
|
|
|
|
|
bool ED_gpencil_data_owner_is_annotation(struct PointerRNA *owner_ptr);
|
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
|
|
|
|
|
|
|
|
/* 3D View */
|
2018-11-23 14:41:38 -02:00
|
|
|
struct bGPdata *ED_gpencil_data_get_active_v3d(struct ViewLayer *view_layer, struct View3D *v3d);
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfra);
|
|
|
|
|
|
2015-01-19 16:38:32 +13:00
|
|
|
/* ----------- Stroke Editing Utilities ---------------- */
|
|
|
|
|
|
|
|
|
|
bool ED_gpencil_stroke_can_use_direct(const struct ScrArea *sa, const struct bGPDstroke *gps);
|
|
|
|
|
bool ED_gpencil_stroke_can_use(const struct bContext *C, const struct bGPDstroke *gps);
|
2018-07-31 10:22:19 +02:00
|
|
|
bool ED_gpencil_stroke_color_use(struct Object *ob, const struct bGPDlayer *gpl, const struct bGPDstroke *gps);
|
2016-05-10 04:37:00 +10:00
|
|
|
|
2009-08-28 12:41:45 +00:00
|
|
|
/* ----------- Grease Pencil Operators ----------------- */
|
2009-08-26 12:01:15 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void ED_keymap_gpencil(struct wmKeyConfig *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
|
|
|
|
2009-08-26 12:01:15 +00:00
|
|
|
void ED_operatortypes_gpencil(void);
|
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);
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2015-01-01 12:36:01 +13:00
|
|
|
/* ------------- Copy-Paste Buffers -------------------- */
|
|
|
|
|
|
|
|
|
|
/* Strokes copybuf */
|
|
|
|
|
void ED_gpencil_strokes_copybuf_free(void);
|
|
|
|
|
|
|
|
|
|
|
2.5
Patch from Joshua, converting Grease Pencil to 2.5.
All GP data now is an ID block, allowing re-use, link and append.
For better contextual control within 2.5, these GP ID's will get
linked to actual data, like NodeTrees, Scenes, Images or Objects.
That will ensure Undo works, and opens up exciting new use cases
as well. :)
Patch note: on reading files, GPencils linked from editors will
get moved to the main library, using standard naming (indicating
where it was used), and with "Fake User" set. That way the user
can manually relink the pencils where appropriate.
We can check on just linking GP to some default, like 3d window
pencils to Scene? Nice to experiment with.
Notes for Joshua:
- for reading old GPencil, it has to use old code as well, meaning
to tread data as "indirect data, within another ID".
- Saving ID data means the chunk in file BHead needs the ID_GD code,
and not "DATA", which indicates 'indirect data'. That's the file
format spec.
- I've added do_versions_gpencil_2_50(), feel free to further tweak
things here, like linking things to scene or so.
- Formerly GPencil saved 2.50 files won't convert gpencil
2009-04-20 10:13:55 +00:00
|
|
|
/* ------------ Grease-Pencil Drawing API ------------------ */
|
2009-01-14 16:13:50 +00:00
|
|
|
/* drawgpencil.c */
|
|
|
|
|
|
2019-03-19 11:01:27 +01:00
|
|
|
void ED_annotation_draw_2dimage(const struct bContext *C);
|
|
|
|
|
void ED_annotation_draw_view2d(const struct bContext *C, bool onlyv2d);
|
|
|
|
|
void ED_annotation_draw_view3d(
|
2018-07-31 10:22:19 +02:00
|
|
|
struct Scene *scene, struct Depsgraph *depsgraph,
|
|
|
|
|
struct View3D *v3d, struct ARegion *ar,
|
|
|
|
|
bool only3d);
|
2019-03-19 10:52:37 +01:00
|
|
|
void ED_annotation_draw_ex(
|
2019-03-19 10:48:24 +01:00
|
|
|
struct Scene *scene,
|
2018-10-31 14:43:25 +11:00
|
|
|
struct bGPdata *gpd, int winx, int winy,
|
2018-07-31 10:22:19 +02:00
|
|
|
const int cfra, const char spacetype);
|
2009-01-14 16:13:50 +00:00
|
|
|
|
2011-01-10 22:10:28 +00:00
|
|
|
/* ----------- Grease-Pencil AnimEdit API ------------------ */
|
2014-06-14 02:54:17 +10:00
|
|
|
bool ED_gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene,
|
2012-06-08 21:48:04 +00:00
|
|
|
short (*gpf_cb)(struct bGPDframe *, struct Scene *));
|
2014-06-14 02:54:17 +10:00
|
|
|
void ED_gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, bool onlysel);
|
2011-01-10 22:10:28 +00:00
|
|
|
|
2014-06-14 02:54:17 +10:00
|
|
|
bool ED_gplayer_frame_select_check(struct bGPDlayer *gpl);
|
2012-06-08 21:48:04 +00:00
|
|
|
void ED_gplayer_frame_select_set(struct bGPDlayer *gpl, short mode);
|
2018-10-05 10:27:04 +10:00
|
|
|
void ED_gplayer_frames_select_box(struct bGPDlayer *gpl, float min, float max, short select_mode);
|
2016-06-24 02:52:13 +12:00
|
|
|
void ED_gplayer_frames_select_region(struct KeyframeEditData *ked, struct bGPDlayer *gpl, short tool, short select_mode);
|
2012-06-08 21:48:04 +00:00
|
|
|
void ED_gpencil_select_frames(struct bGPDlayer *gpl, short select_mode);
|
|
|
|
|
void ED_gpencil_select_frame(struct bGPDlayer *gpl, int selx, short select_mode);
|
2011-01-10 22:10:28 +00:00
|
|
|
|
2013-11-25 04:55:26 +01:00
|
|
|
bool ED_gplayer_frames_delete(struct bGPDlayer *gpl);
|
2012-06-08 21:48:04 +00:00
|
|
|
void ED_gplayer_frames_duplicate(struct bGPDlayer *gpl);
|
2011-01-10 22:10:28 +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_gplayer_frames_keytype_set(struct bGPDlayer *gpl, short type);
|
|
|
|
|
|
2012-12-03 13:07:43 +00:00
|
|
|
void ED_gplayer_snap_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode);
|
2015-12-14 02:36:02 +13:00
|
|
|
void ED_gplayer_mirror_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode);
|
2012-12-03 13:07:43 +00:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
void ED_gpencil_anim_copybuf_free(void);
|
|
|
|
|
bool ED_gpencil_anim_copybuf_copy(struct bAnimContext *ac);
|
|
|
|
|
bool ED_gpencil_anim_copybuf_paste(struct bAnimContext *ac, const short copy_mode);
|
2011-01-10 22:10:28 +00:00
|
|
|
|
2009-01-14 16:13:50 +00:00
|
|
|
|
2011-09-06 07:59:18 +00:00
|
|
|
/* ------------ Grease-Pencil Undo System ------------------ */
|
|
|
|
|
int ED_gpencil_session_active(void);
|
|
|
|
|
int ED_undo_gpencil_step(struct bContext *C, int step, const char *name);
|
|
|
|
|
|
2018-08-30 12:22:55 +02:00
|
|
|
/* ------------ Grease-Pencil Armature weights ------------------ */
|
2018-09-02 16:45:00 +10:00
|
|
|
bool ED_gpencil_add_armature_weights(
|
|
|
|
|
const struct bContext *C, struct ReportList *reports,
|
|
|
|
|
struct Object *ob, struct Object *ob_arm, int mode);
|
2018-08-30 12:22:55 +02:00
|
|
|
|
|
|
|
|
/* keep this aligned with gpencil_armature enum */
|
|
|
|
|
#define GP_PAR_ARMATURE_NAME 0
|
|
|
|
|
#define GP_PAR_ARMATURE_AUTO 1
|
|
|
|
|
|
2016-08-03 23:31:48 +02:00
|
|
|
/* ------------ Transformation Utilities ------------ */
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* get difference matrix */
|
|
|
|
|
void ED_gpencil_parent_location(
|
|
|
|
|
const struct Depsgraph *depsgraph, struct Object *obact, struct bGPdata *gpd,
|
|
|
|
|
struct bGPDlayer *gpl, float diff_mat[4][4]);
|
2016-11-19 22:41:37 +01:00
|
|
|
/* reset parent matrix for all layers */
|
2018-07-31 10:22:19 +02:00
|
|
|
void ED_gpencil_reset_layers_parent(struct Depsgraph *depsgraph, struct Object *obact, struct bGPdata *gpd);
|
|
|
|
|
|
|
|
|
|
/* cursor utilities */
|
|
|
|
|
void ED_gpencil_brush_draw_eraser(struct Brush *brush, int x, int y);
|
|
|
|
|
|
|
|
|
|
/* ----------- Add Primitive Utilities -------------- */
|
|
|
|
|
|
2019-01-03 18:10:39 +01:00
|
|
|
void ED_gpencil_create_monkey(struct bContext *C, struct Object *ob, float mat[4][4]);
|
|
|
|
|
void ED_gpencil_create_stroke(struct bContext *C, struct Object *ob, float mat[4][4]);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
/* ------------ Object Utilities ------------ */
|
2018-12-14 10:30:06 +11:00
|
|
|
struct Object *ED_gpencil_add_object(
|
2018-12-07 12:59:04 +11:00
|
|
|
struct bContext *C, struct Scene *scene, const float loc[3], unsigned short local_view_bits);
|
2019-01-03 18:10:39 +01:00
|
|
|
void ED_gpencil_add_defaults(struct bContext *C, struct Object *ob);
|
2018-07-31 10:22:19 +02:00
|
|
|
/* set object modes */
|
|
|
|
|
void ED_gpencil_setup_modes(struct bContext *C, struct bGPdata *gpd, int newmode);
|
|
|
|
|
|
2018-11-26 13:49:17 +11:00
|
|
|
void ED_gp_project_stroke_to_plane(
|
2019-03-18 14:13:06 +11:00
|
|
|
const struct Scene *scene,
|
2018-11-26 13:49:17 +11:00
|
|
|
const struct Object *ob, const struct RegionView3D *rv3d,
|
|
|
|
|
struct bGPDstroke *gps, const float origin[3], const int axis);
|
|
|
|
|
void ED_gp_project_point_to_plane(
|
2019-03-18 14:13:06 +11:00
|
|
|
const struct Scene *scene,
|
2018-11-26 13:49:17 +11:00
|
|
|
const struct Object *ob, const struct RegionView3D *rv3d,
|
|
|
|
|
const float origin[3], const int axis, struct bGPDspoint *pt);
|
|
|
|
|
void ED_gp_get_drawing_reference(
|
|
|
|
|
const struct Scene *scene, const struct Object *ob,
|
|
|
|
|
struct bGPDlayer *gpl, char align_flag, float vec[3]);
|
2018-12-19 17:07:12 +01:00
|
|
|
void ED_gpencil_project_stroke_to_view(
|
|
|
|
|
struct bContext *C, struct bGPDlayer *gpl, struct bGPDstroke *gps);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
/* set sculpt cursor */
|
|
|
|
|
void ED_gpencil_toggle_brush_cursor(struct bContext *C, bool enable, void *customdata);
|
|
|
|
|
|
|
|
|
|
/* vertex groups */
|
|
|
|
|
void ED_gpencil_vgroup_assign(struct bContext *C, struct Object *ob, float weight);
|
|
|
|
|
void ED_gpencil_vgroup_remove(struct bContext *C, struct Object *ob);
|
|
|
|
|
void ED_gpencil_vgroup_select(struct bContext *C, struct Object *ob);
|
|
|
|
|
void ED_gpencil_vgroup_deselect(struct bContext *C, struct Object *ob);
|
|
|
|
|
|
|
|
|
|
/* join objects */
|
|
|
|
|
int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op);
|
2016-08-03 23:31:48 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* texture coordinate utilities */
|
|
|
|
|
void ED_gpencil_tpoint_to_point(struct ARegion *ar, float origin[3], const struct tGPspoint *tpt, struct bGPDspoint *pt);
|
|
|
|
|
void ED_gpencil_calc_stroke_uv(struct Object *ob, struct bGPDstroke *gps);
|
|
|
|
|
void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
|
2016-08-03 23:31:48 +02:00
|
|
|
|
2019-01-11 19:15:23 +01:00
|
|
|
/* extend selection to stroke intersections
|
|
|
|
|
* returns:
|
|
|
|
|
* 0 - No hit
|
|
|
|
|
* 1 - Hit in point A
|
|
|
|
|
* 2 - Hit in point B
|
|
|
|
|
* 3 - Hit in point A and B
|
|
|
|
|
*/
|
|
|
|
|
int ED_gpencil_select_stroke_segment(
|
|
|
|
|
struct bGPDlayer *gpl,
|
|
|
|
|
struct bGPDstroke *gps, struct bGPDspoint *pt,
|
|
|
|
|
bool select, bool insert, const float scale,
|
|
|
|
|
float r_hita[3], float r_hitb[3]);
|
|
|
|
|
|
2019-03-05 18:37:33 +11:00
|
|
|
void ED_gpencil_select_toggle_all(struct bContext *C, int action);
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_GPENCIL_H__ */
|