Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2016-12-17 00:56:43 +0300
committerAntonio Vazquez <blendergit@gmail.com>2016-12-17 00:56:43 +0300
commit535298eea5fd50a19d04ddffb05060313e32826c (patch)
tree1087d2711d6ea8b95c1df6565d957308fad77c2d /source/blender/editors/gpencil/drawgpencil.c
parent4df75e536a0847cf5e5f567f92f1391f1f72c211 (diff)
Fix T50264: Stroke is not painted when append Grease Pencil block
When append a datablock the default brushes were not created and only were created when draw new strokes. Now the default brushes are created when draw strokes if necessary.
Diffstat (limited to 'source/blender/editors/gpencil/drawgpencil.c')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 48786e08f85..9da3c3ee088 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1554,7 +1554,17 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
int cfra, int dflag, const char spacetype)
{
bGPdata *gpd_source = NULL;
-
+ ToolSettings *ts;
+ bGPDbrush *brush;
+ if (scene) {
+ ts = scene->toolsettings;
+ brush = BKE_gpencil_brush_getactive(ts);
+ /* if no brushes, create default set */
+ if (brush == NULL) {
+ BKE_gpencil_brush_init_presets(ts);
+ brush = BKE_gpencil_brush_getactive(ts);
+ }
+ }
if (scene) {
if (spacetype == SPACE_VIEW3D) {
gpd_source = (scene->gpd ? scene->gpd : NULL);
@@ -1565,8 +1575,6 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
}
if (gpd_source) {
- ToolSettings *ts = scene->toolsettings;
- bGPDbrush *brush = BKE_gpencil_brush_getactive(ts);
if (brush != NULL) {
gp_draw_data(brush, ts->gp_sculpt.alpha, gpd_source,
offsx, offsy, winx, winy, cfra, dflag);
@@ -1578,8 +1586,6 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
/* scene/clip data has already been drawn, only object/track data is drawn here
* if gpd_source == gpd, we don't have any object/track data and we can skip */
if (gpd_source == NULL || (gpd_source && gpd_source != gpd)) {
- ToolSettings *ts = scene->toolsettings;
- bGPDbrush *brush = BKE_gpencil_brush_getactive(ts);
if (brush != NULL) {
gp_draw_data(brush, ts->gp_sculpt.alpha, gpd,
offsx, offsy, winx, winy, cfra, dflag);