[Bf-blender-cvs] [356ed34] gooseberry: Disabled the hair preview feature in the code, due to limited usefulness.

Lukas Tönne noreply at git.blender.org
Thu Oct 30 15:59:51 CET 2014


Commit: 356ed34ba53869cc6925843c53180f11c6a47582
Author: Lukas Tönne
Date:   Thu Oct 30 14:41:14 2014 +0100
Branches: gooseberry
https://developer.blender.org/rB356ed34ba53869cc6925843c53180f11c6a47582

Disabled the hair preview feature in the code, due to limited usefulness.

Interpolating hairs in a meaningful way is a quite difficult problem.
It works ok-ish for child hairs as long as they don't move, but with
motion the direction of interpolated hairs can become quite nonsensical
quickly.

Probably a better way to create simulation previews is to limit
simulation to a particular well-defined area (like render preview
borders), but run it in full detail in that area. The error from
omitting some interaction should still be much less than orientation
errors from interpolation.

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

M	release/scripts/startup/bl_ui/properties_particle.py
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/intern/cloth.c
M	source/blender/blenkernel/intern/particle_system.c

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

diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 2e7df5b..4dec92a 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -284,7 +284,8 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
 
         layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
 
-        layout.prop(psys, "hair_preview_factor")
+        # XXX disabled due to stability issues and limited usefulness
+        #layout.prop(psys, "hair_preview_factor")
 
         split = layout.split()
 
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index a49b3bf..42cbd5d 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -65,6 +65,9 @@ struct BVHTreeRay;
 struct BVHTreeRayHit; 
 struct EdgeHash;
 
+/* XXX disabled for now due to stability issues and limited usefulness */
+//#define USE_PARTICLE_PREVIEW
+
 #define PARTICLE_P              ParticleData * pa; int p
 #define LOOP_PARTICLES  for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++)
 #define LOOP_EXISTING_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) if (!(pa->flag & PARS_UNEXIST))
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index bb91c2b..eff2fad 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -796,6 +796,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
 			/* Reset vertex flags */
 			verts->flags &= ~CLOTH_VERT_FLAG_PINNED;
 			verts->flags &= ~CLOTH_VERT_FLAG_NOSELFCOLL;
+			verts->flags &= ~CLOTH_VERT_FLAG_EXCLUDE;
 
 			dvert = dm->getVertData ( dm, i, CD_MDEFORMVERT );
 			if ( dvert ) {
@@ -848,11 +849,13 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
 		}
 	}
 	
+#ifdef USE_PARTICLE_PREVIEW
 	verts = clothObj->verts;
 	for ( i = 0; i < numverts; i++, verts++ ) {
 		if (mvert[i].flag & ME_VERT_TMP_TAG)
 			verts->flags |= CLOTH_VERT_FLAG_EXCLUDE;
 	}
+#endif
 }
 
 
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 413e0c5..d91806b 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3044,6 +3044,7 @@ static MDeformVert *hair_set_pinning(MDeformVert *dvert, float weight)
 
 bool psys_hair_update_preview(ParticleSimulationData *sim)
 {
+#ifdef USE_PARTICLE_PREVIEW
 	ParticleSystem *psys = sim->psys;
 	ParticleSettings *part = psys->part;
 	DerivedMesh *dm = sim->psmd->dm;
@@ -3149,6 +3150,10 @@ bool psys_hair_update_preview(ParticleSimulationData *sim)
 	
 	psys->hair_num_simulated = num_simulated;
 	return true;
+#else
+	(void)sim;
+	return false;
+#endif
 }
 
 static void hair_create_input_dm(ParticleSimulationData *sim, int totpoint, int totedge, DerivedMesh **r_dm, ClothHairRoot **r_roots)
@@ -3450,7 +3455,9 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
 	psys->hair_out_dm->getVertCos(psys->hair_out_dm, deformedVerts);
 	
 	clothModifier_do(psys->clmd, sim->scene, sim->ob, psys->hair_in_dm, deformedVerts);
+#ifdef USE_PARTICLE_PREVIEW
 	hair_deform_preview_hairs(sim, deformedVerts, psys->clmd->roots);
+#endif
 	
 	CDDM_apply_vert_coords(psys->hair_out_dm, deformedVerts);




More information about the Bf-blender-cvs mailing list