[Bf-blender-cvs] [914f6b686ac] greasepencil-object: Merge branch 'master' into greasepencil-object

Antonio Vazquez noreply at git.blender.org
Thu Mar 5 10:27:57 CET 2020


Commit: 914f6b686ace89acaf7c092de3d3291252112269
Author: Antonio Vazquez
Date:   Thu Mar 5 10:27:51 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB914f6b686ace89acaf7c092de3d3291252112269

Merge branch 'master' into greasepencil-object

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



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

diff --cc source/blender/blenkernel/intern/gpencil.c
index 07826754787,2a84184cfe7..81188917018
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@@ -2597,9 -2366,9 +2597,9 @@@ void BKE_gpencil_stats_update(bGPdata *
  }
  
  /* get material index (0-based like mat_nr not actcol) */
 -int BKE_gpencil_object_material_get_index(Object *ob, Material *ma)
 +int BKE_gpencil_object_material_index_get(Object *ob, Material *ma)
  {
-   short *totcol = BKE_object_material_num(ob);
+   short *totcol = BKE_object_material_len_p(ob);
    Material *read_ma = NULL;
    for (short i = 0; i < *totcol; i++) {
      read_ma = BKE_object_material_get(ob, i + 1);
diff --cc source/blender/editors/interface/interface_eyedropper_gpencil_color.c
index 99668cf67f7,790609a17d8..f9f5c745e94
--- a/source/blender/editors/interface/interface_eyedropper_gpencil_color.c
+++ b/source/blender/editors/interface/interface_eyedropper_gpencil_color.c
@@@ -112,10 -108,26 +112,10 @@@ static void eyedropper_add_material
    Object *ob = CTX_data_active_object(C);
    Material *ma = NULL;
  
 -  const bool only_stroke = ((!event->ctrl) && (!event->shift));
 -  const bool only_fill = ((!event->ctrl) && (event->shift));
 -  const bool both = ((event->ctrl) && (event->shift));
 -
 -  float col_conv[4];
    bool found = false;
  
 -  /* Convert from linear rgb space to display space because grease pencil colors are in display
 -   *  space, and this conversion is needed to undo the conversion to linear performed by
 -   *  eyedropper_color_sample_fl. */
 -  if (eye->display) {
 -    copy_v3_v3(col_conv, eye->color);
 -    IMB_colormanagement_scene_linear_to_display_v3(col_conv, eye->display);
 -  }
 -  else {
 -    copy_v3_v3(col_conv, eye->color);
 -  }
 -
    /* Look for a similar material in grease pencil slots. */
-   short *totcol = BKE_object_material_num(ob);
+   short *totcol = BKE_object_material_len_p(ob);
    for (short i = 0; i < *totcol; i++) {
      ma = BKE_object_material_get(ob, i + 1);
      if (ma == NULL) {



More information about the Bf-blender-cvs mailing list