[Bf-blender-cvs] [94335f79899] greasepencil-refactor: GPencil: Use new BKE_gpencil_layer_named_get() instead of generic BLI

Antonio Vazquez noreply at git.blender.org
Sat Feb 8 10:32:34 CET 2020


Commit: 94335f798997f6b5bbde685fb3d2ef2315fac34c
Author: Antonio Vazquez
Date:   Sat Feb 8 10:32:25 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB94335f798997f6b5bbde685fb3d2ef2315fac34c

GPencil: Use new BKE_gpencil_layer_named_get() instead of generic BLI

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/editors/gpencil/gpencil_sculpt_paint.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index e515b92283d..cc793816c12 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -3528,7 +3528,7 @@ void BKE_gpencil_convert_curve(Main *bmain,
   if (use_collections) {
     Collection *collection = gpencil_get_parent_collection(scene, ob_cu);
     if (collection != NULL) {
-      gpl = BLI_findstring(&gpd->layers, collection->id.name + 2, offsetof(bGPDlayer, info));
+      gpl = BKE_gpencil_layer_named_get(gpd, collection->id.name + 2);
       if (gpl == NULL) {
         gpl = BKE_gpencil_layer_addnew(gpd, collection->id.name + 2, true);
       }
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 31227b8254b..57636bbb4b3 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1014,7 +1014,7 @@ static void gp_brush_clone_add(bContext *C, tGP_BrushEditData *gso)
       bGPDlayer *gpl = NULL;
       /* Try to use original layer. */
       if (gps->runtime.tmp_layerinfo != NULL) {
-        gpl = BLI_findstring(&gpd->layers, gps->runtime.tmp_layerinfo, offsetof(bGPDlayer, info));
+        gpl = BKE_gpencil_layer_named_get(gpd, gps->runtime.tmp_layerinfo);
       }
 
       /* if not available, use active layer. */



More information about the Bf-blender-cvs mailing list