diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-03-18 18:05:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-03-18 18:05:02 +0300 |
commit | e95282e783f2cebb700c354ad181dd5efce50d04 (patch) | |
tree | c775ea102783f363b90469f2cf5ba2bad1da4f79 | |
parent | 4a3d94c0734d1475aa9a2fbe89039fbc59c9fb8d (diff) | |
parent | 0301df40e5b6c51575d7f9013a1a28b901063829 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/boost.cmake | 4 | ||||
-rw-r--r-- | build_files/build_environment/patches/boost.diff | 15 | ||||
-rw-r--r-- | build_files/cmake/config/blender_lite.cmake | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 83 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rigidbody.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_smoke.c | 1 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 8 |
11 files changed, 88 insertions, 42 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bfff781e922..d45cfefcb78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1461,6 +1461,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") "/wd4267" # conversion from 'size_t' to 'type', possible loss of data "/wd4305" # truncation from 'type1' to 'type2' "/wd4800" # forcing value to bool 'true' or 'false' + "/wd4828" # The file contains a character that is illegal # errors: "/we4013" # 'function' undefined; assuming extern returning int "/we4133" # incompatible pointer types diff --git a/build_files/build_environment/cmake/boost.cmake b/build_files/build_environment/cmake/boost.cmake index 2c6bf195e07..46840b7ead4 100644 --- a/build_files/build_environment/cmake/boost.cmake +++ b/build_files/build_environment/cmake/boost.cmake @@ -53,17 +53,20 @@ if(WIN32) if(BUILD_MODE STREQUAL Release) set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_60/ ${HARVEST_TARGET}/boost/include/) endif() + set(BOOST_PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/boost/src/external_boost < ${PATCH_DIR}/boost.diff) elseif(APPLE) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_BUILD_COMMAND ./bjam) set(BOOST_BUILD_OPTIONS toolset=clang cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} --disable-icu boost.locale.icu=off) set(BOOST_HARVEST_CMD echo .) + set(BOOST_PATCH_COMMAND echo .) else() set(BOOST_HARVEST_CMD echo .) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_BUILD_COMMAND ./bjam) set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off) + set(BOOST_PATCH_COMMAND echo .) endif() set(BOOST_OPTIONS @@ -96,6 +99,7 @@ ExternalProject_Add(external_boost URL_HASH MD5=${BOOST_MD5} PREFIX ${BUILD_DIR}/boost UPDATE_COMMAND "" + PATCH_COMMAND ${BOOST_PATCH_COMMAND} CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND} BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} variant=${BOOST_BUILD_TYPE} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install BUILD_IN_SOURCE 1 diff --git a/build_files/build_environment/patches/boost.diff b/build_files/build_environment/patches/boost.diff new file mode 100644 index 00000000000..ea3ec035518 --- /dev/null +++ b/build_files/build_environment/patches/boost.diff @@ -0,0 +1,15 @@ +--- a/boost/config/compiler/visualc.hpp 2015-12-08 11:55:19 -0700 ++++ b/boost/config/compiler/visualc.hpp 2018-03-17 10:29:52 -0600 +@@ -287,12 +287,3 @@ + # define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) + #endif + +-// +-// last known and checked version is 19.00.23026 (VC++ 2015 RTM): +-#if (_MSC_VER > 1900) +-# if defined(BOOST_ASSERT_CONFIG) +-# error "Unknown compiler version - please run the configure tests and report the results" +-# else +-# pragma message("Unknown compiler version - please run the configure tests and report the results") +-# endif +-#endif diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake index 7db26c3f7c0..1a5e6a3158a 100644 --- a/build_files/cmake/config/blender_lite.cmake +++ b/build_files/cmake/config/blender_lite.cmake @@ -9,6 +9,7 @@ set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE) set(WITH_SYSTEM_GLEW ON CACHE BOOL "" FORCE) set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE) +set(WITH_BOOST OFF CACHE BOOL "" FORCE) set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE) set(WITH_BULLET OFF CACHE BOOL "" FORCE) set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE) @@ -54,4 +55,3 @@ set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE) set(WITH_SDL OFF CACHE BOOL "" FORCE) set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE) set(WITH_X11_XF86VMODE OFF CACHE BOOL "" FORCE) - diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index c1187fdd8bb..06e8ade68a2 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -856,9 +856,8 @@ static void non_recursive_bvh_div_nodes_task_cb( else { break; } - - parent->totnode = (char)(k + 1); } + parent->totnode = (char)k; } /** diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 2e75276cd8f..fd5beac9cc6 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -560,12 +560,10 @@ int join_mesh_exec(bContext *C, wmOperator *op) if (ma) id_us_min(&ma->id); } - if (ob->mat) MEM_freeN(ob->mat); - if (ob->matbits) MEM_freeN(ob->matbits); - if (me->mat) MEM_freeN(me->mat); - ob->mat = me->mat = NULL; - ob->matbits = NULL; - + MEM_SAFE_FREE(ob->mat); + MEM_SAFE_FREE(ob->matbits); + MEM_SAFE_FREE(me->mat); + if (totcol) { me->mat = matar; ob->mat = MEM_callocN(sizeof(*ob->mat) * totcol, "join obmatar"); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index b973e0f27ee..466a01a7271 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -723,11 +723,11 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS); RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges"); - /* cache */ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "pointcache"); + RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); /* is cache used */ diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4a89ca001ac..649cb523e92 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -772,31 +772,8 @@ static const EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), Poi #else -/* ptcache.point_caches */ -static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop) +static void rna_def_pointcache_common(StructRNA *srna) { - StructRNA *srna; - PropertyRNA *prop; - - /* FunctionRNA *func; */ - /* PropertyRNA *parm; */ - - RNA_def_property_srna(cprop, "PointCaches"); - srna = RNA_def_struct(brna, "PointCaches", NULL); - RNA_def_struct_sdna(srna, "PointCache"); - RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches"); - - prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", - "rna_Cache_active_point_cache_index_set", - "rna_Cache_active_point_cache_index_range"); - RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); - RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); -} - -static void rna_def_pointcache(BlenderRNA *brna) -{ - StructRNA *srna; PropertyRNA *prop; static const EnumPropertyItem point_cache_compress_items[] = { @@ -806,16 +783,12 @@ static void rna_def_pointcache(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "PointCache", NULL); - RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations"); - RNA_def_struct_ui_icon(srna, ICON_PHYSICS); - prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "startframe"); RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1); RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts"); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "endframe"); RNA_def_property_range(prop, 1, MAXFRAME); @@ -896,13 +869,59 @@ static void rna_def_pointcache(BlenderRNA *brna) "Use this file's path for the disk cache when library linked into another file " "(for local bakes per scene file, disable this option)"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); +} + +static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* FunctionRNA *func; */ + /* PropertyRNA *parm; */ + + RNA_def_property_srna(cprop, "PointCaches"); + srna = RNA_def_struct(brna, "PointCaches", NULL); + RNA_def_struct_sdna(srna, "PointCache"); + RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches"); + + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", + "rna_Cache_active_point_cache_index_set", + "rna_Cache_active_point_cache_index_range"); + RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); + + /* And define another RNA type for those collection items. */ + srna = RNA_def_struct(brna, "PointCacheItem", NULL); + RNA_def_struct_sdna(srna, "PointCache"); + RNA_def_struct_ui_text(srna, "Point Cache", "point cache for physics simulations"); + RNA_def_struct_ui_icon(srna, ICON_PHYSICS); + + rna_def_pointcache_common(srna); +} + +static void rna_def_pointcache_active(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "PointCache", NULL); + RNA_def_struct_ui_text(srna, "Active Point Cache", "Active point cache for physics simulations"); + RNA_def_struct_ui_icon(srna, ICON_PHYSICS); + + rna_def_pointcache_common(srna); + /* This first-level RNA pointer also has list of all caches from owning ID. + * Those caches items have exact same content as 'active' one, except for that collection, + * to prevent ugly recursive layout pattern. + * Note: This shall probably be redone from scratch in a proper way at some poitn, but for now that will do, + * and shall not break anything in the API. */ prop = RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); - RNA_def_property_struct_type(prop, "PointCache"); - RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list"); + RNA_def_property_struct_type(prop, "PointCacheItem"); + RNA_def_property_ui_text(prop, "Point Cache List", ""); rna_def_ptcache_point_caches(brna, prop); } @@ -1882,7 +1901,7 @@ static void rna_def_softbody(BlenderRNA *brna) void RNA_def_object_force(BlenderRNA *brna) { - rna_def_pointcache(brna); + rna_def_pointcache_active(brna); rna_def_collision(brna); rna_def_effector_weight(brna); rna_def_field(brna); diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index bc85e9c6503..ae325651a31 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -802,6 +802,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "pointcache"); + RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); /* effector weights */ diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index a49c71fc54b..8fe97885f49 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -624,6 +624,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); + RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 924e46a8c00..cc6a5367895 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -1710,10 +1710,18 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args) /* TODO, different sized matrix */ if (self->num_col == 4 && self->num_row == 4) { +#ifdef MATH_STANDALONE + blend_m4_m4m4((float (*)[4])mat, (float (*)[4])self->matrix, (float (*)[4])mat2->matrix, fac); +#else interp_m4_m4m4((float (*)[4])mat, (float (*)[4])self->matrix, (float (*)[4])mat2->matrix, fac); +#endif } else if (self->num_col == 3 && self->num_row == 3) { +#ifdef MATH_STANDALONE + blend_m3_m3m3((float (*)[3])mat, (float (*)[3])self->matrix, (float (*)[3])mat2->matrix, fac); +#else interp_m3_m3m3((float (*)[3])mat, (float (*)[3])self->matrix, (float (*)[3])mat2->matrix, fac); +#endif } else { PyErr_SetString(PyExc_ValueError, |