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

Sergey Sharybin noreply at git.blender.org
Fri Sep 16 17:13:34 CEST 2016


Commit: d96b8e168f3c809cd79f6028dbf99eeeebb71302
Author: Sergey Sharybin
Date:   Fri Sep 16 17:09:28 2016 +0200
Branches: blender2.8
https://developer.blender.org/rBd96b8e168f3c809cd79f6028dbf99eeeebb71302

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/alembic/intern/abc_hair.cc
index 967c99d,14bcf67..5a95944
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@@ -53,12 -54,12 +53,12 @@@ AbcHairWriter::AbcHairWriter(Scene *sce
                               AbcTransformWriter *parent,
                               uint32_t time_sampling,
                               ExportSettings &settings,
 -                             ParticleSystem *psys)
 +                             void *UNUSED(psys))
      : AbcObjectWriter(scene, ob, time_sampling, settings, parent)
  {
 -	m_psys = psys;
 +	m_psys = NULL; // = psys;
  
- 	OCurves curves(parent->alembicXform(), m_name, m_time_sampling);
+ 	OCurves curves(parent->alembicXform(), psys->name, m_time_sampling);
  	m_schema = curves.getSchema();
  }
  
diff --cc source/blender/alembic/intern/abc_points.cc
index 22a51d9,0301454..8b71123
--- a/source/blender/alembic/intern/abc_points.cc
+++ b/source/blender/alembic/intern/abc_points.cc
@@@ -61,12 -62,12 +61,12 @@@ AbcPointsWriter::AbcPointsWriter(Scene 
  	                             AbcTransformWriter *parent,
  	                             uint32_t time_sampling,
  	                             ExportSettings &settings,
 -	                             ParticleSystem *psys)
 +	                             void *UNUSED(psys))
      : AbcObjectWriter(scene, ob, time_sampling, settings, parent)
  {
 -	m_psys = psys;
 +	m_psys = NULL; // = psys;
  
- 	OPoints points(parent->alembicXform(), m_name, m_time_sampling);
+ 	OPoints points(parent->alembicXform(), psys->name, m_time_sampling);
  	m_schema = points.getSchema();
  }
  
diff --cc source/blender/editors/space_view3d/drawobject.c
index 7ac74fb,4af8458..d308c11
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@@ -6659,123 -7792,132 +6659,80 @@@ void draw_object(Scene *scene, ARegion 
  		}
  	}
  
- 	/* draw code for smoke */
- 	if (smd) {
- #if 0
- 		/* draw collision objects */
- 		if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) {
- 			SmokeCollSettings *scs = smd->coll;
- 			if (scs->points) {
- 				size_t i;
 -	/* code for new particle system */
 -	if ((ob->particlesystem.first) &&
 -	    (ob != scene->obedit))
 -	{
 -		ParticleSystem *psys;
 -
 -		if ((dflag & DRAW_CONSTCOLOR) == 0) {
 -			/* for visibility, also while wpaint */
 -			if (col || (ob->flag & SELECT)) {
 -				cpack(0xFFFFFF);
 -			}
 -		}
 -		//glDepthMask(GL_FALSE);
 -
 -		glLoadMatrixf(rv3d->viewmat);
 -		
 -		view3d_cached_text_draw_begin();
 -
 -		for (psys = ob->particlesystem.first; psys; psys = psys->next) {
 -			/* run this so that possible child particles get cached */
 -			if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) {
 -				PTCacheEdit *edit = PE_create_current(scene, ob);
 -				if (edit && edit->psys == psys)
 -					draw_update_ptcache_edit(scene, ob, edit);
 -			}
 -
 -			draw_new_particle_system(scene, v3d, rv3d, base, psys, dt, dflag);
 -		}
 -		invert_m4_m4(ob->imat, ob->obmat);
 -		view3d_cached_text_draw_end(v3d, ar, 0, NULL);
 -
 -		glMultMatrixf(ob->obmat);
 -		
 -		//glDepthMask(GL_TRUE);
 -		if (col) cpack(col);
 -	}
 -
 -	/* draw edit particles last so that they can draw over child particles */
 -	if ((dflag & DRAW_PICKING) == 0 &&
 -	    (!scene->obedit))
 -	{
--
 -		if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) {
 -			PTCacheEdit *edit = PE_create_current(scene, ob);
 -			if (edit) {
--				glLoadMatrixf(rv3d->viewmat);
 -				draw_update_ptcache_edit(scene, ob, edit);
 -				draw_ptcache_edit(scene, v3d, edit);
 -				glMultMatrixf(ob->obmat);
 -			}
 -		}
 -	}
