[Bf-blender-cvs] [e82364a] strand_nodes: Clear debug drawing when creating new contacts.

Lukas Tönne noreply at git.blender.org
Sun Aug 7 10:39:45 CEST 2016


Commit: e82364a1a8c130af0a1a9b8154dd97dade4dc221
Author: Lukas Tönne
Date:   Fri Jul 29 12:53:05 2016 +0200
Branches: strand_nodes
https://developer.blender.org/rBe82364a1a8c130af0a1a9b8154dd97dade4dc221

Clear debug drawing when creating new contacts.

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

M	source/blender/physics/intern/strands.cpp

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

diff --git a/source/blender/physics/intern/strands.cpp b/source/blender/physics/intern/strands.cpp
index 20042d8..44a92dc 100644
--- a/source/blender/physics/intern/strands.cpp
+++ b/source/blender/physics/intern/strands.cpp
@@ -432,13 +432,16 @@ void BPH_strands_solve_constraints(Scene *scene, Object *ob, BMEditStrands *edit
 		CollisionContactCache *contacts = BKE_collision_cache_create();
 		
 		BKE_editstrands_get_collision_contacts(scene, ob, edit, contacts);
-		if (settings->flag & HAIR_EDIT_SHOW_DEBUG &&
-		    settings->flag & HAIR_EDIT_SHOW_DEBUG_CONTACTS) {
-			CollisionContactIterator iter;
-			CollisionContactPoint *pt;
-			BKE_COLLISION_ITER_CONTACTS(pt, &iter, contacts) {
-				BKE_sim_debug_data_add_line(pt->point_world_a, pt->point_world_b, 0.95, 0.9, 0.1, "hair collision",
-				                            pt->index_a, pt->index_b, pt->part_id_a, pt->part_id_b);
+		if (settings->flag & HAIR_EDIT_SHOW_DEBUG) {
+			if (settings->flag & HAIR_EDIT_SHOW_DEBUG_CONTACTS) {
+				BKE_sim_debug_data_clear_category("hair collision");
+				
+				CollisionContactIterator iter;
+				CollisionContactPoint *pt;
+				BKE_COLLISION_ITER_CONTACTS(pt, &iter, contacts) {
+					BKE_sim_debug_data_add_line(pt->point_world_a, pt->point_world_b, 0.95, 0.9, 0.1, "hair collision",
+					                            pt->index_a, pt->index_b, pt->part_id_a, pt->part_id_b);
+				}
 			}
 		}




More information about the Bf-blender-cvs mailing list