[Bf-blender-cvs] [7cb65cc0383] blender2.8: Manipulator: rename grab enum

Campbell Barton noreply at git.blender.org
Thu Aug 10 01:43:48 CEST 2017


Commit: 7cb65cc03833f1bda969a55f68983c542691be02
Author: Campbell Barton
Date:   Thu Aug 10 09:44:42 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB7cb65cc03833f1bda969a55f68983c542691be02

Manipulator: rename grab enum

We'll want some 3D shapes, so name existing shapes 2D

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

M	source/blender/editors/include/ED_manipulator_library.h
M	source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
M	source/blender/editors/mesh/editmesh_bisect.c
M	source/blender/editors/mesh/editmesh_extrude.c
M	source/blender/editors/space_node/node_manipulators.c

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

diff --git a/source/blender/editors/include/ED_manipulator_library.h b/source/blender/editors/include/ED_manipulator_library.h
index 5d0f1526050..a713202fc4b 100644
--- a/source/blender/editors/include/ED_manipulator_library.h
+++ b/source/blender/editors/include/ED_manipulator_library.h
@@ -119,8 +119,8 @@ enum {
 };
 
 enum {
-	ED_MANIPULATOR_GRAB_STYLE_RING = 0,
-	ED_MANIPULATOR_GRAB_STYLE_CROSS = 1,
+	ED_MANIPULATOR_GRAB_STYLE_RING_2D = 0,
+	ED_MANIPULATOR_GRAB_STYLE_CROSS_2D = 1,
 };
 
 
diff --git a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
index 7b17a67c9f3..e39b26078c9 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
@@ -106,7 +106,7 @@ static void grab_geom_draw(
 
 	immUniformColor4fv(col);
 
-	if (draw_style == ED_MANIPULATOR_GRAB_STYLE_RING) {
+	if (draw_style == ED_MANIPULATOR_GRAB_STYLE_RING_2D) {
 		if (filled) {
 			imm_draw_circle_fill(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
 		}
@@ -114,7 +114,7 @@ static void grab_geom_draw(
 			imm_draw_circle_wire(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
 		}
 	}
-	else if (draw_style == ED_MANIPULATOR_GRAB_STYLE_CROSS) {
+	else if (draw_style == ED_MANIPULATOR_GRAB_STYLE_CROSS_2D) {
 		immBegin(GWN_PRIM_LINES, 4);
 		immVertex2f(pos,  1.0f,  1.0f);
 		immVertex2f(pos, -1.0f, -1.0f);
@@ -123,6 +123,9 @@ static void grab_geom_draw(
 		immVertex2f(pos,  1.0f, -1.0f);
 		immEnd();
 	}
+	else {
+		BLI_assert(0);
+	}
 
 	immUnbindProgram();
 
@@ -304,7 +307,8 @@ static void MANIPULATOR_WT_grab_3d(wmManipulatorType *wt)
 
 	/* rna */
 	static EnumPropertyItem rna_enum_draw_style[] = {
-		{ED_MANIPULATOR_GRAB_STYLE_RING, "RING", 0, "Ring", ""},
+		{ED_MANIPULATOR_GRAB_STYLE_RING_2D, "RING_2D", 0, "Ring", ""},
+		{ED_MANIPULATOR_GRAB_STYLE_CROSS_2D, "CROSS_2D", 0, "Ring", ""},
 		{0, NULL, 0, NULL, NULL}
 	};
 	static EnumPropertyItem rna_enum_draw_options[] = {
@@ -312,7 +316,7 @@ static void MANIPULATOR_WT_grab_3d(wmManipulatorType *wt)
 		{0, NULL, 0, NULL, NULL}
 	};
 
-	RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_GRAB_STYLE_RING, "Draw Style", "");
+	RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_GRAB_STYLE_RING_2D, "Draw Style", "");
 	RNA_def_enum_flag(wt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
 
 	WM_manipulatortype_target_property_def(wt, "offset", PROP_FLOAT, 3);
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index 9f011140e49..5f50ce1f37b 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -626,7 +626,7 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup
 	UI_GetThemeColor3fv(TH_MANIPULATOR_SECONDARY, man->rotate_c->color);
 
 	RNA_enum_set(man->translate_z->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_NORMAL);
-	RNA_enum_set(man->translate_c->ptr, "draw_style", ED_MANIPULATOR_GRAB_STYLE_RING);
+	RNA_enum_set(man->translate_c->ptr, "draw_style", ED_MANIPULATOR_GRAB_STYLE_RING_2D);
 
 	WM_manipulator_set_flag(man->translate_c, WM_MANIPULATOR_DRAW_VALUE, true);
 	WM_manipulator_set_flag(man->rotate_c, WM_MANIPULATOR_DRAW_VALUE, true);
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index 4be16d73757..aa1d18b18c9 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -1092,7 +1092,7 @@ static void manipulator_mesh_spin_setup(const bContext *C, wmManipulatorGroup *m
 
 
 	RNA_enum_set(man->translate_z->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_NORMAL);
-	RNA_enum_set(man->translate_c->ptr, "draw_style", ED_MANIPULATOR_GRAB_STYLE_RING);
+	RNA_enum_set(man->translate_c->ptr, "draw_style", ED_MANIPULATOR_GRAB_STYLE_RING_2D);
 
 	WM_manipulator_set_flag(man->translate_c, WM_MANIPULATOR_DRAW_VALUE, true);
 	WM_manipulator_set_flag(man->rotate_c, WM_MANIPULATOR_DRAW_VALUE, true);
diff --git a/source/blender/editors/space_node/node_manipulators.c b/source/blender/editors/space_node/node_manipulators.c
index 0435e109922..2064de11c51 100644
--- a/source/blender/editors/space_node/node_manipulators.c
+++ b/source/blender/editors/space_node/node_manipulators.c
@@ -413,7 +413,7 @@ static void WIDGETGROUP_node_sbeam_setup(const bContext *UNUSED(C), wmManipulato
 	sbeam_group->manipulator = WM_manipulator_new("MANIPULATOR_WT_grab_3d", mgroup, NULL);
 	wmManipulator *mpr = sbeam_group->manipulator;
 
-	RNA_enum_set(mpr->ptr, "draw_style",  ED_MANIPULATOR_GRAB_STYLE_CROSS);
+	RNA_enum_set(mpr->ptr, "draw_style",  ED_MANIPULATOR_GRAB_STYLE_CROSS_2D);
 
 	mpr->scale_basis = 0.05f;




More information about the Bf-blender-cvs mailing list