Commit: d82685f57e90c8f06fe63e8cac38b95d2705c494
Author: Antonio Vazquez
Date:   Wed Jun 6 10:37:25 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd82685f57e90c8f06fe63e8cac38b95d2705c494

Merge branch 'blender2.8' into greasepencil-object

 Conflicts:
        source/blender/blenloader/intern/versioning_270.c
        source/blender/blenloader/intern/versioning_280.c

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



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

diff --cc source/blender/blenloader/intern/versioning_270.c
index 685859198b6,ba714405cc0..8653289b3c1
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -1422,13 -1361,22 +1422,13 @@@ void blo_do_versions_270(FileData *fd, 
                        /* Convert Grease Pencil to new palettes/brushes
                         * Loop all strokes and create the palette and all 
colors
                         */
-                       for (bGPdata *gpd = main->gpencil.first; gpd; gpd = 
gpd->id.next) {
+                       for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = 
gpd->id.next) {
                                if (BLI_listbase_is_empty(&gpd->palettes)) {
                                        /* create palette */
 -                                      bGPDpalette *palette = 
BKE_gpencil_palette_addnew(gpd, "GP_Palette", true);
 +                                      bGPDpalette *palette = 
BKE_gpencil_palette_addnew(gpd, "GP_Palette");
                                        for (bGPDlayer *gpl = 
gpd->layers.first; gpl; gpl = gpl->next) {
                                                /* create color using layer 
name */
 -                                              bGPDpalettecolor *palcolor = 
BKE_gpencil_palettecolor_addnew(palette, gpl->info, true);
 +                                              bGPDpalettecolor *palcolor = 
BKE_gpencil_palettecolor_addnew(palette, gpl->info);
                                                if (palcolor != NULL) {
                                                        /* set color attributes 
*/
                                                        
copy_v4_v4(palcolor->color, gpl->color);
diff --cc source/blender/blenloader/intern/versioning_280.c
index 386795b40dc,b4f0b2ddfd2..2036fea0f59
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -854,20 -848,19 +854,20 @@@ void do_versions_after_linking_280(Mai
        }
  
  #ifdef USE_COLLECTION_COMPAT_28
-               if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(main, 
280, 14)) {
-                       for (Collection *group = main->collection.first; group; 
group = group->id.next) {
-                               do_version_group_collection_to_collection(main, 
group);
-                       }
+       if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 14)) {
+               for (Collection *group = bmain->collection.first; group; group 
= group->id.next) {
+                       do_version_group_collection_to_collection(bmain, group);
+               }
  
-                       for (Scene *scene = main->scene.first; scene; scene = 
scene->id.next) {
-                               do_version_scene_collection_to_collection(main, 
scene);
-                       }
+               for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
+                       do_version_scene_collection_to_collection(bmain, scene);
                }
+       }
  #endif
 +      
  }
  
- void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
+ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
  {
        bool use_collection_compat_28 = true;
  
@@@ -1006,73 -999,11 +1006,74 @@@
                        }
                }
  #endif
 +      
 +              {
 +                      /* Grease pencil sculpt and paint cursors */
 +                      if (!DNA_struct_elem_find(fd->filesdna, 
"GP_BrushEdit_Settings", "int", "weighttype")) {
 +                              for (Scene *scene = main->scene.first; scene; 
scene = scene->id.next) {
 +                                      /* sculpt brushes */
 +                                      GP_BrushEdit_Settings *gset = 
&scene->toolsettings->gp_sculpt;
 +                                      if (gset) {
 +                                              gset->alpha = 1.0f;
 +                                              gset->weighttype = 
GP_EDITBRUSH_TYPE_WEIGHT;
 +                                      }
 +                              }
 +                      }
 +
 +                      {
 +                              float curcolor_add[3], curcolor_sub[3];
 +                              ARRAY_SET_ITEMS(curcolor_add, 1.0f, 0.6f, 0.6f);
 +                              ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f);
 +                              GP_EditBrush_Data *gp_brush;
 +
 +                              for (Scene *scene = main->scene.first; scene; 
scene = scene->id.next) {
 +                                      ToolSettings *ts = scene->toolsettings;
 +                                      /* sculpt brushes */
 +                                      GP_BrushEdit_Settings *gset = 
&ts->gp_sculpt;
 +                                      for (int i = 0; i < 
TOT_GP_EDITBRUSH_TYPES; ++i) {
 +                                              gp_brush = &gset->brush[i];
 +                                              gp_brush->flag |= 
GP_EDITBRUSH_FLAG_ENABLE_CURSOR;
 +                                              
copy_v3_v3(gp_brush->curcolor_add, curcolor_add);
 +                                              
copy_v3_v3(gp_brush->curcolor_sub, curcolor_sub);
 +                                      }
 +                              }
 +                      }
 +
 +                      /* Init grease pencil edit line color */
 +                      if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", 
