Commit: 073d6d07e45a9940470fa1a9cd28ba55ddd8f14b
Author: Antonio Vazquez
Date:   Wed Feb 28 18:28:38 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB073d6d07e45a9940470fa1a9cd28ba55ddd8f14b

Merge branch 'blender2.8' into greasepencil-object

 Conflicts:
        source/blender/blenkernel/intern/scene.c
        source/blender/editors/object/object_select.c

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



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

diff --cc source/blender/blenkernel/intern/scene.c
index 514ef0a2cbd,512ce79e21c..396d3478e63
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@@ -151,6 -151,83 +151,89 @@@ static void remove_sequencer_fcurves(Sc
        }
  }
  
+ /* flag -- copying options (see BKE_library.h's LIB_ID_COPY_... flags for 
more). */
+ ToolSettings *BKE_toolsettings_copy(ToolSettings *toolsettings, const int 
flag)
+ {
+       if (toolsettings == NULL) {
+               return NULL;
+       }
+       ToolSettings *ts = MEM_dupallocN(toolsettings);
+       if (ts->vpaint) {
+               ts->vpaint = MEM_dupallocN(ts->vpaint);
+               BKE_paint_copy(&ts->vpaint->paint, &ts->vpaint->paint, flag);
+       }
+       if (ts->wpaint) {
+               ts->wpaint = MEM_dupallocN(ts->wpaint);
+               BKE_paint_copy(&ts->wpaint->paint, &ts->wpaint->paint, flag);
+       }
+       if (ts->sculpt) {
+               ts->sculpt = MEM_dupallocN(ts->sculpt);
+               BKE_paint_copy(&ts->sculpt->paint, &ts->sculpt->paint, flag);
+       }
+       if (ts->uvsculpt) {
+               ts->uvsculpt = MEM_dupallocN(ts->uvsculpt);
+               BKE_paint_copy(&ts->uvsculpt->paint, &ts->uvsculpt->paint, 
flag);
+       }
+ 
+       BKE_paint_copy(&ts->imapaint.paint, &ts->imapaint.paint, flag);
+       ts->imapaint.paintcursor = NULL;
+       ts->particle.paintcursor = NULL;
+       ts->particle.scene = NULL;
+       ts->particle.object = NULL;
+ 
+       /* duplicate Grease Pencil Drawing Brushes */
+       BLI_listbase_clear(&ts->gp_brushes);
+       for (bGPDbrush *brush = toolsettings->gp_brushes.first; brush; brush = 
brush->next) {
+               bGPDbrush *newbrush = BKE_gpencil_brush_duplicate(brush);
+               BLI_addtail(&ts->gp_brushes, newbrush);
+       }
+ 
+       /* duplicate Grease Pencil interpolation curve */
+       ts->gp_interpolate.custom_ipo = 
curvemapping_copy(ts->gp_interpolate.custom_ipo);
++      /* duplicate Grease Pencil multiframe fallof */
++      ts->gp_sculpt.cur_falloff = 
curvemapping_copy(ts->gp_sculpt.cur_falloff);
+       return ts;
+ }
+ 
+ void BKE_toolsettings_free(ToolSettings *toolsettings)
+ {
+       if (toolsettings == NULL) {
+               return;
+       }
+       if (toolsettings->vpaint) {
+               BKE_paint_free(&toolsettings->vpaint->paint);
+               MEM_freeN(toolsettings->vpaint);
+       }
+       if (toolsettings->wpaint) {
+               BKE_paint_free(&toolsettings->wpaint->paint);
+               MEM_freeN(toolsettings->wpaint);
+       }
+       if (toolsettings->sculpt) {
+               BKE_paint_free(&toolsettings->sculpt->paint);
+               MEM_freeN(toolsettings->sculpt);
+       }
+       if (toolsettings->uvsculpt) {
+               BKE_paint_free(&toolsettings->uvsculpt->paint);
+               MEM_freeN(toolsettings->uvsculpt);
+       }
+       BKE_paint_free(&toolsettings->imapaint.paint);
+ 
+       /* free Grease Pencil Drawing Brushes */
+       BKE_gpencil_free_brushes(&toolsettings->gp_brushes);
+       BLI_freelistN(&toolsettings->gp_brushes);
+ 
+       /* free Grease Pencil interpolation curve */
+       if (toolsettings->gp_interpolate.custom_ipo) {
+               curvemapping_free(toolsettings->gp_interpolate.custom_ipo);
+       }
++      /* free Grease Pencil multiframe falloff curve */
++      if (sce->toolsettings->gp_sculpt.cur_falloff) {
++              curvemapping_free(sce->toolsettings->gp_sculpt.cur_falloff);
++      }
+ 
+       MEM_freeN(toolsettings);
+ }
+ 
  /**
   * Only copy internal data of Scene ID from source to already 
allocated/initialized destination.
   * You probably nerver want to use that directly, use id_copy or 
BKE_id_copy_ex for typical needs.

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

Reply via email to