[Bf-blender-cvs] [482fd72] wiggly-widgets: Merge branch 'master' into wiggly-widgets

Julian Eisel noreply at git.blender.org
Mon Feb 29 01:20:25 CET 2016


Commit: 482fd723f5bbdbab73598701a46aa34511a08ab2
Author: Julian Eisel
Date:   Mon Feb 29 01:19:03 2016 +0100
Branches: wiggly-widgets
https://developer.blender.org/rB482fd723f5bbdbab73598701a46aa34511a08ab2

Merge branch 'master' into wiggly-widgets

Conflicts:
	source/blender/editors/interface/resources.c

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



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

diff --cc source/blender/editors/interface/resources.c
index 7d5abef,b1d2e32..8cc6d26
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@@ -2707,15 -2704,14 +2702,23 @@@ void init_userdef_do_versions(void
  		}
  	}
  
- 	if (!USER_VERSION_ATLEAST(276, 11)) {
++	if (!USER_VERSION_ATLEAST(277, 0)) {
 +		bTheme *btheme;
 +		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
 +			rgba_char_args_set_fl(btheme->tui.xaxis, 1.0f, 0.27f, 0.27f, 1.0f); /* red */
 +			rgba_char_args_set_fl(btheme->tui.yaxis, 0.27f, 1.0f, 0.27f, 1.0f); /* green */
 +			rgba_char_args_set_fl(btheme->tui.zaxis, 0.27f, 0.27f, 1.0f, 1.0f); /* blue */
 +		}
 +	}
 +
+ 	/**
+ 	 * Include next version bump.
+ 	 *
+ 	 * (keep this block even if it becomes empty).
+ 	 */
+ 	{
+ 	}
+ 
  	if (U.pixelsize == 0.0f)
  		U.pixelsize = 1.0f;
  	
