Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Tue, 3 Apr 2018 16:12:39 +0000 (18:12 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 3 Apr 2018 16:12:39 +0000 (18:12 +0200)
15 files changed:
1  2 
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/sculpt_paint/paint_image_undo.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_image/image_ops.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index 5184f5cc75765667cfec60bdfa13ac2dfc030a68,ef28dafa8c90469a638eeea2d0eaae50a9fce9a9..e9b6f5a410b1e7dd2ad327568067ff0bf7010c56
@@@ -390,11 -377,34 +379,35 @@@ static void image_undo_invalidate(void
  typedef struct ImageUndoStep {
        UndoStep step;
        ListBase tiles;
+       /* Use for all ID lookups (can be NULL). */
+       struct UndoIDPtrMap *id_map;
  } ImageUndoStep;
  
+ static void image_undosys_step_encode_store_ids(ImageUndoStep *us)
+ {
+       us->id_map = BKE_undosys_ID_map_create();
+       ID *image_prev = NULL;
+       for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) {
+               BKE_undosys_ID_map_add_with_prev(us->id_map, &tile->ima->id, &image_prev);
+       }
+ }
+ /* Restore at runtime. */
+ #if 0
+ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us)
+ {
+       ID *image_prev[2] = {NULL};
+       for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) {
+               tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(us->id_map, &tile->ima->id, image_prev);
+       }
+ }
+ #endif
  static bool image_undosys_poll(bContext *C)
  {
 +      const WorkSpace *workspace = CTX_wm_workspace(C);
        Object *obact = CTX_data_active_object(C);
  
        ScrArea *sa = CTX_wm_area(C);