Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 10 Aug 2017 09:14:36 +0000 (11:14 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 10 Aug 2017 09:14:36 +0000 (11:14 +0200)
1  2 
build_files/build_environment/install_deps.sh
source/blender/blenkernel/intern/library.c

index 1c1e9ea151d42ec867984ab163a54ad4cefb1ed6,db2a1246a60d3d125af7e4d544ebec61b642914c..3816ab1aa0f2f4ab3b1ed70775a693373f27ba3b
@@@ -25,7 -25,7 +25,7 @@@
  ARGS=$( \
  getopt \
  -o s:i:t:h \
 ---long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
 +--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
  with-all,with-opencollada,with-jack,\
  ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
  force-all,force-python,force-numpy,force-boost,\
@@@ -104,6 -104,11 +104,6 @@@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENT
      --no-confirm
          Disable any interaction with user (suitable for automated run).
  
 -    --use-cxx11
 -        Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
 -        NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
 -              standard starting from this version).
 -
      --with-all
          By default, a number of optional and not-so-often needed libraries are not installed.
          This option will try to install them, at the cost of potential conflicts (depending on
@@@ -285,7 -290,7 +285,7 @@@ SUDO="sudo
  
  NO_BUILD=false
  NO_CONFIRM=false
 -USE_CXX11=false
 +USE_CXX11=true  # Mandatory in blender2.8
  
  PYTHON_VERSION="3.5.3"
  PYTHON_VERSION_MIN="3.5"
@@@ -496,6 -501,9 +496,6 @@@ while true; d
      --no-confirm)
        NO_CONFIRM=true; shift; continue
      ;;
 -    --use-cxx11)
 -      USE_CXX11=true; shift; continue
 -    ;;
      --with-all)
        WITH_ALL=true; shift; continue
      ;;
