[Bf-blender-cvs] [9533811eac4] greasepencil-object: Several fixes after merge
Antonio Vazquez
noreply at git.blender.org
Fri Jan 19 16:41:17 CET 2018
Commit: 9533811eac48eb36cae232e5baf59cb91286b684
Author: Antonio Vazquez
Date: Fri Jan 19 16:39:38 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9533811eac48eb36cae232e5baf59cb91286b684
Several fixes after merge
Mainly due parameter list changes and rename of macros.
===================================================================
M source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M source/blender/editors/gpencil/drawgpencil.c
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/include/ED_gpencil.h
M source/blender/editors/space_view3d/view3d_draw_legacy.c
===================================================================
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
index 690a4ef6443..2fa773b73c1 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
@@ -146,7 +146,7 @@ void DepsgraphNodeBuilder::build_view_layer(
}
/* Palettes. */
- LINKLIST_FOREACH(Palette *, palette, &bmain_->palettes) {
+ BLI_LISTBASE_FOREACH (Palette *, palette, &bmain_->palettes) {
build_palette(palette);
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index a5da379fbaf..e73663a2695 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1739,7 +1739,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object)
* settings change (e.g. when fill.opacity changes on/off,
* we need to rebuild the bGPDstroke->triangles caches)
*/
- LINKLIST_FOREACH (bGPDpaletteref *, palslot, &gpd->palette_slots) {
+ BLI_LISTBASE_FOREACH (bGPDpaletteref *, palslot, &gpd->palette_slots) {
if (palslot->palette) {
ComponentKey palette_key(&palslot->palette->id, DEG_NODE_TYPE_PARAMETERS);
add_relation(palette_key, geometry_key, "Palette -> GP Data");
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
index 1fc7d92c575..7ef4bc8c755 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
@@ -106,7 +106,7 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la
}
/* Palettes. */
- LINKLIST_FOREACH(Palette *, palette, &bmain_->palettes) {
+ BLI_LISTBASE_FOREACH (Palette *, palette, &bmain_->palettes) {
build_palette(palette);
}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 519b771d092..53aef5d60f7 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1956,7 +1956,7 @@ void ED_gpencil_draw_view3d(wmWindowManager *wm,
/* draw grease-pencil sketches to specified 3d-view for gp object
* assuming that matrices are already set correctly */
-void ED_gpencil_draw_view3d_object(wmWindowManager *wm, Scene *scene, Object *ob, View3D *v3d, ARegion *ar, bool only3d)
+void ED_gpencil_draw_view3d_object(wmWindowManager *wm, Scene *scene, const struct Depsgraph *depsgraph, Object *ob, View3D *v3d, ARegion *ar, bool only3d)
{
int dflag = 0;
RegionView3D *rv3d = ar->regiondata;
@@ -1970,7 +1970,7 @@ void ED_gpencil_draw_view3d_object(wmWindowManager *wm, Scene *scene, Object *ob
* deal with the camera border, otherwise map the coords to the camera border. */
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
- ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, true); /* no shift */
+ ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, &rectf, true); /* no shift */
offsx = round_fl_to_int(rectf.xmin);
offsy = round_fl_to_int(rectf.ymin);
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 9a214912b98..64edec752b7 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -233,7 +233,7 @@ static void gp_render_offscreen(tGPDfill *tgpf)
rctf viewplane;
float clipsta, clipend;
- is_ortho = ED_view3d_viewplane_get(tgpf->v3d, tgpf->rv3d, tgpf->sizex, tgpf->sizey, &viewplane, &clipsta, &clipend, NULL);
+ is_ortho = ED_view3d_viewplane_get(tgpf->depsgraph, tgpf->v3d, tgpf->rv3d, tgpf->sizex, tgpf->sizey, &viewplane, &clipsta, &clipend, NULL);
if (is_ortho) {
orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
}
@@ -854,7 +854,7 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *op)
tgpf->eval_ctx = bmain->eval_ctx;
tgpf->rv3d = tgpf->ar->regiondata;
tgpf->v3d = tgpf->sa->spacedata.first;
- tgpf->graph = CTX_data_depsgraph(C);
+ tgpf->depsgraph = CTX_data_depsgraph(C);
tgpf->win = CTX_wm_window(C);
/* set GP datablock */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 59f9a86e63a..66361d155f7 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -179,6 +179,7 @@ typedef struct tGPsdata {
bGPDbrush *brush; /* current drawing brush */
short straight[2]; /* 1: line horizontal, 2: line vertical, other: not defined, second element position */
int lock_axis; /* lock drawing to one axis */
+ bool no_fill; /* the stroke is no fill mode */
short keymodifier; /* key used for invoking the operator */
@@ -1393,7 +1394,7 @@ static void gp_init_palette(tGPsdata *p)
}
/* (re)init new painting data */
-static bool gp_session_initdata(bContext *C, tGPsdata *p)
+static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
{
bGPdata **gpd_ptr = NULL;
ScrArea *curarea = CTX_wm_area(C);
@@ -1416,6 +1417,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p)
p->scene = CTX_data_scene(C);
p->graph = CTX_data_depsgraph(C);
p->win = CTX_wm_window(C);
+ p->no_fill = RNA_boolean_get(op->ptr, "no_fill");
unit_m4(p->imat);
unit_m4(p->mat);
@@ -1613,14 +1615,14 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p)
}
/* init new painting session */
-static tGPsdata *gp_session_initpaint(bContext *C)
+static tGPsdata *gp_session_initpaint(bContext *C, wmOperator *op)
{
tGPsdata *p = NULL;
/* create new context data */
p = MEM_callocN(sizeof(tGPsdata), "GPencil Drawing Data");
- gp_session_initdata(C, p);
+ gp_session_initdata(C, op, p);
/* radius for eraser circle is defined in userprefs now */
/* NOTE: we do this here, so that if we exit immediately,
@@ -1774,7 +1776,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, cons
}
/* set special fill stroke mode */
- if (RNA_boolean_get(op->ptr, "no_fill") == true) {
+ if (p->no_fill == true) {
p->gpd->sbuffer_sflag |= GP_STROKE_NOFILL;
/* replace stroke color with fill color */
copy_v4_v4(p->gpd->scolor, p->gpd->sfill);
@@ -2039,7 +2041,7 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
eGPencil_PaintModes paintmode = RNA_enum_get(op->ptr, "mode");
/* check context */
- p = op->customdata = gp_session_initpaint(C);
+ p = op->customdata = gp_session_initpaint(C, op);
if ((p == NULL) || (p->status == GP_STATUS_ERROR)) {
/* something wasn't set correctly in context */
gpencil_draw_exit(C, op);
@@ -2493,7 +2495,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
/* XXX: watch it with the paintmode! in future,
* it'd be nice to allow changing paint-mode when in sketching-sessions */
- if (gp_session_initdata(C, p))
+ if (gp_session_initdata(C, op, p))
gp_paint_initstroke(p, p->paintmode, CTX_data_depsgraph(C));
if (p->status != GP_STATUS_ERROR) {
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index 9b93b69db5d..6ee32a73aab 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -157,7 +157,7 @@ typedef struct tGPDprimitive {
/* Temporary fill operation data */
typedef struct tGPDfill {
- struct Depsgraph *graph;
+ struct Depsgraph *depsgraph;
struct wmWindow *win; /* window where painting originated */
struct Scene *scene; /* current scene from context */
struct Object *ob; /* current active gp object */
@@ -300,7 +300,8 @@ void ED_gpencil_draw_view3d(struct wmWindowManager *wm,
bool only3d);
void ED_gpencil_draw_view3d_object(struct wmWindowManager *wm,
struct Scene *scene,
- struct Object *ob,
+ const struct Depsgraph *depsgraph,
+ struct Object *ob,
struct View3D *v3d,
struct ARegion *ar,
bool only3d);
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index f440d2533ac..9dc4b20ba07 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -1492,7 +1492,7 @@ CustomDataMask ED_view3d_screen_datamask(const Scene *scene, const bScreen *scre
/**
* Draw grease pencil object strokes
*/
-static void draw_gpencil_object_strokes(const bContext *C, Scene *scene, View3D *v3d, ARegion *ar, Base *base)
+static void draw_gpencil_object_strokes(const bContext *C, Scene *scene, const struct Depsgraph *depsgraph, View3D *v3d, ARegion *ar, Base *base)
{
const bool render_override = (v3d->flag2 & V3D_RENDER_OVERRIDE) != 0;
Object *ob = base->object;
@@ -1512,7 +1512,7 @@ static void draw_gpencil_object_strokes(const bContext *C, Scene *scene, View3D
wmWindowManager *wm = (C != NULL) ? CTX_wm_manager(C) : NULL;
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- ED_gpencil_draw_view3d_object(wm, scene, ob, v3d, ar, true);
+ ED_gpencil_draw_view3d_object(wm, scene, depsgraph, ob, v3d, ar, true);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
}
@@ -1528,7 +1528,7 @@ static int compare_gpencil_zdepth(const void *a1, const void *a2)
}
/* draw objects in cache from back to from */
-static void gpencil_draw_objects(const bContext *C, Scene *scene, View3D *v3d, ARegion *ar, tGPencilSort *cache, int gp_cache_used)
+static void gpencil_draw_objects(const bContext *C, Scene *scene, const struct Depsgraph *depsgraph, View3D *v3d, ARegion *ar, tGPencilSor
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list