"float", "line_color[4]")) {
 +                              for (bGPdata *gpd = main->gpencil.first; gpd; 
gpd = gpd->id.next) {
 +                                      ARRAY_SET_ITEMS(gpd->line_color, 0.6f, 
0.6f, 0.6f, 0.5f);
 +                              }
 +                      }
 +
 +                      /* Init grease pencil pixel size factor */
 +                      if (!DNA_struct_elem_find(fd->filesdna, "bGPDdata", 
"int", "pixfactor")) {
 +                              for (bGPdata *gpd = main->gpencil.first; gpd; 
gpd = gpd->id.next) {
 +                                      gpd->pixfactor = GP_DEFAULT_PIX_FACTOR;
 +                              }
 +                      }
 +
 +                      /* Grease pencil multiframe falloff curve */
 +                      if (!DNA_struct_elem_find(fd->filesdna, 
"GP_BrushEdit_Settings", "CurveMapping", "cur_falloff")) {
 +                              for (Scene *scene = main->scene.first; scene; 
scene = scene->id.next) {
 +                                      /* sculpt brushes */
 +                                      GP_BrushEdit_Settings *gset = 
&scene->toolsettings->gp_sculpt;
 +                                      if ((gset) && (gset->cur_falloff == 
NULL)) {
 +                                              gset->cur_falloff = 
curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 +                                              
curvemapping_initialize(gset->cur_falloff);
 +                                              
curvemap_reset(gset->cur_falloff->cm,
 +                                                      
&gset->cur_falloff->clipr,
 +                                                      CURVE_PRESET_GAUSS,
 +                                                      
CURVEMAP_SLOPE_POSITIVE);
 +                                      }
 +                              }
 +                      }
 +              }
        }
  
-       if (!MAIN_VERSION_ATLEAST(main, 280, 3)) {
-               for (Scene *scene = main->scene.first; scene; scene = 
scene->id.next) {
+ #ifdef USE_COLLECTION_COMPAT_28
+       if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 3)) {
+               for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
                        ViewLayer *view_layer;
                        for (view_layer = scene->view_layers.first; view_layer; 
view_layer = view_layer->next) {
                                do_version_view_layer_visibility(view_layer);
@@@ -1084,25 -1015,10 +1085,25 @@@
                                
do_version_view_layer_visibility(group->view_layer);
                        }
                }
- 
 -      }
+ #endif
 +              /* init grease pencil grids and paper */
 +              if (!DNA_struct_elem_find(fd->filesdna, "gp_paper_opacity", 
"float", "gpencil_paper_color[3]")) {
-                       for (bScreen *screen = main->screen.first; screen; 
screen = screen->id.next) {
++                      for (bScreen *screen = bmain->screen.first; screen; 
screen = screen->id.next) {
 +                              for (ScrArea *area = screen->areabase.first; 
area; area = area->next) {
 +                                      for (SpaceLink *sl = 
area->spacedata.first; sl; sl = sl->next) {
 +                                              if (sl->spacetype == 
SPACE_VIEW3D) {
 +                                                      View3D *v3d = (View3D 
*)sl;
 +                                                      
v3d->gpencil_grid_size[0] = GP_DEFAULT_GRID_SIZE;
 +                                                      
v3d->gpencil_grid_size[1] = GP_DEFAULT_GRID_SIZE;
 +                                                      
ARRAY_SET_ITEMS(v3d->gpencil_paper_color, 1.0f, 1.0f, 1.0f, 0.7f);
 +                                              }
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
  
-       if (!MAIN_VERSION_ATLEAST(main, 280, 6)) {
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 6)) {
                if (DNA_struct_elem_find(fd->filesdna, "SpaceOops", "int", 
"filter") == false) {
                        bScreen *sc;
                        ScrArea *sa;
@@@ -1206,13 -1120,12 +1205,13 @@@
                                tex->type = 0;
                        }
                }
 +
        }
  
-       if (!MAIN_VERSION_ATLEAST(main, 280, 11)) {
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) {
  
                /* Remove info editor, but only if at the top of the window. */
-               for (bScreen *screen = main->screen.first; screen; screen = 
screen->id.next) {
+               for (bScreen *screen = bmain->screen.first; screen; screen = 
screen->id.next) {
                        /* Calculate window width/height from screen vertices */
                        int win_width = 0, win_height = 0;
                        for (ScrVert *vert = screen->vertbase.first; vert; vert 
= vert->next) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to