Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 22 Jun 2018 10:46:16 +0000 (12:46 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 22 Jun 2018 10:46:16 +0000 (12:46 +0200)
Conflicts:
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_space.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/generic/bpy_internal_import.h
source/blender/python/intern/bpy_rna_anim.c
source/blender/python/intern/gpu_offscreen.c

16 files changed:
1  2 
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/library.c
source/blender/editors/mesh/editmesh_bevel.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_space.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/generic/bpy_internal_import.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_anim.c
source/blender/python/intern/gpu_offscreen.c

index e71bd52593e6c3abd6fbd68055cbe5b052e72585,9549eb1de085d73794742af888b7e11b30200596..2570f88d09fe31c2304d4f46d69216d07e38125c
@@@ -93,8 -104,9 +93,9 @@@ static void rna_Image_source_set(Pointe
  
        if (value != ima->source) {
                ima->source = value;
-               BKE_image_signal(G.main, ima, NULL, IMA_SIGNAL_SRC_CHANGE);
+               BLI_assert(BKE_id_is_in_gobal_main(&ima->id));
+               BKE_image_signal(G_MAIN, ima, NULL, IMA_SIGNAL_SRC_CHANGE);
 -              DAG_id_tag_update(&ima->id, 0);
 +              DEG_id_tag_update(&ima->id, 0);
        }
  }
  
index e44e9dc8e195179715b72a2a75be442a927a4a40,11cfdbcaa2282426fdfa51789d9aab6837116e12..da799f9520bacd9c2591aa540d99f655b07ffc51
@@@ -737,8 -715,10 +740,10 @@@ static void rna_Object_active_material_
  {
        Object *ob = (Object *)ptr->id.data;
  
 -      DAG_id_tag_update(value.data, 0);
 +      DEG_id_tag_update(value.data, 0);
-       assign_material(G.main, ob, value.data, ob->actcol, BKE_MAT_ASSIGN_EXISTING);
+       BLI_assert(BKE_id_is_in_gobal_main(&ob->id));
+       BLI_assert(BKE_id_is_in_gobal_main(value.data));
+       assign_material(G_MAIN, ob, value.data, ob->actcol, BKE_MAT_ASSIGN_EXISTING);
  }
  
  static int rna_Object_active_material_editable(PointerRNA *ptr, const char **UNUSED(r_info))
index e30b75b27bd1ac9d21d4afa81c1a403381df5e1c,07a149009eefef008291acdf9cf7dc374cce0fcb..e2d9b833a4dfcf21e9b8835ee4ab11d4fe1b8aa5
@@@ -106,28 -99,20 +106,28 @@@ static void rna_Screen_layout_name_get(
        }
  }
  
 -static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 +static int rna_Screen_layout_name_length(PointerRNA *ptr)
  {
 -      bScreen *screen = (bScreen *)ptr->data;
 +      const bScreen *screen = ptr->data;
 +      const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G.main, screen, NULL);
  
 -      /* the settings for this are currently only available from a menu in the TimeLine, hence refresh=SPACE_TIME */
 -      ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_TIME);
 -}
 +      if (layout) {
 +              const char *name = BKE_workspace_layout_name_get(layout);
 +              return strlen(name);
 +      }
  
 +      return 0;
 +}
  
 -static int rna_Screen_is_animation_playing_get(PointerRNA *UNUSED(ptr))
 +static void rna_Screen_layout_name_set(PointerRNA *ptr, const char *value)
  {
 -      /* can be NULL on file load, T42619 */
 -      wmWindowManager *wm = G_MAIN->wm.first;
 -      return wm ? (ED_screen_animation_playing(wm) != NULL) : 0;
 +      bScreen *screen = ptr->data;
 +      WorkSpace *workspace;
-       WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G.main, screen, &workspace);
++      WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, &workspace);
 +
 +      if (layout) {
 +              BKE_workspace_layout_name_set(workspace, layout, value);
 +      }
  }
  
  static int rna_Screen_fullscreen_get(PointerRNA *ptr)
index 80bf6abc3683e3274204dde018a811aace33c97a,76938bd89717cf3d7537fe3375d27452ebfa0acb..91515a61fcf3673a373eec7fa26383c7ddff2bf3
@@@ -986,11 -837,9 +986,13 @@@ static void rna_SpaceImageEditor_image_
  {
        SpaceImage *sima = (SpaceImage *)(ptr->data);
        bScreen *sc = (bScreen *)ptr->id.data;
-       Scene *scene = ED_screen_scene_find_with_window(sc, G.main->wm.first, &win);
 +      wmWindow *win;
-       ED_space_image_set(G.main, sima, scene, obedit, (Image *)value.data);
++      Scene *scene = ED_screen_scene_find_with_window(sc, G_MAIN->wm.first, &win);
 +      ViewLayer *view_layer = WM_window_get_active_view_layer(win);
 +      Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
 -      ED_space_image_set(G_MAIN, sima, sc->scene, sc->scene->obedit, (Image *)value.data);
+       BLI_assert(BKE_id_is_in_gobal_main(value.data));
++      ED_space_image_set(G_MAIN, sima, scene, obedit, (Image *)value.data);
  }
  
  static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr, PointerRNA value)
index d32b8696c9cab8da3fce21041bc1fd7d83bd17fb,e8474efa31f740f5473116d229eddba5eb9354e5..394adb1dd3bfa320c116719d100d201c852a8829
  #include "BKE_customdata.h"
  #include "BKE_DerivedMesh.h"
  #include "BKE_global.h"
+ #include "BKE_library.h"
  
 +#include "DEG_depsgraph.h"
 +
  #include "bmesh.h"
  
  #include <Python.h>
@@@ -903,8 -903,12 +904,9 @@@ static PyObject *bpy_bmesh_to_mesh(BPy_
  
        bm = self->bm;
  
 -      /* python won't ensure matching uv/mtex */
 -      BM_mesh_cd_validate(bm);
 -
+       BLI_assert(BKE_id_is_in_gobal_main(&me->id));
        BM_mesh_bm_to_me(
-               G.main,  /* XXX UGLY! */
+               G_MAIN,  /* XXX UGLY! */
                bm, me,
                (&(struct BMeshToMeshParams){
                    .calc_object_remap = true,
Simple merge
index 7903f92265be245a1dd8dddfb20d182ce5c910ab,73809e96560878de3748134e7a49a1b966d4b7eb..7012e04628ce053383f96dcb6eb4f6aa253d166d
@@@ -267,13 -267,14 +268,15 @@@ PyObject *pyrna_struct_keyframe_insert(
                return PyBool_FromLong(result);
        }
        else {
+               ID *id = self->ptr.id.data;
 +              struct Depsgraph *depsgraph = CTX_data_depsgraph(BPy_GetContext());
                ReportList reports;
                short result;
  
                BKE_reports_init(&reports, RPT_STORE);
  
-               result = insert_keyframe(G.main, depsgraph, &reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, keytype, options);
+               BLI_assert(BKE_id_is_in_gobal_main(id));
 -              result = insert_keyframe(G_MAIN, &reports, id, NULL, group_name, path_full, index, cfra, keytype, options);
++              result = insert_keyframe(G_MAIN, depsgraph, &reports, id, NULL, group_name, path_full, index, cfra, keytype, options);
                MEM_freeN((void *)path_full);
  
                if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1)