[Bf-blender-cvs] [0a5d7efab32] blender2.8: Manipulator: rename struct members

Campbell Barton noreply at git.blender.org
Fri Jun 23 06:45:33 CEST 2017


Commit: 0a5d7efab324f5293e86d329d04aba6c0deaecad
Author: Campbell Barton
Date:   Fri Jun 23 14:48:37 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB0a5d7efab324f5293e86d329d04aba6c0deaecad

Manipulator: rename struct members

Rename:
- matrix -> matrix_basis
- user_scale -> scale_basis
- scale -> scale_final

Match RNA names being added to custom-manipulator branch.

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

M	source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
M	source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
M	source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
M	source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
M	source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
M	source/blender/editors/manipulator_library/manipulator_types/primitive3d_manipulator.c
M	source/blender/editors/mesh/editmesh_bisect.c
M	source/blender/editors/mesh/editmesh_extrude.c
M	source/blender/windowmanager/manipulators/WM_manipulator_types.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator.c

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

diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
index fd8745577cf..d402ab0b6f1 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
@@ -66,13 +66,13 @@ static void arrow2d_draw_geom(wmManipulator *mpr, const float matrix[4][4], cons
 	const float size_h = size / 2.0f;
 	const float arrow_length = RNA_float_get(mpr->ptr, "length");
 	const float arrow_angle = RNA_float_get(mpr->ptr, "angle");
-	const float draw_line_ofs = (mpr->line_width * 0.5f) / mpr->scale;
+	const float draw_line_ofs = (mpr->line_width * 0.5f) / mpr->scale_final;
 
 	uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 
 	gpuPushMatrix();
 	gpuMultMatrix(matrix);
-	gpuScaleUniform(mpr->scale);
+	gpuScaleUniform(mpr->scale_final);
 	gpuRotate2D(RAD2DEGF(arrow_angle));
 	/* local offset */
 	gpuTranslate2f(
@@ -107,7 +107,7 @@ static void manipulator_arrow2d_draw(const bContext *UNUSED(C), wmManipulator *m
 
 	glLineWidth(mpr->line_width);
 	glEnable(GL_BLEND);
-	arrow2d_draw_geom(mpr, mpr->matrix, col);
+	arrow2d_draw_geom(mpr, mpr->matrix_basis, col);
 	glDisable(GL_BLEND);
 
 	if (mpr->interaction_data) {
@@ -129,7 +129,7 @@ static void manipulator_arrow2d_invoke(
 {
 	ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
 
-	copy_m4_m4(inter->init_matrix, mpr->matrix);
+	copy_m4_m4(inter->init_matrix, mpr->matrix_basis);
 	mpr->interaction_data = inter;
 }
 
@@ -139,11 +139,11 @@ static int manipulator_arrow2d_test_select(
 	const float mval[2] = {event->mval[0], event->mval[1]};
 	const float arrow_length = RNA_float_get(mpr->ptr, "length");
 	const float arrow_angle = RNA_float_get(mpr->ptr, "angle");
-	const float line_len = arrow_length * mpr->scale;
+	const float line_len = arrow_length * mpr->scale_final;
 	float mval_local[2];
 
 	copy_v2_v2(mval_local, mval);
-	sub_v2_v2(mval_local, mpr->matrix[3]);
+	sub_v2_v2(mval_local, mpr->matrix_basis[3]);
 
 	float line[2][2];
 	line[0][0] = line[0][1] = line[1][0] = 0.0f;
diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
index c2e549e0be8..2e4a34d7c63 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
@@ -83,8 +83,8 @@ static void manipulator_arrow_matrix_world_get(wmManipulator *mpr, float r_matri
 {
 	ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
 
-	copy_m4_m4(r_matrix, arrow->manipulator.matrix);
-	madd_v3_v3fl(r_matrix[3], arrow->manipulator.matrix[2], arrow->data.offset);
+	copy_m4_m4(r_matrix, arrow->manipulator.matrix_basis);
+	madd_v3_v3fl(r_matrix[3], arrow->manipulator.matrix_basis[2], arrow->data.offset);
 }
 
 static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, const float color[4])
@@ -188,7 +188,7 @@ static void arrow_draw_intern(ArrowManipulator3D *arrow, const bool select, cons
 	manipulator_color_get(&arrow->manipulator, highlight, col);
 	manipulator_arrow_matrix_world_get(&arrow->manipulator, final_matrix);
 
-	mul_mat3_m4_fl(final_matrix, arrow->manipulator.scale);
+	mul_mat3_m4_fl(final_matrix, arrow->manipulator.scale_final);
 	mul_m4_m4m4(final_matrix, final_matrix, arrow->manipulator.matrix_offset);
 
 	gpuPushMatrix();
@@ -253,7 +253,7 @@ static void manipulator_arrow_modal(bContext *C, wmManipulator *mpr, const wmEve
 
 	copy_v3_v3(orig_origin, inter->init_matrix[3]);
 	orig_origin[3] = 1.0f;
-	add_v3_v3v3(offset, orig_origin, arrow->manipulator.matrix[2]);
+	add_v3_v3v3(offset, orig_origin, arrow->manipulator.matrix_basis[2]);
 	offset[3] = 1.0f;
 
 	/* calculate view vector */
@@ -267,7 +267,7 @@ static void manipulator_arrow_modal(bContext *C, wmManipulator *mpr, const wmEve
 
 	/* first determine if view vector is really close to the direction. If it is, we use
 	 * vertical movement to determine offset, just like transform system does */
-	if (RAD2DEG(acos(dot_v3v3(viewvec, arrow->manipulator.matrix[2]))) > 5.0f) {
+	if (RAD2DEG(acos(dot_v3v3(viewvec, arrow->manipulator.matrix_basis[2]))) > 5.0f) {
 		/* multiply to projection space */
 		mul_m4_v4(rv3d->persmat, orig_origin);
 		mul_v4_fl(orig_origin, 1.0f / orig_origin[3]);
@@ -312,11 +312,11 @@ static void manipulator_arrow_modal(bContext *C, wmManipulator *mpr, const wmEve
 		cross_v3_v3v3(plane, tangent, viewvec);
 
 		const float plane_offset = dot_v3v3(plane, offset);
-		const float plane_dir = dot_v3v3(plane, arrow->manipulator.matrix[2]);
+		const float plane_dir = dot_v3v3(plane, arrow->manipulator.matrix_basis[2]);
 		const float fac = (plane_dir != 0.0f) ? (plane_offset / plane_dir) : 0.0f;
 		facdir = (fac < 0.0) ? -1.0 : 1.0;
 		if (isfinite(fac)) {
-			mul_v3_v3fl(offset, arrow->manipulator.matrix[2], fac);
+			mul_v3_v3fl(offset, arrow->manipulator.matrix_basis[2], fac);
 		}
 	}
 	else {
@@ -378,7 +378,7 @@ static void manipulator_arrow_invoke(
 	inter->init_mval[0] = event->mval[0];
 	inter->init_mval[1] = event->mval[1];
 
-	inter->init_scale = mpr->scale;
+	inter->init_scale = mpr->scale_final;
 
 	manipulator_arrow_matrix_world_get(mpr, inter->init_matrix);
 
diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
index 72db4a89f08..973f487fd82 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
@@ -212,7 +212,7 @@ static void manipulator_rect_transform_draw(const bContext *UNUSED(C), wmManipul
 	};
 
 	gpuPushMatrix();
-	gpuMultMatrix(mpr->matrix);
+	gpuMultMatrix(mpr->matrix_basis);
 	gpuMultMatrix(mpr->matrix_offset);
 	if (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) {
 		gpuScaleUniform(scale[0]);
@@ -283,7 +283,7 @@ static int manipulator_rect_transform_test_select(
 	const int transform_flag = RNA_enum_get(mpr->ptr, "transform");
 
 	/* rotate mouse in relation to the center and relocate it */
-	sub_v2_v2v2(point_local, mouse, mpr->matrix[3]);
+	sub_v2_v2v2(point_local, mouse, mpr->matrix_basis[3]);
 	point_local[0] -= mpr->matrix_offset[3][0];
 	point_local[1] -= mpr->matrix_offset[3][1];
 	//rotate_m2(matrot, -cage->transform.rotation);
diff --git a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
index 0260fc44010..485b42f9929 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
@@ -100,10 +100,10 @@ static void dial_calc_matrix(const wmManipulator *mpr, float mat[4][4])
 	float rot[3][3];
 	const float up[3] = {0.0f, 0.0f, 1.0f};
 
-	rotation_between_vecs_to_mat3(rot, up, mpr->matrix[2]);
+	rotation_between_vecs_to_mat3(rot, up, mpr->matrix_basis[2]);
 	copy_m4_m3(mat, rot);
-	copy_v3_v3(mat[3], mpr->matrix[3]);
-	mul_mat3_m4_fl(mat, mpr->scale);
+	copy_v3_v3(mat[3], mpr->matrix_basis[3]);
+	mul_mat3_m4_fl(mat, mpr->scale_final);
 }
 
 /* -------------------------------------------------------------------- */
@@ -202,12 +202,12 @@ static void dial_ghostarc_get_angles(
 
 	/* we might need to invert the direction of the angles */
 	float view_vec[3], axis_vec[3];
-	ED_view3d_global_to_vector(rv3d, mpr->matrix[3], view_vec);
-	normalize_v3_v3(axis_vec, mpr->matrix[2]);
+	ED_view3d_global_to_vector(rv3d, mpr->matrix_basis[3], view_vec);
+	normalize_v3_v3(axis_vec, mpr->matrix_basis[2]);
 
 	float proj_outer_rel[3];
 	mul_v3_project_m4_v3(proj_outer_rel, mat, co_outer);
-	sub_v3_v3(proj_outer_rel, mpr->matrix[3]);
+	sub_v3_v3(proj_outer_rel, mpr->matrix_basis[3]);
 
 	float proj_mval_new_rel[3];
 	float proj_mval_init_rel[3];
@@ -215,7 +215,7 @@ static void dial_ghostarc_get_angles(
 	float ray_co[3], ray_no[3];
 	float ray_lambda;
 
-	plane_from_point_normal_v3(dial_plane, mpr->matrix[3], axis_vec);
+	plane_from_point_normal_v3(dial_plane, mpr->matrix_basis[3], axis_vec);
 
 	if (!ED_view3d_win_to_ray(ar, v3d, inter->init_mval, ray_co, ray_no, false) ||
 		!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
@@ -223,7 +223,7 @@ static void dial_ghostarc_get_angles(
 		goto fail;
 	}
 	madd_v3_v3v3fl(proj_mval_init_rel, ray_co, ray_no, ray_lambda);
-	sub_v3_v3(proj_mval_init_rel, mpr->matrix[3]);
+	sub_v3_v3(proj_mval_init_rel, mpr->matrix_basis[3]);
 
 	if (!ED_view3d_win_to_ray(ar, v3d, mval, ray_co, ray_no, false) ||
 		!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
@@ -231,14 +231,14 @@ static void dial_ghostarc_get_angles(
 		goto fail;
 	}
 	madd_v3_v3v3fl(proj_mval_new_rel, ray_co, ray_no, ray_lambda);
-	sub_v3_v3(proj_mval_new_rel, mpr->matrix[3]);
+	sub_v3_v3(proj_mval_new_rel, mpr->matrix_basis[3]);
 
 	const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
 
 	/* Start direction from mouse or set by user */
 	const float *proj_init_rel =
 	        (draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y) ?
-	        mpr->matrix[1] : proj_mval_init_rel;
+	        mpr->matrix_basis[1] : proj_mval_init_rel;
 
 	/* return angles */
 	const float start = angle_wrap_rad(angle_signed_on_axis_v3v3_v3(proj_outer_rel, proj_init_rel, axis_vec));
@@ -337,7 +337,7 @@ static void manipulator_dial_draw_select(const bContext *C, wmManipulator *mpr,
 		RegionView3D *rv3d = ar->regiondata;
 
 		copy_v3_v3(clip_plane, rv3d->viewinv[2]);
-		clip_plane[3] = -dot_v3v3(rv3d->viewinv[2], mpr->matrix[3]);
+		clip_plane[3] = -dot_v3v3(rv3d->viewinv[2], mpr->matrix_basis[3]);
 		glEnable(GL_CLIP_DISTANCE0);
 	}
 
@@ -363,8 +363,8 @@ static void manipulator_dial_draw(const bContext *C, wmManipulator *mpr)
 		RegionView3D *rv3d = ar->regi

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list