[Bf-committers] Incorrect drawing of DIRECTION property sphere

Francesc Juhe fjuhec at gmail.com
Thu Oct 29 18:06:29 CET 2015


Hello,

I found a minor issue on the drawing function for DIRECTION properties that is fixed with this one line patch.

diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 84767ea..8ae8466 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1233,6 +1233,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
 	glMaterialfv(GL_FRONT, GL_DIFFUSE, diffn);
 	glCullFace(GL_BACK);
 	glEnable(GL_CULL_FACE);
+	glFrontFace(GL_CCW);
 	
 	/* disable blender light */
 	for (a = 0; a < 8; a++) {

The issue seems to be that under some circumstances the FrontFace is set to GL_CW but the DIRECTION property draws incorrectly with this setting. Don’t know where it is set but you can test with this scene here: 

http://www.blendswap.com/blends/view/21803

If you load the scene loading the UI and add a Normal node, the direction sphere is drawn black. If you set the 3d view below the node editor to solid, the direction property draws correctly.
I used GPU_state_print() to check the difference between the correct drawing and the incorrect and found that it was because of glFrontFace setting.

Also, the Normal node draws two spheres on the properties panel, one for output and one for input.

Cheers,
Francesc


More information about the Bf-committers mailing list