[Bf-blender-cvs] [97dd7b540f9] fracture_modifier: compile fixes after merge
Martin Felke
noreply at git.blender.org
Sat Aug 12 22:52:24 CEST 2017
Commit: 97dd7b540f98a64c122b7a83cc87c2e1c332e72d
Author: Martin Felke
Date: Sat Aug 12 22:48:47 2017 +0200
Branches: fracture_modifier
https://developer.blender.org/rB97dd7b540f98a64c122b7a83cc87c2e1c332e72d
compile fixes after merge
===================================================================
M build_files/cmake/macros.cmake
M intern/cycles/bvh/bvh_node.cpp
M release/scripts/startup/bl_operators/presets.py
M release/scripts/startup/bl_ui/properties_physics_fracture.py
M release/scripts/startup/bl_ui/properties_physics_rigidbody.py
M source/blender/blenkernel/BKE_blender_version.h
M source/blender/blenkernel/intern/fracture.c
M source/blender/blenkernel/intern/rigidbody.c
M source/blender/depsgraph/intern/depsgraph.cc
M source/blender/editors/object/object_modifier.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/makesdna/DNA_rigidbody_types.h
M source/blender/makesrna/intern/rna_fracture_api.c
M source/blender/makesrna/intern/rna_gpencil.c
M source/blender/modifiers/intern/MOD_boolean_util_bmesh.c
===================================================================
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 320414d6f73..e87c36fb98d 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -491,6 +491,12 @@ function(setup_liblinks
target_link_libraries(${target} ${NDOF_LIBRARIES})
endif()
endif()
+ if(WITH_SYSTEM_GLOG)
+ target_link_libraries(${target} ${GLOG_LIBRARIES})
+ endif()
+ if(WITH_SYSTEM_GFLAGS)
+ target_link_libraries(${target} ${GFLAGS_LIBRARIES})
+ endif()
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
@@ -511,7 +517,8 @@ function(setup_liblinks
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES})
- target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
+ #target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
+ target_link_libraries(${target} ${PLATFORM_LINKLIBS})
endfunction()
@@ -594,6 +601,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_freestyle
bf_ikplugin
bf_modifiers
+ bf_alembic
bf_bmesh
bf_gpu
bf_blenloader
@@ -612,7 +620,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_imbuf_openimageio
bf_imbuf_dds
bf_collada
- bf_alembic
bf_intern_elbeem
bf_intern_memutil
bf_intern_guardedalloc
@@ -657,13 +664,19 @@ function(SETUP_BLENDER_SORTED_LIBS)
extern_rangetree
extern_wcwidth
bf_intern_libmv
- extern_glog
- extern_gflags
extern_sdlew
bf_intern_glew_mx
)
+ if(NOT WITH_SYSTEM_GLOG)
+ list(APPEND BLENDER_SORTED_LIBS extern_glog)
+ endif()
+
+ if(NOT WITH_SYSTEM_GFLAGS)
+ list(APPEND BLENDER_SORTED_LIBS extern_gflags)
+ endif()
+
if(WITH_COMPOSITOR)
# added for opencl compositor
list_insert_before(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_compositor")
@@ -1202,7 +1215,7 @@ function(get_blender_version)
string(LENGTH "${_out_version_char}" _out_version_char_len)
if(NOT _out_version_char_len EQUAL 1)
set(_out_version_char "")
- elseif(NOT ${_out_version_char} MATCHES "[a-z]?")
+ elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
endif()
@@ -1238,17 +1251,6 @@ endfunction()
# hacks to override initial project settings
# these macros must be called directly before/after project(Blender)
macro(blender_project_hack_pre)
- # ----------------
- # MINGW HACK START
- # ignore system set flag, use our own
- # must be before project(...)
- # if the user wants to add their own its ok after first run.
- if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
- set(_reset_standard_libraries OFF)
- else()
- set(_reset_standard_libraries ON)
- endif()
-
# ------------------
# GCC -O3 HACK START
# needed because O3 can cause problems but
@@ -1267,25 +1269,6 @@ endmacro()
macro(blender_project_hack_post)
- # --------------
- # MINGW HACK END
- if(_reset_standard_libraries)
- # Must come after projecINCt(...)
- #
- # MINGW workaround for -ladvapi32 being included which surprisingly causes
- # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
- # with a meaningless stack trace. by overriding this flag we ensure we only
- # have libs we define.
- set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
- set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
- mark_as_advanced(
- CMAKE_C_STANDARD_LIBRARIES
- CMAKE_CXX_STANDARD_LIBRARIES
- )
- endif()
- unset(_reset_standard_libraries)
-
-
# ----------------
# GCC -O3 HACK END
if(_reset_standard_cflags_rel)
@@ -1577,24 +1560,24 @@ macro(openmp_delayload
endmacro()
MACRO(WINDOWS_SIGN_TARGET target)
- if (WITH_WINDOWS_CODESIGN)
- if (!SIGNTOOL_EXE)
+ if(WITH_WINDOWS_CODESIGN)
+ if(!SIGNTOOL_EXE)
error("Codesigning is enabled, but signtool is not found")
else()
- if (WINDOWS_CODESIGN_PFX_PASSWORD)
+ if(WINDOWS_CODESIGN_PFX_PASSWORD)
set(CODESIGNPASSWORD /p ${WINDOWS_CODESIGN_PFX_PASSWORD})
else()
- if ($ENV{PFXPASSWORD})
+ if($ENV{PFXPASSWORD})
set(CODESIGNPASSWORD /p $ENV{PFXPASSWORD})
else()
- message( FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code.")
+ message(FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code.")
endif()
endif()
add_custom_command(TARGET ${target}
- POST_BUILD
- COMMAND ${SIGNTOOL_EXE} sign /f ${WINDOWS_CODESIGN_PFX} ${CODESIGNPASSWORD} $<TARGET_FILE:${target}>
- VERBATIM
- )
+ POST_BUILD
+ COMMAND ${SIGNTOOL_EXE} sign /f ${WINDOWS_CODESIGN_PFX} ${CODESIGNPASSWORD} $<TARGET_FILE:${target}>
+ VERBATIM
+ )
endif()
endif()
ENDMACRO()
diff --git a/intern/cycles/bvh/bvh_node.cpp b/intern/cycles/bvh/bvh_node.cpp
index 048f9e987dd..4237c62ab5b 100644
--- a/intern/cycles/bvh/bvh_node.cpp
+++ b/intern/cycles/bvh/bvh_node.cpp
@@ -190,19 +190,6 @@ void BVHNode::update_time()
}
}
-void BVHNode::update_time()
-{
- if(!is_leaf()) {
- InnerNode *inner = (InnerNode*)this;
- BVHNode *child0 = inner->children[0];
- BVHNode *child1 = inner->children[1];
- child0->update_time();
- child1->update_time();
- m_time_from = min(child0->m_time_from, child1->m_time_from);
- m_time_to = max(child0->m_time_to, child1->m_time_to);
- }
-}
-
/* Inner Node */
void InnerNode::print(int depth) const
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index d4f5639fd76..679e0a7c1df 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -790,6 +790,7 @@ classes = (
AddPresetCamera,
AddPresetCloth,
AddPresetFluid,
+ AddPresetFracture,
AddPresetHairDynamics,
AddPresetInteraction,
AddPresetInterfaceTheme,
diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py b/release/scripts/startup/bl_ui/properties_physics_fracture.py
index 1fd6b1021e3..463a609d384 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -289,5 +289,15 @@ class PHYSICS_PT_fracture_utilities(PhysicButtonsPanel, Panel):
col.operator("object.rigidbody_convert_to_objects", text = "Convert To Objects")
col.operator("object.rigidbody_convert_to_keyframes", text = "Convert To Keyframed Objects")
+classes = (
+ FRACTURE_MT_presets,
+ FRACTURE_UL_fracture_settings,
+ PHYSICS_PT_fracture,
+ PHYSICS_PT_fracture_simulation,
+ PHYSICS_PT_fracture_utilities,
+)
+
if __name__ == "__main__": # only for live edit.
- bpy.utils.register_module(__name__)
+ from bpy.utils import register_class
+ for cls in classes:
+ register_class(cls)
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
index de5d5edd2ca..610746d7213 100644
--- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -171,6 +171,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
classes = (
PHYSICS_PT_rigid_body,
+ PHYSICS_PT_rigid_body_trigger_advanced,
PHYSICS_PT_rigid_body_collisions,
PHYSICS_PT_rigid_body_dynamics,
)
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index cc0cd28bd7e..553748d920e 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -35,7 +35,7 @@
/* used by packaging tools */
/* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR c
+#define BLENDER_VERSION_CHAR rc
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE release
diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index c8401d94583..055848c35d3 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -236,6 +236,93 @@ bool BKE_fracture_shard_center_median(Shard *shard, float cent[3])
return (shard->totvert != 0);
}
+/* copied from mesh_evaluate.c */
+/**
+ * Calculate the volume and volume-weighted centroid of the volume formed by the polygon and the origin.
+ * Results will be negative if the origin is "outside" the polygon
+ * (+ve normal side), but the polygon may be non-planar with no effect.
+ *
+ * Method from:
+ * - http://forums.cgsociety.org/archive/index.php?t-756235.html
+ * - http://www.globalspec.com/reference/52702/203279/4-8-the-centroid-of-a-tetrahedron
+ *
+ * \note volume is 6x actual volume, and centroid is 4x actual volume-weighted centroid
+ * (so division can be done once at the end)
+ * \note results will have bias if polygon is non-planar.
+ */
+static float mesh_calc_poly_volume_and_weighted_centroid(
+ const MPoly *mpoly, const MLoop *loopstart, const MVert *mvarray,
+ float r_cent[3])
+{
+ const float *v_pivot, *v_step1;
+ float total_volume = 0.0f;
+
+ zero_v3(r_cent);
+
+ v_pivot = mvarray[loopstart[0].v].co;
+ v_step1 = mvarray[loopstart[1].v].co;
+
+ for (int i = 2; i < mpoly->totloop; i++) {
+ const float *v_step2 = mvarray[loopstart[i].v].co;
+
+ /* Calculate the 6x volume of the tetrahedron formed by the 3 vertices
+ * of the triangle and the origin as the fourth vertex */
+ float v_cross[3];
+ cross_v3_v3v3(v_cross, v_pivot, v_step1);
+ const float tetra_volume = dot_v3v3 (v_cross, v_step2);
+ total_volume += tetra_volume;
+
+ /* Calculate the centroid of the tetrahedron formed by the 3 vertices
+ * of the triangle and the origin as the fourth vertex.
+ * The centroid is simply the average of the 4 vertices.
+ *
+ * Note that the vector is 4x the actual centroid so the division can be done once at the end. */
+ for (uint j = 0; j < 3; j++) {
+ r_cent[j] += tetra_volume * (v_pivot[j] + v_step1[j] + v_step2[j]);
+ }
+
+ v_step1 = v_step2;
+ }
+
+ return total_volume;
+}
+
+/* modified fro
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list