[Bf-blender-cvs] [face972] wiggly-widgets: Widgets:

Antony Riakiotakis noreply at git.blender.org
Wed Oct 8 22:52:11 CEST 2014


Commit: face9721d84090c4bb0ea9b8fadb70d64f059125
Author: Antony Riakiotakis
Date:   Wed Oct 8 22:51:54 2014 +0200
Branches: wiggly-widgets
https://developer.blender.org/rBface9721d84090c4bb0ea9b8fadb70d64f059125

Widgets:

* Add option for shaded/non shaded widgets
* Normalize arrow widget size to 1.0 so size is predictable. Probably
will use the same scheme for other widgets as well

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/interface/3d_widgets/arrow_widget.c
M	source/blender/editors/interface/interface_generic_widgets.c
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index dc18dd7..eac0d95 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -203,7 +203,12 @@ class USERPREF_PT_interface(Panel):
         sub.prop(view, "manipulator_size", text="Size")
         sub.prop(view, "manipulator_handle_size", text="Handle Size")
         sub.prop(view, "manipulator_hotspot", text="Hotspot")
+        col.separator()
 
+        sub = col.column()
+        sub.prop(view, "shaded_widgets")
+        sub.prop(view, "widgets_3d")
+ 
         col.separator()
         col.separator()
         col.separator()