@@@ -796,7 -804,7 +796,7 @@@ FFMPEG_SOURCE=( "http://ffmpeg.org/rele
  
  CXXFLAGS_BACK=$CXXFLAGS
  if [ "$USE_CXX11" = true ]; then
 -  WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
 +  WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
  However, if you are experiencing linking errors (also when building Blender itself), please try the following:
      * Re-run this script with '--build-all --force-all' options.
      * Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
@@@ -1591,7 -1599,7 +1591,7 @@@ compile_OIIO() 
    fi
  
    # To be changed each time we make edits that would modify the compiled result!
-   oiio_magic=16
+   oiio_magic=17
    _init_oiio
  
    # Clean install if needed!
        INFO "ILMBASE_HOME=$INST/openexr"
      fi
  
+     # ptex is only needed when nicholas bishop is ready
+     cmake_d="$cmake_d -D USE_PTEX=OFF"
      # Optional tests and cmd tools
      cmake_d="$cmake_d -D USE_QT=OFF"
      cmake_d="$cmake_d -D USE_PYTHON=OFF"
index 4721955af439f4556c6fccba379149b6276fd93b,a1bd410d390eb875495a4e88dd1c5e8c2f57da3d..76b8aa2d446ee2d2170189491751562cc04e4f2b
@@@ -62,7 -62,6 +62,7 @@@
  #include "DNA_mask_types.h"
  #include "DNA_node_types.h"
  #include "DNA_object_types.h"
 +#include "DNA_lightprobe_types.h"
  #include "DNA_scene_types.h"
  #include "DNA_screen_types.h"
  #include "DNA_speaker_types.h"
@@@ -71,7 -70,6 +71,7 @@@
  #include "DNA_vfont_types.h"
  #include "DNA_windowmanager_types.h"
  #include "DNA_world_types.h"
 +#include "DNA_workspace_types.h"
  
  #include "BLI_blenlib.h"
  #include "BLI_utildefines.h"
@@@ -93,6 -91,7 +93,6 @@@
  #include "BKE_cachefile.h"
  #include "BKE_context.h"
  #include "BKE_curve.h"
 -#include "BKE_depsgraph.h"
  #include "BKE_font.h"
  #include "BKE_global.h"
  #include "BKE_group.h"
  #include "BKE_paint.h"
  #include "BKE_particle.h"
  #include "BKE_packedFile.h"
 +#include "BKE_lightprobe.h"
  #include "BKE_sound.h"
  #include "BKE_speaker.h"
  #include "BKE_scene.h"
@@@ -420,9 -418,6 +420,9 @@@ bool id_make_local(Main *bmain, ID *id
                case ID_SPK:
                        if (!test) BKE_speaker_make_local(bmain, (Speaker *)id, lib_local);
                        return true;
 +              case ID_LP:
 +                      if (!test) BKE_lightprobe_make_local(bmain, (LightProbe *)id, lib_local);
 +                      return true;
                case ID_WO:
                        if (!test) BKE_world_make_local(bmain, (World *)id, lib_local);
                        return true;
                case ID_CF:
                        if (!test) BKE_cachefile_make_local(bmain, (CacheFile *)id, lib_local);
                        return true;
 +              case ID_WS:
                case ID_SCR:
 +                      /* A bit special: can be appended but not linked. Return false
 +                       * since supporting make-local doesn't make much sense. */
 +                      return false;
                case ID_LI:
                case ID_KE:
                case ID_WM:
@@@ -586,9 -577,6 +586,9 @@@ bool BKE_id_copy_ex(Main *bmain, const 
                case ID_SPK:
                        BKE_speaker_copy_data(bmain, (Speaker *)*r_newid, (Speaker *)id, flag);
                        break;
 +              case ID_LP:
 +                      BKE_lightprobe_copy_data(bmain, (LightProbe *)*r_newid, (LightProbe *)id, flag);
 +                      break;
                case ID_CA:
                        BKE_camera_copy_data(bmain, (Camera *)*r_newid, (Camera *)id, flag);
                        break;
                case ID_LI:
                case ID_SCR:
                case ID_WM:
 +              case ID_WS:
                case ID_IP:
                        BLI_assert(0);  /* Should have been rejected at start of function! */
                        break;
@@@ -842,8 -829,6 +842,8 @@@ ListBase *which_libbase(Main *mainlib, 
                        return &(mainlib->text);
                case ID_SPK:
                        return &(mainlib->speaker);
 +              case ID_LP:
 +                      return &(mainlib->lightprobe);
                case ID_SO:
                        return &(mainlib->sound);
                case ID_GR:
                        return &(mainlib->paintcurves);
                case ID_CF:
                        return &(mainlib->cachefiles);
 +              case ID_WS:
 +                      return &(mainlib->workspaces);
        }
        return NULL;
  }
@@@ -961,11 -944,11 +961,11 @@@ void BKE_main_lib_objects_recalc_all(Ma
        /* flag for full recalc */
        for (ob = bmain->object.first; ob; ob = ob->id.next) {
                if (ID_IS_LINKED_DATABLOCK(ob)) {
 -                      DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 +                      DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                }
        }
  
 -      DAG_id_type_tag(bmain, ID_OB);
 +      DEG_id_type_tag(bmain, ID_OB);
  }
  
  /**
@@@ -1014,7 -997,6 +1014,7 @@@ int set_listbasepointers(Main *main, Li
        lb[INDEX_ID_BR]  = &(main->brush);
        lb[INDEX_ID_PA]  = &(main->particle);
        lb[INDEX_ID_SPK] = &(main->speaker);
 +      lb[INDEX_ID_LP]  = &(main->lightprobe);
  
        lb[INDEX_ID_WO]  = &(main->world);
        lb[INDEX_ID_MC]  = &(main->movieclip);
        lb[INDEX_ID_OB]  = &(main->object);
        lb[INDEX_ID_LS]  = &(main->linestyle); /* referenced by scenes */
        lb[INDEX_ID_SCE] = &(main->scene);
 +      lb[INDEX_ID_WS]  = &(main->workspaces); /* before wm, so it's freed after it! */
        lb[INDEX_ID_WM]  = &(main->wm);
        lb[INDEX_ID_MSK] = &(main->mask);
        
@@@ -1075,7 -1056,6 +1075,7 @@@ size_t BKE_libblock_get_alloc_info(shor
                CASE_RETURN(ID_VF,  VFont);
                CASE_RETURN(ID_TXT, Text);
                CASE_RETURN(ID_SPK, Speaker);
 +              CASE_RETURN(ID_LP,  LightProbe);
                CASE_RETURN(ID_SO,  bSound);
                CASE_RETURN(ID_GR,  Group);
                CASE_RETURN(ID_AR,  bArmature);
                CASE_RETURN(ID_PAL, Palette);
                CASE_RETURN(ID_PC,  PaintCurve);
                CASE_RETURN(ID_CF,  CacheFile);
 +              CASE_RETURN(ID_WS,  WorkSpace);
        }
        return 0;
  #undef CASE_RETURN
@@@ -1120,23 -1099,21 +1120,21 @@@ void *BKE_libblock_alloc_notest(short t
   */
  void *BKE_libblock_alloc(Main *bmain, short type, const char *name, const int flag)
  {
-       ID *id = NULL;
        BLI_assert((flag & LIB_ID_CREATE_NO_ALLOCATE) == 0);
-       
-       id = BKE_libblock_alloc_notest(type);
  
-       if ((flag & LIB_ID_CREATE_NO_MAIN) != 0) {
-               id->tag |= LIB_TAG_NO_MAIN;
-       }
-       if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0) {
-               id->tag |= LIB_TAG_NO_USER_REFCOUNT;
-       }
+       ID *id = BKE_libblock_alloc_notest(type);
  
        if (id) {
+               if ((flag & LIB_ID_CREATE_NO_MAIN) != 0) {
+                       id->tag |= LIB_TAG_NO_MAIN;
+               }
+               if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0) {
+                       id->tag |= LIB_TAG_NO_USER_REFCOUNT;
+               }
                id->icon_id = 0;
-               *( (short *)id->name) = type;
-               if ((flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0) {
+               *((short *)id->name) = type;
+               if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
                        id->us = 1;
                }
                if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) {
  
                        /* TODO to be removed from here! */
                        if ((flag & LIB_ID_CREATE_NO_DEG_TAG) == 0) {
 -                              DAG_id_type_tag(bmain, type);
 +                              DEG_id_type_tag(bmain, type);
                        }
                }
+               else {
+                       BLI_strncpy(id->name + 2, name, sizeof(id->name) - 2);
+               }
        }
  
        return id;
@@@ -1206,9 -1186,6 +1207,9 @@@ void BKE_libblock_init_empty(ID *id
                case ID_SPK:
                        BKE_speaker_init((Speaker *)id);
                        break;
 +              case ID_LP:
 +                      BKE_lightprobe_init((LightProbe *)id);
 +                      break;
                case ID_CA:
                        BKE_camera_init((Camera *)id);
                        break;
@@@ -1333,7 -1310,7 +1334,7 @@@ void BKE_libblock_copy_ex(Main *bmain, 
        id_copy_animdata(bmain, new_id, (flag & LIB_ID_COPY_ACTIONS) != 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0);
  
        if ((flag & LIB_ID_CREATE_NO_DEG_TAG) == 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0) {
 -              DAG_id_type_tag(bmain, GS(new_id->name));
 +              DEG_id_type_tag(bmain, GS(new_id->name));
        }
  
        *r_newid = new_id;