Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Feb 2018 13:54:51 +0000 (14:54 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Feb 2018 13:54:51 +0000 (14:54 +0100)
1  2 
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/intern/scene.c

Simple merge
index f263f23fb920df5e8db6dc62353027f470131ec6,9b3299bdbc5bd9594f4913ed290329142a77ec3e..512ce79e21ca1bb157390b1b641b9d8e030bcb79
@@@ -296,8 -331,7 +339,7 @@@ Scene *BKE_scene_copy(Main *bmain, Scen
        /* TODO this should/could most likely be replaced by call to more generic code at some point...
         * But for now, let's keep it well isolated here. */
        if (type == SCE_COPY_EMPTY) {
-               ToolSettings *ts;
 -              ListBase rl, rv;
 +              ListBase rv;
  
                sce_copy = BKE_scene_add(bmain, sce->id.name + 2);
  
@@@ -489,43 -490,27 +492,14 @@@ void BKE_scene_free_ex(Scene *sce, cons
                sce->r.ffcodecdata.properties = NULL;
        }
  
 -      for (srl = sce->r.layers.first; srl; srl = srl->next) {
 -              if (srl->prop != NULL) {
 -                      IDP_FreeProperty(srl->prop);
 -                      MEM_freeN(srl->prop);
 -              }
 -              BKE_freestyle_config_free(&srl->freestyleConfig);
 -      }
 -
        BLI_freelistN(&sce->markers);
 -      BLI_freelistN(&sce->transform_spaces);
 -      BLI_freelistN(&sce->r.layers);
        BLI_freelistN(&sce->r.views);
        
-       if (sce->toolsettings) {
-               if (sce->toolsettings->vpaint) {
-                       BKE_paint_free(&sce->toolsettings->vpaint->paint);
-                       MEM_freeN(sce->toolsettings->vpaint);
-               }
-               if (sce->toolsettings->wpaint) {
-                       BKE_paint_free(&sce->toolsettings->wpaint->paint);
-                       MEM_freeN(sce->toolsettings->wpaint);
-               }
-               if (sce->toolsettings->sculpt) {
-                       BKE_paint_free(&sce->toolsettings->sculpt->paint);
-                       MEM_freeN(sce->toolsettings->sculpt);
-               }
-               if (sce->toolsettings->uvsculpt) {
-                       BKE_paint_free(&sce->toolsettings->uvsculpt->paint);
-                       MEM_freeN(sce->toolsettings->uvsculpt);
-               }
-               BKE_paint_free(&sce->toolsettings->imapaint.paint);
-               
-               /* free Grease Pencil Drawing Brushes */
-               BKE_gpencil_free_brushes(&sce->toolsettings->gp_brushes);
-               BLI_freelistN(&sce->toolsettings->gp_brushes);
-               
-               /* free Grease Pencil interpolation curve */
-               if (sce->toolsettings->gp_interpolate.custom_ipo) {
-                       curvemapping_free(sce->toolsettings->gp_interpolate.custom_ipo);
-               }
-               
-               MEM_freeN(sce->toolsettings);
-               sce->toolsettings = NULL;
-       }
+       BKE_toolsettings_free(sce->toolsettings);
+       sce->toolsettings = NULL;
        
 -      DAG_scene_free(sce);
 -      if (sce->depsgraph)
 -              DEG_graph_free(sce->depsgraph);
 -      
 -      MEM_SAFE_FREE(sce->stats);
 +      BKE_scene_free_depsgraph_hash(sce);
 +
        MEM_SAFE_FREE(sce->fps_info);
  
        BKE_sound_destroy_scene(sce);