From 3c2f0466d80611b5f33f01670383024f08591be3 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 26 Jun 2017 16:12:32 +0200 Subject: [PATCH 1/4] Enable optional jack in install_deps.sh Based on D2578, now you can install JACK audio server and use it in Blender build without having to specify the `--with-all` option (that one still enables also JACK of course). Reviewers: mont29 Maniphest Tasks: T51033 Differential Revision: https://developer.blender.org/D2578 --- build_files/build_environment/install_deps.sh | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 9e256a78a59..3852b4fe705 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -26,7 +26,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,\ -with-all,with-opencollada,\ +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,\ force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\ @@ -118,6 +118,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --with-opencollada Build and install the OpenCOLLADA libraries. + --with-jack + Install the jack libraries. + --ver-ocio= Force version of OCIO library. @@ -507,6 +510,9 @@ while true; do --with-opencollada) WITH_OPENCOLLADA=true; shift; continue ;; + --with-jack) + WITH_JACK=true; shift; continue; + ;; --ver-ocio) OCIO_VERSION="$2" OCIO_VERSION_MIN=$OCIO_VERSION @@ -710,6 +716,9 @@ done if [ "$WITH_ALL" = true -a "$OPENCOLLADA_SKIP" = false ]; then WITH_OPENCOLLADA=true fi +if [ "$WITH_ALL" = true ]; then + WITH_JACK=true +fi WARNING "****WARNING****" @@ -2652,7 +2661,7 @@ install_DEB() { PRINT "" fi - if [ "$WITH_ALL" = true ]; then + if [ "$WITH_JACK" = true ]; then _packages="$_packages libspnav-dev" # Only install jack if jack2 is not already installed! JACK="libjack-dev" @@ -3189,7 +3198,7 @@ install_RPM() { if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then _packages="$_packages freetype-devel tbb-devel" - if [ "$WITH_ALL" = true ]; then + if [ "$WITH_JACK" = true ]; then _packages="$_packages jack-audio-connection-kit-devel" fi @@ -3663,7 +3672,11 @@ install_ARCH() { THEORA_USE=true if [ "$WITH_ALL" = true ]; then - _packages="$_packages jack libspnav" + _packages="$_packages libspnav" + fi + + if [ "$WITH_JACK" = true ]; then + _packages="$_packages jack" fi PRINT "" @@ -4325,6 +4338,14 @@ print_info() { _buildargs="$_buildargs $_1" fi + if [ "$WITH_JACK" = true ]; then + _1="-D WITH_JACK=ON" + _2="-D WITH_JACK_DYNLOAD=ON" + PRINT " $_1" + PRINT " $_2" + _buildargs="$_buildargs $_1 $_2" + fi + if [ "$ALEMBIC_SKIP" = false ]; then _1="-D WITH_ALEMBIC=ON" PRINT " $_1" From d4ca2ec9d5bda7d01203faaf8d271a2d87bf923f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 26 Jun 2017 18:55:30 +0200 Subject: [PATCH 2/4] Fix T51902: Severe problem with relocating linked libraries when using proxies. Fix is a bit ugly, but cannot think of another solution for now, at least this **should** not break anything else. And now I go find myself a very remote, high and lonely mountain, climb to its top, roar "I hate proxies!" a few times, and relax hearing the echos... --- source/blender/blenkernel/BKE_library_query.h | 2 ++ source/blender/blenkernel/BKE_library_remap.h | 5 +++++ source/blender/blenkernel/intern/library_query.c | 3 ++- source/blender/blenkernel/intern/library_remap.c | 5 +++-- source/blender/windowmanager/intern/wm_files_link.c | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/BKE_library_query.h b/source/blender/blenkernel/BKE_library_query.h index 6cf18e28e17..d6e7d98f371 100644 --- a/source/blender/blenkernel/BKE_library_query.h +++ b/source/blender/blenkernel/BKE_library_query.h @@ -83,6 +83,8 @@ enum { IDWALK_NOP = 0, IDWALK_READONLY = (1 << 0), IDWALK_RECURSE = (1 << 1), /* Also implies IDWALK_READONLY. */ + + IDWALK_NO_INDIRECT_PROXY_DATA_USAGE = (1 << 8), /* Ugly special case :(((( */ }; /* Loop over all of the ID's this datablock links to. */ diff --git a/source/blender/blenkernel/BKE_library_remap.h b/source/blender/blenkernel/BKE_library_remap.h index 53d438a0fdd..fd37fd762f4 100644 --- a/source/blender/blenkernel/BKE_library_remap.h +++ b/source/blender/blenkernel/BKE_library_remap.h @@ -46,6 +46,11 @@ enum { /* This tells the callback func to force setting IDs using target one with a 'never NULL' pointer to NULL. * WARNING! Use with extreme care, this will leave database in broken state and can cause crashes very easily! */ ID_REMAP_FORCE_NEVER_NULL_USAGE = 1 << 3, + /* Do not consider proxy/_group pointers of local objects as indirect usages... + * Our oh-so-beloved proxies again... Do not consider data used by local proxy object as indirect usage. + * This is needed e.g. in reload scenario, since we have to ensure remapping of Armature data of local proxy + * is also performed. Usual nightmare... */ + ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE = 1 << 4, }; /* Note: Requiring new_id to be non-null, this *may* not be the case ultimately, but makes things simpler for now. */ diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 931002e6bbc..d1f0c87183d 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -512,7 +512,8 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call /* Object is special, proxies make things hard... */ const int data_cb_flag = data.cb_flag; - const int proxy_cb_flag = (object->proxy || object->proxy_group) ? IDWALK_CB_INDIRECT_USAGE : 0; + const int proxy_cb_flag = ((data.flag & IDWALK_NO_INDIRECT_PROXY_DATA_USAGE) == 0 && (object->proxy || object->proxy_group)) ? + IDWALK_CB_INDIRECT_USAGE : 0; /* object data special case */ data.cb_flag |= proxy_cb_flag; diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 01ad4fb86ce..5e5ba44f039 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -419,6 +419,7 @@ ATTR_NONNULL(1) static void libblock_remap_data( IDRemap id_remap_data; ListBase *lb_array[MAX_LIBARRAY]; int i; + const int foreach_id_flags = (remap_flags & ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE) != 0 ? IDWALK_NO_INDIRECT_PROXY_DATA_USAGE : IDWALK_NOP; if (r_id_remap_data == NULL) { r_id_remap_data = &id_remap_data; @@ -439,7 +440,7 @@ ATTR_NONNULL(1) static void libblock_remap_data( #endif r_id_remap_data->id = id; libblock_remap_data_preprocess(r_id_remap_data); - BKE_library_foreach_ID_link(NULL, id, foreach_libblock_remap_callback, (void *)r_id_remap_data, IDWALK_NOP); + BKE_library_foreach_ID_link(NULL, id, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags); } else { i = set_listbasepointers(bmain, lb_array); @@ -456,7 +457,7 @@ ATTR_NONNULL(1) static void libblock_remap_data( r_id_remap_data->id = id_curr; libblock_remap_data_preprocess(r_id_remap_data); BKE_library_foreach_ID_link( - NULL, id_curr, foreach_libblock_remap_callback, (void *)r_id_remap_data, IDWALK_NOP); + NULL, id_curr, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags); } } } diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 3b733f9558c..f19c999a4f1 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -608,7 +608,8 @@ static void lib_relocate_do( } /* Note that in reload case, we also want to replace indirect usages. */ - const short remap_flags = ID_REMAP_SKIP_NEVER_NULL_USAGE | (do_reload ? 0 : ID_REMAP_SKIP_INDIRECT_USAGE); + const short remap_flags = ID_REMAP_SKIP_NEVER_NULL_USAGE | ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE | + (do_reload ? 0 : ID_REMAP_SKIP_INDIRECT_USAGE); for (item_idx = 0, itemlink = lapp_data->items.list; itemlink; item_idx++, itemlink = itemlink->next) { WMLinkAppendDataItem *item = itemlink->link; ID *old_id = item->customdata; From 5a1bdf2c3a7df5a6bde94e0dbc0e3d4d5618139d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 26 Jun 2017 19:00:45 +0200 Subject: [PATCH 3/4] Add warning that 'purge all' action in Outliner does save to current .blend file. This is a very important, potentially deadly side-effect of this operator. If something goes wrong, it can save a broken .blend file. Ideally we could get rid of that operation anyway, once ID management if fully renewed, but for now would rather keep it around. Related to T51902. --- source/blender/editors/space_outliner/outliner_edit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 335eb95da0e..265a19b9e7e 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1944,7 +1944,7 @@ static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEv { /* present a prompt to informing users that this change is irreversible */ return WM_operator_confirm_message(C, op, - "Purging unused data-blocks cannot be undone. " + "Purging unused data-blocks cannot be undone and saves to current .blend file. " "Click here to proceed..."); } @@ -1966,7 +1966,8 @@ void OUTLINER_OT_orphans_purge(wmOperatorType *ot) /* identifiers */ ot->idname = "OUTLINER_OT_orphans_purge"; ot->name = "Purge All"; - ot->description = "Clear all orphaned data-blocks without any users from the file (cannot be undone)"; + ot->description = "Clear all orphaned data-blocks without any users from the file " + "(cannot be undone, saves to current .blend file)"; /* callbacks */ ot->invoke = outliner_orphans_purge_invoke; From b796ce0f26c1bf206194eb8c004d214806c2828b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Jun 2017 09:50:35 +1000 Subject: [PATCH 4/4] CMake: Only set CMAKE_BUILD_TYPE_INIT when not set Convenience makefile now uses CMAKE_BUILD_TYPE_INIT, this means you can change the build type of an existing build and it won't be overwritten when running `make`. Useful if you want to add debug info to a release build for profiling. --- CMakeLists.txt | 4 +++- GNUmakefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7917278434..04237812d87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform") # avoid having empty buildtype -set(CMAKE_BUILD_TYPE_INIT "Release") +if(NOT DEFINED CMAKE_BUILD_TYPE_INIT) + set(CMAKE_BUILD_TYPE_INIT "Release") +endif() # quiet output for Makefiles, 'make -s' helps too # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) diff --git a/GNUmakefile b/GNUmakefile index 86964e68873..ba7f89c3097 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -104,7 +104,7 @@ endif CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \ -H"$(BLENDER_DIR)" \ -B"$(BUILD_DIR)" \ - -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) + -DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) # -----------------------------------------------------------------------------