[Bf-blender-cvs] [5e8dbafb5b2] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Tue Aug 14 02:06:44 CEST 2018


Commit: 5e8dbafb5b211f9a2c7de5580a7e83254706521b
Author: Campbell Barton
Date:   Tue Aug 14 10:02:43 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB5e8dbafb5b211f9a2c7de5580a7e83254706521b

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/physics/particle_boids.c
index ac031079434,bb7dd64fb47..f1e0fd39014
--- a/source/blender/editors/physics/particle_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@@ -77,7 -75,7 +77,7 @@@ static int rule_add_exec(bContext *C, w
  
  	BLI_addtail(&state->rules, rule);
  
- 	DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
 -	DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
++	DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  
  	return OPERATOR_FINISHED;
  }
@@@ -123,8 -121,8 +123,8 @@@ static int rule_del_exec(bContext *C, w
  	if (rule)
  		rule->flag |= BOIDRULE_CURRENT;
  
 -	DAG_relations_tag_update(bmain);
 -	DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
 +	DEG_relations_tag_update(bmain);
- 	DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
++	DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  
  	return OPERATOR_FINISHED;
  }
@@@ -160,7 -158,7 +160,7 @@@ static int rule_move_up_exec(bContext *
  			BLI_remlink(&state->rules, rule);
  			BLI_insertlinkbefore(&state->rules, rule->prev, rule);
  
- 			DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
 -			DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
++			DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  			break;
  		}
  	}
@@@ -196,7 -194,7 +196,7 @@@ static int rule_move_down_exec(bContex
  			BLI_remlink(&state->rules, rule);
  			BLI_insertlinkafter(&state->rules, rule->next, rule);
  
- 			DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
 -			DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
++			DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  			break;
  		}
  	}
@@@ -279,8 -277,8 +279,8 @@@ static int state_del_exec(bContext *C, 
  
  	state->flag |= BOIDSTATE_CURRENT;
  
 -	DAG_relations_tag_update(bmain);
 -	DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
 +	DEG_relations_tag_update(bmain);
- 	DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
++	DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  
  	return OPERATOR_FINISHED;
  }
@@@ -351,7 -349,7 +351,7 @@@ static int state_move_down_exec(bContex
  		if (state->flag & BOIDSTATE_CURRENT && state->next) {
  			BLI_remlink(&boids->states, state);
  			BLI_insertlinkafter(&boids->states, state->next, state);
- 			DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
 -			DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
++			DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET);
  			break;
  		}
  	}
diff --cc source/blender/editors/physics/particle_edit.c
index 1b82e60b986,5699c1f59f8..40a7c65385c
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@@ -103,25 -88,27 +103,25 @@@
  
  bool PE_poll(bContext *C)
  {
- 	Scene *scene= CTX_data_scene(C);
- 	Object *ob= CTX_data_active_object(C);
 -	Main *bmain = CTX_data_main(C);
+ 	Scene *scene = CTX_data_scene(C);
+ 	Object *ob = CTX_data_active_object(C);
  
 -	if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
 +	if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT)) {
  		return 0;
 -
 -	return (PE_get_current(bmain, scene, ob) != NULL);
 +	}
 +	return (PE_get_current(scene, ob) != NULL);
  }
  
  bool PE_hair_poll(bContext *C)
  {
- 	Scene *scene= CTX_data_scene(C);
- 	Object *ob= CTX_data_active_object(C);
 -	Main *bmain = CTX_data_main(C);
+ 	Scene *scene = CTX_data_scene(C);
+ 	Object *ob = CTX_data_active_object(C);
  	PTCacheEdit *edit;
  
 -	if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
 +	if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT)) {
  		return 0;
 -
 -	edit = PE_get_current(bmain, scene, ob);
 +	}
 +	edit = PE_get_current(scene, ob);
  
  	return (edit && edit->psys);
  }