diff --git a/source/blender/editors/interface/3d_widgets/arrow_widget.c b/source/blender/editors/interface/3d_widgets/arrow_widget.c
index 45358b8..2cd4dd2 100644
--- a/source/blender/editors/interface/3d_widgets/arrow_widget.c
+++ b/source/blender/editors/interface/3d_widgets/arrow_widget.c
@@ -2,87 +2,87 @@ int _WIDGET_nverts_arrow = 81;
 int _WIDGET_nfaces_arrow = 76;
 
 float _WIDGET_verts_arrow[][3] = {
-    {0.069024, 0.069024, 0.001571},
-    {0.090184, 0.037355, 0.001571},
-    {0.097614, 0.000000, 0.001571},
-    {0.090184, -0.037355, 0.001571},
-    {0.069024, -0.069024, 0.001571},
-    {0.037355, -0.090184, 0.001571},
-    {-0.000000, -0.097614, 0.001571},
-    {-0.037356, -0.090184, 0.001571},
-    {-0.069024, -0.069024, 0.001571},
-    {-0.090184, -0.037355, 0.001571},
-    {-0.097615, -0.000000, 0.001571},
-    {-0.090184, 0.037355, 0.001571},
-    {-0.069024, 0.069024, 0.001571},
-    {-0.037356, 0.090184, 0.001571},
-    {-0.000000, 0.097614, 0.001571},
-    {0.037355, 0.090184, 0.001571},
-    {-0.000000, 0.393391, 2.000000},
-    {-0.150544, 0.363446, 2.000000},
-    {-0.278169, 0.278169, 2.000000},
-    {-0.363446, 0.150544, 2.000000},
-    {-0.393391, -0.000000, 2.000000},
-    {-0.363446, -0.150544, 2.000000},
-    {-0.278169, -0.278169, 2.000000},
-    {-0.150544, -0.363446, 2.000000},
-    {-0.000000, -0.393391, 2.000000},
-    {0.150544, -0.363446, 2.000000},
-    {0.278169, -0.278169, 2.000000},
-    {0.363446, -0.150544, 2.000000},
-    {0.393391, 0.000000, 2.000000},
-    {0.363446, 0.150544, 2.000000},
-    {0.278169, 0.278169, 2.000000},
-    {0.150544, 0.363446, 2.000000},
-    {-0.000000, 0.393391, 2.000000},
-    {-0.150544, 0.363446, 2.000000},
-    {-0.278169, 0.278169, 2.000000},
-    {-0.363446, 0.150544, 2.000000},
-    {-0.393391, -0.000000, 2.000000},
-    {-0.363446, -0.150544, 2.000000},
-    {-0.278169, -0.278169, 2.000000},
-    {-0.150544, -0.363446, 2.000000},
-    {-0.000000, -0.393391, 2.000000},
-    {0.150544, -0.363446, 2.000000},
-    {0.278169, -0.278169, 2.000000},
-    {0.363446, -0.150544, 2.000000},
-    {0.393391, 0.000000, 2.000000},
-    {0.363446, 0.150544, 2.000000},
-    {0.278169, 0.278169, 2.000000},
-    {0.150544, 0.363446, 2.000000},
-    {-0.000000, -0.000000, 3.000072},
-    {0.069024, 0.069024, 0.001571},
-    {0.090184, 0.037355, 0.001571},
-    {0.097614, 0.000000, 0.001571},
-    {0.090184, -0.037355, 0.001571},
-    {0.069024, -0.069024, 0.001571},
-    {0.037355, -0.090184, 0.001571},
-    {-0.000000, -0.097614, 0.001571},
-    {-0.037356, -0.090184, 0.001571},
-    {-0.069024, -0.069024, 0.001571},
-    {-0.090184, -0.037355, 0.001571},
-    {-0.097615, -0.000000, 0.001571},
-    {-0.090184, 0.037355, 0.001571},
-    {-0.069024, 0.069024, 0.001571},
-    {-0.037356, 0.090184, 0.001571},
-    {-0.000000, 0.097614, 0.001571},
-    {0.037355, 0.090184, 0.001571},
-    {0.069024, 0.069024, 2.021901},
-    {0.090184, 0.037355, 2.021901},
-    {0.097614, 0.000000, 2.021901},
-    {0.090184, -0.037355, 2.021901},
-    {0.069024, -0.069024, 2.021901},
-    {0.037355, -0.090184, 2.021901},
-    {-0.000000, -0.097614, 2.021901},
-    {-0.037356, -0.090184, 2.021901},
-    {-0.069024, -0.069024, 2.021901},
-    {-0.090184, -0.037355, 2.021901},
-    {-0.097615, -0.000000, 2.021901},
-    {-0.090184, 0.037355, 2.021901},
-    {-0.069024, 0.069024, 2.021901},
-    {-0.037356, 0.090184, 2.021901},
-    {-0.000000, 0.097614, 2.021901},
-    {0.037355, 0.090184, 2.021901},
+    {0.023005, 0.023005, 0.000524},
+    {0.030057, 0.012450, 0.000524},
+    {0.032533, 0.000000, 0.000524},
+    {0.030057, -0.012450, 0.000524},
+    {0.023005, -0.023005, 0.000524},
+    {0.012450, -0.030057, 0.000524},
+    {-0.000000, -0.032533, 0.000524},
+    {-0.012450, -0.030057, 0.000524},
+    {-0.023005, -0.023005, 0.000524},
+    {-0.030057, -0.012450, 0.000524},
+    {-0.032533, -0.000000, 0.000524},
+    {-0.030057, 0.012450, 0.000524},
+    {-0.023005, 0.023005, 0.000524},
+    {-0.012450, 0.030057, 0.000524},
+    {-0.000000, 0.032533, 0.000524},
+    {0.012450, 0.030057, 0.000524},
+    {-0.000000, 0.131111, 0.666568},
+    {-0.050174, 0.121131, 0.666568},
+    {-0.092709, 0.092709, 0.666568},
+    {-0.121131, 0.050174, 0.666568},
+    {-0.131111, -0.000000, 0.666568},
+    {-0.121131, -0.050174, 0.666568},
+    {-0.092709, -0.092709, 0.666568},
+    {-0.050174, -0.121131, 0.666568},
+    {-0.000000, -0.131111, 0.666568},
+    {0.050174, -0.121131, 0.666568},
+    {0.092709, -0.092709, 0.666568},
+    {0.121131, -0.050174, 0.666568},
+    {0.131111, 0.000000, 0.666568},
+    {0.121131, 0.050174, 0.666568},
+    {0.092709, 0.092709, 0.666568},
+    {0.050174, 0.121131, 0.666568},
+    {-0.000000, 0.131111, 0.666568},
+    {-0.050174, 0.121131, 0.666568},
+    {-0.092709, 0.092709, 0.666568},
+    {-0.121131, 0.050174, 0.666568},
+    {-0.131111, -0.000000, 0.666568},
+    {-0.121131, -0.050174, 0.666568},
+    {-0.092709, -0.092709, 0.666568},
+    {-0.050174, -0.121131, 0.666568},
+    {-0.000000, -0.131111, 0.666568},
+    {0.050174, -0.121131, 0.666568},
+    {0.092709, -0.092709, 0.666568},
+    {0.121131, -0.050174, 0.666568},
+    {0.131111, 0.000000, 0.666568},
+    {0.121131, 0.050174, 0.666568},
+    {0.092709, 0.092709, 0.666568},
+    {0.050174, 0.121131, 0.666568},
+    {-0.000000, -0.000000, 0.999876},
+    {0.023005, 0.023005, 0.000524},
+    {0.030057, 0.012450, 0.000524},
+    {0.032533, 0.000000, 0.000524},
+    {0.030057, -0.012450, 0.000524},
+    {0.023005, -0.023005, 0.000524},
+    {0.012450, -0.030057, 0.000524},
+    {-0.000000, -0.032533, 0.000524},
+    {-0.012450, -0.030057, 0.000524},
+    {-0.023005, -0.023005, 0.000524},
+    {-0.030057, -0.012450, 0.000524},
+    {-0.032533, -0.000000, 0.000524},
+    {-0.030057, 0.012450, 0.000524},
+    {-0.023005, 0.023005, 0.000524},
+    {-0.012450, 0.030057, 0.000524},
+    {-0.000000, 0.032533, 0.000524},
+    {0.012450, 0.030057, 0.000524},
+    {0.023005, 0.023005, 0.673867},
+    {0.030057, 0.012450, 0.673867},
+    {0.032533, 0.000000, 0.673867},
+    {0.030057, -0.012450, 0.673867},
+    {0.023005, -0.023005, 0.673867},
+    {0.012450, -0.030057, 0.673867},
+    {-0.000000, -0.032533, 0.673867},
+    {-0.012450, -0.030057, 0.673867},
+    {-0.023005, -0.023005, 0.673867},
+    {-0.030057, -0.012450, 0.673867},
+    {-0.032533, -0.000000, 0.673867},
+    {-0.030057, 0.012450, 0.673867},
+    {-0.023005, 0.023005, 0.673867},
+    {-0.012450, 0.030057, 0.673867},
+    {-0.000000, 0.032533, 0.673867},
+    {0.012450, 0.030057, 0.673867},
 };
 
 float _WIDGET_normals_arrow[][3] = {
@@ -157,7 +157,7 @@ float _WIDGET_normals_arrow[][3] = {
     {0.923856, -0.382672, 0.000000},
     {0.707083, -0.707083, 0.000000},
     {0.382672, -0.923856, 0.000000},
-    {0.000000, -1.000000, 0.000000},
+    {0.000000, -0.999969, 0.000000},
     {-0.382672, -0.923856, 0.000000},
     {-0.707083, -0.707083, 0.000000},
     {-0.923856, -0.382672, 0.000000},
@@ -170,7 +170,7 @@ float _WIDGET_normals_arrow[][3] = {
 };
 
 unsigned short _WIDGET_indices_arrow[] = {
-    1, 13, 14,
+    13, 1, 9,
     49, 65, 66,
     62, 78, 79,
     51, 67, 68,
@@ -184,7 +184,7 @@ unsigned short _WIDGET_indices_arrow[] = {
     52, 68, 69,
     54, 70, 71,
     56, 72, 73,
-    17, 16, 25,
+    30, 29, 28,
     39, 40, 48,
     37, 38, 48,
     35, 36, 48,
@@ -205,20 +205,20 @@ unsigned short _WIDGET_indices_arrow[] = {
     63, 79, 80,
     58, 74, 75,
     11, 12, 13,
-    11, 13, 10,
+    9, 10, 11,
     7, 8, 9,
-    7, 13, 6,
-    3, 4, 5,
-    3, 6, 2,
-    15, 0, 1,
-    15, 1, 14,
-    10, 13, 7,
-    9, 10, 7,
-    5, 6, 3,
+    7, 9, 6,
+    5, 6, 4,
+    1, 2, 3,
+    1, 14, 0,
     63, 62, 79,
+    9, 11, 13,
     50, 49, 66,
-    6, 1, 2,
-    6, 13, 1,
+    14, 15, 0,
+    6, 9, 1,
+    1, 13, 14,
+    6, 3, 4,
+    3, 6, 1,
     52, 51, 68,
     54, 53, 70,
     56, 55, 72,
@@ -231,19 +231,19 @@ unsigned short _WIDGET_indices_arrow[] = {
     55, 54, 71,
     57, 56, 73,
     17, 20, 18,
-    20, 23, 22,
+    61, 60, 77,
     21, 20, 22,
-    20, 19, 18,
-    25, 28, 26,
-    17, 25, 24,
-    31, 30, 29,
-    31, 29, 16,
-    17, 24, 20,
-    28, 27, 26,
-    16, 28, 25,
-    16, 29, 28,
+    23, 20, 24,
+    26, 25, 24,
+    16, 31, 30,
     64, 63, 80,
-    61, 60, 77,
-    24, 23, 20,
+    28, 27, 26,
+    17, 26, 20,
+    20, 26, 24,
+    28, 26, 16,
+    16, 30, 28,
+    20, 23, 22,
+    16, 26, 17,
+    20, 19, 18,
     59, 58, 75,
 };
diff --git a/source/blender/editors/interface/interface_generic_widgets.c b/source/blender/editors/interface/interface_generic_widgets.c
index 87e981d..92eba1a 100644
--- a/source/blender/editors/interface/interface_generic_widgets.c
+++ b/source/blender/editors/interface/interface_generic_widgets.c
@@ -36,6 +36,7 @@
 #include "DNA_lamp_types.h"
 #include "DNA_view3d_types.h"
 #include "DNA_windowmanager_types.h"
+#include "DNA_userdef_types.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_math_matrix.h"
@@ -344,7 +345,10 @@ static void arrow_draw_intern(ArrowWidget *arrow, bool select, bool highlight)
 	float mat[4][4];
 	float up[3] = {0.0f, 0.0f, 1.0f};
 	GLuint buf[3];
-	if (!select)
+	
+	bool use_lighting = !select && ((U.tw_flag & V3D_SHADED_WIDGETS) != 0);
+	
+	if (use_lighting)
 		glGenBuffers(3, buf);
 	else
 		glGenBuffers(2, buf);
@@ -358,7 +362,7 @@ static void arrow_draw_intern(ArrowWidget *arrow, bool select, bool highlight)
 	glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * _WIDGET_nverts_arrow, _WID

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list