[Bf-blender-cvs] [ecab7bef698] master: Cleanup: Rename view3d context set function

Campbell Barton noreply at git.blender.org
Thu Mar 8 07:25:12 CET 2018


Commit: ecab7bef6989752ff1a8c5fd1eab7b5ab159ed46
Author: Campbell Barton
Date:   Thu Mar 8 17:30:24 2018 +1100
Branches: master
https://developer.blender.org/rBecab7bef6989752ff1a8c5fd1eab7b5ab159ed46

Cleanup: Rename view3d context set function

Use common prefix so adding related functions share the prefix.

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

M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/armature/editarmature_sketch.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/curve/editcurve_paint.c
M	source/blender/editors/curve/editcurve_select.c
M	source/blender/editors/curve/editfont.c
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/metaball/mball_edit.c
M	source/blender/editors/object/object_lattice.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_hide.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_mask.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_select.c

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

diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index fc295647ed5..2e2c184e43d 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -171,7 +171,7 @@ void *get_nearest_bone(bContext *C, const int xy[2], bool findunsel)
 	unsigned int buffer[MAXPICKBUF];
 	short hits;
 	
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 	
 	// rect.xmin = ... mouseco!
 	rect.xmin = rect.xmax = xy[0];
@@ -486,7 +486,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d
 	EditBone *nearBone = NULL;
 	int selmask;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 	
 	if (BIF_sk_selectStroke(C, mval, extend)) {
 		return true;
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 86d5f75888d..79b538b4f4a 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -1905,7 +1905,7 @@ static bool sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], c
 	unsigned int buffer[MAXPICKBUF];
 	short hits;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	BLI_rcti_init_pt_radius(&rect, mval, 5);
 
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 6e059342a6b..86a7c58972e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4308,7 +4308,7 @@ bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], bool extend,
 	short hand;
 	
 	view3d_operator_needs_opengl(C);
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 	
 	location[0] = mval[0];
 	location[1] = mval[1];
@@ -4984,7 +4984,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
 	ViewContext vc;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (vc.rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
 		Curve *cu;
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 5bba21f6252..0d7cb089c4f 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -581,7 +581,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
 	struct CurveDrawData *cdd = MEM_callocN(sizeof(*cdd), __func__);
 
 	if (is_invoke) {
-		view3d_set_viewcontext(C, &cdd->vc);
+		ED_view3d_viewcontext_init(C, &cdd->vc);
 		if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) {
 			MEM_freeN(cdd);
 			BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport");
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index 4a4b13d0d1b..673faa37f2a 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -559,7 +559,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent
 	const bool select = !RNA_boolean_get(op->ptr, "deselect");
 
 	view3d_operator_needs_opengl(C);
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu, &bezt, &bp, NULL)) {
 		return OPERATOR_CANCELLED;
@@ -1677,7 +1677,7 @@ static int edcu_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
 	}
 
 	view3d_operator_needs_opengl(C);
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu_dst, &bezt_dst, &bp_dst, NULL)) {
 		return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 4c5642493fa..d651f673a7f 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -1850,7 +1850,7 @@ bool ED_curve_editfont_select_pick(bContext *C, const int mval[2], bool extend,
 	const float dist = ED_view3d_select_dist_px();
 	float dist_sq_best = dist * dist;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
 
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 86de619323c..2767e041627 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -329,7 +329,7 @@ int view3d_opengl_select(
 
 /* view3d_select.c */
 float ED_view3d_select_dist_px(void);
-void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
+void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc);
 void view3d_operator_needs_opengl(const struct bContext *C);
 void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
 void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, int format, int type, void *data);
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 1e2c93389ed..f0ad491e148 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -3381,7 +3381,7 @@ void MESH_OT_select_nth(wmOperatorType *ot)
 
 void em_setup_viewcontext(bContext *C, ViewContext *vc)
 {
-	view3d_set_viewcontext(C, vc);
+	ED_view3d_viewcontext_init(C, vc);
 	
 	if (vc->obedit) {
 		vc->em = BKE_editmesh_from_object(vc->obedit);
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index fa1c935e2ff..b66821c4e37 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1088,7 +1088,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int
 	if (!me || me->totpoly == 0)
 		return false;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (size) {
 		/* sample rect to increase chances of selecting, so that when clicking
@@ -1253,7 +1253,7 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
 	if (!me || me->totvert == 0)
 		return false;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (use_zbuf) {
 		if (size > 0) {
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 5b4078b98b7..e948de02f40 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -595,7 +595,7 @@ bool ED_mball_select_pick(bContext *C, const int mval[2], bool extend, bool dese
 	unsigned int buffer[MAXPICKBUF];
 	rcti rect;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	BLI_rcti_init_pt_radius(&rect, mval, 12);
 
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c
index 57053ddc020..008ad62b39e 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -882,7 +882,7 @@ bool ED_lattice_select_pick(bContext *C, const int mval[2], bool extend, bool de
 	BPoint *bp = NULL;
 	Lattice *lt;
 
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 	lt = ((Lattice *)vc.obedit->data)->editlatt->latt;
 	bp = findnearestLattvert(&vc, mval, true);
 
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 1cbc6aa39fa..3c7cb90eba4 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -396,7 +396,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
 {
 	PE_set_data(C, data);
 
-	view3d_set_viewcontext(C, &data->vc);
+	ED_view3d_viewcontext_init(C, &data->vc);
 	/* note, the object argument means the modelview matrix does not account for the objects matrix, use viewmat rather than (obmat * viewmat) */
 	view3d_get_transformation(data->vc.ar, data->vc.rv3d, NULL, &data->mats);
 
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index e8778eea3b9..e6219b4fae1 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1011,7 +1011,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 
 	/* can't use stroke vc here because this will be called during
 	 * mouse over too, not just during a stroke */
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 
 	if (vc.rv3d && (vc.rv3d->rflag & RV3D_NAVIGATING)) {
 		return;
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c
index a49fe9c929a..e2b318710a8 100644
--- a/source/blender/editors/sculpt_paint/paint_hide.c
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -326,7 +326,7 @@ static void clip_planes_from_rect(bContext *C,
 	bglMats mats = {{0}};
 	
 	view3d_operator_needs_opengl(C);
-	view3d_set_viewcontext(C, &vc);
+	ED_view3d_viewcontext_init(C, &vc);
 	view3d_get_transformation(vc.ar, vc.rv3d, vc.obact, &mats);
 	ED_view3d_clipping_calc(&bb, clip_planes, &mats, rect);
 	negate_m4(clip_planes);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 3ecece580ee..34eaab68379 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -741,7 +741,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
 	PaintOperation *pop = MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */
 	Brush *brush = BKE_paint_brush(&settings->imapaint.paint);
 	int mode = RNA_enum_get(op->ptr, "mode");
-	view3d_set_viewcontext(C, &pop->vc);
+	ED_view3d_viewcontext_init(C, &pop->vc);
 
 	copy_v2_v2(pop->prevmouse, mouse);
 	copy_v2_v2(pop->startmouse, mouse);
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/bl

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list