[Bf-blender-cvs] [d4ac65d0032] blender2.8: Cleanup: use same 'depsgraph' name everywhere outside of DEG space.

Bastien Montagne noreply at git.blender.org
Tue May 29 12:07:55 CEST 2018


Commit: d4ac65d003244db4368222f52fbc8fad1cf9a788
Author: Bastien Montagne
Date:   Tue May 29 12:01:07 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd4ac65d003244db4368222f52fbc8fad1cf9a788

Cleanup: use same 'depsgraph' name everywhere outside of DEG space.

'graph' is waaaayyyyy too generic name outside of DEG context, and
better try to use same name everywhere!

===================================================================

M	source/blender/draw/intern/DRW_render.h
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/interface/interface_eyedropper_depth.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_utils.c
M	source/blender/editors/space_view3d/view3d_view.c
M	source/blender/makesrna/intern/rna_layer.c

===================================================================

diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 25806062f68..2b2a5bd3b48 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -438,10 +438,10 @@ struct DefaultTextureList     *DRW_viewport_texture_list_get(void);
 
 void DRW_viewport_request_redraw(void);
 
-void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *graph);
+void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *depsgraph);
 void DRW_render_object_iter(
-	void *vedata, struct RenderEngine *engine, struct Depsgraph *graph,
-	void (*callback)(void *vedata, struct Object *ob, struct RenderEngine *engine, struct Depsgraph *graph));
+	void *vedata, struct RenderEngine *engine, struct Depsgraph *depsgraph,
+	void (*callback)(void *vedata, struct Object *ob, struct RenderEngine *engine, struct Depsgraph *depsgraph));
 void DRW_render_instance_buffer_finish(void);
 
 /* ViewLayers */
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d2f291f69fb..cf9cbbe3765 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2109,9 +2109,9 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
 	
 	/* init autodist for geometry projection */
 	if (mode == GP_REPROJECT_SURFACE) {
-		struct Depsgraph *graph = CTX_data_depsgraph(C);
+		struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 		view3d_region_operator_needs_opengl(CTX_wm_window(C), gsc.ar);
-		ED_view3d_autodist_init(graph, gsc.ar, CTX_wm_view3d(C), 0);
+		ED_view3d_autodist_init(depsgraph, gsc.ar, CTX_wm_view3d(C), 0);
 	}
 	
 	// TODO: For deforming geometry workflow, create new frames?
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 3f3349a752c..f9b5966dee3 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -116,7 +116,7 @@ typedef enum eGPencil_PaintFlags {
  */
 typedef struct tGPsdata {
 	Scene *scene;       /* current scene from context */
-	struct Depsgraph *graph;
+	struct Depsgraph *depsgraph;
 	
 	wmWindow *win;      /* window where painting originated */
 	ScrArea *sa;        /* area where painting originated */
@@ -645,7 +645,7 @@ static short gp_stroke_addpoint(
 				
 				view3d_region_operator_needs_opengl(p->win, p->ar);
 				ED_view3d_autodist_init(
-				        p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
+				        p->depsgraph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
 			}
 			
 			/* convert screen-coordinates to appropriate coordinates (and store them) */
@@ -1246,7 +1246,7 @@ static void gp_stroke_doeraser(tGPsdata *p)
 		if (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH) {
 			View3D *v3d = p->sa->spacedata.first;
 			view3d_region_operator_needs_opengl(p->win, p->ar);
-			ED_view3d_autodist_init(p->graph, p->ar, v3d, 0);
+			ED_view3d_autodist_init(p->depsgraph, p->ar, v3d, 0);
 		}
 	}
 	
@@ -1400,7 +1400,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p)
 	
 	/* pass on current scene and window */
 	p->scene = CTX_data_scene(C);
-	p->graph = CTX_data_depsgraph(C);
+	p->depsgraph = CTX_data_depsgraph(C);
 	p->win = CTX_wm_window(C);
 	
 	unit_m4(p->imat);
@@ -1813,7 +1813,7 @@ static void gp_paint_strokeend(tGPsdata *p)
 		
 		/* need to restore the original projection settings before packing up */
 		view3d_region_operator_needs_opengl(p->win, p->ar);
-		ED_view3d_autodist_init(p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
+		ED_view3d_autodist_init(p->depsgraph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
 	}
 	
 	/* check if doing eraser or not */
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index babe68ba439..0e08630d8bc 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -538,7 +538,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
 	if (sa->spacetype == SPACE_VIEW3D) {
 		wmWindow *win = CTX_wm_window(C);
 		Scene *scene = CTX_data_scene(C);
-		struct Depsgraph *graph = CTX_data_depsgraph(C);
+		struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 		View3D *v3d = (View3D *)CTX_wm_space_data(C);
 		RegionView3D *rv3d = ar->regiondata;
 		
@@ -546,7 +546,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
 		view3d_operator_needs_opengl(C);
 		
 		view3d_region_operator_needs_opengl(win, ar);
-		ED_view3d_autodist_init(graph, ar, v3d, 0);
+		ED_view3d_autodist_init(depsgraph, ar, v3d, 0);
 		
 		/* for camera view set the subrect */
 		if (rv3d->persp == RV3D_CAMOB) {
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index e1a6d59a748..067791667dd 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -326,12 +326,12 @@ unsigned int ED_view3d_backbuf_sample(
         struct ViewContext *vc, int x, int y);
 
 bool ED_view3d_autodist(
-        struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d,
+        struct Depsgraph *depsgraph, struct ARegion *ar, struct View3D *v3d,
         const int mval[2], float mouse_worldloc[3],
         const bool alphaoverride, const float fallback_depth_pt[3]);
 
 /* only draw so ED_view3d_autodist_simple can be called many times after */
-void ED_view3d_autodist_init(struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d, int mode);
+void ED_view3d_autodist_init(struct Depsgraph *depsgraph, struct ARegion *ar, struct View3D *v3d, int mode);
 bool ED_view3d_autodist_simple(struct ARegion *ar, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth);
 bool ED_view3d_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth);
 bool ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth);
diff --git a/source/blender/editors/interface/interface_eyedropper_depth.c b/source/blender/editors/interface/interface_eyedropper_depth.c
index fd9c5f1869d..bd23fbb961d 100644
--- a/source/blender/editors/interface/interface_eyedropper_depth.c
+++ b/source/blender/editors/interface/interface_eyedropper_depth.c
@@ -169,7 +169,7 @@ static void depthdropper_depth_sample_pt(bContext *C, DepthDropper *ddr, int mx,
 		if (sa->spacetype == SPACE_VIEW3D) {
 			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
 			if (ar) {
-				struct Depsgraph *graph = CTX_data_depsgraph(C);
+				struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 				View3D *v3d = sa->spacedata.first;
 				RegionView3D *rv3d = ar->regiondata;
 				/* weak, we could pass in some reference point */
@@ -187,7 +187,7 @@ static void depthdropper_depth_sample_pt(bContext *C, DepthDropper *ddr, int mx,
 
 				view3d_operator_needs_opengl(C);
 
-				if (ED_view3d_autodist(graph, ar, v3d, mval, co, true, NULL)) {
+				if (ED_view3d_autodist(depsgraph, ar, v3d, mval, co, true, NULL)) {
 					const float mval_center_fl[2] = {
 					    (float)ar->winx / 2,
 					    (float)ar->winy / 2};
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 76449b61d4d..dab75df8d13 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -5013,7 +5013,7 @@ void paint_proj_stroke(
 	/* clone gets special treatment here to avoid going through image initialization */
 	if (ps_handle->is_clone_cursor_pick) {
 		Scene *scene = ps_handle->scene;
-		struct Depsgraph *graph = CTX_data_depsgraph(C);
+		struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 		View3D *v3d = CTX_wm_view3d(C);
 		ARegion *ar = CTX_wm_region(C);
 		float *cursor = ED_view3d_cursor3d_get(scene, v3d)->location;
@@ -5021,7 +5021,7 @@ void paint_proj_stroke(
 
 		view3d_operator_needs_opengl(C);
 
-		if (!ED_view3d_autodist(graph, ar, v3d, mval_i, cursor, false, NULL)) {
+		if (!ED_view3d_autodist(depsgraph, ar, v3d, mval_i, cursor, false, NULL)) {
 			return;
 		}
 
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 3f59a5db9b3..2ac2bf683e0 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3089,7 +3089,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev
 	ARegion *ar = CTX_wm_region(C);
 
 	if (rv3d) {
-		struct Depsgraph *graph = CTX_data_depsgraph(C);
+		struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 		float new_ofs[3];
 		const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
 
@@ -3097,7 +3097,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev
 
 		view3d_operator_needs_opengl(C);
 
-		if (ED_view3d_autodist(graph, ar, v3d, event->mval, new_ofs, false, NULL)) {
+		if (ED_view3d_autodist(depsgraph, ar, v3d, event->mval, new_ofs, false, NULL)) {
 			/* pass */
 		}
 		else {
@@ -4574,10 +4574,10 @@ void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2])
 	}
 
 	if (U.uiflag & USER_DEPTH_CURSOR) {  /* maybe this should be accessed some other way */
-		struct Depsgraph *graph = CTX_data_depsgraph(C);
+		struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
 
 		view3d_operator_needs_opengl(C);
-		if (ED_view3d_autodist(graph, ar, v3d, mval, fp, true, NULL)) {
+		if (ED_view3d_autodist(depsgraph, ar, v3d, mval, fp, true, NULL)) {
 			depth_used = true;
 		}
 	}
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 90b1b043de6..8b0b461d443 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -899,7 +899,7 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg
  * \param fallback_depth_pt: Use t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list