--
- 				if (col || (ob->flag & SELECT)) cpack(0xFFFFFF);
- 				glDepthMask(GL_FALSE);
- 				glEnable(GL_BLEND);
- 				
+ 	/* draw code for smoke, only draw domains */
+ 	if (smd && smd->domain) {
+ 		SmokeDomainSettings *sds = smd->domain;
++		const bool show_smoke = true; /* XXX was checking cached frame range before */
+ 		float viewnormal[3];
  
- 				// glPointSize(3.0);
- 				glBegin(GL_POINTS);
- 
- 				for (i = 0; i < scs->numpoints; i++)
- 				{
- 					glVertex3fv(&scs->points[3 * i]);
- 				}
+ 		glLoadMatrixf(rv3d->viewmat);
+ 		glMultMatrixf(ob->obmat);
  
- 				glEnd();
+ 		if (!render_override) {
+ 			BoundBox bb;
+ 			float p0[3], p1[3];
  
- 				glMultMatrixf(ob->obmat);
- 				glDisable(GL_BLEND);
- 				glDepthMask(GL_TRUE);
- 				if (col) cpack(col);
+ 			/* draw max domain bounds */
+ 			if ((sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN)) {
+ 				VECSUBFAC(p0, sds->p0, sds->cell_size, sds->adapt_res);
+ 				VECADDFAC(p1, sds->p1, sds->cell_size, sds->adapt_res);
+ 				BKE_boundbox_init_from_minmax(&bb, p0, p1);
+ 				draw_box(bb.vec, false);
  			}
- 		}
- #endif
  
- 		/* only draw domains */
- 		if (smd->domain) {
- 			SmokeDomainSettings *sds = smd->domain;
- 			const bool show_smoke = true; /* XXX was checking cached frame range before */
- 			float viewnormal[3];
+ 			/* draw a single voxel to hint the user about the resolution of the fluid */
+ 			copy_v3_v3(p0, sds->p0);
  
- 			glLoadMatrixf(rv3d->viewmat);
- 			glMultMatrixf(ob->obmat);
- 
- 			if (!render_override) {
- 				BoundBox bb;
- 				float p0[3], p1[3];
- 
- 				/* draw adaptive domain bounds */
- 				if ((sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN)) {
- 					/* draw domain max bounds */
- 					VECSUBFAC(p0, sds->p0, sds->cell_size, sds->adapt_res);
- 					VECADDFAC(p1, sds->p1, sds->cell_size, sds->adapt_res);
- 					BKE_boundbox_init_from_minmax(&bb, p0, p1);
- 					draw_box(bb.vec, false);
- 				}
- 
- #if 0
- 				/* draw base resolution bounds */
- 				BKE_boundbox_init_from_minmax(&bb, sds->p0, sds->p1);
- 				draw_box(bb.vec);
- #endif
- 
- 
- 				/* draw a single voxel to hint the user about the resolution of the fluid */
- 				copy_v3_v3(p0, sds->p0);
- 
- 				if (sds->flags & MOD_SMOKE_HIGHRES) {
- 					madd_v3_v3v3fl(p1, p0, sds->cell_size, 1.0f / (sds->amplify + 1));
- 				}
- 				else {
- 					add_v3_v3v3(p1, p0, sds->cell_size);
- 				}
- 
- 				BKE_boundbox_init_from_minmax(&bb, p0, p1);
- 				draw_box(bb.vec, false);
+ 			if (sds->flags & MOD_SMOKE_HIGHRES) {
+ 				madd_v3_v3v3fl(p1, p0, sds->cell_size, 1.0f / (sds->amplify + 1));
+ 			}
+ 			else {
+ 				add_v3_v3v3(p1, p0, sds->cell_size);
  			}
  
- 			/* don't show smoke before simulation starts, this could be made an option in the future */
- 			if (sds->fluid && show_smoke) {
- 				float p0[3], p1[3];
- 
- 				/* get view vector */
- 				invert_m4_m4(ob->imat, ob->obmat);
- 				mul_v3_mat3_m4v3(viewnormal, ob->imat, rv3d->viewinv[2]);
- 				normalize_v3(viewnormal);
- 
- 				/* set dynamic boundaries to draw the volume
- 				 * also scale cube to global space to equalize volume slicing on all axes
- 				 *  (it's scaled back before drawing) */
- 				p0[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_min[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
- 				p0[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_min[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
- 				p0[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_min[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
- 				p1[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_max[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
- 				p1[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_max[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
- 				p1[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_max[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
- 
- 				if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
- 					sds->tex = NULL;
- 					GPU_create_smoke(smd, 0);
- 					draw_smoke_volume(sds, ob, p0, p1, viewnormal);
- 					GPU_free_smoke(smd);
- 				}
- 				else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
- 					sds->tex = NULL;
- 					GPU_create_smoke(smd, 1);
- 					draw_smoke_volume(sds, ob, p0, p1, viewnormal);
- 					GPU_free_smoke(smd);
- 				}
+ 			BKE_boundbox_init_from_minmax(&bb, p0, p1);
+ 			draw_box(bb.vec, false);
+ 		}
+ 
+ 		/* don't show smoke before simulation starts, this could be made an option in the future */
 -		if (sds->fluid && CFRA >= sds->point_cache[0]->startframe) {
++		if (sds->fluid && show_smoke) {
+ 			float p0[3], p1[3];
+ 
+ 			/* get view vector */
+ 			invert_m4_m4(ob->imat, ob->obmat);
+ 			mul_v3_mat3_m4v3(viewnormal, ob->imat, rv3d->viewinv[2]);
+ 			normalize_v3(viewnormal);
+ 
+ 			/* set dynamic boundaries to draw the volume
+ 			 * also scale cube to global space to equalize volume slicing on all axes
+ 			 *  (it's scaled back before drawing) */
+ 			p0[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_min[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
+ 			p0[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_min[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
+ 			p0[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_min[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
+ 			p1[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_max[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
+ 			p1[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_max[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
+ 			p1[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_max[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
+ 
+ 			if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
+ 				sds->tex = NULL;
+ 				GPU_create_smoke(smd, 0);
+ 				draw_smoke_volume(sds, ob, p0, p1, viewnormal);
+ 				GPU_free_smoke(smd);
+ 			}
+ 			else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
+ 				sds->tex = NULL;
+ 				GPU_create_smoke(smd, 1);
+ 				draw_smoke_volume(sds, ob, p0, p1, viewnormal);
+ 				GPU_free_smoke(smd);
+ 			}
  
- 				/* smoke debug render */
+ 			/* smoke debug render */
  #ifdef SMOKE_DEBUG_VELOCITY
- 				draw_smoke_velocity(smd->domain, ob);
+ 			draw_smoke_velocity(smd->domain, ob);
  #endif
  #ifdef SMOKE_DEBUG_HEAT
- 				draw_smoke_heat(smd->domain, ob);
+ 			draw_smoke_heat(smd->domain, ob);
  #endif
- 			}
  		}
  	}




More information about the Bf-blender-cvs mailing list