[Bf-blender-cvs] [59c6487e931] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Sun May 13 06:57:43 CEST 2018


Commit: 59c6487e9314dd43003af1a018fc092b041e7e10
Author: Campbell Barton
Date:   Sun May 13 06:56:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB59c6487e9314dd43003af1a018fc092b041e7e10

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/transform/transform.c
index 632779d50a4,69e8ebf5ca4..405c6213017
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@@ -1867,8 -1810,8 +1867,8 @@@ static void drawHelpline(bContext *UNUS
  static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), void *arg)
  {
  	TransInfo *t = arg;
- 	
+ 
 -	glLineWidth(1.0);
 +	glLineWidth(1.0f);
  
  	drawConstraint(t);
  	drawPropCircle(C, t);
@@@ -1889,12 -1832,11 +1889,12 @@@ static void drawAutoKeyWarning(TransInf
  
  	ED_region_visible_rect(ar, &rect);
  
 -	BLF_width_and_height_default(printable, BLF_DRAW_STR_DUMMY_MAX, &printable_size[0], &printable_size[1]);
 +	const int font_id = BLF_default();
 +	BLF_width_and_height(font_id, printable, BLF_DRAW_STR_DUMMY_MAX, &printable_size[0], &printable_size[1]);
- 	
+ 
  	xco = (rect.xmax - U.widget_unit) - (int)printable_size[0];
  	yco = (rect.ymax - U.widget_unit);
- 	
+ 
  	/* warning text (to clarify meaning of overlays)
  	 * - original color was red to match the icon, but that clashes badly with a less nasty border
  	 */
@@@ -1906,11 -1846,11 +1906,11 @@@
  #else
  	BLF_draw_default_ascii(xco, yco, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
  #endif
- 	
+ 
  	/* autokey recording icon... */
 -	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 +	glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
  	glEnable(GL_BLEND);
- 	
+ 
  	xco -= U.widget_unit;
  	yco -= (int)printable_size[1] / 2;
  
@@@ -1920,14 -1860,13 +1920,14 @@@
  }
  
  static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, void *arg)
- {	
+ {
  	TransInfo *t = arg;
  	Scene *scene = t->scene;
 -	Object *ob = OBACT;
 +	ViewLayer *view_layer = t->view_layer;
 +	Object *ob = OBACT(view_layer);
- 	
- 	/* draw autokeyframing hint in the corner 
- 	 * - only draw if enabled (advanced users may be distracted/annoyed), 
+ 
+ 	/* draw autokeyframing hint in the corner
+ 	 * - only draw if enabled (advanced users may be distracted/annoyed),
  	 *   for objects that will be autokeyframed (no point ohterwise),
  	 *   AND only for the active region (as showing all is too overwhelming)
  	 */
@@@ -2695,13 -2619,13 +2695,13 @@@ static void constraintTransLim(TransInf
  					/* skip... incompatable spacetype */
  					continue;
  				}
- 				
+ 
  				/* get constraint targets if needed */
 -				BKE_constraint_targets_for_solving_get(con, &cob, &targets, ctime);
 +				BKE_constraint_targets_for_solving_get(t->depsgraph, con, &cob, &targets, ctime);
- 				
+ 
  				/* do constraint */
  				cti->evaluate_constraint(con, &cob, &targets);
- 				
+ 
  				/* convert spaces again */
  				if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
  					/* just multiply by td->smtx (this should be ok) */
@@@ -3036,13 -2964,13 +3036,13 @@@ static void Bend(TransInfo *t, const in
  		             RAD2DEGF(values.angle), values.scale * data->warp_init_dist,
  		             WM_bool_as_string(is_clamp));
  	}
- 	
+ 
  	values.angle *= -1.0f;
  	values.scale *= data->warp_init_dist;
- 	
+ 
  	/* calc 'data->warp_end' from 'data->warp_end_init' */
 -	copy_v3_v3(warp_end_radius, data->warp_end);
 -	dist_ensure_v3_v3fl(warp_end_radius, data->warp_sta, values.scale);
 +	copy_v3_v3(warp_end_radius_global, data->warp_end);
 +	dist_ensure_v3_v3fl(warp_end_radius_global, data->warp_sta, values.scale);
  	/* done */
  
  	/* calculate pivot */
@@@ -3399,11 -3302,11 +3399,11 @@@ static void ElementResize(TransInfo *t
  	else {
  		copy_m3_m3(tmat, mat);
  	}
- 	
+ 
  	if (t->con.applySize) {
 -		t->con.applySize(t, td, tmat);
 +		t->con.applySize(t, tc, td, tmat);
  	}
- 	
+ 
  	/* local constraint shouldn't alter center */
  	if (transdata_check_local_center(t, t->around)) {
  		copy_v3_v3(center, td->center);
@@@ -3510,28 -3422,25 +3510,28 @@@ static void applyResize(TransInfo *t, c
  
  		applySnapping(t, t->values);
  	}
- 	
+ 
  	size_to_mat3(mat, t->values);
- 	
+ 
  	if (t->con.applySize) {
 -		t->con.applySize(t, NULL, mat);
 +		t->con.applySize(t, NULL, NULL, mat);
  	}
- 	
+ 
  	copy_m3_m3(t->mat, mat);    // used in manipulator
- 	
+ 
  	headerResize(t, t->values, str);
  
 -	for (i = 0, td = t->data; i < t->total; i++, td++) {
 -		if (td->flag & TD_NOACTION)
 -			break;
 +	FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 +		TransData *td = tc->data;
 +		for (i = 0; i < tc->data_len; i++, td++) {
 +			if (td->flag & TD_NOACTION)
 +				break;
  
 -		if (td->flag & TD_SKIP)
 -			continue;
 +			if (td->flag & TD_SKIP)
 +				continue;
  
 -		ElementResize(t, td, mat);
 +			ElementResize(t, tc, td, mat);
 +		}
  	}
  
  	/* evil hack - redo resize if cliping needed */
@@@ -3539,26 -3448,22 +3539,26 @@@
  		size_to_mat3(mat, t->values);
  
  		if (t->con.applySize)
 -			t->con.applySize(t, NULL, mat);
 +			t->con.applySize(t, NULL, NULL, mat);
  
 -		for (i = 0, td = t->data; i < t->total; i++, td++)
 -			ElementResize(t, td, mat);
  
 -		/* In proportional edit it can happen that */
 -		/* vertices in the radius of the brush end */
 -		/* outside the clipping area               */
 -		/* XXX HACK - dg */
 -		if (t->flag & T_PROP_EDIT_ALL) {
 -			clipUVData(t);
 +		FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 +			TransData *td = tc->data;
 +			for (i = 0; i < tc->data_len; i++, td++)
 +				ElementResize(t, tc, td, mat);
 +
 +			/* In proportional edit it can happen that */
 +			/* vertices in the radius of the brush end */
 +			/* outside the clipping area               */
 +			/* XXX HACK - dg */
 +			if (t->flag & T_PROP_EDIT_ALL) {
 +				clipUVData(t);
 +			}
  		}
  	}
- 	
+ 
  	recalcData(t);
- 	
+ 
  	ED_area_headerprint(t->sa, str);
  }
  /** \} */
@@@ -3623,41 -3529,38 +3623,41 @@@ static void applySkinResize(TransInfo *
  	if (t->flag & T_AUTOVALUES) {
  		copy_v3_v3(size, t->auto_values);
  	}
- 	
+ 
  	copy_v3_v3(t->values, size);
- 	
+ 
  	size_to_mat3(mat, size);
- 	
+ 
  	headerResize(t, size, str);
  
 -	for (i = 0, td = t->data; i < t->total; i++, td++) {
 -		float tmat[3][3], smat[3][3];
 -		float fsize[3];
 +	FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 +		TransData *td = tc->data;
 +		for (i = 0; i < tc->data_len; i++, td++) {
 +			float tmat[3][3], smat[3][3];
 +			float fsize[3];
  
 -		if (td->flag & TD_NOACTION)
 -			break;
 +			if (td->flag & TD_NOACTION)
 +				break;
  
 -		if (td->flag & TD_SKIP)
 -			continue;
 +			if (td->flag & TD_SKIP)
 +				continue;
  
 -		if (t->flag & T_EDIT) {
 -			mul_m3_m3m3(smat, mat, td->mtx);
 -			mul_m3_m3m3(tmat, td->smtx, smat);
 -		}
 -		else {
 -			copy_m3_m3(tmat, mat);
 -		}
 +			if (t->flag & T_EDIT) {
 +				mul_m3_m3m3(smat, mat, td->mtx);
 +				mul_m3_m3m3(tmat, td->smtx, smat);
 +			}
 +			else {
 +				copy_m3_m3(tmat, mat);
 +			}
  
 -		if (t->con.applySize) {
 -			t->con.applySize(t, NULL, tmat);
 -		}
 +			if (t->con.applySize) {
 +				t->con.applySize(t, NULL, NULL, tmat);
 +			}
  
 -		mat3_to_size(fsize, tmat);
 -		td->val[0] = td->ext->isize[0] * (1 + (fsize[0] - 1) * td->factor);
 -		td->val[1] = td->ext->isize[1] * (1 + (fsize[1] - 1) * td->factor);
 +			mat3_to_size(fsize, tmat);
 +			td->val[0] = td->ext->isize[0] * (1 + (fsize[0] - 1) * td->factor);
 +			td->val[1] = td->ext->isize[1] * (1 + (fsize[1] - 1) * td->factor);
 +		}
  	}
  
  	recalcData(t);
@@@ -3675,13 -3578,14 +3675,13 @@@
  
  static void initToSphere(TransInfo *t)
  {
 -	TransData *td = t->data;
  	int i;
- 	
+ 
  	t->mode = TFM_TOSPHERE;
  	t->transform = applyToSphere;
- 	
+ 
  	initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_RATIO);
- 	
+ 
  	t->idx_max = 0;
  	t->num.idx_max = 0;
  	t->snap[0] = 0.0f;
@@@ -3712,15 -3613,16 +3712,15 @@@ static void applyToSphere(TransInfo *t
  	float ratio, radius;
  	int i;
  	char str[UI_MAX_DRAW_STR];
 -	TransData *td = t->data;
  
  	ratio = t->values[0];
- 	
+ 
  	snapGridIncrement(t, &ratio);
- 	
+ 
  	applyNumInput(&t->num, &ratio);
- 	
+ 
  	CLAMP(ratio, 0.0f, 1.0f);
- 	
+ 
  	t->values[0] = ratio;
  
  	/* header print for NumInput */
@@@ -3736,30 -3638,29 +3736,30 @@@
  		BLI_snprintf(str, sizeof(str), IFACE_("To Sphere: %.4f %s"), ratio, t->proptext);
  	}
  
 +	FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 +		TransData *td = tc->data;
 +		for (i = 0; i < tc->data_len; i++, td++) {
 +			float tratio;
 +			if (td->flag & TD_NOACTION)
 +				break;
  
 -	for (i = 0; i < t->total; i++, td++) {
 -		float tratio;
 -		if (td->flag & TD_NOACTION)
 -			break;
 -
 -		if (td->flag & TD_SKIP)
 -			continue;
 +			if (td->flag & TD_SKIP)
 +				continue;
  
 -		sub_v3_v3v3(vec, td->iloc, t->center);
 +			sub_v3_v3v3(vec, td->iloc, tc->center_local);
  
 -		radius = normalize_v3(vec);
 +			radius = normalize_v3(vec);
  
 -		tratio = ratio * td->factor;
 +			tratio = ratio * td->factor;
  
 -		mul_v3_fl(vec, radius * (1.0f - tratio) + t->val * tratio);
 +			mul_v3_fl(vec, radius * (1.0f - tratio) + t->val * tratio);
  
 -		add_v3_v3v3(td->loc, t->center, vec);
 +			add_v3_v3v3(td->loc, tc->center_local, vec);
 +		}
  	}
  
 -
  	recalcData(t);
- 	
+ 
  	ED_area_headerprint(t->sa, str);
  }
  /** \} */
@@@ -3867,16 -3770,18 +3867,16 @@@ static void ElementRotation_ex(TransInf
  
  		if ((td->flag & TD_NO_LOC) == 0) {
  			sub_v3_v3v3(vec, td->center, center);
- 			
+ 
 -			mul_m3_v3(pmtx, vec);   // To Global space
 +			mul_m3_v3(tc->mat3, vec);   // To Global space
  			mul_m3_v3(mat, vec);        // Applying rotation
 -			mul_m3_v3(imtx, vec);   // To Local space
 +			mul_m3_v3(tc->imat3, vec);  // To Local space
- 			
+ 
  			add_v3_v3(vec, center);
  			/* vec now is the location where the object has to be */
- 			
+ 
  			sub_v3_v3v3(vec, vec, td->center); // Translation needed from the initial location
- 			
+ 
  			/* special exception, see TD_PBONE_LOCAL_MTX definition comments */
  			if (td->flag & TD_PBONE_LOCAL_MTX_P) {
  				/* do nothing */
@@@ -4045,31 -3950,29 +4045,31 @@@ static void ElementRotation(TransInfo *
  
  static void applyRotationValue(TransInfo *t, float angle, float axis[3])
  {
 -	TransData *td = t->data;
  	float mat[3][3];
  	int i;
- 	
+ 
  	axis_angle_normalized_to_mat3(mat, axis, angle);
  
 -	for (i = 0; i < t->total; i++, td++) {
 +	FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 +	

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list