diff --cc source/blender/editors/transform/transform_manipulator.c
index 0acefbd,c3ac196..606e4f4
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@@ -1039,190 -893,693 +1039,189 @@@ static void manipulator_line_range(cons
  			}
  			break;
  	}
 -}
 -static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
 -                                  int flagx, int flagy, int flagz,
 -                                  const int axis_order[3], const bool is_picksel)
 -{
 -	int i;
 -	for (i = 0; i < 3; i++) {
 -		draw_manipulator_axes_single(v3d, rv3d, colcode, flagx, flagy, flagz, axis_order[i], is_picksel);
 -	}
 -}
  
 -static void preOrthoFront(const bool ortho, float twmat[4][4], int axis)
 -{
 -	if (ortho == false) {
 -		float omat[4][4];
 -		copy_m4_m4(omat, twmat);
 -		orthogonalize_m4(omat, axis);
 -		glPushMatrix();
 -		glMultMatrixf(omat);
 -		glFrontFace(is_negative_m4(omat) ? GL_CW : GL_CCW);
 -	}
 +	*r_len -= *r_start;
  }
  
 -static void postOrtho(const bool ortho)
 -{
 -	if (ortho == false) {
 -		glPopMatrix();
 -	}
 -}
  
 -BLI_INLINE bool manipulator_rotate_is_visible(const int drawflags)
 -{
 -	return (drawflags & (MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z));
 -}
 +/* **************** Actual Widget Stuff **************** */
  
 -static void draw_manipulator_rotate(
 -        View3D *v3d, RegionView3D *rv3d, const int drawflags, const int combo,
 -        const bool is_moving, const bool is_picksel)
 +static ManipulatorGroup *manipulatorgroup_init(
 +        struct wmWidgetGroup *wgroup, const bool init_trans, const bool init_rot, const bool init_scale)
  {
 -	double plane[4];
 -	float matt[4][4];
 -	float size, unitmat[4][4];
 -	float cywid = 0.33f * 0.01f * (float)U.tw_handlesize;
 -	float cusize = cywid * 0.65f;
 -	int arcs = (G.debug_value != 2);
 -	const int colcode = (is_moving) ? MAN_MOVECOL : MAN_RGB;
 -	bool ortho;
 -
 -	/* skip drawing if all axes are locked */
 -	if (manipulator_rotate_is_visible(drawflags) == false) return;
 -
 -	/* Init stuff */
 -	glDisable(GL_DEPTH_TEST);
 -	unit_m4(unitmat);
 -
 -	/* prepare for screen aligned draw */
 -	size = len_v3(rv3d->twmat[0]);
 -	glPushMatrix();
 -	glTranslate3fv(rv3d->twmat[3]);
 -
 -	if (arcs) {
 -		/* clipplane makes nice handles, calc here because of multmatrix but with translate! */
 -		copy_v3db_v3fl(plane, rv3d->viewinv[2]);
 -		plane[3] = -0.02f * size; // clip just a bit more
 -		glClipPlane(GL_CLIP_PLANE0, plane);
 -	}
 -	/* sets view screen aligned */
 -	glRotatef(-360.0f * saacos(rv3d->viewquat[0]) / (float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]);
 -
 -	/* Screen aligned help circle */
 -	if (arcs) {
 -		if (is_picksel == false) {
 -			UI_ThemeColorShade(TH_BACK, -30);
 -			drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
 -		}
 -	}
 -
 -	/* Screen aligned trackball rot circle */
 -	if (drawflags & MAN_ROT_T) {
 -		if (is_picksel) GPU_select_load_id(MAN_ROT_T);
 -		else UI_ThemeColor(TH_TRANSFORM);
 -
 -		drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f * size, unitmat);
 -	}
 +	ManipulatorGroup *man;
  
 -	/* Screen aligned view rot circle */
 -	if (drawflags & MAN_ROT_V) {
 -		if (is_picksel) GPU_select_load_id(MAN_ROT_V);
 -		else UI_ThemeColor(TH_TRANSFORM);
 -		drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f * size, unitmat);
 -
 -		if (is_moving) {
 -			float vec[3];
 -			vec[0] = 0; // XXX (float)(t->mouse.imval[0] - t->center2d[0]);
 -			vec[1] = 0; // XXX (float)(t->mouse.imval[1] - t->center2d[1]);
 -			vec[2] = 0.0f;
 -			normalize_v3(vec);
 -			mul_v3_fl(vec, 1.2f * size);
 -			glBegin(GL_LINES);
 -			glVertex3f(0.0f, 0.0f, 0.0f);
 -			glVertex3fv(vec);
 -			glEnd();
 -		}
 -	}
 -	glPopMatrix();
 +	if (!(init_trans || init_rot || init_scale))
 +		return NULL;
  
 +	man = MEM_callocN(sizeof(ManipulatorGroup), "manipulator_data");
  
 -	ortho = is_orthogonal_m4(rv3d->twmat);
 -	
 -	/* apply the transform delta */
 -	if (is_moving) {
 -		copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
 -		// XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat);
 -		if (ortho) {
 -			glMultMatrixf(matt);
 -			glFrontFace(is_negative_m4(matt) ? GL_CW : GL_CCW);
 -		}
 -	}
 -	else {
 -		if (ortho) {
 -			glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW : GL_CCW);
 -			glMultMatrixf(rv3d->twmat);
 -		}
 -	}
 -
 -	/* axes */
 -	if (arcs == 0) {
 -		if (!is_picksel) {
 -			if ((combo & V3D_MANIP_SCALE) == 0) {
 -				/* axis */
 -				if ((drawflags & MAN_ROT_X) || (is_moving && (drawflags & MAN_ROT_Z))) {
 -					preOrthoFront(ortho, rv3d->twmat, 2);
 -					manipulator_setcolor(v3d, 'X', colcode, 255);
 -					glBegin(GL_LINES);
 -					glVertex3f(0.2f, 0.0f, 0.0f);
 -					glVertex3f(1.0f, 0.0f, 0.0f);
 -					glEnd();
 -					postOrtho(ortho);
 -				}
 -				if ((drawflags & MAN_ROT_Y) || (is_moving && (drawflags & MAN_ROT_X))) {
 -					preOrthoFront(ortho, rv3d->twmat, 0);
 -					manipulator_setcolor(v3d, 'Y', colcode, 255);
 -					glBegin(GL_LINES);
 -					glVertex3f(0.0f, 0.2f, 0.0f);
 -					glVertex3f(0.0f, 1.0f, 0.0f);
 -					glEnd();
 -					postOrtho(ortho);
 -				}
 -				if ((drawflags & MAN_ROT_Z) || (is_moving && (drawflags & MAN_ROT_Y))) {
 -					preOrthoFront(ortho, rv3d->twmat, 1);
 -					manipulator_setcolor(v3d, 'Z', colcode, 255);
 -					glBegin(GL_LINES);
 -					glVertex3f(0.0f, 0.0f, 0.2f);
 -					glVertex3f(0.0f, 0.0f, 1.0f);
 -					glEnd();
 -					postOrtho(ortho);
 -				}
 -			}
 -		}
 +	/* add/init widgets - order matters! */
 +	if (init_rot) {
 +		man->rotate_t = WIDGET_dial_new(wgroup, "rotate_c", WIDGET_DIAL_STYLE_RING_FILLED);
  	}
 -
 -	if (arcs == 0 && is_moving) {
 -
 -		/* Z circle */
 -		if (drawflags & MAN_ROT_Z) {
 -			preOrthoFront(ortho, matt, 2);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_Z);
 -			else manipulator_setcolor(v3d, 'Z', colcode, 255);
 -			drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
 -			postOrtho(ortho);
 -		}
 -		/* X circle */
 -		if (drawflags & MAN_ROT_X) {
 -			preOrthoFront(ortho, matt, 0);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_X);
 -			else manipulator_setcolor(v3d, 'X', colcode, 255);
 -			glRotatef(90.0, 0.0, 1.0, 0.0);
 -			drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
 -			glRotatef(-90.0, 0.0, 1.0, 0.0);
 -			postOrtho(ortho);
 -		}
 -		/* Y circle */
 -		if (drawflags & MAN_ROT_Y) {
 -			preOrthoFront(ortho, matt, 1);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_Y);
 -			else manipulator_setcolor(v3d, 'Y', colcode, 255);
 -			glRotatef(-90.0, 1.0, 0.0, 0.0);
 -			drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
 -			glRotatef(90.0, 1.0, 0.0, 0.0);
 -			postOrtho(ortho);
 -		}
 +	if (init_scale) {
 +		man->scale_c = WIDGET_dial_new(wgroup, "scale_c", WIDGET_DIAL_STYLE_RING);
 +		man->scale_x = WIDGET_arrow_new(wgroup, "scale_x", WIDGET_ARROW_STYLE_BOX);
 +		man->scale_y = WIDGET_arrow_new(wgroup, "scale_y", WIDGET_ARROW_STYLE_BOX);
 +		man->scale_z = WIDGET_arrow_new(wgroup, "scale_z", WIDGET_ARROW_STYLE_BOX);
 +		man->scale_xy = WIDGET_primitive_new(wgroup, "scale_xy", WIDGET_PRIMITIVE_STYLE_PLANE);
 +		man->scale_yz = WIDGET_primitive_new(wgroup, "scale_yz", WIDGET_PRIMITIVE_STYLE_PLANE);
 +		man->scale_zx = WIDGET_primitive_new(wgroup, "scale_zx", WIDGET_PRIMITIVE_STYLE_PLANE);
  	}
 -	// donut arcs
 -	if (arcs) {
 -		glEnable(GL_CLIP_PLANE0);
 -
 -		/* Z circle */
 -		if (drawflags & MAN_ROT_Z) {
 -			preOrthoFront(ortho, rv3d->twmat, 2);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_Z);
 -			else manipulator_setcolor(v3d, 'Z', colcode, 255);
 -			partial_doughnut(cusize / 4.0f, 1.0f, 0, 48, 8, 48);
 -			postOrtho(ortho);
 -		}
 -		/* X circle */
 -		if (drawflags & MAN_ROT_X) {
 -			preOrthoFront(ortho, rv3d->twmat, 0);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_X);
 -			else manipulator_setcolor(v3d, 'X', colcode, 255);
 -			glRotatef(90.0, 0.0, 1.0, 0.0);
 -			partial_doughnut(cusize / 4.0f, 1.0f, 0, 48, 8, 48);
 -			glRotatef(-90.0, 0.0, 1.0, 0.0);
 -			postOrtho(ortho);
 -		}
 -		/* Y circle */
 -		if (drawflags & MAN_ROT_Y) {
 -			preOrthoFront(ortho, rv3d->twmat, 1);
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_Y);
 -			else manipulator_setcolor(v3d, 'Y', colcode, 255);
 -			glRotatef(-90.0, 1.0, 0.0, 0.0);
 -			partial_doughnut(cusize / 4.0f, 1.0f, 0, 48, 8, 48);
 -			glRotatef(90.0, 1.0, 0.0, 0.0);
 -			postOrtho(ortho);
 -		}
 -
 -		glDisable(GL_CLIP_PLANE0);
 +	if (init_rot) {
 +		man->rotate_x = WIDGET_dial_new(wgroup, "rotate_x", WIDGET_DIAL_STYLE_RING_CLIPPED);
 +		man->rotate_y = WIDGET_dial_new(wgroup, "rotate_y", WIDGET_DIAL_STYLE_RING_CLIPPED);
 +		man->rotate_z = WIDGET_dial_new(wgroup, "rotate_z", WIDGET_DIAL_STYLE_RING_CLIPPED);
 +		/* init screen aligned widget last here, looks better, behaves better */
 +		man->rotate_c = WIDGET_dial_new(wgroup, "rotate_c", WIDGET_DIAL_STYLE_RING);
  	}
 -
 -	if (arcs == 0) {
 -
 -		/* Z handle on X axis */
 -		if (drawflags & MAN_ROT_Z) {
 -			preOrthoFront(ortho, rv3d->twmat, 2);
 -			glPushMatrix();
 -			if (is_picksel) GPU_select_load_id(MAN_ROT_Z);
 -			else manipulator_setcolor(v3d, 'Z', colcode, 255);
 -
 -			partial_doughnut(0.7f * cusize, 1.0f, 31, 33, 8, 64);
 -
 -			glPopMatrix();
 -			postOrtho(ortho);
 -		}
 -
 -		/* Y handle on X axis */
 -		if (drawflags & MAN_ROT_Y) {
 -			preOrthoFront(ortho, rv3d->twmat, 1);
 -			gl

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list