[Bf-blender-cvs] [06def089d3b] blender2.8: Draw Manager: Recalculate batch of Curves, Surfaces and Texts when a property is changed

Germano noreply at git.blender.org
Thu Dec 14 17:44:32 CET 2017


Commit: 06def089d3b3de1a0a49a0014b75cb7aa8a19fc7
Author: Germano
Date:   Thu Dec 14 14:44:20 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB06def089d3b3de1a0a49a0014b75cb7aa8a19fc7

Draw Manager: Recalculate batch of Curves, Surfaces and Texts when a property is changed

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

M	source/blender/draw/intern/draw_cache_impl_curve.c

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

diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index 42533cc2802..5a2ee2b0695 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -344,6 +344,10 @@ static bool curve_batch_cache_valid(Curve *cu)
 		return false;
 	}
 
+	if (cache->is_dirty) {
+		return false;
+	}
+
 	if (cache->is_editmode != ((cu->editnurb != NULL) || (cu->editfont != NULL))) {
 		return false;
 	}
@@ -362,16 +366,6 @@ static bool curve_batch_cache_valid(Curve *cu)
 		}
 	}
 
-	if (cache->is_dirty == false) {
-		return true;
-	}
-	else {
-		/* TODO: check number of vertices/edges? */
-		if (cache->is_editmode) {
-			return false;
-		}
-	}
-
 	return true;
 }
 
@@ -1050,7 +1044,7 @@ Gwn_Batch **DRW_curve_batch_cache_get_surface_shaded(
 
 		for (int i = 0; i < gpumat_array_len; ++i) {
 			cache->surface.shaded_triangles[i] = GWN_batch_create_ex(
-			        GWN_PRIM_TRIS, cache->surface.verts, el[i], GWN_BATCH_OWNS_INDEX);
+			        GWN_PRIM_TRIS, cache->surface.verts, el[i], el[i] ? GWN_BATCH_OWNS_INDEX : 0);
 
 			/* TODO: Add vertbuff for UV */
 		}



More information about the Bf-blender-cvs mailing list