Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 28 Mar 2017 08:41:10 +0000 (10:41 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 28 Mar 2017 08:41:10 +0000 (10:41 +0200)
Conflicts:
source/blender/blenloader/intern/readfile.c
source/blender/windowmanager/intern/wm_window.c

13 files changed:
1  2 
intern/cycles/blender/addon/ui.py
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_window.h

Simple merge
index efa3e09329fdd6329c76334914f25db60ff46f58,18c4034c0dde29fd3b4e29e8a8c6eb4ba735d0bc..81d72dce3a4fb248ce59b1b736e9e067b86f2cff
@@@ -5670,33 -5660,8 +5670,25 @@@ static bool scene_validate_setscene__li
  }
  #endif
  
 +static void lib_link_scene_collection(FileData *fd, Library *lib, SceneCollection *sc)
 +{
 +      for (LinkData *link = sc->objects.first; link; link = link->next) {
 +              link->data = newlibadr_us(fd, lib, link->data);
 +              BLI_assert(link->data);
 +      }
 +
 +      for (LinkData *link = sc->filter_objects.first; link; link = link->next) {
 +              link->data = newlibadr_us(fd, lib, link->data);
 +              BLI_assert(link->data);
 +      }
 +
 +      for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
 +              lib_link_scene_collection(fd, lib, nsc);
 +      }
 +}
 +
  static void lib_link_scene(FileData *fd, Main *main)
  {
-       Scene *sce;
-       BaseLegacy *base_legacy, *base_legacy_next;
-       Sequence *seq;
-       SceneLayer *sl;
-       SceneRenderLayer *srl;
-       FreestyleModuleConfig *fmc;
-       FreestyleLineSet *fls;
  #ifdef USE_SETSCENE_CHECK
        bool need_check_set = false;
        int totscene = 0;
                        
                        sce->toolsettings->particle.shape_object = newlibadr(fd, sce->id.lib, sce->toolsettings->particle.shape_object);
                        
-                       for (base_legacy = sce->base.first; base_legacy; base_legacy = base_legacy_next) {
 -                      for (Base *next, *base = sce->base.first; base; base = next) {
 -                              next = base->next;
++                      for (BaseLegacy *base_legacy_next, *base_legacy = sce->base.first; base_legacy; base_legacy = base_legacy_next) {
 +                              base_legacy_next = base_legacy->next;
                                
 -                              base->object = newlibadr_us(fd, sce->id.lib, base->object);
 +                              base_legacy->object = newlibadr_us(fd, sce->id.lib, base_legacy->object);
                                
 -                              if (base->object == NULL) {
 +                              if (base_legacy->object == NULL) {
                                        blo_reportf_wrap(fd->reports, RPT_WARNING, TIP_("LIB: object lost from scene: '%s'"),
                                                         sce->id.name + 2);
 -                                      BLI_remlink(&sce->base, base);
 -                                      if (base == sce->basact) sce->basact = NULL;
 -                                      MEM_freeN(base);
 +                                      BLI_remlink(&sce->base, base_legacy);
 +                                      if (base_legacy == sce->basact) sce->basact = NULL;
 +                                      MEM_freeN(base_legacy);
                                }
                        }
                        
                        /* Motion Tracking */
                        sce->clip = newlibadr_us(fd, sce->id.lib, sce->clip);
  
-                       for (sl = sce->render_layers.first; sl; sl = sl->next) {
 +                      lib_link_scene_collection(fd, sce->id.lib, sce->collection);
 +
++                      for (SceneLayer *sl = sce->render_layers.first; sl; sl = sl->next) {
 +                              /* tag scene layer to update for collection tree evaluation */
 +                              sl->flag |= SCENE_LAYER_ENGINE_DIRTY;
 +                              for (Base *base = sl->object_bases.first; base; base = base->next) {
 +                                      /* we only bump the use count for the collection objects */
 +                                      base->object = newlibadr(fd, sce->id.lib, base->object);
 +                                      base->flag |= BASE_DIRTY_ENGINE_SETTINGS;
 +                              }
 +                      }
 +
  #ifdef USE_SETSCENE_CHECK
                        if (sce->set != NULL) {
                                /* link flag for scenes with set would be reset later,
@@@ -7591,7 -7501,9 +7608,9 @@@ static void lib_link_group(FileData *fd
                        if (add_us) {
                                id_us_ensure_real(&group->id);
                        }
 -                      BKE_group_object_unlink(group, NULL, NULL, NULL);       /* removes NULL entries */
 +                      BKE_group_object_unlink(group, NULL);   /* removes NULL entries */
+                       group->id.tag &= ~LIB_TAG_NEED_LINK;
                }
        }
  }
@@@ -8535,8 -8435,8 +8543,9 @@@ static void do_versions_after_linking(M
  {
  //    printf("%s for %s (%s), %d.%d\n", __func__, main->curlib ? main->curlib->name : main->name,
  //           main->curlib ? "LIB" : "MAIN", main->versionfile, main->subversionfile);
        do_versions_after_linking_270(main);
 +      do_versions_after_linking_280(main);
  }
  
  static void lib_link_all(FileData *fd, Main *main)
index b6f1b431009f56da16d44eeac22060c9302bb20d,40baab8809c366bc5f5e7e0064411608887f0e96..49fe3a1d0157c186e447b5556dac79616d1a3e60
  #include "GPU_draw.h"
  #include "GPU_extensions.h"
  #include "GPU_init_exit.h"
 -#include "GPU_glew.h"
 +#include "GPU_immediate.h"
+ #include "BLF_api.h"
  
 +#include "UI_resources.h"
 +
  /* for assert */
  #ifndef NDEBUG
  #  include "BLI_threads.h"
@@@ -918,14 -854,10 +940,13 @@@ void wm_window_make_drawable(wmWindowMa
                if (G.debug & G_DEBUG_EVENTS) {
                        printf("%s: set drawable %d\n", __func__, win->winid);
                }
 +
 +              immDeactivate();
                GHOST_ActivateWindowDrawingContext(win->ghostwin);
 -              
 +              immActivate();
 +
                /* this can change per window */
-               U.pixelsize = wm_window_pixelsize(win);
-               BKE_blender_userdef_refresh();
+               wm_window_set_dpi(win);
        }
  }
  
@@@ -1289,12 -1234,9 +1324,11 @@@ static int ghost_event_proc(GHOST_Event
                        {
                                // only update if the actual pixel size changes
                                float prev_pixelsize = U.pixelsize;
-                               U.pixelsize = wm_window_pixelsize(win);
+                               wm_window_set_dpi(win);
  
                                if (U.pixelsize != prev_pixelsize) {
-                                       BKE_blender_userdef_refresh();
 +                                      BKE_icon_changed(win->screen->id.icon_id);
 +
                                        // close all popups since they are positioned with the pixel
                                        // size baked in and it's difficult to correct them
                                        wmWindow *oldWindow = CTX_wm_window(C);