[Bf-blender-cvs] [5793a84f126] master: GP: Count all strokes when use multiedit for VBO size

Antonioya noreply at git.blender.org
Fri Jan 11 11:00:46 CET 2019


Commit: 5793a84f1262ce78398320f8518816ff7e62cdd8
Author: Antonioya
Date:   Fri Jan 11 11:00:30 2019 +0100
Branches: master
https://developer.blender.org/rB5793a84f1262ce78398320f8518816ff7e62cdd8

GP: Count all strokes when use multiedit for VBO size

When use multi frame edition, the initial size of the VBO must be bigger than normal edition because the realloc of VBO is very slow.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index fa16a00183e..8bcd1e13fe1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -79,6 +79,7 @@ static void gpencil_calc_vertex(
 		main_onion && DRW_gpencil_onion_active(gpd) && !playing;
 
 	const bool time_remap = BKE_gpencil_has_time_modifiers(ob);
+	const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 
 	cache_ob->tot_vertex = 0;
 	cache_ob->tot_triangles = 0;
@@ -90,9 +91,9 @@ static void gpencil_calc_vertex(
 			continue;
 		}
 
-		/* if onion skin need to count all frames of the layer */
-		if (is_onion) {
-			init_gpf = gpl->actframe;
+		/* if multiedit or onion skin need to count all frames of the layer */
+		if ((is_multiedit) || (is_onion)) {
+			init_gpf = gpl->frames.first;
 		}
 		else {
 			/* verify time modifiers */



More information about the Bf-blender-cvs mailing list