[Bf-blender-cvs] [136e88f4ea3] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Fri Dec 7 07:12:35 CET 2018


Commit: 136e88f4ea377a938b49113d6335deb8ae2cb335
Author: Campbell Barton
Date:   Fri Dec 7 17:11:28 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB136e88f4ea377a938b49113d6335deb8ae2cb335

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/transform/transform_conversions.c
index c5e606b94c9,efa49d8907a..7f0b39a590b
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@@ -1734,231 -1614,225 +1734,227 @@@ static void createTransCurveVerts(Trans
  				}
  			}
  		}
 -	}
 -	/* note: in prop mode we need at least 1 selected */
 -	if (countsel == 0) return;
 +		/* note: in prop mode we need at least 1 selected */
 +		if (countsel == 0) {
 +			tc->data_len = 0;
 +			continue;
 +		}
  
 -	if (is_prop_edit) t->total = count;
 -	else t->total = countsel;
 -	t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Curve EditMode)");
 +		if (is_prop_edit) tc->data_len = count;
 +		else tc->data_len = countsel;
 +		tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransObData(Curve EditMode)");
  
 -	transform_around_single_fallback(t);
 +		transform_around_single_fallback(t);
  
 -	copy_m3_m4(mtx, t->obedit->obmat);
 -	pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON);
 +		copy_m3_m4(mtx, tc->obedit->obmat);
 +		pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON);
  
 -	td = t->data;
 -	for (nu = nurbs->first; nu; nu = nu->next) {
 -		if (nu->type == CU_BEZIER) {
 -			TransData *head, *tail;
 -			head = tail = td;
 -			for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) {
 -				if (bezt->hide == 0) {
 -					TransDataCurveHandleFlags *hdata = NULL;
 -					float axismtx[3][3];
 +		td = tc->data;
 +		for (nu = nurbs->first; nu; nu = nu->next) {
 +			if (nu->type == CU_BEZIER) {
 +				TransData *head, *tail;
 +				head = tail = td;
 +				for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) {
 +					if (bezt->hide == 0) {
 +						TransDataCurveHandleFlags *hdata = NULL;
 +						float axismtx[3][3];
  
 -					if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 -						float normal[3], plane[3];
 +						if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 +							float normal[3], plane[3];
  
 -						BKE_nurb_bezt_calc_normal(nu, bezt, normal);
 -						BKE_nurb_bezt_calc_plane(nu, bezt, plane);
 +							BKE_nurb_bezt_calc_normal(nu, bezt, normal);
 +							BKE_nurb_bezt_calc_plane(nu, bezt, plane);
  
 -						if (createSpaceNormalTangent(axismtx, normal, plane)) {
 -							/* pass */
 -						}
 -						else {
 -							normalize_v3(normal);
 -							axis_dominant_v3_to_m3(axismtx, normal);
 -							invert_m3(axismtx);
 +							if (createSpaceNormalTangent(axismtx, normal, plane)) {
 +								/* pass */
 +							}
 +							else {
 +								normalize_v3(normal);
 +								axis_dominant_v3_to_m3(axismtx, normal);
 +								invert_m3(axismtx);
 +							}
  						}
 -					}
  
 -					/* Elements that will be transform (not always a match to selection). */
 -					const int bezt_tx = bezt_select_to_transform_triple_flag(bezt, hide_handles);
 +						/* Elements that will be transform (not always a match to selection). */
 +						const int bezt_tx = bezt_select_to_transform_triple_flag(bezt, hide_handles);
 +
 +						if (is_prop_edit || bezt_tx & SEL_F1) {
 +							copy_v3_v3(td->iloc, bezt->vec[0]);
 +							td->loc = bezt->vec[0];
 +							copy_v3_v3(td->center, bezt->vec[(hide_handles ||
 +							                                  (t->around == V3D_AROUND_LOCAL_ORIGINS) ||
 +							                                  (bezt->f2 & SELECT)) ? 1 : 0]);
 +							if (hide_handles) {
 +								if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 +								else td->flag = 0;
 +							}
 +							else {
 +								if (bezt->f1 & SELECT) td->flag = TD_SELECTED;
 +								else td->flag = 0;
 +							}
 +							td->ext = NULL;
 +							td->val = NULL;
  
 -					if (is_prop_edit || bezt_tx & SEL_F1) {
 -						copy_v3_v3(td->iloc, bezt->vec[0]);
 -						td->loc = bezt->vec[0];
 -						copy_v3_v3(td->center, bezt->vec[(hide_handles ||
 -						                                  (t->around == V3D_AROUND_LOCAL_ORIGINS) ||
 -						                                  (bezt->f2 & SELECT)) ? 1 : 0]);
 -						if (hide_handles) {
 -							if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 -							else td->flag = 0;
 -						}
 -						else {
 -							if (bezt->f1 & SELECT) td->flag = TD_SELECTED;
 -							else td->flag = 0;
 -						}
 -						td->ext = NULL;
 -						td->val = NULL;
 +							hdata = initTransDataCurveHandles(td, bezt);
  
 -						hdata = initTransDataCurveHandles(td, bezt);
 +							copy_m3_m3(td->smtx, smtx);
 +							copy_m3_m3(td->mtx, mtx);
 +							if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 +								copy_m3_m3(td->axismtx, axismtx);
 +							}
  
 -						copy_m3_m3(td->smtx, smtx);
 -						copy_m3_m3(td->mtx, mtx);
 -						if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 -							copy_m3_m3(td->axismtx, axismtx);
 +							td++;
- 							count++;
 +							tail++;
  						}
  
 -						td++;
 -						tail++;
 -					}
 +						/* This is the Curve Point, the other two are handles */
 +						if (is_prop_edit || bezt_tx & SEL_F2) {
 +							copy_v3_v3(td->iloc, bezt->vec[1]);
 +							td->loc = bezt->vec[1];
 +							copy_v3_v3(td->center, td->loc);
 +							if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 +							else td->flag = 0;
 +							td->ext = NULL;
  
 -					/* This is the Curve Point, the other two are handles */
 -					if (is_prop_edit || bezt_tx & SEL_F2) {
 -						copy_v3_v3(td->iloc, bezt->vec[1]);
 -						td->loc = bezt->vec[1];
 -						copy_v3_v3(td->center, td->loc);
 -						if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 -						else td->flag = 0;
 -						td->ext = NULL;
 +							if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */
 +								td->val = &(bezt->radius);
 +								td->ival = bezt->radius;
 +							}
 +							else if (t->mode == TFM_TILT) {
 +								td->val = &(bezt->alfa);
 +								td->ival = bezt->alfa;
 +							}
 +							else {
 +								td->val = NULL;
 +							}
  
 -						if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */
 -							td->val = &(bezt->radius);
 -							td->ival = bezt->radius;
 -						}
 -						else if (t->mode == TFM_TILT) {
 -							td->val = &(bezt->alfa);
 -							td->ival = bezt->alfa;
 -						}
 -						else {
 -							td->val = NULL;
 -						}
 +							copy_m3_m3(td->smtx, smtx);
 +							copy_m3_m3(td->mtx, mtx);
 +							if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 +								copy_m3_m3(td->axismtx, axismtx);
 +							}
  
 -						copy_m3_m3(td->smtx, smtx);
 -						copy_m3_m3(td->mtx, mtx);
 -						if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 -							copy_m3_m3(td->axismtx, axismtx);
 +							if ((bezt_tx & SEL_F1) == 0 && (bezt_tx & SEL_F3) == 0)
 +								/* If the middle is selected but the sides arnt, this is needed */
 +								if (hdata == NULL) { /* if the handle was not saved by the previous handle */
 +									hdata = initTransDataCurveHandles(td, bezt);
 +								}
 +
 +							td++;
- 							count++;
 +							tail++;
  						}
 +						if (is_prop_edit || bezt_tx & SEL_F3) {
 +							copy_v3_v3(td->iloc, bezt->vec[2]);
 +							td->loc = bezt->vec[2];
 +							copy_v3_v3(td->center, bezt->vec[(hide_handles ||
 +							                                  (t->around == V3D_AROUND_LOCAL_ORIGINS) ||
 +							                                  (bezt->f2 & SELECT)) ? 1 : 2]);
 +							if (hide_handles) {
 +								if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 +								else td->flag = 0;
 +							}
 +							else {
 +								if (bezt->f3 & SELECT) td->flag = TD_SELECTED;
 +								else td->flag = 0;
 +							}
 +							td->ext = NULL;
 +							td->val = NULL;
  
 -						if ((bezt_tx & SEL_F1) == 0 && (bezt_tx & SEL_F3) == 0)
 -							/* If the middle is selected but the sides arnt, this is needed */
  							if (hdata == NULL) { /* if the handle was not saved by the previous handle */
  								hdata = initTransDataCurveHandles(td, bezt);
  							}
  
 -						td++;
 -						tail++;
 -					}
 -					if (is_prop_edit || bezt_tx & SEL_F3) {
 -						copy_v3_v3(td->iloc, bezt->vec[2]);
 -						td->loc = bezt->vec[2];
 -						copy_v3_v3(td->center, bezt->vec[(hide_handles ||
 -						                                  (t->around == V3D_AROUND_LOCAL_ORIGINS) ||
 -						                                  (bezt->f2 & SELECT)) ? 1 : 2]);
 -						if (hide_handles) {
 -							if (bezt->f2 & SELECT) td->flag = TD_SELECTED;
 -							else td->flag = 0;
 -						}
 -						else {
 -							if (bezt->f3 & SELECT) td->flag = TD_SELECTED;
 -							else td->flag = 0;
 -						}
 -						td->ext = NULL;
 -						td->val = NULL;
 -
 -						if (hdata == NULL) { /* if the handle was not saved by the previous handle */
 -							hdata = initTransDataCurveHandles(td, bezt);
 -						}
 +							copy_m3_m3(td->smtx, smtx);
 +							copy_m3_m3(td->mtx, mtx);
 +							if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 +								copy_m3_m3(td->axismtx, axismtx);
 +							}
  
 -						copy_m3_m3(td->smtx, smtx);
 -						copy_m3_m3(td->mtx, mtx);
 -						if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 -							copy_m3_m3(td->axismtx, axismtx);
 +							td++;
- 							count++;
 +							tail++;
  						}
  
 -						td++;
 -						tail++;
 +						(void)hdata;  /* quiet warning */
 +					}
 +					else if (is_prop_edit && head != tail) {
 +						calc_distanceCurveVerts(head, tail - 1);
 +						head = tail;
  					}
 -
 -					(void)hdata;  /* quiet warning */
  				}
 -				else if (is_prop_edit && head != tail) {
 +				if (is_prop_edit && head != tail)
  					calc_distanceCurveVerts(head, tail - 1);
 -					head = tail;
 -				}
 -			}
 -			if (is_prop_edit && head != tail)
 -				calc_distanceCurveVerts(head, tail - 1);
  
 -			/* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
 -			 * but for now just don't change handle types */
 -			if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT, TFM_DUMMY) == 0) {
 -				/* sets the handles based on their selection, do this after the data is copied to the TransData */
 -				BKE_nurb_handles_test(nu, !hide_handles);
 +				/* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
 +				 * but for now just don't change handle types */
 +				if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TIL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list