@@@ -246,10 -191,9 +246,10 @@@ static void pe_update_hair_particle_edi
   *
   * note: this function runs on poll, therefor it can runs many times a second
   * keep it fast! */
 -static PTCacheEdit *pe_get_current(Main *bmain, Scene *scene, Object *ob, int create)
 +static PTCacheEdit *pe_get_current(
 +        Depsgraph *depsgraph, Scene *scene, Object *ob, int create)
  {
- 	ParticleEditSettings *pset= PE_settings(scene);
+ 	ParticleEditSettings *pset = PE_settings(scene);
  	PTCacheEdit *edit = NULL;
  	ListBase pidlist;
  	PTCacheID *pid;
@@@ -506,8 -418,9 +506,8 @@@ static void PE_free_random_generator(PE
  
  static bool key_test_depth(PEData *data, const float co[3], const int screen_co[2])
  {
- 	View3D *v3d= data->vc.v3d;
+ 	View3D *v3d = data->vc.v3d;
  	ViewDepths *vd = data->vc.rv3d->depths;
 -	double ux, uy, uz;
  	float depth;
  
  	/* nothing to do */
@@@ -699,60 -612,55 +699,60 @@@ static void foreach_mouse_hit_point(PED
  	}
  }
  
 -static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected)
 +typedef struct KeyIterData {
 +	PEData *data;
 +	PTCacheEdit *edit;
 +	int selected;
 +	ForKeyMatFunc func;
 +} KeyIterData;
 +
 +static void foreach_mouse_hit_key_iter(
 +        void *__restrict iter_data_v,
 +        const int iter,
 +        const ParallelRangeTLS *__restrict UNUSED(tls))
  {
 +	KeyIterData *iter_data = (KeyIterData *)iter_data_v;
 +	PEData *data = iter_data->data;
  	PTCacheEdit *edit = data->edit;
 +	PTCacheEditPoint *point = &edit->points[iter];
 +	if (point->flag & PEP_HIDE) {
 +		return;
 +	}
  	ParticleSystem *psys = edit->psys;
 -	ParticleSystemModifierData *psmd = NULL;
 +	ParticleSystemModifierData *psmd_eval = iter_data->edit->psmd_eval;
  	ParticleEditSettings *pset = PE_settings(data->scene);
 -	POINT_P; KEY_K;
 +	const int selected = iter_data->selected;
  	float mat[4][4], imat[4][4];
 -
  	unit_m4(mat);
  	unit_m4(imat);
- 	if (pset->selectmode==SCE_SELECT_END) {
 -
 -	if (edit->psys)
 -		psmd = psys_get_modifier(data->ob, edit->psys);
 -
 -	/* all is selected in path mode */
 -	if (pset->selectmode == SCE_SELECT_PATH)
 -		selected = 0;
 -
 -	LOOP_VISIBLE_POINTS {
 -		if (pset->selectmode == SCE_SELECT_END) {
 -			if (point->totkey) {
 -				/* only do end keys */
 -				key = point->keys + point->totkey - 1;
 -
 -				if (selected == 0 || key->flag & PEK_SELECT) {
 -					if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
 -						if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
 -							psys_mat_hair_to_global(data->ob, psmd->dm_final, psys->part->from, psys->particles + p, mat);
 -							invert_m4_m4(imat, mat);
 -						}
 -
 -						func(data, mat, imat, p, point->totkey - 1, key);
++	if (pset->selectmode == SCE_SELECT_END) {
 +		if (point->totkey) {
 +			/* only do end keys */
- 			PTCacheEditKey *key = point->keys + point->totkey-1;
++			PTCacheEditKey *key = point->keys + point->totkey - 1;
 +
- 			if (selected==0 || key->flag & PEK_SELECT) {
++			if (selected == 0 || key->flag & PEK_SELECT) {
 +				if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
 +					if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
 +						psys_mat_hair_to_global(data->ob, psmd_eval->mesh_final, psys->part->from, psys->particles + iter, mat);
 +						invert_m4_m4(imat, mat);
  					}
- 					iter_data->func(data, mat, imat, iter, point->totkey-1, key);
++					iter_data->func(data, mat, imat, iter, point->totkey - 1, key);
  				}
  			}
  		}
 -		else {
 -			/* do all keys */
 -			LOOP_VISIBLE_KEYS {
 -				if (selected == 0 || key->flag & PEK_SELECT) {
 -					if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
 -						if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
 -							psys_mat_hair_to_global(data->ob, psmd->dm_final, psys->part->from, psys->particles + p, mat);
 -							invert_m4_m4(imat, mat);
 -						}
 -
 -						func(data, mat, imat, p, k, key);
 +	}
 +	else {
 +		/* do all keys */
 +		PTCacheEditKey *key;
 +		int k;
 +		LOOP_VISIBLE_KEYS {
- 			if (selected==0 || key->flag & PEK_SELECT) {
++			if (selected == 0 || key->flag & PEK_SELECT) {
 +				if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
 +					if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
 +						psys_mat_hair_to_global(data->ob, psmd_eval->mesh_final, psys->part->from, psys->particles + iter, mat);
 +						invert_m4_m4(imat, mat);
  					}
 +					iter_data->func(data, mat, imat, iter, k, key);
  				}
  			}
  		}
@@@ -851,14 -738,14 +851,14 @@@ static void PE_update_mirror_cache(Obje
  	float mat[4][4], co[3];
  	int index, totpart;
  
- 	edit= psys->edit;
+ 	edit = psys->edit;
 -	psmd = psys_get_modifier(ob, psys);
 +	psmd_eval = edit->psmd_eval;
- 	totpart= psys->totpart;
+ 	totpart = psys->totpart;
  
 -	if (!psmd->dm_final)
 +	if (!psmd_eval->mesh_final)
  		return;
  
- 	tree= BLI_kdtree_new(totpart);
+ 	tree = BLI_kdtree_new(totpart);
  
  	/* insert particles into kd tree */
  	LOOP_PARTICLES {
@@@ -954,15 -841,15 +954,15 @@@ static void PE_mirror_particle(Object *
  	}
  
  	/* mirror positions and tags */
 -	psys_mat_hair_to_orco(ob, dm, psys->part->from, pa, mat);
 -	psys_mat_hair_to_orco(ob, dm, psys->part->from, mpa, mmat);
 +	psys_mat_hair_to_orco(ob, mesh, psys->part->from, pa, mat);
 +	psys_mat_hair_to_orco(ob, mesh, psys->part->from, mpa, mmat);
  	invert_m4_m4(immat, mmat);
  
- 	hkey=pa->hair;
- 	mhkey=mpa->hair;
- 	key= point->keys;
- 	mkey= mpoint->keys;
- 	for (k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
+ 	hkey = pa->hair;
+ 	mhkey = mpa->hair;
+ 	key = point->keys;
+ 	mkey = mpoint->keys;
+ 	for (k = 0; k < pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
  		copy_v3_v3(mhkey->co, hkey->co);
  		mul_m4_v3(mat, mhkey->co);
  		mhkey->co[0] = -mhkey->co[0];
@@@ -989,10 -876,10 +989,10 @@@ static void PE_apply_mirror(Object *ob
  	if (!psys)
  		return;
  
- 	edit= psys->edit;
- 	psmd_eval= edit->psmd_eval;
+ 	edit = psys->edit;
 -	psmd = psys_get_modifier(ob, psys);
++	psmd_eval = edit->psmd_eval;
  
 -	if (!psmd->dm_final)
 +	if (!psmd_eval->mesh_final)
  		return;
  
  	if (!edit->mirror_cache)
@@@ -1022,244 -909,154 +1022,244 @@@
  /************************************************/
  /*			Edit Calculation					*/
  /*****************************

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list