Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-01 12:20:57 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-01 12:20:57 +0300
commit3cae7df33f406e4d6430a831209de6f3c0dcb5c8 (patch)
tree411ad565e104ea2c362424dcf2e66b7eb9964b99
parent39fd500965940f99610fc73bce776abd4d2dd63c (diff)
parent6119f3cad1707401466c59f8e90aed9c790d6ac9 (diff)
Merge branch 'master' into greasepencil-edit-curve
-rw-r--r--CMakeLists.txt2
-rw-r--r--build_files/build_environment/CMakeLists.txt1
-rw-r--r--build_files/build_environment/cmake/gmp.cmake88
-rw-r--r--build_files/build_environment/cmake/harvest.cmake2
-rw-r--r--build_files/build_environment/cmake/versions.cmake4
-rw-r--r--build_files/build_environment/patches/cmakelists_gmpxx.txt22
-rw-r--r--build_files/build_environment/patches/config_gmpxx.h668
-rw-r--r--build_files/cmake/Modules/FindGMP.cmake96
-rw-r--r--build_files/cmake/Modules/GTest.cmake550
-rw-r--r--build_files/cmake/Modules/GTestAddTests.cmake191
-rw-r--r--build_files/cmake/config/blender_full.cmake1
-rw-r--r--build_files/cmake/config/blender_lite.cmake1
-rw-r--r--build_files/cmake/config/blender_release.cmake1
-rw-r--r--build_files/cmake/platform/platform_apple.cmake8
-rw-r--r--build_files/cmake/platform/platform_unix.cmake8
-rw-r--r--build_files/cmake/platform/platform_win32.cmake11
-rw-r--r--intern/cycles/blender/blender_shader.cpp4
-rw-r--r--intern/cycles/blender/blender_util.h6
-rw-r--r--intern/ghost/intern/GHOST_ContextEGL.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp2
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h2
-rw-r--r--intern/guardedalloc/intern/leak_detector.cc2
-rw-r--r--intern/mantaflow/extern/manta_fluid_API.h17
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp528
-rw-r--r--intern/mantaflow/intern/MANTA_main.h168
-rw-r--r--intern/mantaflow/intern/manta_fluid_API.cpp93
-rw-r--r--intern/sky/include/sky_model.h8
-rw-r--r--source/blender/blenkernel/BKE_colortools.h2
-rw-r--r--source/blender/blenkernel/BKE_curveprofile.h2
-rw-r--r--source/blender/blenkernel/BKE_particle.h2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c2
-rw-r--r--source/blender/blenkernel/intern/armature_update.c2
-rw-r--r--source/blender/blenkernel/intern/brush.c12
-rw-r--r--source/blender/blenkernel/intern/colortools.c2
-rw-r--r--source/blender/blenkernel/intern/curveprofile.c10
-rw-r--r--source/blender/blenkernel/intern/fluid.c34
-rw-r--r--source/blender/blenkernel/intern/gpencil_curve.c2
-rw-r--r--source/blender/blenkernel/intern/image.c14
-rw-r--r--source/blender/blenkernel/intern/layer.c2
-rw-r--r--source/blender/blenkernel/intern/light.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c4
-rw-r--r--source/blender/blenkernel/intern/particle.c6
-rw-r--r--source/blender/blenkernel/intern/particle_system.c10
-rw-r--r--source/blender/blenkernel/intern/scene.c6
-rw-r--r--source/blender/blenkernel/intern/seqmodifier.c4
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c40
-rw-r--r--source/blender/blenlib/BLI_dial_2d.h4
-rw-r--r--source/blender/blenlib/intern/BLI_dial_2d.c2
-rw-r--r--source/blender/blenlib/intern/session_uuid.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c12
-rw-r--r--source/blender/blenloader/intern/versioning_250.c8
-rw-r--r--source/blender/blenloader/intern/versioning_260.c2
-rw-r--r--source/blender/blenloader/intern/versioning_270.c2
-rw-r--r--source/blender/blenloader/intern/versioning_280.c14
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c6
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c2
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c4
-rw-r--r--source/blender/compositor/nodes/COM_TimeNode.cpp2
-rw-r--r--source/blender/compositor/operations/COM_CurveBaseOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_SunBeamsOperation.cpp2
-rw-r--r--source/blender/draw/CMakeLists.txt7
-rw-r--r--source/blender/editors/animation/anim_filter.c2
-rw-r--r--source/blender/editors/armature/pose_slide.c12
-rw-r--r--source/blender/editors/curve/editcurve.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c2
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c18
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c20
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_weight_paint.c16
-rw-r--r--source/blender/editors/include/ED_screen.h6
-rw-r--r--source/blender/editors/interface/interface_region_hud.c2
-rw-r--r--source/blender/editors/interface/interface_region_popup.c2
-rw-r--r--source/blender/editors/interface/interface_region_search.c2
-rw-r--r--source/blender/editors/interface/interface_region_tooltip.c2
-rw-r--r--source/blender/editors/interface/view2d.c6
-rw-r--r--source/blender/editors/interface/view2d_ops.c2
-rw-r--r--source/blender/editors/object/object_add.c2
-rw-r--r--source/blender/editors/object/object_bake_api.c4
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/render/render_opengl.c6
-rw-r--r--source/blender/editors/screen/area.c52
-rw-r--r--source/blender/editors/screen/screen_edit.c4
-rw-r--r--source/blender/editors/screen/screen_ops.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c10
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_cloth.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_face_set.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_paint_color.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_pose.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c2
-rw-r--r--source/blender/editors/space_clip/space_clip.c22
-rw-r--r--source/blender/editors/space_file/space_file.c4
-rw-r--r--source/blender/editors/space_graph/graph_edit.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c4
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c14
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c2
-rw-r--r--source/blender/editors/transform/transform_convert_gpencil.c2
-rw-r--r--source/blender/editors/transform/transform_convert_mesh.c21
-rw-r--r--source/blender/editors/uvedit/uvedit_select.c83
-rw-r--r--source/blender/freestyle/FRS_freestyle.h2
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Freestyle.cpp2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c2
-rw-r--r--source/blender/gpu/GPU_init_exit.h2
-rw-r--r--source/blender/gpu/intern/gpu_init_exit.c2
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc2
-rw-r--r--source/blender/ikplugin/BIK_api.h2
-rw-r--r--source/blender/ikplugin/intern/ikplugin_api.c2
-rw-r--r--source/blender/imbuf/intern/colormanagement.c2
-rw-r--r--source/blender/imbuf/intern/jp2.c4
-rw-r--r--source/blender/imbuf/intern/stereoimbuf.c12
-rw-r--r--source/blender/io/usd/tests/usd_stage_creation_test.cc4
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h2
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h4
-rw-r--r--source/blender/makesdna/intern/makesdna.c2
-rw-r--r--source/blender/makesrna/intern/makesrna.c2
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_curveprofile.c2
-rw-r--r--source/blender/makesrna/intern/rna_fluid.c9
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_screen.c2
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c2
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c2
-rw-r--r--source/blender/nodes/intern/node_util.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_curves.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_curves.c2
-rw-r--r--source/blender/python/gpu/gpu_py_api.c4
-rw-r--r--source/blender/python/gpu/gpu_py_api.h6
-rw-r--r--source/blender/render/intern/source/pipeline.c25
-rw-r--r--source/blender/render/intern/source/pointdensity.c2
-rw-r--r--source/blender/windowmanager/intern/wm.c12
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
-rw-r--r--source/creator/CMakeLists.txt17
-rw-r--r--source/creator/creator.c8
-rw-r--r--tests/gtests/blenloader/blendfile_loading_base_test.h2
-rw-r--r--tests/gtests/runner/BlenderAddTests.cmake3
-rw-r--r--tests/gtests/runner/CMakeLists.txt19
-rw-r--r--tests/gtests/testing/testing_main.cc2
158 files changed, 2524 insertions, 790 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc4d4e032af..cd518227e27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,6 +214,8 @@ if(WITH_GHOST_X11)
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
endif()
+option(WITH_GMP "Use the gmp library for more accurate booleans" OFF)
+
# Misc...
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
mark_as_advanced(WITH_HEADLESS)
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index 276311fe2d8..c26b90637c3 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -117,6 +117,7 @@ if(WIN32)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
+ include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)
diff --git a/build_files/build_environment/cmake/gmp.cmake b/build_files/build_environment/cmake/gmp.cmake
new file mode 100644
index 00000000000..40d8e04b3a7
--- /dev/null
+++ b/build_files/build_environment/cmake/gmp.cmake
@@ -0,0 +1,88 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(GMP_EXTRA_ARGS -enable-cxx)
+
+if(WIN32)
+ # Shared for windows because static libs will drag in a libgcc dependency.
+ set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
+else()
+ set(GMP_OPTIONS --enable-static --disable-shared )
+endif()
+
+ExternalProject_Add(external_gmp
+ URL ${GMP_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GMP_HASH}
+ PREFIX ${BUILD_DIR}/gmp
+ CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
+ BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
+ INSTALL_DIR ${LIBDIR}/gmp
+)
+
+if(MSVC)
+ set_target_properties(external_gmp PROPERTIES FOLDER Mingw)
+endif()
+
+if(BUILD_MODE STREQUAL Release AND WIN32)
+ ExternalProject_Add_Step(external_gmp after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
+ COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
+ DEPENDEES install
+ )
+endif()
+
+if(BUILD_MODE STREQUAL Debug AND WIN32)
+ExternalProject_Add_Step(external_gmp after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
+ COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
+ DEPENDEES install
+ )
+endif()
+
+if(WIN32)
+ # gmpxx is somewhat special, it builds on top of the C style gmp library but exposes C++ bindings
+ # given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
+ # with MSVC, while GMP can only be build with mingw.
+ ExternalProject_Add(external_gmpxx
+ URL ${GMP_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GMP_HASH}
+ PREFIX ${BUILD_DIR}/gmpxx
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
+ ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmpxx ${DEFAULT_CMAKE_FLAGS} -DGMP_LIBRARY=${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib -DGMP_INCLUDE_DIR=${BUILD_DIR}/gmp/src/external_gmp -DCMAKE_DEBUG_POSTFIX=_d
+ INSTALL_DIR ${LIBDIR}/gmpxx
+ )
+ set_target_properties(external_gmpxx PROPERTIES FOLDER Mingw)
+
+ add_dependencies(
+ external_gmpxx
+ external_gmp
+ )
+
+ ExternalProject_Add_Step(external_gmpxx after_install
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmpxx/ ${HARVEST_TARGET}/gmp
+ DEPENDEES install
+ )
+
+endif()
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index 3f5d2044dbc..dbb3a33e705 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -89,6 +89,8 @@ harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
+harvest(gmp/include gmp/include "*.h")
+harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index ce2a1191f17..30a0b1184c2 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -315,3 +315,7 @@ set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
set(ISPC_VERSION v1.13.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
+
+set(GMP_VERSION 6.2.0)
+set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
+set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
diff --git a/build_files/build_environment/patches/cmakelists_gmpxx.txt b/build_files/build_environment/patches/cmakelists_gmpxx.txt
new file mode 100644
index 00000000000..5aa6c404035
--- /dev/null
+++ b/build_files/build_environment/patches/cmakelists_gmpxx.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.1)
+project(libgmpxx)
+
+include_directories(. cxx ${GMP_INCLUDE_DIR})
+add_definitions(-D__GMP_WITHIN_GMPXX)
+add_library(libgmpxx SHARED
+ cxx/dummy.cc
+ cxx/isfuns.cc
+ cxx/ismpf.cc
+ cxx/ismpq.cc
+ cxx/ismpz.cc
+ cxx/ismpznw.cc
+ cxx/limits.cc
+ cxx/osdoprnti.cc
+ cxx/osfuns.cc
+ cxx/osmpf.cc
+ cxx/osmpq.cc
+ cxx/osmpz.cc
+)
+
+target_link_libraries(libgmpxx ${GMP_LIBRARY})
+install(TARGETS libgmpxx DESTINATION lib)
diff --git a/build_files/build_environment/patches/config_gmpxx.h b/build_files/build_environment/patches/config_gmpxx.h
new file mode 100644
index 00000000000..842d6d5d240
--- /dev/null
+++ b/build_files/build_environment/patches/config_gmpxx.h
@@ -0,0 +1,668 @@
+/* config.h. Generated from config.in by configure. */
+/* config.in. Generated from configure.ac by autoheader. */
+
+/*
+
+Copyright 1996-2020 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your
+ option) any later version.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/.
+*/
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* The gmp-mparam.h file (a string) the tune program should suggest updating.
+ */
+#define GMP_MPARAM_H_SUGGEST "./mpn/x86_64/coreisbr/gmp-mparam.h"
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define to 1 if alloca() works (via gmp-impl.h). */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
+//#define HAVE_ATTRIBUTE_CONST 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
+//#define HAVE_ATTRIBUTE_MALLOC 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
+ */
+//#define HAVE_ATTRIBUTE_MODE 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
+//#define HAVE_ATTRIBUTE_NORETURN 1
+
+/* Define to 1 if you have the `attr_get' function. */
+/* #undef HAVE_ATTR_GET */
+
+/* Define to 1 if tests/libtests has calling conventions checking for the CPU
+ */
+/* #undef HAVE_CALLING_CONVENTIONS */
+
+/* Define to 1 if you have the `clock' function. */
+#define HAVE_CLOCK 1
+
+/* Define to 1 if you have the `clock_gettime' function */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the `cputime' function. */
+/* #undef HAVE_CPUTIME */
+
+/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
+ */
+#define HAVE_DECL_FGETC 1
+
+/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
+ */
+#define HAVE_DECL_FSCANF 1
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#define HAVE_DECL_OPTARG 1
+
+/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_ERRLIST 0
+
+/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_NERR 0
+
+/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
+ */
+#define HAVE_DECL_UNGETC 1
+
+/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
+ don't. */
+#define HAVE_DECL_VFPRINTF 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+/* #undef HAVE_DOUBLE_IEEE_BIG_ENDIAN */
+#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1
+/* #undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED */
+/* #undef HAVE_DOUBLE_VAX_D */
+/* #undef HAVE_DOUBLE_VAX_G */
+/* #undef HAVE_DOUBLE_CRAY_CFP */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `getrusage' function. */
+/* #undef HAVE_GETRUSAGE */
+
+/* Define to 1 if you have the `getsysinfo' function. */
+/* #undef HAVE_GETSYSINFO */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
+ and __attribute__ ((alias)) */
+#define HAVE_HIDDEN_ALIAS 1
+
+/* Define one of these to 1 for the host CPU family.
+ If your CPU is not in any of these families, leave all undefined.
+ For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
+/* #undef HAVE_HOST_CPU_FAMILY_alpha */
+/* #undef HAVE_HOST_CPU_FAMILY_m68k */
+/* #undef HAVE_HOST_CPU_FAMILY_power */
+/* #undef HAVE_HOST_CPU_FAMILY_powerpc */
+/* #undef HAVE_HOST_CPU_FAMILY_x86 */
+#define HAVE_HOST_CPU_FAMILY_x86_64 1
+
+/* Define one of the following to 1 for the host CPU, as per the output of
+ ./config.guess. If your CPU is not listed here, leave all undefined. */
+/* #undef HAVE_HOST_CPU_alphaev67 */
+/* #undef HAVE_HOST_CPU_alphaev68 */
+/* #undef HAVE_HOST_CPU_alphaev7 */
+/* #undef HAVE_HOST_CPU_m68020 */
+/* #undef HAVE_HOST_CPU_m68030 */
+/* #undef HAVE_HOST_CPU_m68040 */
+/* #undef HAVE_HOST_CPU_m68060 */
+/* #undef HAVE_HOST_CPU_m68360 */
+/* #undef HAVE_HOST_CPU_powerpc604 */
+/* #undef HAVE_HOST_CPU_powerpc604e */
+/* #undef HAVE_HOST_CPU_powerpc750 */
+/* #undef HAVE_HOST_CPU_powerpc7400 */
+/* #undef HAVE_HOST_CPU_supersparc */
+/* #undef HAVE_HOST_CPU_i386 */
+/* #undef HAVE_HOST_CPU_i586 */
+/* #undef HAVE_HOST_CPU_i686 */
+/* #undef HAVE_HOST_CPU_pentium */
+/* #undef HAVE_HOST_CPU_pentiummmx */
+/* #undef HAVE_HOST_CPU_pentiumpro */
+/* #undef HAVE_HOST_CPU_pentium2 */
+/* #undef HAVE_HOST_CPU_pentium3 */
+/* #undef HAVE_HOST_CPU_pentium4 */
+/* #undef HAVE_HOST_CPU_core2 */
+/* #undef HAVE_HOST_CPU_nehalem */
+/* #undef HAVE_HOST_CPU_westmere */
+/* #undef HAVE_HOST_CPU_sandybridge */
+#define HAVE_HOST_CPU_ivybridge 1
+/* #undef HAVE_HOST_CPU_haswell */
+/* #undef HAVE_HOST_CPU_broadwell */
+/* #undef HAVE_HOST_CPU_skylake */
+/* #undef HAVE_HOST_CPU_silvermont */
+/* #undef HAVE_HOST_CPU_goldmont */
+/* #undef HAVE_HOST_CPU_k8 */
+/* #undef HAVE_HOST_CPU_k10 */
+/* #undef HAVE_HOST_CPU_bulldozer */
+/* #undef HAVE_HOST_CPU_piledriver */
+/* #undef HAVE_HOST_CPU_steamroller */
+/* #undef HAVE_HOST_CPU_excavator */
+/* #undef HAVE_HOST_CPU_zen */
+/* #undef HAVE_HOST_CPU_bobcat */
+/* #undef HAVE_HOST_CPU_jaguar */
+/* #undef HAVE_HOST_CPU_s390_z900 */
+/* #undef HAVE_HOST_CPU_s390_z990 */
+/* #undef HAVE_HOST_CPU_s390_z9 */
+/* #undef HAVE_HOST_CPU_s390_z10 */
+/* #undef HAVE_HOST_CPU_s390_z196 */
+
+/* Define to 1 iff we have a s390 with 64-bit registers. */
+/* #undef HAVE_HOST_CPU_s390_zarch */
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#define HAVE_INTPTR_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <invent.h> header file. */
+/* #undef HAVE_INVENT_H */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define one of these to 1 for the endianness of `mp_limb_t'.
+ If the endianness is not a simple big or little, or you don't know what
+ it is, then leave both undefined. */
+/* #undef HAVE_LIMB_BIG_ENDIAN */
+#define HAVE_LIMB_LITTLE_ENDIAN 1
+
+/* Define to 1 if you have the `localeconv' function. */
+#define HAVE_LOCALECONV 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if the system has the type `long double'. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define to 1 if the system has the type `long long'. */
+#define HAVE_LONG_LONG 1
+
+/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
+/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mmap' function. */
+/* #undef HAVE_MMAP */
+
+/* Define to 1 if you have the `mprotect' function. */
+#define HAVE_MPROTECT 1
+
+/* Define to 1 each of the following for which a native (ie. CPU specific)
+ implementation of the corresponding routine exists. */
+#define HAVE_NATIVE_mpn_add_n 1
+/* #undef HAVE_NATIVE_mpn_add_n_sub_n */
+#define HAVE_NATIVE_mpn_add_nc 1
+/* #undef HAVE_NATIVE_mpn_addaddmul_1msb0 */
+#define HAVE_NATIVE_mpn_addlsh1_n 1
+#define HAVE_NATIVE_mpn_addlsh2_n 1
+#define HAVE_NATIVE_mpn_addlsh_n 1
+#define HAVE_NATIVE_mpn_addlsh1_nc 1
+#define HAVE_NATIVE_mpn_addlsh2_nc 1
+#define HAVE_NATIVE_mpn_addlsh_nc 1
+/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addmul_1c */
+#define HAVE_NATIVE_mpn_addmul_2 1
+/* #undef HAVE_NATIVE_mpn_addmul_3 */
+/* #undef HAVE_NATIVE_mpn_addmul_4 */
+/* #undef HAVE_NATIVE_mpn_addmul_5 */
+/* #undef HAVE_NATIVE_mpn_addmul_6 */
+/* #undef HAVE_NATIVE_mpn_addmul_7 */
+/* #undef HAVE_NATIVE_mpn_addmul_8 */
+/* #undef HAVE_NATIVE_mpn_addmul_2s */
+#define HAVE_NATIVE_mpn_and_n 1
+#define HAVE_NATIVE_mpn_andn_n 1
+#define HAVE_NATIVE_mpn_bdiv_dbm1c 1
+#define HAVE_NATIVE_mpn_bdiv_q_1 1
+#define HAVE_NATIVE_mpn_pi1_bdiv_q_1 1
+#define HAVE_NATIVE_mpn_cnd_add_n 1
+#define HAVE_NATIVE_mpn_cnd_sub_n 1
+#define HAVE_NATIVE_mpn_com 1
+#define HAVE_NATIVE_mpn_copyd 1
+#define HAVE_NATIVE_mpn_copyi 1
+/* #undef HAVE_NATIVE_mpn_div_qr_1n_pi1 */
+/* #undef HAVE_NATIVE_mpn_div_qr_2 */
+#define HAVE_NATIVE_mpn_divexact_1 1
+/* #undef HAVE_NATIVE_mpn_divexact_by3c */
+#define HAVE_NATIVE_mpn_divrem_1 1
+/* #undef HAVE_NATIVE_mpn_divrem_1c */
+#define HAVE_NATIVE_mpn_divrem_2 1
+/* #undef HAVE_NATIVE_mpn_gcd_1 */
+#define HAVE_NATIVE_mpn_gcd_11 1
+/* #undef HAVE_NATIVE_mpn_gcd_22 */
+#define HAVE_NATIVE_mpn_hamdist 1
+#define HAVE_NATIVE_mpn_invert_limb 1
+#define HAVE_NATIVE_mpn_ior_n 1
+#define HAVE_NATIVE_mpn_iorn_n 1
+#define HAVE_NATIVE_mpn_lshift 1
+#define HAVE_NATIVE_mpn_lshiftc 1
+/* #undef HAVE_NATIVE_mpn_lshsub_n */
+/* #undef HAVE_NATIVE_mpn_mod_1 */
+#define HAVE_NATIVE_mpn_mod_1_1p 1
+/* #undef HAVE_NATIVE_mpn_mod_1c */
+#define HAVE_NATIVE_mpn_mod_1s_2p 1
+#define HAVE_NATIVE_mpn_mod_1s_4p 1
+#define HAVE_NATIVE_mpn_mod_34lsub1 1
+#define HAVE_NATIVE_mpn_modexact_1_odd 1
+#define HAVE_NATIVE_mpn_modexact_1c_odd 1
+#define HAVE_NATIVE_mpn_mul_1 1
+#define HAVE_NATIVE_mpn_mul_1c 1
+#define HAVE_NATIVE_mpn_mul_2 1
+/* #undef HAVE_NATIVE_mpn_mul_3 */
+/* #undef HAVE_NATIVE_mpn_mul_4 */
+/* #undef HAVE_NATIVE_mpn_mul_5 */
+/* #undef HAVE_NATIVE_mpn_mul_6 */
+#define HAVE_NATIVE_mpn_mul_basecase 1
+#define HAVE_NATIVE_mpn_mullo_basecase 1
+#define HAVE_NATIVE_mpn_nand_n 1
+#define HAVE_NATIVE_mpn_nior_n 1
+#define HAVE_NATIVE_mpn_popcount 1
+#define HAVE_NATIVE_mpn_preinv_divrem_1 1
+/* #undef HAVE_NATIVE_mpn_preinv_mod_1 */
+#define HAVE_NATIVE_mpn_redc_1 1
+/* #undef HAVE_NATIVE_mpn_redc_2 */
+#define HAVE_NATIVE_mpn_rsblsh1_n 1
+#define HAVE_NATIVE_mpn_rsblsh2_n 1
+#define HAVE_NATIVE_mpn_rsblsh_n 1
+#define HAVE_NATIVE_mpn_rsblsh1_nc 1
+/* #undef HAVE_NATIVE_mpn_rsblsh2_nc */
+/* #undef HAVE_NATIVE_mpn_rsblsh_nc */
+#define HAVE_NATIVE_mpn_rsh1add_n 1
+#define HAVE_NATIVE_mpn_rsh1add_nc 1
+#define HAVE_NATIVE_mpn_rsh1sub_n 1
+#define HAVE_NATIVE_mpn_rsh1sub_nc 1
+#define HAVE_NATIVE_mpn_rshift 1
+/* #undef HAVE_NATIVE_mpn_sbpi1_bdiv_r */
+#define HAVE_NATIVE_mpn_sqr_basecase 1
+/* #undef HAVE_NATIVE_mpn_sqr_diagonal */
+#define HAVE_NATIVE_mpn_sqr_diag_addlsh1 1
+#define HAVE_NATIVE_mpn_sub_n 1
+#define HAVE_NATIVE_mpn_sub_nc 1
+#define HAVE_NATIVE_mpn_sublsh1_n 1
+#define HAVE_NATIVE_mpn_sublsh2_n 1
+/* #undef HAVE_NATIVE_mpn_sublsh_n */
+/* #undef HAVE_NATIVE_mpn_sublsh1_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh2_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh1_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh2_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh1_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh2_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_submul_1c */
+/* #undef HAVE_NATIVE_mpn_tabselect */
+/* #undef HAVE_NATIVE_mpn_udiv_qrnnd */
+/* #undef HAVE_NATIVE_mpn_udiv_qrnnd_r */
+/* #undef HAVE_NATIVE_mpn_umul_ppmm */
+/* #undef HAVE_NATIVE_mpn_umul_ppmm_r */
+#define HAVE_NATIVE_mpn_xor_n 1
+#define HAVE_NATIVE_mpn_xnor_n 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+/* #undef HAVE_NL_LANGINFO */
+
+/* Define to 1 if you have the <nl_types.h> header file. */
+/* #undef HAVE_NL_TYPES_H */
+
+/* Define to 1 if you have the `obstack_vprintf' function. */
+/* #undef HAVE_OBSTACK_VPRINTF */
+
+/* Define to 1 if you have the `popen' function. */
+#define HAVE_POPEN 1
+
+/* Define to 1 if you have the `processor_info' function. */
+/* #undef HAVE_PROCESSOR_INFO */
+
+/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
+ `psp_iticksperclktick'. */
+/* #undef HAVE_PSP_ITICKSPERCLKTICK */
+
+/* Define to 1 if you have the `pstat_getprocessor' function. */
+/* #undef HAVE_PSTAT_GETPROCESSOR */
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#define HAVE_PTRDIFF_T 1
+
+/* Define to 1 if the system has the type `quad_t'. */
+/* #undef HAVE_QUAD_T */
+
+/* Define to 1 if you have the `raise' function. */
+#define HAVE_RAISE 1
+
+/* Define to 1 if you have the `read_real_time' function. */
+/* #undef HAVE_READ_REAL_TIME */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the `sigaltstack' function. */
+/* #undef HAVE_SIGALTSTACK */
+
+/* Define to 1 if you have the `sigstack' function. */
+/* #undef HAVE_SIGSTACK */
+
+/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
+#define HAVE_SPEED_CYCLECOUNTER 2
+
+/* Define to 1 if you have the <sstream> header file. */
+#define HAVE_SSTREAM 1
+
+/* Define to 1 if the system has the type `stack_t'. */
+/* #undef HAVE_STACK_T */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if the system has the type `std::locale'. */
+#define HAVE_STD__LOCALE 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strnlen' function. */
+#define HAVE_STRNLEN 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the `sysconf' function. */
+/* #undef HAVE_SYSCONF */
+
+/* Define to 1 if you have the `sysctl' function. */
+/* #undef HAVE_SYSCTL */
+
+/* Define to 1 if you have the `sysctlbyname' function. */
+/* #undef HAVE_SYSCTLBYNAME */
+
+/* Define to 1 if you have the `syssgi' function. */
+/* #undef HAVE_SYSSGI */
+
+/* Define to 1 if you have the <sys/attributes.h> header file. */
+/* #undef HAVE_SYS_ATTRIBUTES_H */
+
+/* Define to 1 if you have the <sys/iograph.h> header file. */
+/* #undef HAVE_SYS_IOGRAPH_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+/* #undef HAVE_SYS_MMAN_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/processor.h> header file. */
+/* #undef HAVE_SYS_PROCESSOR_H */
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+/* #undef HAVE_SYS_PSTAT_H */
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+/* #undef HAVE_SYS_RESOURCE_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+/* #undef HAVE_SYS_SYSCTL_H */
+
+/* Define to 1 if you have the <sys/sysinfo.h> header file. */
+/* #undef HAVE_SYS_SYSINFO_H */
+
+/* Define to 1 if you have the <sys/syssgi.h> header file. */
+/* #undef HAVE_SYS_SYSSGI_H */
+
+/* Define to 1 if you have the <sys/systemcfg.h> header file. */
+/* #undef HAVE_SYS_SYSTEMCFG_H */
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+/* #undef HAVE_SYS_TIMES_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `times' function. */
+/* #undef HAVE_TIMES */
+
+/* Define to 1 if the system has the type `uint_least32_t'. */
+#define HAVE_UINT_LEAST32_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vsnprintf' function and it works properly. */
+/* #undef HAVE_VSNPRINTF */
+
+/* Define to 1 for Windos/64 */
+#define HOST_DOS64 1
+
+/* Assembler local label prefix */
+#define LSYM_PREFIX "L"
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 to disable the use of inline assembly */
+/* #undef NO_ASM */
+
+/* Name of package */
+#define PACKAGE "gmp"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU MP"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GNU MP 6.2.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gmp"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "6.2.0"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* The size of `mp_limb_t', as computed by sizeof. */
+#define SIZEOF_MP_LIMB_T 8
+
+/* The size of `unsigned', as computed by sizeof. */
+#define SIZEOF_UNSIGNED 4
+
+/* The size of `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 4
+
+/* The size of `unsigned short', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_SHORT 2
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 8
+
+/* Define to 1 if sscanf requires writable inputs */
+/* #undef SSCANF_WRITABLE_INPUT */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
+/* #undef TUNE_SQR_TOOM2_MAX */
+
+/* Version number of package */
+#define VERSION "6.2.0"
+
+/* Define to 1 to enable ASSERT checking, per --enable-assert */
+/* #undef WANT_ASSERT */
+
+/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
+/* #undef WANT_FAKE_CPUID */
+
+/* Define to 1 when building a fat binary. */
+/* #undef WANT_FAT_BINARY */
+
+/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
+#define WANT_FFT 1
+
+/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
+ --enable-old-fft-full */
+/* #undef WANT_OLD_FFT_FULL */
+
+/* Define to 1 if --enable-profiling=gprof */
+/* #undef WANT_PROFILING_GPROF */
+
+/* Define to 1 if --enable-profiling=instrument */
+/* #undef WANT_PROFILING_INSTRUMENT */
+
+/* Define to 1 if --enable-profiling=prof */
+/* #undef WANT_PROFILING_PROF */
+
+/* Define one of these to 1 for the desired temporary memory allocation
+ method, per --enable-alloca. */
+#define WANT_TMP_ALLOCA 1
+/* #undef WANT_TMP_REENTRANT */
+/* #undef WANT_TMP_NOTREENTRANT */
+/* #undef WANT_TMP_DEBUG */
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Define to 1 if the assembler understands the mulx instruction */
+/* #undef X86_ASM_MULX */
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+/* #undef YYTEXT_POINTER */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#define restrict __restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/build_files/cmake/Modules/FindGMP.cmake b/build_files/cmake/Modules/FindGMP.cmake
new file mode 100644
index 00000000000..4469f32c785
--- /dev/null
+++ b/build_files/cmake/Modules/FindGMP.cmake
@@ -0,0 +1,96 @@
+# - Find GMP library
+# Find the native GMP includes and library
+# This module defines
+# GMP_INCLUDE_DIRS, where to find gmp.h, Set when
+# GMP_INCLUDE_DIR is found.
+# GMP_LIBRARIES, libraries to link against to use GMP.
+# GMP_ROOT_DIR, The base directory to search for GMP.
+# This can also be an environment variable.
+# GMP_FOUND, If false, do not try to use GMP.
+#
+# also defined, but not for general use are
+# GMP_LIBRARY, where to find the GMP library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If GMP_ROOT_DIR was defined in the environment, use it.
+IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "")
+ SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR})
+ENDIF()
+
+SET(_gmp_SEARCH_DIRS
+ ${GMP_ROOT_DIR}
+ /opt/lib/gmp
+)
+
+FIND_PATH(GMP_INCLUDE_DIR
+ NAMES
+ gmp.h
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/gmp
+)
+
+FIND_PATH(GMPXX_INCLUDE_DIR
+ NAMES
+ gmpxx.h
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/gmp
+)
+
+FIND_LIBRARY(GMP_LIBRARY
+ NAMES
+ gmp
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib
+ )
+
+FIND_LIBRARY(GMPXX_LIBRARY
+ NAMES
+ gmpxx
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib
+ )
+
+if(GMP_INCLUDE_DIR)
+ SET(_version_regex "^#define[ \t]+__GNU_MP_VERSION[ \t]+\"([^\"]+)\".*")
+ file(STRINGS "${GMP_INCLUDE_DIR}/gmp.h"
+ GMP_VERSION REGEX "${_version_regex}")
+ string(REGEX REPLACE "${_version_regex}" "\\1"
+ GMP_VERSION "${GMP_VERSION}")
+ unset(_version_regex)
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
+ GMP_LIBRARY GMPXX_LIBRARY GMP_INCLUDE_DIR GMPXX_INCLUDE_DIR)
+
+IF(GMP_FOUND)
+ SET(GMP_LIBRARIES ${GMP_LIBRARY} ${GMPXX_LIBRARY})
+ SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+ENDIF(GMP_FOUND)
+
+MARK_AS_ADVANCED(
+ GMP_INCLUDE_DIR
+ GMP_LIBRARY
+ GMPXX_INCLUDE_DIR
+ GMPXX_LIBRARY
+)
diff --git a/build_files/cmake/Modules/GTest.cmake b/build_files/cmake/Modules/GTest.cmake
new file mode 100644
index 00000000000..9a82fc49628
--- /dev/null
+++ b/build_files/cmake/Modules/GTest.cmake
@@ -0,0 +1,550 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+GoogleTest
+----------
+
+.. versionadded:: 3.9
+
+This module defines functions to help use the Google Test infrastructure. Two
+mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
+around for some time, originally via ``find_package(GTest)``.
+:command:`gtest_discover_tests` was introduced in CMake 3.10.
+
+The (older) :command:`gtest_add_tests` scans source files to identify tests.
+This is usually effective, with some caveats, including in cross-compiling
+environments, and makes setting additional properties on tests more convenient.
+However, its handling of parameterized tests is less comprehensive, and it
+requires re-running CMake to detect changes to the list of tests.
+
+The (newer) :command:`gtest_discover_tests` discovers tests by asking the
+compiled test executable to enumerate its tests. This is more robust and
+provides better handling of parameterized tests, and does not require CMake
+to be re-run when tests change. However, it may not work in a cross-compiling
+environment, and setting test properties is less convenient.
+
+More details can be found in the documentation of the respective functions.
+
+Both commands are intended to replace use of :command:`add_test` to register
+tests, and will create a separate CTest test for each Google Test test case.
+Note that this is in some cases less efficient, as common set-up and tear-down
+logic cannot be shared by multiple test cases executing in the same instance.
+However, it provides more fine-grained pass/fail information to CTest, which is
+usually considered as more beneficial. By default, the CTest test name is the
+same as the Google Test name (i.e. ``suite.testcase``); see also
+``TEST_PREFIX`` and ``TEST_SUFFIX``.
+
+.. command:: gtest_add_tests
+
+ Automatically add tests with CTest by scanning source code for Google Test
+ macros::
+
+ gtest_add_tests(TARGET target
+ [SOURCES src1...]
+ [EXTRA_ARGS arg1...]
+ [WORKING_DIRECTORY dir]
+ [TEST_PREFIX prefix]
+ [TEST_SUFFIX suffix]
+ [SKIP_DEPENDENCY]
+ [TEST_LIST outVar]
+ )
+
+ ``gtest_add_tests`` attempts to identify tests by scanning source files.
+ Although this is generally effective, it uses only a basic regular expression
+ match, which can be defeated by atypical test declarations, and is unable to
+ fully "split" parameterized tests. Additionally, it requires that CMake be
+ re-run to discover any newly added, removed or renamed tests (by default,
+ this means that CMake is re-run when any test source file is changed, but see
+ ``SKIP_DEPENDENCY``). However, it has the advantage of declaring tests at
+ CMake time, which somewhat simplifies setting additional properties on tests,
+ and always works in a cross-compiling environment.
+
+ The options are:
+
+ ``TARGET target``
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
+
+ ``SOURCES src1...``
+ When provided, only the listed files will be scanned for test cases. If
+ this option is not given, the :prop_tgt:`SOURCES` property of the
+ specified ``target`` will be used to obtain the list of sources.
+
+ ``EXTRA_ARGS arg1...``
+ Any extra arguments to pass on the command line to each test case.
+
+ ``WORKING_DIRECTORY dir``
+ Specifies the directory in which to run the discovered test cases. If this
+ option is not provided, the current binary directory is used.
+
+ ``TEST_PREFIX prefix``
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same source files are being used in
+ multiple calls to ``gtest_add_test()`` but with different ``EXTRA_ARGS``.
+
+ ``TEST_SUFFIX suffix``
+ Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
+
+ ``SKIP_DEPENDENCY``
+ Normally, the function creates a dependency which will cause CMake to be
+ re-run if any of the sources being scanned are changed. This is to ensure
+ that the list of discovered tests is updated. If this behavior is not
+ desired (as may be the case while actually writing the test cases), this
+ option can be used to prevent the dependency from being added.
+
+ ``TEST_LIST outVar``
+ The variable named by ``outVar`` will be populated in the calling scope
+ with the list of discovered test cases. This allows the caller to do
+ things like manipulate test properties of the discovered tests.
+
+ .. code-block:: cmake
+
+ include(GoogleTest)
+ add_executable(FooTest FooUnitTest.cxx)
+ gtest_add_tests(TARGET FooTest
+ TEST_SUFFIX .noArgs
+ TEST_LIST noArgsTests
+ )
+ gtest_add_tests(TARGET FooTest
+ EXTRA_ARGS --someArg someValue
+ TEST_SUFFIX .withArgs
+ TEST_LIST withArgsTests
+ )
+ set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
+ set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)
+
+ For backward compatibility, the following form is also supported::
+
+ gtest_add_tests(exe args files...)
+
+ ``exe``
+ The path to the test executable or the name of a CMake target.
+ ``args``
+ A ;-list of extra arguments to be passed to executable. The entire
+ list must be passed as a single argument. Enclose it in quotes,
+ or pass ``""`` for no arguments.
+ ``files...``
+ A list of source files to search for tests and test fixtures.
+ Alternatively, use ``AUTO`` to specify that ``exe`` is the name
+ of a CMake executable target whose sources should be scanned.
+
+ .. code-block:: cmake
+
+ include(GoogleTest)
+ set(FooTestArgs --foo 1 --bar 2)
+ add_executable(FooTest FooUnitTest.cxx)
+ gtest_add_tests(FooTest "${FooTestArgs}" AUTO)
+
+.. command:: gtest_discover_tests
+
+ Automatically add tests with CTest by querying the compiled test executable
+ for available tests::
+
+ gtest_discover_tests(target
+ [EXTRA_ARGS arg1...]
+ [WORKING_DIRECTORY dir]
+ [TEST_PREFIX prefix]
+ [TEST_SUFFIX suffix]
+ [NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
+ [PROPERTIES name1 value1...]
+ [TEST_LIST var]
+ [DISCOVERY_TIMEOUT seconds]
+ [XML_OUTPUT_DIR dir]
+ [DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
+ )
+
+ ``gtest_discover_tests()`` sets up a post-build command on the test executable
+ that generates the list of tests by parsing the output from running the test
+ with the ``--gtest_list_tests`` argument. Compared to the source parsing
+ approach of :command:`gtest_add_tests`, this ensures that the full list of
+ tests, including instantiations of parameterized tests, is obtained. Since
+ test discovery occurs at build time, it is not necessary to re-run CMake when
+ the list of tests changes.
+ However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
+ in order to function in a cross-compiling environment.
+
+ Additionally, setting properties on tests is somewhat less convenient, since
+ the tests are not available at CMake time. Additional test properties may be
+ assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
+ more fine-grained test control is needed, custom content may be provided
+ through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
+ directory property. The set of discovered tests is made accessible to such a
+ script via the ``<target>_TESTS`` variable.
+
+ The options are:
+
+ ``target``
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
+
+ ``EXTRA_ARGS arg1...``
+ Any extra arguments to pass on the command line to each test case.
+
+ ``WORKING_DIRECTORY dir``
+ Specifies the directory in which to run the discovered test cases. If this
+ option is not provided, the current binary directory is used.
+
+ ``TEST_PREFIX prefix``
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same test executable is being used in
+ multiple calls to ``gtest_discover_tests()`` but with different
+ ``EXTRA_ARGS``.
+
+ ``TEST_SUFFIX suffix``
+ Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
+
+ ``NO_PRETTY_TYPES``
+ By default, the type index of type-parameterized tests is replaced by the
+ actual type name in the CTest test name. If this behavior is undesirable
+ (e.g. because the type names are unwieldy), this option will suppress this
+ behavior.
+
+ ``NO_PRETTY_VALUES``
+ By default, the value index of value-parameterized tests is replaced by the
+ actual value in the CTest test name. If this behavior is undesirable
+ (e.g. because the value strings are unwieldy), this option will suppress
+ this behavior.
+
+ ``PROPERTIES name1 value1...``
+ Specifies additional properties to be set on all tests discovered by this
+ invocation of ``gtest_discover_tests()``.
+
+ ``TEST_LIST var``
+ Make the list of tests available in the variable ``var``, rather than the
+ default ``<target>_TESTS``. This can be useful when the same test
+ executable is being used in multiple calls to ``gtest_discover_tests()``.
+ Note that this variable is only available in CTest.
+
+ ``DISCOVERY_TIMEOUT num``
+ Specifies how long (in seconds) CMake will wait for the test to enumerate
+ available tests. If the test takes longer than this, discovery (and your
+ build) will fail. Most test executables will enumerate their tests very
+ quickly, but under some exceptional circumstances, a test may require a
+ longer timeout. The default is 5. See also the ``TIMEOUT`` option of
+ :command:`execute_process`.
+
+ .. note::
+
+ In CMake versions 3.10.1 and 3.10.2, this option was called ``TIMEOUT``.
+ This clashed with the ``TIMEOUT`` test property, which is one of the
+ common properties that would be set with the ``PROPERTIES`` keyword,
+ usually leading to legal but unintended behavior. The keyword was
+ changed to ``DISCOVERY_TIMEOUT`` in CMake 3.10.3 to address this
+ problem. The ambiguous behavior of the ``TIMEOUT`` keyword in 3.10.1
+ and 3.10.2 has not been preserved.
+
+ ``XML_OUTPUT_DIR dir``
+ If specified, the parameter is passed along with ``--gtest_output=xml:``
+ to test executable. The actual file name is the same as the test target,
+ including prefix and suffix. This should be used instead of
+ ``EXTRA_ARGS --gtest_output=xml`` to avoid race conditions writing the
+ XML result output when using parallel test execution.
+
+ ``DISCOVERY_MODE``
+ Provides greater control over when ``gtest_discover_tests()`` performs test
+ discovery. By default, ``POST_BUILD`` sets up a post-build command
+ to perform test discovery at build time. In certain scenarios, like
+ cross-compiling, this ``POST_BUILD`` behavior is not desirable.
+ By contrast, ``PRE_TEST`` delays test discovery until just prior to test
+ execution. This way test discovery occurs in the target environment
+ where the test has a better chance at finding appropriate runtime
+ dependencies.
+
+ ``DISCOVERY_MODE`` defaults to the value of the
+ ``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not
+ passed when calling ``gtest_discover_tests()``. This provides a mechanism
+ for globally selecting a preferred test discovery behavior without having
+ to modify each call site.
+
+#]=======================================================================]
+
+# Save project's policies
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
+#------------------------------------------------------------------------------
+function(gtest_add_tests)
+
+ if (ARGC LESS 1)
+ message(FATAL_ERROR "No arguments supplied to gtest_add_tests()")
+ endif()
+
+ set(options
+ SKIP_DEPENDENCY
+ )
+ set(oneValueArgs
+ TARGET
+ WORKING_DIRECTORY
+ TEST_PREFIX
+ TEST_SUFFIX
+ TEST_LIST
+ )
+ set(multiValueArgs
+ SOURCES
+ EXTRA_ARGS
+ )
+ set(allKeywords ${options} ${oneValueArgs} ${multiValueArgs})
+
+ unset(sources)
+ if("${ARGV0}" IN_LIST allKeywords)
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(autoAddSources YES)
+ else()
+ # Non-keyword syntax, convert to keyword form
+ if (ARGC LESS 3)
+ message(FATAL_ERROR "gtest_add_tests() without keyword options requires at least 3 arguments")
+ endif()
+ set(ARGS_TARGET "${ARGV0}")
+ set(ARGS_EXTRA_ARGS "${ARGV1}")
+ if(NOT "${ARGV2}" STREQUAL "AUTO")
+ set(ARGS_SOURCES "${ARGV}")
+ list(REMOVE_AT ARGS_SOURCES 0 1)
+ endif()
+ endif()
+
+ # The non-keyword syntax allows the first argument to be an arbitrary
+ # executable rather than a target if source files are also provided. In all
+ # other cases, both forms require a target.
+ if(NOT TARGET "${ARGS_TARGET}" AND NOT ARGS_SOURCES)
+ message(FATAL_ERROR "${ARGS_TARGET} does not define an existing CMake target")
+ endif()
+ if(NOT ARGS_WORKING_DIRECTORY)
+ unset(workDir)
+ else()
+ set(workDir WORKING_DIRECTORY "${ARGS_WORKING_DIRECTORY}")
+ endif()
+
+ if(NOT ARGS_SOURCES)
+ get_property(ARGS_SOURCES TARGET ${ARGS_TARGET} PROPERTY SOURCES)
+ endif()
+
+ unset(testList)
+
+ set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
+ set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
+
+ foreach(source IN LISTS ARGS_SOURCES)
+ if(NOT ARGS_SKIP_DEPENDENCY)
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
+ endif()
+ file(READ "${source}" contents)
+ string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}")
+ foreach(hit ${found_tests})
+ string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
+
+ # Parameterized tests have a different signature for the filter
+ if("x${test_type}" STREQUAL "xTEST_P")
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
+ elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
+ elseif("x${test_type}" STREQUAL "xTYPED_TEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" gtest_test_name ${hit})
+ else()
+ message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
+ continue()
+ endif()
+
+ # Make sure tests disabled in GTest get disabled in CTest
+ if(gtest_test_name MATCHES "(^|\\.)DISABLED_")
+ # Add the disabled test if CMake is new enough
+ # Note that this check is to allow backwards compatibility so this
+ # module can be copied locally in projects to use with older CMake
+ # versions
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401)
+ string(REGEX REPLACE
+ "(^|\\.)DISABLED_" "\\1"
+ orig_test_name "${gtest_test_name}"
+ )
+ set(ctest_test_name
+ ${ARGS_TEST_PREFIX}${orig_test_name}${ARGS_TEST_SUFFIX}
+ )
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_also_run_disabled_tests
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
+ list(APPEND testList ${ctest_test_name})
+ endif()
+ else()
+ set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ list(APPEND testList ${ctest_test_name})
+ endif()
+ endforeach()
+ endforeach()
+
+ if(ARGS_TEST_LIST)
+ set(${ARGS_TEST_LIST} ${testList} PARENT_SCOPE)
+ endif()
+
+endfunction()
+
+#------------------------------------------------------------------------------
+
+function(gtest_discover_tests TARGET)
+ cmake_parse_arguments(
+ ""
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES"
+ "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
+ "EXTRA_ARGS;PROPERTIES"
+ ${ARGN}
+ )
+
+ if(NOT _WORKING_DIRECTORY)
+ set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ endif()
+ if(NOT _TEST_LIST)
+ set(_TEST_LIST ${TARGET}_TESTS)
+ endif()
+ if(NOT _DISCOVERY_TIMEOUT)
+ set(_DISCOVERY_TIMEOUT 5)
+ endif()
+ if(NOT _DISCOVERY_MODE)
+ if(NOT CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
+ set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "POST_BUILD")
+ endif()
+ set(_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
+ endif()
+
+ get_property(
+ has_counter
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ SET
+ )
+ if(has_counter)
+ get_property(
+ counter
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ )
+ math(EXPR counter "${counter} + 1")
+ else()
+ set(counter 1)
+ endif()
+ set_property(
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ ${counter}
+ )
+
+ # Define rule to generate test list for aforementioned test executable
+ # Blender: use _ instead of [] to avoid problems with zsh regex.
+ set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_${counter}_")
+ set(ctest_include_file "${ctest_file_base}_include.cmake")
+ set(ctest_tests_file "${ctest_file_base}_tests.cmake")
+ get_property(crosscompiling_emulator
+ TARGET ${TARGET}
+ PROPERTY CROSSCOMPILING_EMULATOR
+ )
+
+ if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
+ add_custom_command(
+ TARGET ${TARGET} POST_BUILD
+ BYPRODUCTS "${ctest_tests_file}"
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TARGET=${TARGET}"
+ -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
+ -D "TEST_EXECUTOR=${crosscompiling_emulator}"
+ -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
+ -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
+ -D "TEST_PROPERTIES=${_PROPERTIES}"
+ -D "TEST_PREFIX=${_TEST_PREFIX}"
+ -D "TEST_SUFFIX=${_TEST_SUFFIX}"
+ -D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
+ -D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
+ -D "TEST_LIST=${_TEST_LIST}"
+ -D "CTEST_FILE=${ctest_tests_file}"
+ -D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
+ -D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
+ -P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
+ VERBATIM
+ )
+
+ file(WRITE "${ctest_include_file}"
+ "if(EXISTS \"${ctest_tests_file}\")\n"
+ " include(\"${ctest_tests_file}\")\n"
+ "else()\n"
+ " add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
+ "endif()\n"
+ )
+ elseif(_DISCOVERY_MODE STREQUAL "PRE_TEST")
+
+ get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL
+ PROPERTY GENERATOR_IS_MULTI_CONFIG
+ )
+
+ if(GENERATOR_IS_MULTI_CONFIG)
+ set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
+ endif()
+
+ string(CONCAT ctest_include_content
+ "if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
+ " if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
+ " include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
+ " gtest_discover_tests_impl(" "\n"
+ " TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
+ " TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
+ " TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
+ " TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
+ " TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
+ " TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
+ " TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
+ " NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
+ " NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
+ " TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
+ " CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n"
+ " TEST_DISCOVERY_TIMEOUT" " [==[" "${_DISCOVERY_TIMEOUT}" "]==]" "\n"
+ " TEST_XML_OUTPUT_DIR" " [==[" "${_XML_OUTPUT_DIR}" "]==]" "\n"
+ " )" "\n"
+ " endif()" "\n"
+ " include(\"${ctest_tests_file}\")" "\n"
+ "else()" "\n"
+ " add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)" "\n"
+ "endif()" "\n"
+ )
+
+ if(GENERATOR_IS_MULTI_CONFIG)
+ foreach(_config ${CMAKE_CONFIGURATION_TYPES})
+ file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
+ endforeach()
+ file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
+ else()
+ file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
+ file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
+ endif()
+
+ else()
+ message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
+ endif()
+
+ # Add discovered tests to directory TEST_INCLUDE_FILES
+ set_property(DIRECTORY
+ APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
+ )
+
+endfunction()
+
+###############################################################################
+
+set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
+ ${CMAKE_CURRENT_LIST_DIR}/GTestAddTests.cmake
+)
+
+# Restore project's policies
+cmake_policy(POP)
diff --git a/build_files/cmake/Modules/GTestAddTests.cmake b/build_files/cmake/Modules/GTestAddTests.cmake
new file mode 100644
index 00000000000..8be07b8e2e5
--- /dev/null
+++ b/build_files/cmake/Modules/GTestAddTests.cmake
@@ -0,0 +1,191 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Blender: disable ASAN leak detection when trying to discover tests.
+set(ENV{ASAN_OPTIONS} "detect_leaks=0")
+
+cmake_minimum_required(VERSION ${CMAKE_VERSION})
+
+# Overwrite possibly existing ${_CTEST_FILE} with empty file
+set(flush_tests_MODE WRITE)
+
+# Flushes script to ${_CTEST_FILE}
+macro(flush_script)
+ file(${flush_tests_MODE} "${_CTEST_FILE}" "${script}")
+ set(flush_tests_MODE APPEND)
+
+ set(script "")
+endmacro()
+
+# Flushes tests_buffer to tests
+macro(flush_tests_buffer)
+ list(APPEND tests "${tests_buffer}")
+ set(tests_buffer "")
+endmacro()
+
+macro(add_command NAME)
+ set(_args "")
+ foreach(_arg ${ARGN})
+ if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
+ string(APPEND _args " [==[${_arg}]==]")
+ else()
+ string(APPEND _args " ${_arg}")
+ endif()
+ endforeach()
+ string(APPEND script "${NAME}(${_args})\n")
+ string(LENGTH "${script}" _script_len)
+ if(${_script_len} GREATER "50000")
+ flush_script()
+ endif()
+ # Unsets macro local variables to prevent leakage outside of this macro.
+ unset(_args)
+ unset(_script_len)
+endmacro()
+
+function(gtest_discover_tests_impl)
+
+ cmake_parse_arguments(
+ ""
+ ""
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_EXECUTOR;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
+ "TEST_EXTRA_ARGS;TEST_PROPERTIES"
+ ${ARGN}
+ )
+
+ set(prefix "${_TEST_PREFIX}")
+ set(suffix "${_TEST_SUFFIX}")
+ set(extra_args ${_TEST_EXTRA_ARGS})
+ set(properties ${_TEST_PROPERTIES})
+ set(script)
+ set(suite)
+ set(tests)
+ set(tests_buffer)
+
+ # Run test executable to get list of available tests
+ if(NOT EXISTS "${_TEST_EXECUTABLE}")
+ message(FATAL_ERROR
+ "Specified test executable does not exist.\n"
+ " Path: '${_TEST_EXECUTABLE}'"
+ )
+ endif()
+ execute_process(
+ COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
+ WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
+ TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
+ OUTPUT_VARIABLE output
+ RESULT_VARIABLE result
+ )
+ if(NOT ${result} EQUAL 0)
+ string(REPLACE "\n" "\n " output "${output}")
+ message(FATAL_ERROR
+ "Error running test executable.\n"
+ " Path: '${_TEST_EXECUTABLE}'\n"
+ " Result: ${result}\n"
+ " Output:\n"
+ " ${output}\n"
+ )
+ endif()
+
+ # Preserve semicolon in test-parameters
+ string(REPLACE [[;]] [[\;]] output "${output}")
+ string(REPLACE "\n" ";" output "${output}")
+
+ # Parse output
+ foreach(line ${output})
+ # Skip header
+ if(NOT line MATCHES "gtest_main\\.cc")
+ # Do we have a module name or a test name?
+ if(NOT line MATCHES "^ ")
+ # Module; remove trailing '.' to get just the name...
+ string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
+ if(line MATCHES "#" AND NOT _NO_PRETTY_TYPES)
+ string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
+ else()
+ set(pretty_suite "${suite}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
+ else()
+ # Test name; strip spaces and comments to get just the name...
+ string(REGEX REPLACE " +" "" test "${line}")
+ if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
+ string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ else()
+ string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
+ string(REGEX REPLACE "#.*" "" test "${test}")
+ if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
+ set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
+ else()
+ unset(TEST_XML_OUTPUT_PARAM)
+ endif()
+
+ # sanitize test name for further processing downstream
+ set(testname "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ # escape \
+ string(REPLACE [[\]] [[\\]] testname "${testname}")
+ # escape ;
+ string(REPLACE [[;]] [[\;]] testname "${testname}")
+ # escape $
+ string(REPLACE [[$]] [[\$]] testname "${testname}")
+
+ # ...and add to script
+ add_command(add_test
+ "${testname}"
+ ${_TEST_EXECUTOR}
+ "${_TEST_EXECUTABLE}"
+ "--gtest_filter=${suite}.${test}"
+ "--gtest_also_run_disabled_tests"
+ ${TEST_XML_OUTPUT_PARAM}
+ ${extra_args}
+ )
+ if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
+ add_command(set_tests_properties
+ "${testname}"
+ PROPERTIES DISABLED TRUE
+ )
+ endif()
+ add_command(set_tests_properties
+ "${testname}"
+ PROPERTIES
+ WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
+ SKIP_REGULAR_EXPRESSION "\\\\[ SKIPPED \\\\]"
+ ${properties}
+ )
+ list(APPEND tests_buffer "${testname}")
+ list(LENGTH tests_buffer tests_buffer_length)
+ if(${tests_buffer_length} GREATER "250")
+ flush_tests_buffer()
+ endif()
+ endif()
+ endif()
+ endforeach()
+
+
+ # Create a list of all discovered tests, which users may use to e.g. set
+ # properties on the tests
+ flush_tests_buffer()
+ add_command(set ${_TEST_LIST} ${tests})
+
+ # Write CTest script
+ flush_script()
+
+endfunction()
+
+if(CMAKE_SCRIPT_MODE_FILE)
+ gtest_discover_tests_impl(
+ NO_PRETTY_TYPES ${NO_PRETTY_TYPES}
+ NO_PRETTY_VALUES ${NO_PRETTY_VALUES}
+ TEST_EXECUTABLE ${TEST_EXECUTABLE}
+ TEST_EXECUTOR ${TEST_EXECUTOR}
+ TEST_WORKING_DIR ${TEST_WORKING_DIR}
+ TEST_PREFIX ${TEST_PREFIX}
+ TEST_SUFFIX ${TEST_SUFFIX}
+ TEST_LIST ${TEST_LIST}
+ CTEST_FILE ${CTEST_FILE}
+ TEST_DISCOVERY_TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
+ TEST_XML_OUTPUT_DIR ${TEST_XML_OUTPUT_DIR}
+ TEST_EXTRA_ARGS ${TEST_EXTRA_ARGS}
+ TEST_PROPERTIES ${TEST_PROPERTIES}
+ )
+endif()
diff --git a/build_files/cmake/config/blender_full.cmake b/build_files/cmake/config/blender_full.cmake
index 41bee263e22..7d3284af158 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -15,6 +15,7 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index 68b9bd1d94d..16c15961c59 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -20,6 +20,7 @@ set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake
index e6fc73a75ed..ddd9aa1d766 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -16,6 +16,7 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index a80b0b56901..c5c46a3b394 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -437,6 +437,14 @@ if(WITH_XR_OPENXR)
endif()
endif()
+if(WITH_GMP)
+ find_package(GMP)
+ if(NOT GMP_FOUND)
+ message(WARNING "GMP not found, disabling WITH_GMP")
+ set(WITH_GMP OFF)
+ endif()
+endif()
+
set(EXETYPE MACOSX_BUNDLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index c5e8893424b..b623200a159 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -435,6 +435,14 @@ if(WITH_XR_OPENXR)
endif()
endif()
+if(WITH_GMP)
+ find_package_wrapper(GMP)
+ if(NOT GMP_FOUND)
+ message(WARNING "GMP not found, disabling WITH_GMP")
+ set(WITH_GMP OFF)
+ endif()
+endif()
+
if(EXISTS ${LIBDIR})
without_system_libs_end()
endif()
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index ebafe92c962..dfcd5d75444 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -26,10 +26,6 @@ if(NOT MSVC)
message(FATAL_ERROR "Compiler is unsupported")
endif()
-if(WITH_GTESTS AND ${CMAKE_VERSION} VERSION_LESS "3.18.0")
- message(FATAL_ERROR "CMake 3.18.0 is required for building WITH_GTESTS on windows, currently installed cmake version is ${CMAKE_VERSION}")
-endif()
-
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(MSVC_CLANG On)
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
@@ -754,3 +750,10 @@ if(WITH_XR_OPENXR)
set(WITH_XR_OPENXR OFF)
endif()
endif()
+
+if(WITH_GMP)
+ set(GMP_INCLUDE_DIRS ${LIBDIR}/gmp/include)
+ set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/libgmp-10.lib optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
+ set(GMP_ROOT_DIR ${LIBDIR}/gmp)
+ set(GMP_FOUND On)
+endif()
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 33e73b5a4b9..ae681432a43 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -678,7 +678,7 @@ static ShaderNode *add_node(Scene *scene,
* builtin names for packed images and movies
*/
int scene_frame = b_scene.frame_current();
- int image_frame = image_user_frame_number(b_image_user, scene_frame);
+ int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
image->handle = scene->image_manager->add_image(
new BlenderImageLoader(b_image, image_frame), image->image_params());
}
@@ -713,7 +713,7 @@ static ShaderNode *add_node(Scene *scene,
if (is_builtin) {
int scene_frame = b_scene.frame_current();
- int image_frame = image_user_frame_number(b_image_user, scene_frame);
+ int image_frame = image_user_frame_number(b_image_user, b_image, scene_frame);
env->handle = scene->image_manager->add_image(new BlenderImageLoader(b_image, image_frame),
env->image_params());
}
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index ad90a5f8d52..1ea34b41aa2 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -238,7 +238,7 @@ static inline string image_user_file_path(BL::ImageUser &iuser,
{
char filepath[1024];
iuser.tile(0);
- BKE_image_user_frame_calc(NULL, iuser.ptr.data, cfra);
+ BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra);
BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath);
string filepath_str = string(filepath);
@@ -248,9 +248,9 @@ static inline string image_user_file_path(BL::ImageUser &iuser,
return filepath_str;
}
-static inline int image_user_frame_number(BL::ImageUser &iuser, int cfra)
+static inline int image_user_frame_number(BL::ImageUser &iuser, BL::Image &ima, int cfra)
{
- BKE_image_user_frame_calc(NULL, iuser.ptr.data, cfra);
+ BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra);
return iuser.frame_current();
}
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 02daad2111a..bac7057d953 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -118,7 +118,7 @@ static const char *get_egl_error_message_string(EGLint error)
case EGL_CONTEXT_LOST:
return (
"A power management event has occurred. "
- "The application must destroy all contexts and reinitialise OpenGL ES state "
+ "The application must destroy all contexts and reinitialize OpenGL ES state "
"and objects to continue rendering.");
default:
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 96073c21e79..74bdff3812e 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -1951,7 +1951,7 @@ void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt,
switch (*context) {
/* There is no context, do an XConvertSelection() */
case XCLIB_XCOUT_NONE:
- /* Initialise return length to 0 */
+ /* Initialize return length to 0. */
if (*len > 0) {
free(*txt);
*len = 0;
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 604330bd1d3..9c62b2396f6 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -213,7 +213,7 @@ extern const char *(*MEM_name_ptr)(void *vmemh);
/** This should be called as early as possible in the program. When it has been called, information
* about memory leaks will be printed on exit. */
-void MEM_initialize_memleak_detection(void);
+void MEM_init_memleak_detection(void);
/* Switch allocator to slower but fully guarded mode. */
void MEM_use_guarded_allocator(void);
diff --git a/intern/guardedalloc/intern/leak_detector.cc b/intern/guardedalloc/intern/leak_detector.cc
index 4b2689ee28c..d7b6f749742 100644
--- a/intern/guardedalloc/intern/leak_detector.cc
+++ b/intern/guardedalloc/intern/leak_detector.cc
@@ -46,7 +46,7 @@ class MemLeakPrinter {
};
} // namespace
-void MEM_initialize_memleak_detection(void)
+void MEM_init_memleak_detection(void)
{
/**
* This variable is constructed when this function is first called. This should happen as soon as
diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h
index 3da1d8f53f0..dd5eab34ee0 100644
--- a/intern/mantaflow/extern/manta_fluid_API.h
+++ b/intern/mantaflow/extern/manta_fluid_API.h
@@ -33,10 +33,10 @@ struct MANTA;
/* Fluid functions */
struct MANTA *manta_init(int *res, struct FluidModifierData *fmd);
void manta_free(struct MANTA *fluid);
-void manta_ensure_obstacle(struct MANTA *fluid, struct FluidModifierData *fmd);
-void manta_ensure_guiding(struct MANTA *fluid, struct FluidModifierData *fmd);
-void manta_ensure_invelocity(struct MANTA *fluid, struct FluidModifierData *fmd);
-void manta_ensure_outflow(struct MANTA *fluid, struct FluidModifierData *fmd);
+int manta_ensure_obstacle(struct MANTA *fluid, struct FluidModifierData *fmd);
+int manta_ensure_guiding(struct MANTA *fluid, struct FluidModifierData *fmd);
+int manta_ensure_invelocity(struct MANTA *fluid, struct FluidModifierData *fmd);
+int manta_ensure_outflow(struct MANTA *fluid, struct FluidModifierData *fmd);
int manta_write_config(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr);
int manta_write_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr);
int manta_write_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr);
@@ -77,6 +77,7 @@ int manta_get_frame(struct MANTA *fluid);
float manta_get_timestep(struct MANTA *fluid);
void manta_adapt_timestep(struct MANTA *fluid);
bool manta_needs_realloc(struct MANTA *fluid, struct FluidModifierData *fmd);
+void manta_update_pointers(struct MANTA *fluid, struct FluidModifierData *fmd);
/* Fluid accessors */
size_t manta_get_index(int x, int max_x, int y, int max_y, int z /*, int max_z */);
@@ -121,9 +122,9 @@ void manta_noise_get_rgba_fixed_color(struct MANTA *smoke,
float color[3],
float *data,
int sequential);
-void manta_smoke_ensure_heat(struct MANTA *smoke, struct FluidModifierData *fmd);
-void manta_smoke_ensure_fire(struct MANTA *smoke, struct FluidModifierData *fmd);
-void manta_smoke_ensure_colors(struct MANTA *smoke, struct FluidModifierData *fmd);
+int manta_smoke_ensure_heat(struct MANTA *smoke, struct FluidModifierData *fmd);
+int manta_smoke_ensure_fire(struct MANTA *smoke, struct FluidModifierData *fmd);
+int manta_smoke_ensure_colors(struct MANTA *smoke, struct FluidModifierData *fmd);
/* Smoke accessors */
float *manta_smoke_get_density(struct MANTA *smoke);
@@ -167,7 +168,7 @@ int manta_noise_get_cells(struct MANTA *smoke);
/* Liquid functions */
void manta_liquid_export_script(struct MANTA *smoke, struct FluidModifierData *fmd);
-void manta_liquid_ensure_sndparts(struct MANTA *fluid, struct FluidModifierData *fmd);
+int manta_liquid_ensure_sndparts(struct MANTA *fluid, struct FluidModifierData *fmd);
/* Liquid accessors */
int manta_liquid_get_particle_res_x(struct MANTA *liquid);
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 5b2cbb09979..7de1aca6e87 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -27,10 +27,6 @@
#include <sstream>
#include <zlib.h>
-#if OPENVDB == 1
-# include "openvdb/openvdb.h"
-#endif
-
#include "MANTA_main.h"
#include "Python.h"
#include "fluid_script.h"
@@ -60,13 +56,6 @@ using std::to_string;
atomic<int> MANTA::solverID(0);
int MANTA::with_debug(0);
-/* Number of particles that the cache reads at once (with zlib). */
-#define PARTICLE_CHUNK 20000
-/* Number of mesh nodes that the cache reads at once (with zlib). */
-#define NODE_CHUNK 20000
-/* Number of mesh triangles that the cache reads at once (with zlib). */
-#define TRIANGLE_CHUNK 20000
-
MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
{
if (with_debug)
@@ -96,8 +85,7 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mUsingInvel = (fds->active_fields & FLUID_DOMAIN_ACTIVE_INVEL);
mUsingOutflow = (fds->active_fields & FLUID_DOMAIN_ACTIVE_OUTFLOW);
- // Simulation constants
- mTempAmb = 0; // TODO: Maybe use this later for buoyancy calculation
+ /* Simulation constants. */
mResX = res[0];
mResY = res[1];
mResZ = res[2];
@@ -105,7 +93,7 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mTotalCells = mResX * mResY * mResZ;
mResGuiding = fds->res;
- // Smoke low res grids
+ /* Smoke low res grids. */
mDensity = nullptr;
mShadow = nullptr;
mHeat = nullptr;
@@ -131,7 +119,7 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mReactIn = nullptr;
mEmissionIn = nullptr;
- // Smoke high res grids
+ /* Smoke high res grids. */
mDensityHigh = nullptr;
mFlameHigh = nullptr;
mFuelHigh = nullptr;
@@ -146,19 +134,19 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mTextureV2 = nullptr;
mTextureW2 = nullptr;
- // Fluid low res grids
+ /* Fluid low res grids. */
mPhiIn = nullptr;
mPhiStaticIn = nullptr;
mPhiOutIn = nullptr;
mPhiOutStaticIn = nullptr;
mPhi = nullptr;
- // Mesh
+ /* Mesh. */
mMeshNodes = nullptr;
mMeshTriangles = nullptr;
mMeshVelocities = nullptr;
- // Fluid obstacle
+ /* Fluid obstacle. */
mPhiObsIn = nullptr;
mPhiObsStaticIn = nullptr;
mNumObstacle = nullptr;
@@ -166,47 +154,48 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mObVelocityY = nullptr;
mObVelocityZ = nullptr;
- // Fluid guiding
+ /* Fluid guiding. */
mPhiGuideIn = nullptr;
mNumGuide = nullptr;
mGuideVelocityX = nullptr;
mGuideVelocityY = nullptr;
mGuideVelocityZ = nullptr;
- // Fluid initial velocity
+ /* Fluid initial velocity. */
mInVelocityX = nullptr;
mInVelocityY = nullptr;
mInVelocityZ = nullptr;
- // Secondary particles
+ /* Secondary particles. */
mFlipParticleData = nullptr;
mFlipParticleVelocity = nullptr;
- mSndParticleData = nullptr;
- mSndParticleVelocity = nullptr;
- mSndParticleLife = nullptr;
+ mParticleData = nullptr;
+ mParticleVelocity = nullptr;
+ mParticleLife = nullptr;
- // Cache read success indicators
+ /* Cache read success indicators. */
mFlipFromFile = false;
mMeshFromFile = false;
mParticlesFromFile = false;
- // Setup Mantaflow in Python
+ /* Setup Mantaflow in Python. */
initializeMantaflow();
- // Initializa RNA map with values that Python will need
+ /* Initializa RNA map with values that Python will need. */
initializeRNAMap(fmd);
- // Initialize Mantaflow variables in Python
- // Liquid
+ bool initSuccess = true;
+ /* Initialize Mantaflow variables in Python. */
+ /* Liquid. */
if (mUsingLiquid) {
- initDomain();
- initLiquid();
+ initSuccess &= initDomain();
+ initSuccess &= initLiquid();
if (mUsingObstacle)
- initObstacle();
+ initSuccess &= initObstacle();
if (mUsingInvel)
- initInVelocity();
+ initSuccess &= initInVelocity();
if (mUsingOutflow)
- initOutflow();
+ initSuccess &= initOutflow();
if (mUsingDrops || mUsingBubbles || mUsingFloats || mUsingTracers) {
mUpresParticle = fds->particle_scale;
@@ -215,8 +204,8 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mResZParticle = mUpresParticle * mResZ;
mTotalCellsParticles = mResXParticle * mResYParticle * mResZParticle;
- initSndParts();
- initLiquidSndParts();
+ initSuccess &= initSndParts();
+ initSuccess &= initLiquidSndParts();
}
if (mUsingMesh) {
@@ -226,44 +215,44 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mResZMesh = mUpresMesh * mResZ;
mTotalCellsMesh = mResXMesh * mResYMesh * mResZMesh;
- // Initialize Mantaflow variables in Python
- initMesh();
- initLiquidMesh();
+ /* Initialize Mantaflow variables in Python. */
+ initSuccess &= initMesh();
+ initSuccess &= initLiquidMesh();
}
if (mUsingDiffusion) {
- initCurvature();
+ initSuccess &= initCurvature();
}
if (mUsingGuiding) {
mResGuiding = (fds->guide_parent) ? fds->guide_res : fds->res;
- initGuiding();
+ initSuccess &= initGuiding();
}
if (mUsingFractions) {
- initFractions();
+ initSuccess &= initFractions();
}
}
- // Smoke
+ /* Smoke. */
if (mUsingSmoke) {
- initDomain();
- initSmoke();
+ initSuccess &= initDomain();
+ initSuccess &= initSmoke();
if (mUsingHeat)
- initHeat();
+ initSuccess &= initHeat();
if (mUsingFire)
- initFire();
+ initSuccess &= initFire();
if (mUsingColors)
- initColors();
+ initSuccess &= initColors();
if (mUsingObstacle)
- initObstacle();
+ initSuccess &= initObstacle();
if (mUsingInvel)
- initInVelocity();
+ initSuccess &= initInVelocity();
if (mUsingOutflow)
- initOutflow();
+ initSuccess &= initOutflow();
if (mUsingGuiding) {
mResGuiding = (fds->guide_parent) ? fds->guide_res : fds->res;
- initGuiding();
+ initSuccess &= initGuiding();
}
if (mUsingNoise) {
@@ -273,31 +262,33 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
mResZNoise = amplify * mResZ;
mTotalCellsHigh = mResXNoise * mResYNoise * mResZNoise;
- // Initialize Mantaflow variables in Python
- initNoise();
- initSmokeNoise();
+ /* Initialize Mantaflow variables in Python. */
+ initSuccess &= initNoise();
+ initSuccess &= initSmokeNoise();
if (mUsingFire)
- initFireHigh();
+ initSuccess &= initFireHigh();
if (mUsingColors)
- initColorsHigh();
+ initSuccess &= initColorsHigh();
}
}
- updatePointers();
+ /* All requested initializations must not fail in constructor. */
+ BLI_assert(initSuccess);
+ updatePointers(fmd);
}
-void MANTA::initDomain(FluidModifierData *fmd)
+bool MANTA::initDomain(FluidModifierData *fmd)
{
- // Vector will hold all python commands that are to be executed
+ /* Vector will hold all python commands that are to be executed. */
vector<string> pythonCommands;
- // Set manta debug level first
+ /* Set manta debug level first. */
pythonCommands.push_back(manta_import + manta_debuglevel);
ostringstream ss;
ss << "set_manta_debuglevel(" << with_debug << ")";
pythonCommands.push_back(ss.str());
- // Now init basic fluid domain
+ /* Now init basic fluid domain. */
string tmpString = fluid_variables + fluid_solver + fluid_alloc + fluid_cache_helper +
fluid_bake_multiprocessing + fluid_bake_data + fluid_bake_noise +
fluid_bake_mesh + fluid_bake_particles + fluid_bake_guiding +
@@ -305,20 +296,20 @@ void MANTA::initDomain(FluidModifierData *fmd)
fluid_adapt_time_step + fluid_time_stepping;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
+ return runPythonString(pythonCommands);
}
-void MANTA::initNoise(FluidModifierData *fmd)
+bool MANTA::initNoise(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = fluid_variables_noise + fluid_solver_noise;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
+ return runPythonString(pythonCommands);
}
-void MANTA::initSmoke(FluidModifierData *fmd)
+bool MANTA::initSmoke(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = smoke_variables + smoke_alloc + smoke_adaptive_step + smoke_save_data +
@@ -326,10 +317,10 @@ void MANTA::initSmoke(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
+ return runPythonString(pythonCommands);
}
-void MANTA::initSmokeNoise(FluidModifierData *fmd)
+bool MANTA::initSmokeNoise(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = smoke_variables_noise + smoke_alloc_noise + smoke_wavelet_noise +
@@ -337,11 +328,11 @@ void MANTA::initSmokeNoise(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingNoise = true;
+ return runPythonString(pythonCommands);
}
-void MANTA::initHeat(FluidModifierData *fmd)
+bool MANTA::initHeat(FluidModifierData *fmd)
{
if (!mHeat) {
vector<string> pythonCommands;
@@ -349,12 +340,13 @@ void MANTA::initHeat(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingHeat = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initFire(FluidModifierData *fmd)
+bool MANTA::initFire(FluidModifierData *fmd)
{
if (!mFuel) {
vector<string> pythonCommands;
@@ -362,12 +354,13 @@ void MANTA::initFire(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingFire = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initFireHigh(FluidModifierData *fmd)
+bool MANTA::initFireHigh(FluidModifierData *fmd)
{
if (!mFuelHigh) {
vector<string> pythonCommands;
@@ -375,12 +368,13 @@ void MANTA::initFireHigh(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingFire = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initColors(FluidModifierData *fmd)
+bool MANTA::initColors(FluidModifierData *fmd)
{
if (!mColorR) {
vector<string> pythonCommands;
@@ -388,12 +382,13 @@ void MANTA::initColors(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingColors = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initColorsHigh(FluidModifierData *fmd)
+bool MANTA::initColorsHigh(FluidModifierData *fmd)
{
if (!mColorRHigh) {
vector<string> pythonCommands;
@@ -401,12 +396,13 @@ void MANTA::initColorsHigh(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingColors = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initLiquid(FluidModifierData *fmd)
+bool MANTA::initLiquid(FluidModifierData *fmd)
{
if (!mPhiIn) {
vector<string> pythonCommands;
@@ -415,44 +411,45 @@ void MANTA::initLiquid(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingLiquid = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initMesh(FluidModifierData *fmd)
+bool MANTA::initMesh(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = fluid_variables_mesh + fluid_solver_mesh + liquid_load_mesh;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingMesh = true;
+ return runPythonString(pythonCommands);
}
-void MANTA::initLiquidMesh(FluidModifierData *fmd)
+bool MANTA::initLiquidMesh(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = liquid_alloc_mesh + liquid_step_mesh + liquid_save_mesh;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingMesh = true;
+ return runPythonString(pythonCommands);
}
-void MANTA::initCurvature(FluidModifierData *fmd)
+bool MANTA::initCurvature(FluidModifierData *fmd)
{
std::vector<std::string> pythonCommands;
std::string finalString = parseScript(liquid_alloc_curvature, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingDiffusion = true;
+ return runPythonString(pythonCommands);
}
-void MANTA::initObstacle(FluidModifierData *fmd)
+bool MANTA::initObstacle(FluidModifierData *fmd)
{
if (!mPhiObsIn) {
vector<string> pythonCommands;
@@ -460,12 +457,13 @@ void MANTA::initObstacle(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingObstacle = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initGuiding(FluidModifierData *fmd)
+bool MANTA::initGuiding(FluidModifierData *fmd)
{
if (!mPhiGuideIn) {
vector<string> pythonCommands;
@@ -474,23 +472,24 @@ void MANTA::initGuiding(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingGuiding = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initFractions(FluidModifierData *fmd)
+bool MANTA::initFractions(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = fluid_alloc_fractions + fluid_with_fractions;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingFractions = true;
+ return runPythonString(pythonCommands);
}
-void MANTA::initInVelocity(FluidModifierData *fmd)
+bool MANTA::initInVelocity(FluidModifierData *fmd)
{
if (!mInVelocityX) {
vector<string> pythonCommands;
@@ -498,12 +497,13 @@ void MANTA::initInVelocity(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingInvel = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initOutflow(FluidModifierData *fmd)
+bool MANTA::initOutflow(FluidModifierData *fmd)
{
if (!mPhiOutIn) {
vector<string> pythonCommands;
@@ -511,24 +511,25 @@ void MANTA::initOutflow(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
mUsingOutflow = true;
+ return runPythonString(pythonCommands);
}
+ return false;
}
-void MANTA::initSndParts(FluidModifierData *fmd)
+bool MANTA::initSndParts(FluidModifierData *fmd)
{
vector<string> pythonCommands;
string tmpString = fluid_variables_particles + fluid_solver_particles;
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
+ return runPythonString(pythonCommands);
}
-void MANTA::initLiquidSndParts(FluidModifierData *fmd)
+bool MANTA::initLiquidSndParts(FluidModifierData *fmd)
{
- if (!mSndParticleData) {
+ if (!mParticleData) {
vector<string> pythonCommands;
string tmpString = liquid_alloc_particles + liquid_variables_particles +
liquid_step_particles + fluid_with_sndparts + liquid_load_particles +
@@ -536,8 +537,9 @@ void MANTA::initLiquidSndParts(FluidModifierData *fmd)
string finalString = parseScript(tmpString, fmd);
pythonCommands.push_back(finalString);
- runPythonString(pythonCommands);
+ return runPythonString(pythonCommands);
}
+ return false;
}
MANTA::~MANTA()
@@ -546,7 +548,7 @@ MANTA::~MANTA()
cout << "~FLUID: " << mCurrentID << " with res(" << mResX << ", " << mResY << ", " << mResZ
<< ")" << endl;
- // Destruction string for Python
+ /* Destruction string for Python. */
string tmpString = "";
vector<string> pythonCommands;
bool result = false;
@@ -554,10 +556,10 @@ MANTA::~MANTA()
tmpString += manta_import;
tmpString += fluid_delete_all;
- // Initializa RNA map with values that Python will need
+ /* Initializa RNA map with values that Python will need. */
initializeRNAMap();
- // Leave out fmd argument in parseScript since only looking up IDs
+ /* Leave out fmd argument in parseScript since only looking up IDs. */
string finalString = parseScript(tmpString);
pythonCommands.push_back(finalString);
result = runPythonString(pythonCommands);
@@ -619,10 +621,10 @@ void MANTA::initializeMantaflow()
string filename = "manta_scene_" + to_string(mCurrentID) + ".py";
vector<string> fill = vector<string>();
- // Initialize extension classes and wrappers
+ /* Initialize extension classes and wrappers. */
srand(0);
PyGILState_STATE gilstate = PyGILState_Ensure();
- Pb::setup(filename, fill); // Namespace from Mantaflow (registry)
+ Pb::setup(filename, fill); /* Namespace from Mantaflow (registry). */
PyGILState_Release(gilstate);
}
@@ -632,7 +634,7 @@ void MANTA::terminateMantaflow()
cout << "Fluid: Releasing Mantaflow framework" << endl;
PyGILState_STATE gilstate = PyGILState_Ensure();
- Pb::finalize(); // Namespace from Mantaflow (registry)
+ Pb::finalize(); /* Namespace from Mantaflow (registry). */
PyGILState_Release(gilstate);
}
@@ -1073,7 +1075,7 @@ string MANTA::parseScript(const string &setup_string, FluidModifierData *fmd)
ostringstream res;
string line = "";
- // Update RNA map if modifier data is handed over
+ /* Update RNA map if modifier data is handed over. */
if (fmd) {
initializeRNAMap(fmd);
}
@@ -1111,7 +1113,8 @@ bool MANTA::writeConfiguration(FluidModifierData *fmd, int framenr)
/* Create 'config' subdir if it does not exist already. */
BLI_dir_create_recursive(directory.c_str());
- gzFile gzf = (gzFile)BLI_gzopen(file.c_str(), "wb1"); // do some compression
+ /* Open new file with some compression. */
+ gzFile gzf = (gzFile)BLI_gzopen(file.c_str(), "wb1");
if (!gzf) {
cerr << "Fluid Error -- Cannot open file " << file << endl;
return false;
@@ -1615,10 +1618,10 @@ void MANTA::exportSmokeScript(FluidModifierData *fmd)
string manta_script;
- // Libraries
+ /* Libraries. */
manta_script += header_libraries + manta_import;
- // Variables
+ /* Variables. */
manta_script += header_variables + fluid_variables + smoke_variables;
if (noise) {
manta_script += fluid_variables_noise + smoke_variables_noise;
@@ -1626,14 +1629,14 @@ void MANTA::exportSmokeScript(FluidModifierData *fmd)
if (guiding)
manta_script += fluid_variables_guiding;
- // Solvers
+ /* Solvers. */
manta_script += header_solvers + fluid_solver;
if (noise)
manta_script += fluid_solver_noise;
if (guiding)
manta_script += fluid_solver_guiding;
- // Grids
+ /* Grids. */
manta_script += header_grids + fluid_alloc + smoke_alloc;
if (noise) {
manta_script += smoke_alloc_noise;
@@ -1657,36 +1660,36 @@ void MANTA::exportSmokeScript(FluidModifierData *fmd)
if (outflow)
manta_script += fluid_alloc_outflow;
- // Noise field
+ /* Noise field. */
if (noise)
manta_script += smoke_wavelet_noise;
- // Time
+ /* Time. */
manta_script += header_time + fluid_time_stepping + fluid_adapt_time_step;
- // Import
+ /* Import. */
manta_script += header_import + fluid_file_import + fluid_cache_helper + smoke_load_data;
if (noise)
manta_script += smoke_load_noise;
if (guiding)
manta_script += fluid_load_guiding;
- // Pre/Post Steps
+ /* Pre/Post Steps. */
manta_script += header_prepost + fluid_pre_step + fluid_post_step;
- // Steps
+ /* Steps. */
manta_script += header_steps + smoke_adaptive_step + smoke_step;
if (noise) {
manta_script += smoke_step_noise;
}
- // Main
+ /* Main. */
manta_script += header_main + smoke_standalone + fluid_standalone;
- // Fill in missing variables in script
+ /* Fill in missing variables in script. */
string final_script = MANTA::parseScript(manta_script, fmd);
- // Write script
+ /* Write script. */
ofstream myfile;
myfile.open(cacheDirScript);
myfile << final_script;
@@ -1725,10 +1728,10 @@ void MANTA::exportLiquidScript(FluidModifierData *fmd)
string manta_script;
- // Libraries
+ /* Libraries. */
manta_script += header_libraries + manta_import;
- // Variables
+ /* Variables. */
manta_script += header_variables + fluid_variables + liquid_variables;
if (mesh)
manta_script += fluid_variables_mesh;
@@ -1737,7 +1740,7 @@ void MANTA::exportLiquidScript(FluidModifierData *fmd)
if (guiding)
manta_script += fluid_variables_guiding;
- // Solvers
+ /* Solvers. */
manta_script += header_solvers + fluid_solver;
if (mesh)
manta_script += fluid_solver_mesh;
@@ -1746,7 +1749,7 @@ void MANTA::exportLiquidScript(FluidModifierData *fmd)
if (guiding)
manta_script += fluid_solver_guiding;
- // Grids
+ /* Grids. */
manta_script += header_grids + fluid_alloc + liquid_alloc;
if (mesh)
manta_script += liquid_alloc_mesh;
@@ -1763,13 +1766,13 @@ void MANTA::exportLiquidScript(FluidModifierData *fmd)
if (outflow)
manta_script += fluid_alloc_outflow;
- // Domain init
+ /* Domain init. */
manta_script += header_gridinit + liquid_init_phi;
- // Time
+ /* Time. */
manta_script += header_time + fluid_time_stepping + fluid_adapt_time_step;
- // Import
+ /* Import. */
manta_script += header_import + fluid_file_import + fluid_cache_helper + liquid_load_data;
if (mesh)
manta_script += liquid_load_mesh;
@@ -1778,23 +1781,23 @@ void MANTA::exportLiquidScript(FluidModifierData *fmd)
if (guiding)
manta_script += fluid_load_guiding;
- // Pre/Post Steps
+ /* Pre/Post Steps. */
manta_script += header_prepost + fluid_pre_step + fluid_post_step;
- // Steps
+ /* Steps. */
manta_script += header_steps + liquid_adaptive_step + liquid_step;
if (mesh)
manta_script += liquid_step_mesh;
if (drops || bubble || floater || tracer)
manta_script += liquid_step_particles;
- // Main
+ /* Main. */
manta_script += header_main + liquid_standalone + fluid_standalone;
- // Fill in missing variables in script
+ /* Fill in missing variables in script. */
string final_script = MANTA::parseScript(manta_script, fmd);
- // Write script
+ /* Write script. */
ofstream myfile;
myfile.open(cacheDirScript);
myfile << final_script;
@@ -1823,12 +1826,18 @@ static PyObject *callPythonFunction(string varName, string functionName, bool is
/* Be sure to initialize Python before using it. */
Py_Initialize();
- // Get pyobject that holds result value
+ /* Get pyobject that holds result value. */
if (!manta_main_module) {
PyGILState_Release(gilstate);
return nullptr;
}
+ /* Ensure that requested variable is present in module - avoid attribute errors later on. */
+ if (!PyObject_HasAttrString(manta_main_module, varName.c_str())) {
+ PyGILState_Release(gilstate);
+ return nullptr;
+ }
+
var = PyObject_GetAttrString(manta_main_module, varName.c_str());
if (!var) {
PyGILState_Release(gilstate);
@@ -1911,6 +1920,11 @@ static long pyObjectToLong(PyObject *inputObject)
return result;
}
+template<class T> static T *getPointer(string pyObjectName, string pyFunctionName)
+{
+ return static_cast<T *>(pyObjectToPointer(callPythonFunction(pyObjectName, pyFunctionName)));
+}
+
int MANTA::getFrame()
{
if (with_debug)
@@ -1955,137 +1969,137 @@ void MANTA::adaptTimestep()
runPythonString(pythonCommands);
}
-void MANTA::updatePointers()
+void MANTA::updatePointers(FluidModifierData *fmd)
{
if (with_debug)
cout << "MANTA::updatePointers()" << endl;
+ FluidDomainSettings *fds = fmd->domain;
+
+ bool liquid = (fds->type == FLUID_DOMAIN_TYPE_LIQUID);
+ bool smoke = (fds->type == FLUID_DOMAIN_TYPE_GAS);
+ bool noise = smoke && fds->flags & FLUID_DOMAIN_USE_NOISE;
+ bool heat = smoke && fds->active_fields & FLUID_DOMAIN_ACTIVE_HEAT;
+ bool colors = smoke && fds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS;
+ bool fire = smoke && fds->active_fields & FLUID_DOMAIN_ACTIVE_FIRE;
+ bool obstacle = fds->active_fields & FLUID_DOMAIN_ACTIVE_OBSTACLE;
+ bool guiding = fds->active_fields & FLUID_DOMAIN_ACTIVE_GUIDE;
+ bool invel = fds->active_fields & FLUID_DOMAIN_ACTIVE_INVEL;
+ bool outflow = fds->active_fields & FLUID_DOMAIN_ACTIVE_OUTFLOW;
+ bool drops = liquid && fds->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY;
+ bool bubble = liquid && fds->particle_type & FLUID_DOMAIN_PARTICLE_BUBBLE;
+ bool floater = liquid && fds->particle_type & FLUID_DOMAIN_PARTICLE_FOAM;
+ bool tracer = liquid && fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER;
+ bool parts = liquid && (drops | bubble | floater | tracer);
+ bool mesh = liquid && fds->flags & FLUID_DOMAIN_USE_MESH;
+ bool meshvel = liquid && mesh && fds->flags & FLUID_DOMAIN_USE_SPEED_VECTORS;
+
string func = "getDataPointer";
string funcNodes = "getNodesDataPointer";
string funcTris = "getTrisDataPointer";
string id = to_string(mCurrentID);
- string solver = "s" + id;
- string parts = "pp" + id;
- string snd = "sp" + id;
- string mesh = "sm" + id;
- string mesh2 = "mesh" + id;
- string noise = "sn" + id;
- string solver_ext = "_" + solver;
- string parts_ext = "_" + parts;
- string snd_ext = "_" + snd;
- string mesh_ext = "_" + mesh;
- string mesh_ext2 = "_" + mesh2;
- string noise_ext = "_" + noise;
-
- mFlags = (int *)pyObjectToPointer(callPythonFunction("flags" + solver_ext, func));
- mPhiIn = (float *)pyObjectToPointer(callPythonFunction("phiIn" + solver_ext, func));
- mPhiStaticIn = (float *)pyObjectToPointer(callPythonFunction("phiSIn" + solver_ext, func));
- mVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_vel" + solver_ext, func));
- mVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_vel" + solver_ext, func));
- mVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_vel" + solver_ext, func));
- mForceX = (float *)pyObjectToPointer(callPythonFunction("x_force" + solver_ext, func));
- mForceY = (float *)pyObjectToPointer(callPythonFunction("y_force" + solver_ext, func));
- mForceZ = (float *)pyObjectToPointer(callPythonFunction("z_force" + solver_ext, func));
-
- if (mUsingOutflow) {
- mPhiOutIn = (float *)pyObjectToPointer(callPythonFunction("phiOutIn" + solver_ext, func));
- mPhiOutStaticIn = (float *)pyObjectToPointer(
- callPythonFunction("phiOutSIn" + solver_ext, func));
- }
- if (mUsingObstacle) {
- mPhiObsIn = (float *)pyObjectToPointer(callPythonFunction("phiObsIn" + solver_ext, func));
- mPhiObsStaticIn = (float *)pyObjectToPointer(
- callPythonFunction("phiObsSIn" + solver_ext, func));
- mObVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_obvel" + solver_ext, func));
- mObVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_obvel" + solver_ext, func));
- mObVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_obvel" + solver_ext, func));
- mNumObstacle = (float *)pyObjectToPointer(callPythonFunction("numObs" + solver_ext, func));
- }
- if (mUsingGuiding) {
- mPhiGuideIn = (float *)pyObjectToPointer(callPythonFunction("phiGuideIn" + solver_ext, func));
- mGuideVelocityX = (float *)pyObjectToPointer(
- callPythonFunction("x_guidevel" + solver_ext, func));
- mGuideVelocityY = (float *)pyObjectToPointer(
- callPythonFunction("y_guidevel" + solver_ext, func));
- mGuideVelocityZ = (float *)pyObjectToPointer(
- callPythonFunction("z_guidevel" + solver_ext, func));
- mNumGuide = (float *)pyObjectToPointer(callPythonFunction("numGuides" + solver_ext, func));
- }
- if (mUsingInvel) {
- mInVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_invel" + solver_ext, func));
- mInVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_invel" + solver_ext, func));
- mInVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_invel" + solver_ext, func));
- }
- if (mUsingSmoke) {
- mDensity = (float *)pyObjectToPointer(callPythonFunction("density" + solver_ext, func));
- mDensityIn = (float *)pyObjectToPointer(callPythonFunction("densityIn" + solver_ext, func));
- mShadow = (float *)pyObjectToPointer(callPythonFunction("shadow" + solver_ext, func));
- mEmissionIn = (float *)pyObjectToPointer(callPythonFunction("emissionIn" + solver_ext, func));
- }
- if (mUsingSmoke && mUsingHeat) {
- mHeat = (float *)pyObjectToPointer(callPythonFunction("heat" + solver_ext, func));
- mHeatIn = (float *)pyObjectToPointer(callPythonFunction("heatIn" + solver_ext, func));
- }
- if (mUsingSmoke && mUsingFire) {
- mFlame = (float *)pyObjectToPointer(callPythonFunction("flame" + solver_ext, func));
- mFuel = (float *)pyObjectToPointer(callPythonFunction("fuel" + solver_ext, func));
- mReact = (float *)pyObjectToPointer(callPythonFunction("react" + solver_ext, func));
- mFuelIn = (float *)pyObjectToPointer(callPythonFunction("fuelIn" + solver_ext, func));
- mReactIn = (float *)pyObjectToPointer(callPythonFunction("reactIn" + solver_ext, func));
- }
- if (mUsingSmoke && mUsingColors) {
- mColorR = (float *)pyObjectToPointer(callPythonFunction("color_r" + solver_ext, func));
- mColorG = (float *)pyObjectToPointer(callPythonFunction("color_g" + solver_ext, func));
- mColorB = (float *)pyObjectToPointer(callPythonFunction("color_b" + solver_ext, func));
- mColorRIn = (float *)pyObjectToPointer(callPythonFunction("color_r_in" + solver_ext, func));
- mColorGIn = (float *)pyObjectToPointer(callPythonFunction("color_g_in" + solver_ext, func));
- mColorBIn = (float *)pyObjectToPointer(callPythonFunction("color_b_in" + solver_ext, func));
- }
- if (mUsingSmoke && mUsingNoise) {
- mDensityHigh = (float *)pyObjectToPointer(callPythonFunction("density" + noise_ext, func));
- mTextureU = (float *)pyObjectToPointer(callPythonFunction("texture_u" + solver_ext, func));
- mTextureV = (float *)pyObjectToPointer(callPythonFunction("texture_v" + solver_ext, func));
- mTextureW = (float *)pyObjectToPointer(callPythonFunction("texture_w" + solver_ext, func));
- mTextureU2 = (float *)pyObjectToPointer(callPythonFunction("texture_u2" + solver_ext, func));
- mTextureV2 = (float *)pyObjectToPointer(callPythonFunction("texture_v2" + solver_ext, func));
- mTextureW2 = (float *)pyObjectToPointer(callPythonFunction("texture_w2" + solver_ext, func));
- }
- if (mUsingSmoke && mUsingNoise && mUsingFire) {
- mFlameHigh = (float *)pyObjectToPointer(callPythonFunction("flame" + noise_ext, func));
- mFuelHigh = (float *)pyObjectToPointer(callPythonFunction("fuel" + noise_ext, func));
- mReactHigh = (float *)pyObjectToPointer(callPythonFunction("react" + noise_ext, func));
- }
- if (mUsingSmoke && mUsingNoise && mUsingColors) {
- mColorRHigh = (float *)pyObjectToPointer(callPythonFunction("color_r" + noise_ext, func));
- mColorGHigh = (float *)pyObjectToPointer(callPythonFunction("color_g" + noise_ext, func));
- mColorBHigh = (float *)pyObjectToPointer(callPythonFunction("color_b" + noise_ext, func));
- }
- if (mUsingLiquid) {
- mPhi = (float *)pyObjectToPointer(callPythonFunction("phi" + solver_ext, func));
- mFlipParticleData = (vector<pData> *)pyObjectToPointer(
- callPythonFunction("pp" + solver_ext, func));
- mFlipParticleVelocity = (vector<pVel> *)pyObjectToPointer(
- callPythonFunction("pVel" + parts_ext, func));
- }
- if (mUsingLiquid && mUsingMesh) {
- mMeshNodes = (vector<Node> *)pyObjectToPointer(
- callPythonFunction("mesh" + mesh_ext, funcNodes));
- mMeshTriangles = (vector<Triangle> *)pyObjectToPointer(
- callPythonFunction("mesh" + mesh_ext, funcTris));
- }
- if (mUsingLiquid && mUsingMVel) {
- mMeshVelocities = (vector<pVel> *)pyObjectToPointer(
- callPythonFunction("mVel" + mesh_ext2, func));
- }
- if (mUsingLiquid && (mUsingDrops | mUsingBubbles | mUsingFloats | mUsingTracers)) {
- mSndParticleData = (vector<pData> *)pyObjectToPointer(
- callPythonFunction("ppSnd" + snd_ext, func));
- mSndParticleVelocity = (vector<pVel> *)pyObjectToPointer(
- callPythonFunction("pVelSnd" + parts_ext, func));
- mSndParticleLife = (vector<float> *)pyObjectToPointer(
- callPythonFunction("pLifeSnd" + parts_ext, func));
- }
+ string s_ext = "_s" + id;
+ string pp_ext = "_pp" + id;
+ string snd_ext = "_sp" + id;
+ string sm_ext = "_sm" + id;
+ string mesh_ext = "_mesh" + id;
+ string sn_ext = "_sn" + id;
+
+ mFlags = getPointer<int>("flags" + s_ext, func);
+ mPhiIn = getPointer<float>("phiIn" + s_ext, func);
+ mPhiStaticIn = getPointer<float>("phiSIn" + s_ext, func);
+ mVelocityX = getPointer<float>("x_vel" + s_ext, func);
+ mVelocityY = getPointer<float>("y_vel" + s_ext, func);
+ mVelocityZ = getPointer<float>("z_vel" + s_ext, func);
+ mForceX = getPointer<float>("x_force" + s_ext, func);
+ mForceY = getPointer<float>("y_force" + s_ext, func);
+ mForceZ = getPointer<float>("z_force" + s_ext, func);
+
+ /* Outflow. */
+ mPhiOutIn = (outflow) ? getPointer<float>("phiOutIn" + s_ext, func) : nullptr;
+ mPhiOutStaticIn = (outflow) ? getPointer<float>("phiOutSIn" + s_ext, func) : nullptr;
+
+ /* Obstacles. */
+ mPhiObsIn = (obstacle) ? getPointer<float>("phiObsIn" + s_ext, func) : nullptr;
+ mPhiObsStaticIn = (obstacle) ? getPointer<float>("phiObsSIn" + s_ext, func) : nullptr;
+ mObVelocityX = (obstacle) ? getPointer<float>("x_obvel" + s_ext, func) : nullptr;
+ mObVelocityY = (obstacle) ? getPointer<float>("y_obvel" + s_ext, func) : nullptr;
+ mObVelocityZ = (obstacle) ? getPointer<float>("z_obvel" + s_ext, func) : nullptr;
+ mNumObstacle = (obstacle) ? getPointer<float>("numObs" + s_ext, func) : nullptr;
+
+ /* Guiding. */
+ mPhiGuideIn = (guiding) ? getPointer<float>("phiGuideIn" + s_ext, func) : nullptr;
+ mGuideVelocityX = (guiding) ? getPointer<float>("x_guidevel" + s_ext, func) : nullptr;
+ mGuideVelocityY = (guiding) ? getPointer<float>("y_guidevel" + s_ext, func) : nullptr;
+ mGuideVelocityZ = (guiding) ? getPointer<float>("z_guidevel" + s_ext, func) : nullptr;
+ mNumGuide = (guiding) ? getPointer<float>("numGuides" + s_ext, func) : nullptr;
+
+ /* Initial velocities. */
+ mInVelocityX = (invel) ? getPointer<float>("x_invel" + s_ext, func) : nullptr;
+ mInVelocityY = (invel) ? getPointer<float>("y_invel" + s_ext, func) : nullptr;
+ mInVelocityZ = (invel) ? getPointer<float>("z_invel" + s_ext, func) : nullptr;
+
+ /* Smoke. */
+ mDensity = (smoke) ? getPointer<float>("density" + s_ext, func) : nullptr;
+ mDensityIn = (smoke) ? getPointer<float>("densityIn" + s_ext, func) : nullptr;
+ mShadow = (smoke) ? getPointer<float>("shadow" + s_ext, func) : nullptr;
+ mEmissionIn = (smoke) ? getPointer<float>("emissionIn" + s_ext, func) : nullptr;
+
+ /* Heat. */
+ mHeat = (heat) ? getPointer<float>("heat" + s_ext, func) : nullptr;
+ mHeatIn = (heat) ? getPointer<float>("heatIn" + s_ext, func) : nullptr;
+
+ /* Fire. */
+ mFlame = (fire) ? getPointer<float>("flame" + s_ext, func) : nullptr;
+ mFuel = (fire) ? getPointer<float>("fuel" + s_ext, func) : nullptr;
+ mReact = (fire) ? getPointer<float>("react" + s_ext, func) : nullptr;
+ mFuelIn = (fire) ? getPointer<float>("fuelIn" + s_ext, func) : nullptr;
+ mReactIn = (fire) ? getPointer<float>("reactIn" + s_ext, func) : nullptr;
+
+ /* Colors. */
+ mColorR = (colors) ? getPointer<float>("color_r" + s_ext, func) : nullptr;
+ mColorG = (colors) ? getPointer<float>("color_g" + s_ext, func) : nullptr;
+ mColorB = (colors) ? getPointer<float>("color_b" + s_ext, func) : nullptr;
+ mColorRIn = (colors) ? getPointer<float>("color_r_in" + s_ext, func) : nullptr;
+ mColorGIn = (colors) ? getPointer<float>("color_g_in" + s_ext, func) : nullptr;
+ mColorBIn = (colors) ? getPointer<float>("color_b_in" + s_ext, func) : nullptr;
+
+ /* Noise. */
+ mDensityHigh = (noise) ? getPointer<float>("density" + sn_ext, func) : nullptr;
+ mTextureU = (noise) ? getPointer<float>("texture_u" + s_ext, func) : nullptr;
+ mTextureV = (noise) ? getPointer<float>("texture_v" + s_ext, func) : nullptr;
+ mTextureW = (noise) ? getPointer<float>("texture_w" + s_ext, func) : nullptr;
+ mTextureU2 = (noise) ? getPointer<float>("texture_u2" + s_ext, func) : nullptr;
+ mTextureV2 = (noise) ? getPointer<float>("texture_v2" + s_ext, func) : nullptr;
+ mTextureW2 = (noise) ? getPointer<float>("texture_w2" + s_ext, func) : nullptr;
+
+ /* Fire with noise. */
+ mFlameHigh = (noise && fire) ? getPointer<float>("flame" + sn_ext, func) : nullptr;
+ mFuelHigh = (noise && fire) ? getPointer<float>("fuel" + sn_ext, func) : nullptr;
+ mReactHigh = (noise && fire) ? getPointer<float>("react" + sn_ext, func) : nullptr;
+
+ /* Colors with noise. */
+ mColorRHigh = (noise && colors) ? getPointer<float>("color_r" + sn_ext, func) : nullptr;
+ mColorGHigh = (noise && colors) ? getPointer<float>("color_g" + sn_ext, func) : nullptr;
+ mColorBHigh = (noise && colors) ? getPointer<float>("color_b" + sn_ext, func) : nullptr;
+
+ /* Liquid. */
+ mPhi = (liquid) ? getPointer<float>("phi" + s_ext, func) : nullptr;
+ mFlipParticleData = (liquid) ? getPointer<vector<pData>>("pp" + s_ext, func) : nullptr;
+ mFlipParticleVelocity = (liquid) ? getPointer<vector<pVel>>("pVel" + pp_ext, func) : nullptr;
+
+ /* Mesh. */
+ mMeshNodes = (mesh) ? getPointer<vector<Node>>("mesh" + sm_ext, funcNodes) : nullptr;
+ mMeshTriangles = (mesh) ? getPointer<vector<Triangle>>("mesh" + sm_ext, funcTris) : nullptr;
+
+ /* Mesh velocities. */
+ mMeshVelocities = (meshvel) ? getPointer<vector<pVel>>("mVel" + mesh_ext, func) : nullptr;
+
+ /* Secondary particles. */
+ mParticleData = (parts) ? getPointer<vector<pData>>("ppSnd" + snd_ext, func) : nullptr;
+ mParticleVelocity = (parts) ? getPointer<vector<pVel>>("pVelSnd" + pp_ext, func) : nullptr;
+ mParticleLife = (parts) ? getPointer<vector<float>>("pLifeSnd" + pp_ext, func) : nullptr;
mFlipFromFile = false;
mMeshFromFile = false;
diff --git a/intern/mantaflow/intern/MANTA_main.h b/intern/mantaflow/intern/MANTA_main.h
index dae2aea4e08..2de484db59d 100644
--- a/intern/mantaflow/intern/MANTA_main.h
+++ b/intern/mantaflow/intern/MANTA_main.h
@@ -41,7 +41,7 @@ struct MANTA {
MANTA(){};
virtual ~MANTA();
- // Mirroring Mantaflow structures for particle data (pVel also used for mesh vert vels)
+ /* Mirroring Mantaflow structures for particle data (pVel also used for mesh vert vels). */
typedef struct PData {
float pos[3];
int flag;
@@ -50,7 +50,7 @@ struct MANTA {
float pos[3];
} pVel;
- // Mirroring Mantaflow structures for meshes
+ /* Mirroring Mantaflow structures for meshes. */
typedef struct Node {
int flags;
float pos[3], normal[3];
@@ -60,36 +60,33 @@ struct MANTA {
int flags;
} Triangle;
- // Manta step, handling everything
- void step(struct FluidModifierData *fmd, int startFrame);
-
- // Grid initialization functions
- void initHeat(struct FluidModifierData *fmd = NULL);
- void initFire(struct FluidModifierData *fmd = NULL);
- void initColors(struct FluidModifierData *fmd = NULL);
- void initFireHigh(struct FluidModifierData *fmd = NULL);
- void initColorsHigh(struct FluidModifierData *fmd = NULL);
- void initLiquid(FluidModifierData *fmd = NULL);
- void initLiquidMesh(FluidModifierData *fmd = NULL);
- void initObstacle(FluidModifierData *fmd = NULL);
- void initCurvature(FluidModifierData *fmd = NULL);
- void initGuiding(FluidModifierData *fmd = NULL);
- void initFractions(FluidModifierData *fmd = NULL);
- void initInVelocity(FluidModifierData *fmd = NULL);
- void initOutflow(FluidModifierData *fmd = NULL);
- void initSndParts(FluidModifierData *fmd = NULL);
- void initLiquidSndParts(FluidModifierData *fmd = NULL);
-
- // Pointer transfer: Mantaflow -> Blender
- void updatePointers();
-
- // Write cache
+ /* Grid initialization functions. */
+ bool initHeat(struct FluidModifierData *fmd = nullptr);
+ bool initFire(struct FluidModifierData *fmd = nullptr);
+ bool initColors(struct FluidModifierData *fmd = nullptr);
+ bool initFireHigh(struct FluidModifierData *fmd = nullptr);
+ bool initColorsHigh(struct FluidModifierData *fmd = nullptr);
+ bool initLiquid(FluidModifierData *fmd = nullptr);
+ bool initLiquidMesh(FluidModifierData *fmd = nullptr);
+ bool initObstacle(FluidModifierData *fmd = nullptr);
+ bool initCurvature(FluidModifierData *fmd = nullptr);
+ bool initGuiding(FluidModifierData *fmd = nullptr);
+ bool initFractions(FluidModifierData *fmd = nullptr);
+ bool initInVelocity(FluidModifierData *fmd = nullptr);
+ bool initOutflow(FluidModifierData *fmd = nullptr);
+ bool initSndParts(FluidModifierData *fmd = nullptr);
+ bool initLiquidSndParts(FluidModifierData *fmd = nullptr);
+
+ /* Pointer transfer: Mantaflow -> Blender. */
+ void updatePointers(FluidModifierData *fmd);
+
+ /* Write cache. */
bool writeConfiguration(FluidModifierData *fmd, int framenr);
bool writeData(FluidModifierData *fmd, int framenr);
bool writeNoise(FluidModifierData *fmd, int framenr);
// write calls for mesh and particles were left in bake calls for now
- // Read cache (via Manta save/load)
+ /* Read cache (via Python). */
bool readConfiguration(FluidModifierData *fmd, int framenr);
bool readData(FluidModifierData *fmd, int framenr, bool resumable);
bool readNoise(FluidModifierData *fmd, int framenr, bool resumable);
@@ -97,26 +94,21 @@ struct MANTA {
bool readParticles(FluidModifierData *fmd, int framenr, bool resumable);
bool readGuiding(FluidModifierData *fmd, int framenr, bool sourceDomain);
- // Read cache (via file read functions in MANTA - e.g. read .bobj.gz meshes, .uni particles)
- bool updateMeshStructures(FluidModifierData *fmd, int framenr);
- bool updateFlipStructures(FluidModifierData *fmd, int framenr);
- bool updateParticleStructures(FluidModifierData *fmd, int framenr);
- bool updateSmokeStructures(FluidModifierData *fmd, int framenr);
- bool updateNoiseStructures(FluidModifierData *fmd, int framenr);
+ /* Propagate variable changes from RNA to Python. */
bool updateVariables(FluidModifierData *fmd);
- // Bake cache
+ /* Bake cache. */
bool bakeData(FluidModifierData *fmd, int framenr);
bool bakeNoise(FluidModifierData *fmd, int framenr);
bool bakeMesh(FluidModifierData *fmd, int framenr);
bool bakeParticles(FluidModifierData *fmd, int framenr);
bool bakeGuiding(FluidModifierData *fmd, int framenr);
- // IO for Mantaflow scene script
+ /* IO for Mantaflow scene script. */
void exportSmokeScript(struct FluidModifierData *fmd);
void exportLiquidScript(struct FluidModifierData *fmd);
- // Check cache status by frame
+ /* Check cache status by frame. */
bool hasConfig(FluidModifierData *fmd, int framenr);
bool hasData(FluidModifierData *fmd, int framenr);
bool hasNoise(FluidModifierData *fmd, int framenr);
@@ -193,7 +185,7 @@ struct MANTA {
return mUpresParticle;
}
- // Smoke getters
+ /* Smoke getters. */
inline float *getDensity()
{
return mDensity;
@@ -422,9 +414,9 @@ struct MANTA {
}
static atomic<int> solverID;
- static int with_debug; // on or off (1 or 0), also sets manta debug level
+ static int with_debug; /* On or off (1 or 0), also sets manta debug level. */
- // Mesh getters
+ /* Mesh getters. */
inline int getNumVertices()
{
return (mMeshNodes && !mMeshNodes->empty()) ? mMeshNodes->size() : 0;
@@ -563,9 +555,9 @@ struct MANTA {
inline int getSndParticleFlagAt(int i)
{
assert(i >= 0);
- if (mSndParticleData && !mSndParticleData->empty()) {
- assert(i < mSndParticleData->size());
- return (*mSndParticleData)[i].flag;
+ if (mParticleData && !mParticleData->empty()) {
+ assert(i < mParticleData->size());
+ return (*mParticleData)[i].flag;
}
return 0;
}
@@ -601,27 +593,27 @@ struct MANTA {
inline float getSndParticlePositionXAt(int i)
{
assert(i >= 0);
- if (mSndParticleData && !mSndParticleData->empty()) {
- assert(i < mSndParticleData->size());
- return (*mSndParticleData)[i].pos[0];
+ if (mParticleData && !mParticleData->empty()) {
+ assert(i < mParticleData->size());
+ return (*mParticleData)[i].pos[0];
}
return 0.0f;
}
inline float getSndParticlePositionYAt(int i)
{
assert(i >= 0);
- if (mSndParticleData && !mSndParticleData->empty()) {
- assert(i < mSndParticleData->size());
- return (*mSndParticleData)[i].pos[1];
+ if (mParticleData && !mParticleData->empty()) {
+ assert(i < mParticleData->size());
+ return (*mParticleData)[i].pos[1];
}
return 0.0f;
}
inline float getSndParticlePositionZAt(int i)
{
assert(i >= 0);
- if (mSndParticleData && !mSndParticleData->empty()) {
- assert(i < mSndParticleData->size());
- return (*mSndParticleData)[i].pos[2];
+ if (mParticleData && !mParticleData->empty()) {
+ assert(i < mParticleData->size());
+ return (*mParticleData)[i].pos[2];
}
return 0.0f;
}
@@ -657,27 +649,27 @@ struct MANTA {
inline float getSndParticleVelocityXAt(int i)
{
assert(i >= 0);
- if (mSndParticleVelocity && !mSndParticleVelocity->empty()) {
- assert(i < mSndParticleVelocity->size());
- return (*mSndParticleVelocity)[i].pos[0];
+ if (mParticleVelocity && !mParticleVelocity->empty()) {
+ assert(i < mParticleVelocity->size());
+ return (*mParticleVelocity)[i].pos[0];
}
return 0.0f;
}
inline float getSndParticleVelocityYAt(int i)
{
assert(i >= 0);
- if (mSndParticleVelocity && !mSndParticleVelocity->empty()) {
- assert(i < mSndParticleVelocity->size());
- return (*mSndParticleVelocity)[i].pos[1];
+ if (mParticleVelocity && !mParticleVelocity->empty()) {
+ assert(i < mParticleVelocity->size());
+ return (*mParticleVelocity)[i].pos[1];
}
return 0.0f;
}
inline float getSndParticleVelocityZAt(int i)
{
assert(i >= 0);
- if (mSndParticleVelocity && !mSndParticleVelocity->empty()) {
- assert(i < mSndParticleVelocity->size());
- return (*mSndParticleVelocity)[i].pos[2];
+ if (mParticleVelocity && !mParticleVelocity->empty()) {
+ assert(i < mParticleVelocity->size());
+ return (*mParticleVelocity)[i].pos[2];
}
return 0.0f;
}
@@ -686,30 +678,28 @@ struct MANTA {
{
return (mFlipParticleData && !mFlipParticleData->empty()) ?
(float *)&mFlipParticleData->front() :
- NULL;
+ nullptr;
}
inline float *getSndParticleData()
{
- return (mSndParticleData && !mSndParticleData->empty()) ? (float *)&mSndParticleData->front() :
- NULL;
+ return (mParticleData && !mParticleData->empty()) ? (float *)&mParticleData->front() : nullptr;
}
inline float *getFlipParticleVelocity()
{
return (mFlipParticleVelocity && !mFlipParticleVelocity->empty()) ?
(float *)&mFlipParticleVelocity->front() :
- NULL;
+ nullptr;
}
inline float *getSndParticleVelocity()
{
- return (mSndParticleVelocity && !mSndParticleVelocity->empty()) ?
- (float *)&mSndParticleVelocity->front() :
- NULL;
+ return (mParticleVelocity && !mParticleVelocity->empty()) ?
+ (float *)&mParticleVelocity->front() :
+ nullptr;
}
inline float *getSndParticleLife()
{
- return (mSndParticleLife && !mSndParticleLife->empty()) ? (float *)&mSndParticleLife->front() :
- NULL;
+ return (mParticleLife && !mParticleLife->empty()) ? (float *)&mParticleLife->front() : nullptr;
}
inline int getNumFlipParticles()
@@ -718,7 +708,7 @@ struct MANTA {
}
inline int getNumSndParticles()
{
- return (mSndParticleData && !mSndParticleData->empty()) ? mSndParticleData->size() : 0;
+ return (mParticleData && !mParticleData->empty()) ? mParticleData->size() : 0;
}
inline bool usingFlipFromFile()
@@ -734,7 +724,7 @@ struct MANTA {
return mParticlesFromFile;
}
- // Direct access to solver time attributes
+ /* Direct access to solver time attributes. */
int getFrame();
float getTimestep();
void adaptTimestep();
@@ -742,7 +732,7 @@ struct MANTA {
bool needsRealloc(FluidModifierData *fmd);
private:
- // simulation constants
+ /* Simulation constants. */
size_t mTotalCells;
size_t mTotalCellsHigh;
size_t mTotalCellsMesh;
@@ -750,6 +740,7 @@ struct MANTA {
unordered_map<string, string> mRNAMap;
+ /* The ID of the solver objects will be incremented for every new object. */
int mCurrentID;
bool mUsingHeat;
@@ -796,10 +787,7 @@ struct MANTA {
int mUpresMesh;
int mUpresParticle;
- float mTempAmb; /* ambient temperature */
- float mConstantScaling;
-
- // Fluid grids
+ /* Fluid grids. */
float *mVelocityX;
float *mVelocityY;
float *mVelocityZ;
@@ -819,7 +807,7 @@ struct MANTA {
float *mNumObstacle;
float *mNumGuide;
- // Smoke grids
+ /* Smoke grids. */
float *mDensity;
float *mHeat;
float *mFlame;
@@ -851,7 +839,7 @@ struct MANTA {
float *mTextureV2;
float *mTextureW2;
- // Liquid grids
+ /* Liquid grids. */
float *mPhiIn;
float *mPhiStaticIn;
float *mPhiObsIn;
@@ -861,31 +849,31 @@ struct MANTA {
float *mPhiOutStaticIn;
float *mPhi;
- // Mesh fields
+ /* Mesh fields. */
vector<Node> *mMeshNodes;
vector<Triangle> *mMeshTriangles;
vector<pVel> *mMeshVelocities;
- // Particle fields
+ /* Particle fields. */
vector<pData> *mFlipParticleData;
vector<pVel> *mFlipParticleVelocity;
- vector<pData> *mSndParticleData;
- vector<pVel> *mSndParticleVelocity;
- vector<float> *mSndParticleLife;
+ vector<pData> *mParticleData;
+ vector<pVel> *mParticleVelocity;
+ vector<float> *mParticleLife;
- void initializeRNAMap(struct FluidModifierData *fmd = NULL);
- void initDomain(struct FluidModifierData *fmd = NULL);
- void initNoise(struct FluidModifierData *fmd = NULL);
- void initMesh(struct FluidModifierData *fmd = NULL);
- void initSmoke(struct FluidModifierData *fmd = NULL);
- void initSmokeNoise(struct FluidModifierData *fmd = NULL);
+ void initializeRNAMap(struct FluidModifierData *doRnaRefresh = nullptr);
+ bool initDomain(struct FluidModifierData *doRnaRefresh = nullptr);
+ bool initNoise(struct FluidModifierData *doRnaRefresh = nullptr);
+ bool initMesh(struct FluidModifierData *doRnaRefresh = nullptr);
+ bool initSmoke(struct FluidModifierData *doRnaRefresh = nullptr);
+ bool initSmokeNoise(struct FluidModifierData *doRnaRefresh = nullptr);
void initializeMantaflow();
void terminateMantaflow();
bool runPythonString(vector<string> commands);
string getRealValue(const string &varName);
string parseLine(const string &line);
- string parseScript(const string &setup_string, FluidModifierData *fmd = NULL);
+ string parseScript(const string &setup_string, FluidModifierData *fmd = nullptr);
string getDirectory(struct FluidModifierData *fmd, string subdirectory);
string getFile(struct FluidModifierData *fmd,
string subdirectory,
diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp
index 60546bc1183..f58ac186ff1 100644
--- a/intern/mantaflow/intern/manta_fluid_API.cpp
+++ b/intern/mantaflow/intern/manta_fluid_API.cpp
@@ -37,33 +37,29 @@ void manta_free(MANTA *fluid)
fluid = nullptr;
}
-void manta_ensure_obstacle(MANTA *fluid, struct FluidModifierData *fmd)
+int manta_ensure_obstacle(MANTA *fluid, struct FluidModifierData *fmd)
{
- if (!fluid)
- return;
- fluid->initObstacle(fmd);
- fluid->updatePointers();
+ if (!fluid || !fmd)
+ return 0;
+ return fluid->initObstacle(fmd);
}
-void manta_ensure_guiding(MANTA *fluid, struct FluidModifierData *fmd)
+int manta_ensure_guiding(MANTA *fluid, struct FluidModifierData *fmd)
{
- if (!fluid)
- return;
- fluid->initGuiding(fmd);
- fluid->updatePointers();
+ if (!fluid || !fmd)
+ return 0;
+ return fluid->initGuiding(fmd);
}
-void manta_ensure_invelocity(MANTA *fluid, struct FluidModifierData *fmd)
+int manta_ensure_invelocity(MANTA *fluid, struct FluidModifierData *fmd)
{
- if (!fluid)
- return;
- fluid->initInVelocity(fmd);
- fluid->updatePointers();
+ if (!fluid || !fmd)
+ return 0;
+ return fluid->initInVelocity(fmd);
}
-void manta_ensure_outflow(MANTA *fluid, struct FluidModifierData *fmd)
+int manta_ensure_outflow(MANTA *fluid, struct FluidModifierData *fmd)
{
- if (!fluid)
- return;
- fluid->initOutflow(fmd);
- fluid->updatePointers();
+ if (!fluid || !fmd)
+ return 0;
+ return fluid->initOutflow(fmd);
}
int manta_write_config(MANTA *fluid, FluidModifierData *fmd, int framenr)
@@ -229,11 +225,18 @@ void manta_adapt_timestep(MANTA *fluid)
bool manta_needs_realloc(MANTA *fluid, FluidModifierData *fmd)
{
- if (!fluid)
+ if (!fluid || !fmd)
return false;
return fluid->needsRealloc(fmd);
}
+void manta_update_pointers(struct MANTA *fluid, struct FluidModifierData *fmd)
+{
+ if (!fluid || !fmd)
+ return;
+ fluid->updatePointers(fmd);
+}
+
/* Fluid accessors */
size_t manta_get_index(int x, int max_x, int y, int max_y, int z /*, int max_z */)
{
@@ -441,34 +444,35 @@ void manta_noise_get_rgba_fixed_color(MANTA *smoke, float color[3], float *data,
get_rgba_fixed_color(color, smoke->getTotalCellsHigh(), data, sequential);
}
-void manta_smoke_ensure_heat(MANTA *smoke, struct FluidModifierData *fmd)
+int manta_smoke_ensure_heat(MANTA *smoke, struct FluidModifierData *fmd)
{
- if (smoke) {
- smoke->initHeat(fmd);
- smoke->updatePointers();
- }
+ if (!smoke || !fmd)
+ return 0;
+ return smoke->initHeat(fmd);
}
-void manta_smoke_ensure_fire(MANTA *smoke, struct FluidModifierData *fmd)
+int manta_smoke_ensure_fire(MANTA *smoke, struct FluidModifierData *fmd)
{
- if (smoke) {
- smoke->initFire(fmd);
- if (smoke->usingNoise()) {
- smoke->initFireHigh(fmd);
- }
- smoke->updatePointers();
+ if (!smoke || !fmd)
+ return 0;
+
+ int result = smoke->initFire(fmd);
+ if (smoke->usingNoise()) {
+ result &= smoke->initFireHigh(fmd);
}
+ return result;
}
-void manta_smoke_ensure_colors(MANTA *smoke, struct FluidModifierData *fmd)
+int manta_smoke_ensure_colors(MANTA *smoke, struct FluidModifierData *fmd)
{
- if (smoke) {
- smoke->initColors(fmd);
- if (smoke->usingNoise()) {
- smoke->initColorsHigh(fmd);
- }
- smoke->updatePointers();
+ if (!smoke || !fmd)
+ return 0;
+
+ int result = smoke->initColors(fmd);
+ if (smoke->usingNoise()) {
+ result &= smoke->initColorsHigh(fmd);
}
+ return result;
}
/* Smoke accessors */
@@ -645,12 +649,11 @@ void manta_liquid_export_script(MANTA *liquid, FluidModifierData *fmd)
liquid->exportLiquidScript(fmd);
}
-void manta_liquid_ensure_sndparts(MANTA *liquid, struct FluidModifierData *fmd)
+int manta_liquid_ensure_sndparts(MANTA *liquid, struct FluidModifierData *fmd)
{
- if (liquid) {
- liquid->initLiquidSndParts(fmd);
- liquid->updatePointers();
- }
+ if (!liquid || !fmd)
+ return 0;
+ return liquid->initLiquidSndParts(fmd);
}
/* Liquid accessors */
diff --git a/intern/sky/include/sky_model.h b/intern/sky/include/sky_model.h
index 021086e1e02..983b90fed35 100644
--- a/intern/sky/include/sky_model.h
+++ b/intern/sky/include/sky_model.h
@@ -112,7 +112,7 @@ bands, you would need something like
ArHosekSkyModelState * skymodel_state[num_channels];
-You then have to allocate and initialise these states. In the following code
+You then have to allocate and initialize these states. In the following code
snippet, we assume that 'albedo' is defined as
double albedo[num_channels];
@@ -228,7 +228,7 @@ actually not altered at all in this release. All we did was to add some support
functionality for doing this more easily with the existing data and functions,
and to add some explanations.
-Just use 'arhosekskymodelstate_alienworld_alloc_init()' to initialise the sky
+Just use 'arhosekskymodelstate_alienworld_alloc_init()' to initialize the sky
model states (you will have to provide values for star temperature and solar
intensity compared to the terrestrial sun), and do everything else as you
did before.
@@ -351,7 +351,7 @@ typedef struct SKY_ArHosekSkyModelState {
arhosekskymodelstate_alloc_init() function
------------------------------------------
- Initialises an ArHosekSkyModelState struct for a terrestrial setting.
+ Initializes an #ArHosekSkyModelState struct for a terrestrial setting.
---------------------------------------------------------------------------- */
@@ -364,7 +364,7 @@ SKY_ArHosekSkyModelState *SKY_arhosekskymodelstate_alloc_init(const double solar
arhosekskymodelstate_alienworld_alloc_init() function
-----------------------------------------------------
- Initialises an ArHosekSkyModelState struct for an "alien world" setting
+ Initializes an ArHosekSkyModelState struct for an "alien world" setting
with a sun of a surface temperature given in 'kelvin'. The parameter
'solar_intensity' controls the overall brightness of the sky, relative
to the solar irradiance on Earth. A value of 1.0 yields a sky dome that
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index 0623e0e5395..936d01d1ea4 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -70,7 +70,7 @@ void BKE_curvemapping_changed(struct CurveMapping *cumap, const bool rem_doubles
void BKE_curvemapping_changed_all(struct CurveMapping *cumap);
/* call before _all_ evaluation functions */
-void BKE_curvemapping_initialize(struct CurveMapping *cumap);
+void BKE_curvemapping_init(struct CurveMapping *cumap);
/* keep these (const CurveMap) - to help with thread safety */
/* single curve, no table check */
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h
index 877ab887138..d7880e9ec43 100644
--- a/source/blender/blenkernel/BKE_curveprofile.h
+++ b/source/blender/blenkernel/BKE_curveprofile.h
@@ -72,7 +72,7 @@ void BKE_curveprofile_create_samples(struct CurveProfile *profile,
bool sample_straight_edges,
struct CurveProfilePoint *r_samples);
-void BKE_curveprofile_initialize(struct CurveProfile *profile, short segments_len);
+void BKE_curveprofile_init(struct CurveProfile *profile, short segments_len);
/* Called for a complete update of the widget after modifications */
enum {
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 7de588450d6..3c0ec8147fe 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -580,7 +580,7 @@ void psys_particle_on_dm(struct Mesh *mesh_final,
/* particle_system.c */
void distribute_particles(struct ParticleSimulationData *sim, int from);
-void initialize_particle(struct ParticleSimulationData *sim, struct ParticleData *pa);
+void init_particle(struct ParticleSimulationData *sim, struct ParticleData *pa);
void psys_calc_dmcache(struct Object *ob,
struct Mesh *mesh_final,
struct Mesh *mesh_original,
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index ea5a4bd99d1..5b5e32f1d81 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1150,7 +1150,7 @@ static int nlaevalchan_validate_index(NlaEvalChannel *nec, int index)
return 0;
}
-/* Initialise default values for NlaEvalChannel from the property data. */
+/* Initialize default values for NlaEvalChannel from the property data. */
static void nlaevalchan_get_default_values(NlaEvalChannel *nec, float *r_values)
{
PointerRNA *ptr = &nec->key.ptr;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index bf04603aa46..d1d6cc63174 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2576,7 +2576,7 @@ void BKE_pose_where_is(struct Depsgraph *depsgraph, Scene *scene, Object *ob)
}
/* 2a. construct the IK tree (standard IK) */
- BIK_initialize_tree(depsgraph, scene, ob, ctime);
+ BIK_init_tree(depsgraph, scene, ob, ctime);
/* 2b. construct the Spline IK trees
* - this is not integrated as an IK plugin, since it should be able
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index d66991aed70..97c717572bc 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -658,7 +658,7 @@ void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph, Scene *scene, Object *ob
return;
}
/* construct the IK tree (standard IK) */
- BIK_initialize_tree(depsgraph, scene, object, ctime);
+ BIK_init_tree(depsgraph, scene, object, ctime);
/* construct the Spline IK trees
* - this is not integrated as an IK plugin, since it should be able
* to function in conjunction with standard IK. */
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 355bdfd10fd..8178415a8f6 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -557,7 +557,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
/* Curve. */
custom_curve = brush->gpencil_settings->curve_sensitivity;
BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(custom_curve);
+ BKE_curvemapping_init(custom_curve);
brush_gpencil_curvemap_reset(custom_curve->cm, 3, GPCURVE_PRESET_INK);
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_INK;
@@ -594,7 +594,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
/* Curve. */
custom_curve = brush->gpencil_settings->curve_sensitivity;
BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(custom_curve);
+ BKE_curvemapping_init(custom_curve);
brush_gpencil_curvemap_reset(custom_curve->cm, 3, GPCURVE_PRESET_INKNOISE);
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_INKNOISE;
@@ -631,7 +631,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
/* Curve. */
custom_curve = brush->gpencil_settings->curve_sensitivity;
BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(custom_curve);
+ BKE_curvemapping_init(custom_curve);
brush_gpencil_curvemap_reset(custom_curve->cm, 4, GPCURVE_PRESET_MARKER);
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_MARKER;
@@ -667,12 +667,12 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
/* Curve. */
custom_curve = brush->gpencil_settings->curve_sensitivity;
BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(custom_curve);
+ BKE_curvemapping_init(custom_curve);
brush_gpencil_curvemap_reset(custom_curve->cm, 3, GPCURVE_PRESET_CHISEL_SENSIVITY);
custom_curve = brush->gpencil_settings->curve_strength;
BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(custom_curve);
+ BKE_curvemapping_init(custom_curve);
brush_gpencil_curvemap_reset(custom_curve->cm, 4, GPCURVE_PRESET_CHISEL_STRENGTH);
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_CHISEL;
@@ -2274,7 +2274,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary, bool
int half = side / 2;
int i, j;
- BKE_curvemapping_initialize(br->curve);
+ BKE_curvemapping_init(br->curve);
texcache = BKE_brush_gen_texture_cache(br, half, secondary);
im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
im->x = im->y = side;
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 4f4eb8f9f9d..fc326ffb390 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1202,7 +1202,7 @@ int BKE_curvemapping_RGBA_does_something(const CurveMapping *cumap)
return 0;
}
-void BKE_curvemapping_initialize(CurveMapping *cumap)
+void BKE_curvemapping_init(CurveMapping *cumap)
{
int a;
diff --git a/source/blender/blenkernel/intern/curveprofile.c b/source/blender/blenkernel/intern/curveprofile.c
index 8577990dc03..0a41529aac1 100644
--- a/source/blender/blenkernel/intern/curveprofile.c
+++ b/source/blender/blenkernel/intern/curveprofile.c
@@ -1040,7 +1040,7 @@ void BKE_curveprofile_update(CurveProfile *profile, const int update_flags)
* Also sets the number of segments used for the display preview of the locations
* of the sampled points.
*/
-void BKE_curveprofile_initialize(CurveProfile *profile, short segments_len)
+void BKE_curveprofile_init(CurveProfile *profile, short segments_len)
{
if (segments_len != profile->segments_len) {
profile->flag |= PROF_DIRTY_PRESET;
@@ -1055,7 +1055,7 @@ void BKE_curveprofile_initialize(CurveProfile *profile, short segments_len)
* Gives the distance to the next point in the widgets sampled table, in other words the length
* of the \a 'i' edge of the table.
*
- * \note Requires curveprofile_initialize or #BKE_curveprofile_update call before to fill table.
+ * \note Requires #BKE_curveprofile_init or #BKE_curveprofile_update call before to fill table.
*/
static float curveprofile_distance_to_next_table_point(const CurveProfile *profile, int i)
{
@@ -1067,7 +1067,7 @@ static float curveprofile_distance_to_next_table_point(const CurveProfile *profi
/**
* Calculates the total length of the profile from the curves sampled in the table.
*
- * \note Requires curveprofile_initialize or #BKE_curveprofile_update call before to fill table.
+ * \note Requires #BKE_curveprofile_init or #BKE_curveprofile_update call before to fill table.
*/
float BKE_curveprofile_total_length(const CurveProfile *profile)
{
@@ -1082,7 +1082,7 @@ float BKE_curveprofile_total_length(const CurveProfile *profile)
* Samples evenly spaced positions along the curve profile's table (generated from path). Fills
* an entire table at once for a speedup if all of the results are going to be used anyway.
*
- * \note Requires curveprofile_initialize or #BKE_curveprofile_update call before to fill table.
+ * \note Requires #BKE_curveprofile_init or #BKE_curveprofile_update call before to fill table.
* \note Working, but would conflict with "Sample Straight Edges" option, so this is unused for
* now.
*/
@@ -1145,7 +1145,7 @@ void BKE_curveprofile_create_samples_even_spacing(CurveProfile *profile,
* Travels down (length_portion * path) length and returns the position at that point.
*
* \param length_portion: The portion (0 to 1) of the path's full length to sample at.
- * \note Requires curveprofile_initialize or #BKE_curveprofile_update call before to fill table.
+ * \note Requires #BKE_curveprofile_init or #BKE_curveprofile_update call before to fill table.
*/
void BKE_curveprofile_evaluate_length_portion(const CurveProfile *profile,
float length_portion,
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 079b436a3ea..ad517fe1c23 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -1119,6 +1119,7 @@ static void ensure_obstaclefields(FluidDomainSettings *fds)
if (fds->active_fields & FLUID_DOMAIN_ACTIVE_GUIDE) {
manta_ensure_guiding(fds->fluid, fds->fmd);
}
+ manta_update_pointers(fds->fluid, fds->fmd);
}
static void update_obstacleflags(FluidDomainSettings *fds,
@@ -2596,7 +2597,7 @@ static void ensure_flowsfields(FluidDomainSettings *fds)
manta_smoke_ensure_fire(fds->fluid, fds->fmd);
}
if (fds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS) {
- /* initialize all smoke with "active_color" */
+ /* Initialize all smoke with "active_color". */
manta_smoke_ensure_colors(fds->fluid, fds->fmd);
}
if (fds->type == FLUID_DOMAIN_TYPE_LIQUID &&
@@ -2605,6 +2606,7 @@ static void ensure_flowsfields(FluidDomainSettings *fds)
fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER)) {
manta_liquid_ensure_sndparts(fds->fluid, fds->fmd);
}
+ manta_update_pointers(fds->fluid, fds->fmd);
}
static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int numflowobj)
@@ -2617,7 +2619,7 @@ static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int n
FLUID_DOMAIN_ACTIVE_HEAT | FLUID_DOMAIN_ACTIVE_FIRE);
active_fields &= ~prev_flags;
- /* Monitor active fields based on flow settings */
+ /* Monitor active fields based on flow settings. */
for (flow_index = 0; flow_index < numflowobj; flow_index++) {
Object *flow_ob = flowobjs[flow_index];
FluidModifierData *fmd2 = (FluidModifierData *)BKE_modifiers_findby_type(flow_ob,
@@ -2628,6 +2630,7 @@ static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int n
continue;
}
+ /* Activate specific grids if at least one flow object requires this grid. */
if ((fmd2->type & MOD_FLUID_TYPE_FLOW) && fmd2->flow) {
FluidFlowSettings *ffs = fmd2->flow;
if (!ffs) {
@@ -2648,17 +2651,17 @@ static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int n
continue;
}
- /* activate heat field if flow produces any heat */
- if (ffs->temperature) {
+ /* Activate heat field if a flow object produces any heat. */
+ if (ffs->temperature != 0.0) {
active_fields |= FLUID_DOMAIN_ACTIVE_HEAT;
}
- /* activate fuel field if flow adds any fuel */
- if (ffs->fuel_amount &&
- (ffs->type == FLUID_FLOW_TYPE_FIRE || ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE)) {
+ /* Activate fuel field if a flow object is of fire type. */
+ if (ffs->fuel_amount != 0.0 || ffs->type == FLUID_FLOW_TYPE_FIRE ||
+ ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE) {
active_fields |= FLUID_DOMAIN_ACTIVE_FIRE;
}
- /* activate color field if flows add smoke with varying colors */
- if (ffs->density &&
+ /* Activate color field if flows add smoke with varying colors. */
+ if (ffs->density != 0.0 &&
(ffs->type == FLUID_FLOW_TYPE_SMOKE || ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE)) {
if (!(active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET)) {
copy_v3_v3(fds->active_color, ffs->color);
@@ -2671,11 +2674,11 @@ static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int n
}
}
}
- /* Monitor active fields based on domain settings */
+ /* Monitor active fields based on domain settings. */
if (fds->type == FLUID_DOMAIN_TYPE_GAS && active_fields & FLUID_DOMAIN_ACTIVE_FIRE) {
- /* heat is always needed for fire */
+ /* Heat is always needed for fire. */
active_fields |= FLUID_DOMAIN_ACTIVE_HEAT;
- /* also activate colors if domain smoke color differs from active color */
+ /* Also activate colors if domain smoke color differs from active color. */
if (!(active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET)) {
copy_v3_v3(fds->active_color, fds->flame_smoke_color);
active_fields |= FLUID_DOMAIN_ACTIVE_COLOR_SET;
@@ -3617,14 +3620,16 @@ static int manta_step(
fds->time_per_frame = time_per_frame;
fds->time_total = time_total;
}
+
/* Total time must not exceed framecount times framelength. Correct tiny errors here. */
CLAMP(fds->time_total, fds->time_total, time_total_old + fds->frame_length);
+ /* Compute shadow grid for gas simulations. Make sure to skip if bake job was canceled early. */
if (fds->type == FLUID_DOMAIN_TYPE_GAS && result) {
manta_smoke_calc_transparency(fds, DEG_get_evaluated_view_layer(depsgraph));
}
- BLI_mutex_unlock(&object_update_lock);
+ BLI_mutex_unlock(&object_update_lock);
return result;
}
@@ -4073,6 +4078,9 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
}
}
+ /* Ensure that fluid pointers are always up to date at the end of modifier processing. */
+ manta_update_pointers(fds->fluid, fmd);
+
fds->flags &= ~FLUID_DOMAIN_FILE_LOAD;
fmd->time = scene_framenr;
}
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 70d4b20f751..f7417a27402 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -370,7 +370,7 @@ static void gpencil_convert_spline(Main *bmain,
BKE_nurb_makeCurve(nu, coord_array, NULL, NULL, NULL, resolu, sizeof(float[3]));
/* Allocate memory for storage points. */
- gps->totpoints = nurb_points - 1;
+ gps->totpoints = nurb_points;
gps->points = MEM_callocN(sizeof(bGPDspoint) * gps->totpoints, "gp_stroke_points");
/* Add points. */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index fa0be9ea441..e331e5ae1dd 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -3942,7 +3942,7 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
#endif /* WITH_OPENEXR */
/* common stuff to do with images after loading */
-static void image_initialize_after_load(Image *ima, ImageUser *iuser, ImBuf *UNUSED(ibuf))
+static void image_init_after_load(Image *ima, ImageUser *iuser, ImBuf *UNUSED(ibuf))
{
/* Preview is NULL when it has never been used as an icon before.
* Never handle previews/icons outside of main thread. */
@@ -4045,11 +4045,11 @@ static ImBuf *load_sequence_single(
}
}
else {
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
*r_assign = true;
}
#else
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
*r_assign = true;
#endif
}
@@ -4154,7 +4154,7 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int e
BKE_imbuf_stamp_info(ima->rr, ibuf);
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
image_assign_ibuf(ima, ibuf, iuser ? iuser->multi_index : 0, entry);
}
// else printf("pass not found\n");
@@ -4218,7 +4218,7 @@ static ImBuf *load_movie_single(Image *ima, ImageUser *iuser, int frame, const i
ibuf = IMB_makeSingleUser(IMB_anim_absolute(ia->anim, fra, IMB_TC_RECORD_RUN, IMB_PROXY_NONE));
if (ibuf) {
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
}
else {
tile->ok = 0;
@@ -4363,7 +4363,7 @@ static ImBuf *load_image_single(Image *ima,
else
#endif
{
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
*r_assign = true;
/* make packed file for autopack */
@@ -4477,7 +4477,7 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
if (rpass) {
ibuf = IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0);
- image_initialize_after_load(ima, iuser, ibuf);
+ image_init_after_load(ima, iuser, ibuf);
ibuf->rect_float = rpass->rect;
ibuf->flags |= IB_rectfloat;
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 64649d84320..83071fd5dd3 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -221,7 +221,7 @@ ViewLayer *BKE_view_layer_add(Scene *scene,
view_layer_new = view_layer_add(name);
BLI_addtail(&scene->view_layers, view_layer_new);
- /* Initialise layercollections */
+ /* Initialize layer-collections. */
BKE_layer_collection_sync(scene, view_layer_new);
layer_collection_exclude_all(view_layer_new->layer_collections.first);
diff --git a/source/blender/blenkernel/intern/light.c b/source/blender/blenkernel/intern/light.c
index aa1005c663f..f42df6765c4 100644
--- a/source/blender/blenkernel/intern/light.c
+++ b/source/blender/blenkernel/intern/light.c
@@ -58,7 +58,7 @@ static void light_init_data(ID *id)
MEMCPY_STRUCT_AFTER(la, DNA_struct_default_get(Light), id);
la->curfalloff = BKE_curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
- BKE_curvemapping_initialize(la->curfalloff);
+ BKE_curvemapping_init(la->curfalloff);
}
/**
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 71d49dd1c19..6c10f6de855 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -241,7 +241,7 @@ static void multires_mdisps_subdivide_hidden(MDisps *md, int new_level)
md->hidden = subd;
}
-static MDisps *multires_mdisps_initialize_hidden(Mesh *me, int level)
+static MDisps *multires_mdisps_init_hidden(Mesh *me, int level)
{
MDisps *mdisps = CustomData_add_layer(&me->ldata, CD_MDISPS, CD_CALLOC, NULL, me->totloop);
int gridsize = BKE_ccg_gridsize(level);
@@ -868,7 +868,7 @@ static void multires_subdivide_legacy(
mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
if (!mdisps) {
- mdisps = multires_mdisps_initialize_hidden(me, totlvl);
+ mdisps = multires_mdisps_init_hidden(me, totlvl);
}
if (mdisps->disps && !updateblock && lvl != 0) {
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index a003daf1042..1df5cda0ce5 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3871,7 +3871,7 @@ void BKE_particlesettings_clump_curve_init(ParticleSettings *part)
cumap->cm[0].curve[1].x = 1.0f;
cumap->cm[0].curve[1].y = 1.0f;
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
part->clumpcurve = cumap;
}
@@ -3885,7 +3885,7 @@ void BKE_particlesettings_rough_curve_init(ParticleSettings *part)
cumap->cm[0].curve[1].x = 1.0f;
cumap->cm[0].curve[1].y = 1.0f;
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
part->roughcurve = cumap;
}
@@ -3899,7 +3899,7 @@ void BKE_particlesettings_twist_curve_init(ParticleSettings *part)
cumap->cm[0].curve[1].x = 1.0f;
cumap->cm[0].curve[1].y = 1.0f;
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
part->twistcurve = cumap;
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index bec9cbbad79..6bfbb4b9d00 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -570,7 +570,7 @@ void psys_thread_context_free(ParticleThreadContext *ctx)
}
}
-static void initialize_particle_texture(ParticleSimulationData *sim, ParticleData *pa, int p)
+static void init_particle_texture(ParticleSimulationData *sim, ParticleData *pa, int p)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
@@ -595,7 +595,7 @@ static void initialize_particle_texture(ParticleSimulationData *sim, ParticleDat
}
/* set particle parameters that don't change during particle's life */
-void initialize_particle(ParticleSimulationData *sim, ParticleData *pa)
+void init_particle(ParticleSimulationData *sim, ParticleData *pa)
{
ParticleSettings *part = sim->psys->part;
float birth_time = (float)(pa - sim->psys->particles) / (float)sim->psys->totpart;
@@ -629,7 +629,7 @@ static void initialize_all_particles(ParticleSimulationData *sim)
LOOP_PARTICLES
{
if (!(emit_from_volume_grid && (pa->flag & PARS_UNEXIST) != 0)) {
- initialize_particle(sim, pa);
+ init_particle(sim, pa);
}
}
}
@@ -1092,7 +1092,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
* We could only do it now because we'll need to know coordinate
* before sampling the texture.
*/
- initialize_particle_texture(sim, pa, p);
+ init_particle_texture(sim, pa, p);
if (part->phystype == PART_PHYS_BOIDS && pa->boid) {
BoidParticle *bpa = pa->boid;
@@ -4584,7 +4584,7 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_
psys->dt_frac = get_base_time_step(part);
}
else if ((int)cfra == startframe) {
- /* Variable time step; initialise to subframes */
+ /* Variable time step; initialize to sub-frames. */
psys->dt_frac = get_base_time_step(part);
}
else if (psys->dt_frac < MIN_TIMESTEP) {
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 5ae2f4b9005..fdec29dd43e 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -127,7 +127,7 @@ static void scene_init_data(ID *id)
mblur_shutter_curve = &scene->r.mblur_shutter_curve;
BKE_curvemapping_set_defaults(mblur_shutter_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(mblur_shutter_curve);
+ BKE_curvemapping_init(mblur_shutter_curve);
BKE_curvemap_reset(mblur_shutter_curve->cm,
&mblur_shutter_curve->clipr,
CURVE_PRESET_MAX,
@@ -140,13 +140,13 @@ static void scene_init_data(ID *id)
/* grease pencil multiframe falloff curve */
scene->toolsettings->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_falloff_curve = scene->toolsettings->gp_sculpt.cur_falloff;
- BKE_curvemapping_initialize(gp_falloff_curve);
+ BKE_curvemapping_init(gp_falloff_curve);
BKE_curvemap_reset(
gp_falloff_curve->cm, &gp_falloff_curve->clipr, CURVE_PRESET_GAUSS, CURVEMAP_SLOPE_POSITIVE);
scene->toolsettings->gp_sculpt.cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_primitive_curve = scene->toolsettings->gp_sculpt.cur_primitive;
- BKE_curvemapping_initialize(gp_primitive_curve);
+ BKE_curvemapping_init(gp_primitive_curve);
BKE_curvemap_reset(gp_primitive_curve->cm,
&gp_primitive_curve->clipr,
CURVE_PRESET_BELL,
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c
index a630170d6d5..0bf7fffb833 100644
--- a/source/blender/blenkernel/intern/seqmodifier.c
+++ b/source/blender/blenkernel/intern/seqmodifier.c
@@ -396,7 +396,7 @@ static void curves_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImBuf *m
float black[3] = {0.0f, 0.0f, 0.0f};
float white[3] = {1.0f, 1.0f, 1.0f};
- BKE_curvemapping_initialize(&cmd->curve_mapping);
+ BKE_curvemapping_init(&cmd->curve_mapping);
BKE_curvemapping_premultiply(&cmd->curve_mapping, 0);
BKE_curvemapping_set_black_white(&cmd->curve_mapping, black, white);
@@ -525,7 +525,7 @@ static void hue_correct_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImB
{
HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
- BKE_curvemapping_initialize(&hcmd->curve_mapping);
+ BKE_curvemapping_init(&hcmd->curve_mapping);
modifier_apply_threaded(ibuf, mask, hue_correct_apply_threaded, &hcmd->curve_mapping);
}
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index e09e92588c6..b9c6bb83157 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -215,7 +215,7 @@ static void use_values_from_fcurves(StabContext *ctx, bool toggle)
/* Prepare per call private working area.
* Used for access to possibly animated values: retrieve available F-curves.
*/
-static StabContext *initialize_stabilization_working_context(MovieClip *clip)
+static StabContext *init_stabilization_working_context(MovieClip *clip)
{
StabContext *ctx = MEM_callocN(sizeof(StabContext), "2D stabilization animation runtime data");
ctx->clip = clip;
@@ -841,14 +841,14 @@ static int establish_track_initialization_order(StabContext *ctx, TrackInitOrder
*
* NOTE: when done, this track is marked as initialized
*/
-static void initialize_track_for_stabilization(StabContext *ctx,
- MovieTrackingTrack *track,
- int reference_frame,
- float aspect,
- const float average_translation[2],
- const float pivot[2],
- const float average_angle,
- const float average_scale_step)
+static void init_track_for_stabilization(StabContext *ctx,
+ MovieTrackingTrack *track,
+ int reference_frame,
+ float aspect,
+ const float average_translation[2],
+ const float pivot[2],
+ const float average_angle,
+ const float average_scale_step)
{
float pos[2], angle, len;
TrackStabilizationBase *local_data = access_stabilization_baseline_data(ctx, track);
@@ -876,7 +876,7 @@ static void initialize_track_for_stabilization(StabContext *ctx,
local_data->is_init_for_stabilization = true;
}
-static void initialize_all_tracks(StabContext *ctx, float aspect)
+static void init_all_tracks(StabContext *ctx, float aspect)
{
size_t track_len = 0;
MovieClip *clip = ctx->clip;
@@ -936,14 +936,14 @@ static void initialize_all_tracks(StabContext *ctx, float aspect)
&average_angle,
&average_scale_step);
}
- initialize_track_for_stabilization(ctx,
- track,
- reference_frame,
- aspect,
- average_translation,
- pivot,
- average_angle,
- average_scale_step);
+ init_track_for_stabilization(ctx,
+ track,
+ reference_frame,
+ aspect,
+ average_translation,
+ pivot,
+ average_angle,
+ average_scale_step);
}
cleanup:
@@ -1257,9 +1257,9 @@ static float calculate_autoscale_factor(StabContext *ctx, int size, float aspect
*/
static StabContext *init_stabilizer(MovieClip *clip, int size, float aspect)
{
- StabContext *ctx = initialize_stabilization_working_context(clip);
+ StabContext *ctx = init_stabilization_working_context(clip);
BLI_assert(ctx != NULL);
- initialize_all_tracks(ctx, aspect);
+ init_all_tracks(ctx, aspect);
if (ctx->stab->flag & TRACKING_AUTOSCALE) {
ctx->stab->scale = 1.0;
ctx->stab->scale = calculate_autoscale_factor(ctx, size, aspect);
diff --git a/source/blender/blenlib/BLI_dial_2d.h b/source/blender/blenlib/BLI_dial_2d.h
index a39543720e6..83467881eb5 100644
--- a/source/blender/blenlib/BLI_dial_2d.h
+++ b/source/blender/blenlib/BLI_dial_2d.h
@@ -38,7 +38,7 @@
* float angle;
* Dial *dial;
*
- * dial = BLI_dial_initialize(start_position, threshold);
+ * dial = BLI_dial_init(start_position, threshold);
*
* angle = BLI_dial_angle(dial, current_position);
*
@@ -52,7 +52,7 @@ extern "C" {
typedef struct Dial Dial;
-Dial *BLI_dial_initialize(const float start_position[2], float threshold);
+Dial *BLI_dial_init(const float start_position[2], float threshold);
float BLI_dial_angle(Dial *dial, const float current_position[2]);
diff --git a/source/blender/blenlib/intern/BLI_dial_2d.c b/source/blender/blenlib/intern/BLI_dial_2d.c
index c6d28e20f35..7363233d573 100644
--- a/source/blender/blenlib/intern/BLI_dial_2d.c
+++ b/source/blender/blenlib/intern/BLI_dial_2d.c
@@ -45,7 +45,7 @@ struct Dial {
bool initialized;
};
-Dial *BLI_dial_initialize(const float start_position[2], float threshold)
+Dial *BLI_dial_init(const float start_position[2], float threshold)
{
Dial *dial = MEM_callocN(sizeof(Dial), "dial");
diff --git a/source/blender/blenlib/intern/session_uuid.c b/source/blender/blenlib/intern/session_uuid.c
index a5307684059..d3446fae5cb 100644
--- a/source/blender/blenlib/intern/session_uuid.c
+++ b/source/blender/blenlib/intern/session_uuid.c
@@ -43,7 +43,7 @@ SessionUUID BLI_session_uuid_generate(void)
* Just request the UUID once again, hoping that there are no a lot of high-priority threads
* which will overflow the counter once again between the previous call and this one.
*
- * NOTE: It is possible to have collissions after such overflow. */
+ * NOTE: It is possible to have collisions after such overflow. */
result.uuid_ = atomic_add_and_fetch_uint64(&global_session_uuid.uuid_, 1);
}
return result;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index df001a5146c..e6d54550aa4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5516,7 +5516,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
if (gpmd->curve_intensity) {
BKE_curvemapping_blend_read(reader, gpmd->curve_intensity);
/* initialize the curve. Maybe this could be moved to modififer logic */
- BKE_curvemapping_initialize(gpmd->curve_intensity);
+ BKE_curvemapping_init(gpmd->curve_intensity);
}
}
else if (md->type == eGpencilModifierType_Thick) {
@@ -5525,7 +5525,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
BLO_read_data_address(reader, &gpmd->curve_thickness);
if (gpmd->curve_thickness) {
BKE_curvemapping_blend_read(reader, gpmd->curve_thickness);
- BKE_curvemapping_initialize(gpmd->curve_thickness);
+ BKE_curvemapping_init(gpmd->curve_thickness);
}
}
else if (md->type == eGpencilModifierType_Tint) {
@@ -5534,7 +5534,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
BLO_read_data_address(reader, &gpmd->curve_intensity);
if (gpmd->curve_intensity) {
BKE_curvemapping_blend_read(reader, gpmd->curve_intensity);
- BKE_curvemapping_initialize(gpmd->curve_intensity);
+ BKE_curvemapping_init(gpmd->curve_intensity);
}
}
else if (md->type == eGpencilModifierType_Smooth) {
@@ -5542,7 +5542,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
BLO_read_data_address(reader, &gpmd->curve_intensity);
if (gpmd->curve_intensity) {
BKE_curvemapping_blend_read(reader, gpmd->curve_intensity);
- BKE_curvemapping_initialize(gpmd->curve_intensity);
+ BKE_curvemapping_init(gpmd->curve_intensity);
}
}
else if (md->type == eGpencilModifierType_Color) {
@@ -5550,7 +5550,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
BLO_read_data_address(reader, &gpmd->curve_intensity);
if (gpmd->curve_intensity) {
BKE_curvemapping_blend_read(reader, gpmd->curve_intensity);
- BKE_curvemapping_initialize(gpmd->curve_intensity);
+ BKE_curvemapping_init(gpmd->curve_intensity);
}
}
else if (md->type == eGpencilModifierType_Opacity) {
@@ -5558,7 +5558,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb)
BLO_read_data_address(reader, &gpmd->curve_intensity);
if (gpmd->curve_intensity) {
BKE_curvemapping_blend_read(reader, gpmd->curve_intensity);
- BKE_curvemapping_initialize(gpmd->curve_intensity);
+ BKE_curvemapping_init(gpmd->curve_intensity);
}
}
}
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 3ed59a0baa1..1432fbeb4e2 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -280,7 +280,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
region->v2d.keepzoom |= (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_KEEPASPECT);
region->v2d.keeptot = V2D_KEEPTOT_STRICT;
region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
- // region->v2d.flag |= V2D_IS_INITIALISED;
+ // region->v2d.flag |= V2D_IS_INIT;
break;
}
case SPACE_GRAPH: {
@@ -297,7 +297,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
region->v2d.max[0] = MAXFRAMEF;
region->v2d.max[1] = FLT_MAX;
- // region->v2d.flag |= V2D_IS_INITIALISED;
+ // region->v2d.flag |= V2D_IS_INIT;
break;
}
case SPACE_NLA: {
@@ -355,7 +355,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
region->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
region->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_VERTICAL_HANDLES);
region->v2d.align = V2D_ALIGN_NO_NEG_Y;
- region->v2d.flag |= V2D_IS_INITIALISED;
+ region->v2d.flag |= V2D_IS_INIT;
break;
}
case SPACE_NODE: {
@@ -965,7 +965,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
- /* just need to initialise rotation axis properly... */
+ /* Just need to initialize rotation axis properly. */
pchan->rotAxis[1] = 1.0f;
}
}
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 5e91fea3e20..f74ee9cd735 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1205,7 +1205,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (region->regiontype == RGN_TYPE_PREVIEW) {
if (region->alignment != RGN_ALIGN_NONE) {
region->flag |= RGN_FLAG_HIDDEN;
- region->v2d.flag &= ~V2D_IS_INITIALISED;
+ region->v2d.flag &= ~V2D_IS_INIT;
region->alignment = RGN_ALIGN_NONE;
hide = true;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 521fc4b9b82..2c4602f546b 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1108,7 +1108,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) {
CurveMapping *curve_mapping = &scene->r.mblur_shutter_curve;
BKE_curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(curve_mapping);
+ BKE_curvemapping_init(curve_mapping);
BKE_curvemap_reset(
curve_mapping->cm, &curve_mapping->clipr, CURVE_PRESET_MAX, CURVEMAP_SLOPE_POS_NEG);
}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 86a4cfd3805..74a07050d7d 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1958,7 +1958,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
if ((gset) && (gset->cur_falloff == NULL)) {
gset->cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(gset->cur_falloff);
+ BKE_curvemapping_init(gset->cur_falloff);
BKE_curvemap_reset(gset->cur_falloff->cm,
&gset->cur_falloff->clipr,
CURVE_PRESET_GAUSS,
@@ -3371,7 +3371,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
if ((gset) && (gset->cur_primitive == NULL)) {
gset->cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
- BKE_curvemapping_initialize(gset->cur_primitive);
+ BKE_curvemapping_init(gset->cur_primitive);
BKE_curvemap_reset(gset->cur_primitive->cm,
&gset->cur_primitive->clipr,
CURVE_PRESET_BELL,
@@ -4767,7 +4767,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (mmd->curve_intensity == NULL) {
mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (mmd->curve_intensity) {
- BKE_curvemapping_initialize(mmd->curve_intensity);
+ BKE_curvemapping_init(mmd->curve_intensity);
}
}
break;
@@ -4778,7 +4778,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (mmd->curve_intensity == NULL) {
mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (mmd->curve_intensity) {
- BKE_curvemapping_initialize(mmd->curve_intensity);
+ BKE_curvemapping_init(mmd->curve_intensity);
}
}
break;
@@ -4788,7 +4788,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (mmd->curve_intensity == NULL) {
mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (mmd->curve_intensity) {
- BKE_curvemapping_initialize(mmd->curve_intensity);
+ BKE_curvemapping_init(mmd->curve_intensity);
}
}
break;
@@ -4798,7 +4798,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (mmd->curve_intensity == NULL) {
mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (mmd->curve_intensity) {
- BKE_curvemapping_initialize(mmd->curve_intensity);
+ BKE_curvemapping_init(mmd->curve_intensity);
}
}
break;
@@ -4808,7 +4808,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (mmd->curve_intensity == NULL) {
mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (mmd->curve_intensity) {
- BKE_curvemapping_initialize(mmd->curve_intensity);
+ BKE_curvemapping_init(mmd->curve_intensity);
}
}
break;
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 7f75c0100b8..ae6d3a58091 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -106,7 +106,7 @@ static void blo_update_defaults_screen(bScreen *screen,
/* Some toolbars have been saved as initialized,
* we don't want them to have odd zoom-level or scrolling set, see: T47047 */
if (ELEM(region->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) {
- region->v2d.flag &= ~V2D_IS_INITIALISED;
+ region->v2d.flag &= ~V2D_IS_INIT;
}
}
@@ -326,7 +326,7 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
if (ts->gp_sculpt.cur_falloff == NULL) {
ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_falloff_curve = ts->gp_sculpt.cur_falloff;
- BKE_curvemapping_initialize(gp_falloff_curve);
+ BKE_curvemapping_init(gp_falloff_curve);
BKE_curvemap_reset(gp_falloff_curve->cm,
&gp_falloff_curve->clipr,
CURVE_PRESET_GAUSS,
@@ -335,7 +335,7 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
if (ts->gp_sculpt.cur_primitive == NULL) {
ts->gp_sculpt.cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_primitive_curve = ts->gp_sculpt.cur_primitive;
- BKE_curvemapping_initialize(gp_primitive_curve);
+ BKE_curvemapping_init(gp_primitive_curve);
BKE_curvemap_reset(gp_primitive_curve->cm,
&gp_primitive_curve->clipr,
CURVE_PRESET_BELL,
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 44c7c35e47d..d25e340d4fc 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -2096,7 +2096,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (la->curfalloff == NULL) {
la->curfalloff = BKE_curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
- BKE_curvemapping_initialize(la->curfalloff);
+ BKE_curvemapping_init(la->curfalloff);
}
}
}
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 39174a49283..cc7aef65bbb 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -7156,7 +7156,7 @@ static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bo
if (custom) {
/* Make sure the curve profile's sample table is full. */
if (bp->custom_profile->segments_len != seg || !bp->custom_profile->segments) {
- BKE_curveprofile_initialize((CurveProfile *)bp->custom_profile, (short)seg);
+ BKE_curveprofile_init((CurveProfile *)bp->custom_profile, (short)seg);
}
/* Copy segment locations into the profile spacing struct. */
@@ -7185,7 +7185,7 @@ static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bo
(size_t)(seg_2 + 1) * sizeof(double));
if (custom) {
/* Make sure the curve profile widget's sample table is full of the seg_2 samples. */
- BKE_curveprofile_initialize((CurveProfile *)bp->custom_profile, (short)seg_2);
+ BKE_curveprofile_init((CurveProfile *)bp->custom_profile, (short)seg_2);
/* Copy segment locations into the profile spacing struct. */
for (int i = 0; i < seg_2 + 1; i++) {
diff --git a/source/blender/compositor/nodes/COM_TimeNode.cpp b/source/blender/compositor/nodes/COM_TimeNode.cpp
index 9722ead0716..247e0d11df6 100644
--- a/source/blender/compositor/nodes/COM_TimeNode.cpp
+++ b/source/blender/compositor/nodes/COM_TimeNode.cpp
@@ -49,7 +49,7 @@ void TimeNode::convertToOperations(NodeConverter &converter,
fac = (context.getFramenumber() - node->custom1) / (float)(node->custom2 - node->custom1);
}
- BKE_curvemapping_initialize((CurveMapping *)node->storage);
+ BKE_curvemapping_init((CurveMapping *)node->storage);
fac = BKE_curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
operation->setValue(clamp_f(fac, 0.0f, 1.0f));
converter.addOperation(operation);
diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
index b18e77cf0e3..855f728f7bf 100644
--- a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
@@ -35,7 +35,7 @@ CurveBaseOperation::~CurveBaseOperation()
void CurveBaseOperation::initExecution()
{
- BKE_curvemapping_initialize(this->m_curveMapping);
+ BKE_curvemapping_init(this->m_curveMapping);
}
void CurveBaseOperation::deinitExecution()
{
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
index 6f47e0e190b..4a7139537c1 100644
--- a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
+++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
@@ -172,7 +172,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
return;
}
- /* initialise the iteration variables */
+ /* Initialize the iteration variables. */
float *buffer = init_buffer_iterator(
input, source, co, dist_min, dist_max, x, y, num, v, dv, falloff_factor);
zero_v3(border);
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index 8bd4832e446..f85b03dc517 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -404,6 +404,13 @@ data_to_c_simple(engines/overlay/shaders/xray_fade_frag.glsl SRC)
list(APPEND INC
)
+if(WITH_MOD_FLUID)
+ list(APPEND INC
+ ../../../intern/mantaflow/extern
+ )
+ add_definitions(-DWITH_FLUID)
+endif()
+
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 50733afe6fb..8280b58c21a 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -427,7 +427,7 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
ac->spacetype = (area) ? area->spacetype : 0;
ac->regiontype = (region) ? region->regiontype : 0;
- /* initialise default y-scale factor */
+ /* Initialize default y-scale factor. */
animedit_get_yscale_factor(ac);
/* get data context info */
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 8df9c99896e..e60270bc3f0 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -251,7 +251,7 @@ static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode)
*/
BLI_dlrbTree_init(&pso->keys);
- /* initialise numeric input */
+ /* Initialize numeric input. */
initNumInput(&pso->num);
pso->num.idx_max = 0; /* one axis */
pso->num.val_flag[0] |= NUM_NO_NEGATIVE;
@@ -1310,7 +1310,7 @@ static int pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *ev
pso = op->customdata;
- /* initialise percentage so that it won't pop on first mouse move */
+ /* Initialize percentage so that it won't pop on first mouse move. */
pose_slide_mouse_update_percentage(pso, op, event);
/* do common setup work */
@@ -1370,7 +1370,7 @@ static int pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *e
pso = op->customdata;
- /* initialise percentage so that it won't pop on first mouse move */
+ /* Initialize percentage so that it won't pop on first mouse move. */
pose_slide_mouse_update_percentage(pso, op, event);
/* do common setup work */
@@ -1429,7 +1429,7 @@ static int pose_slide_push_rest_invoke(bContext *C, wmOperator *op, const wmEven
pso = op->customdata;
- /* initialise percentage so that it won't pop on first mouse move */
+ /* Initialize percentage so that it won't pop on first mouse move. */
pose_slide_mouse_update_percentage(pso, op, event);
/* do common setup work */
@@ -1489,7 +1489,7 @@ static int pose_slide_relax_rest_invoke(bContext *C, wmOperator *op, const wmEve
pso = op->customdata;
- /* initialise percentage so that it won't pop on first mouse move */
+ /* Initialize percentage so that it won't pop on first mouse move. */
pose_slide_mouse_update_percentage(pso, op, event);
/* do common setup work */
@@ -1549,7 +1549,7 @@ static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, const wmEven
pso = op->customdata;
- /* initialise percentage so that it won't pop on first mouse move */
+ /* Initialize percentage so that it won't pop on first mouse move. */
pose_slide_mouse_update_percentage(pso, op, event);
/* do common setup work */
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 91a8ea0fa3a..72ea52314b9 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1137,7 +1137,7 @@ int ED_curve_updateAnimPaths(Main *bmain, Curve *cu)
/** \name Edit Mode Conversion (Make & Load)
* \{ */
-static int *initialize_index_map(Object *obedit, int *r_old_totvert)
+static int *init_index_map(Object *obedit, int *r_old_totvert)
{
Curve *curve = (Curve *)obedit->data;
EditNurb *editnurb = curve->editnurb;
@@ -1225,7 +1225,7 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
if ((object->parent) && (object->parent->data == curve) &&
ELEM(object->partype, PARVERT1, PARVERT3)) {
if (old_to_new_map == NULL) {
- old_to_new_map = initialize_index_map(obedit, &old_totvert);
+ old_to_new_map = init_index_map(obedit, &old_totvert);
}
if (object->par1 < old_totvert) {
@@ -1254,7 +1254,7 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
int i, j;
if (old_to_new_map == NULL) {
- old_to_new_map = initialize_index_map(obedit, &old_totvert);
+ old_to_new_map = init_index_map(obedit, &old_totvert);
}
for (i = j = 0; i < hmd->totindex; i++) {
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
index 85f84af5f14..406d66dfd8f 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
@@ -999,7 +999,7 @@ static int gizmo_cage2d_modal(bContext *C,
if (data->dial == NULL) {
MUL_V2_V3_M4_FINAL(test_co, data->orig_matrix_offset[3]);
- data->dial = BLI_dial_initialize(test_co, FLT_EPSILON);
+ data->dial = BLI_dial_init(test_co, FLT_EPSILON);
MUL_V2_V3_M4_FINAL(test_co, data->orig_mouse);
BLI_dial_angle(data->dial, test_co);
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 6a6da6b4de4..f6b01b27be4 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -603,7 +603,7 @@ static short annotation_stroke_addpoint(tGPsdata *p,
/* store settings */
copy_v2_v2(&pt->x, mval);
pt->pressure = pressure;
- /* unused for annotations, but initialise for easier conversions to GP Object */
+ /* Unused for annotations, but initialize for easier conversions to GP Object. */
pt->strength = 1.0f;
/* point time */
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d78ee4d305b..2d3a25e70da 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1825,7 +1825,7 @@ static int gpencil_blank_frame_add_exec(bContext *C, wmOperator *op)
const bool all_layers = RNA_boolean_get(op->ptr, "all_layers");
- /* Initialise datablock and an active layer if nothing exists yet */
+ /* Initialize data-block and an active layer if nothing exists yet. */
if (ELEM(NULL, gpd, active_gpl)) {
/* Let's just be lazy, and call the "Add New Layer" operator,
* which sets everything up as required. */
@@ -4577,14 +4577,14 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op)
base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_prev, dupflag);
ob_dst = base_new->object;
ob_dst->mode = OB_MODE_OBJECT;
- /* Duplication will increment bGPdata usercount, but since we create a new greasepencil datablock
- * for ob_dst (which gets its own user automatically), we have to decrement the usercount again.
- */
+ /* Duplication will increment #bGPdata user-count, but since we create a new grease-pencil
+ * data-block for ob_dst (which gets its own user automatically),
+ * we have to decrement the user-count again. */
gpd_dst = BKE_gpencil_data_addnew(bmain, gpd_src->id.name + 2);
id_us_min(ob_dst->data);
ob_dst->data = (bGPdata *)gpd_dst;
- /* loop old datablock and separate parts */
+ /* Loop old data-block and separate parts. */
if ((mode == GP_SEPARATE_POINT) || (mode == GP_SEPARATE_STROKE)) {
CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) {
gpl_dst = NULL;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 2c5f011e857..52c12392082 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1817,15 +1817,15 @@ static void gpencil_init_drawing_brush(bContext *C, tGPsdata *p)
changed = true;
}
/* Be sure curves are initializated. */
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_sensitivity);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_strength);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_jitter);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_pressure);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_strength);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_uv);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_hue);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_saturation);
- BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_rand_value);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_sensitivity);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_strength);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_jitter);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_pressure);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_strength);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_uv);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_hue);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_saturation);
+ BKE_curvemapping_init(paint->brush->gpencil_settings->curve_rand_value);
/* assign to temp tGPsdata */
p->brush = paint->brush;
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index d1012fdaf5d..35a6fabdce4 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -740,13 +740,13 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
gpencil_session_validatebuffer(tgpi);
gpencil_init_colors(tgpi);
if (gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) {
- BKE_curvemapping_initialize(ts->gp_sculpt.cur_primitive);
+ BKE_curvemapping_init(ts->gp_sculpt.cur_primitive);
}
if (brush_settings->flag & GP_BRUSH_USE_JITTER_PRESSURE) {
- BKE_curvemapping_initialize(brush_settings->curve_jitter);
+ BKE_curvemapping_init(brush_settings->curve_jitter);
}
if (brush_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
- BKE_curvemapping_initialize(brush_settings->curve_strength);
+ BKE_curvemapping_init(brush_settings->curve_strength);
}
/* get an array of depths, far depths are blended */
@@ -1085,7 +1085,7 @@ static void gpencil_primitive_update(bContext *C, wmOperator *op, tGPDprimitive
gpencil_primitive_update_strokes(C, tgpi);
}
-/* Initialise mouse points */
+/* Initialize mouse points. */
static void gpencil_primitive_interaction_begin(tGPDprimitive *tgpi, const wmEvent *event)
{
copy_v2fl_v2i(tgpi->mval, event->mval);
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 6145ff274b1..7e78594cd50 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -444,7 +444,9 @@ typedef struct tGPSB_Grab_StrokeData {
int size;
} tGPSB_Grab_StrokeData;
-/* initialise custom data for handling this stroke */
+/**
+ * Initialize custom data for handling this stroke.
+ */
static void gpencil_brush_grab_stroke_init(tGP_BrushEditData *gso, bGPDstroke *gps)
{
tGPSB_Grab_StrokeData *data = NULL;
@@ -910,13 +912,13 @@ typedef struct tGPSB_CloneBrushData {
GHash *new_colors;
} tGPSB_CloneBrushData;
-/* Initialise "clone" brush data */
+/* Initialize "clone" brush data. */
static void gpencil_brush_clone_init(bContext *C, tGP_BrushEditData *gso)
{
tGPSB_CloneBrushData *data;
bGPDstroke *gps;
- /* init custom data */
+ /* Initialize custom-data. */
gso->customdata = data = MEM_callocN(sizeof(tGPSB_CloneBrushData), "CloneBrushData");
/* compute midpoint of strokes on clipboard */
@@ -1188,7 +1190,7 @@ static bool gpencil_sculpt_brush_init(bContext *C, wmOperator *op)
Paint *paint = &ts->gp_sculptpaint->paint;
gso->brush = paint->brush;
- BKE_curvemapping_initialize(gso->brush->curve);
+ BKE_curvemapping_init(gso->brush->curve);
/* save mask */
gso->mask = ts->gpencil_selectmode_sculpt;
@@ -1200,10 +1202,10 @@ static bool gpencil_sculpt_brush_init(bContext *C, wmOperator *op)
/* Init multi-edit falloff curve data before doing anything,
* so we won't have to do it again later. */
if (gso->is_multiframe) {
- BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+ BKE_curvemapping_init(ts->gp_sculpt.cur_falloff);
}
- /* initialise custom data for brushes */
+ /* Initialize custom data for brushes. */
char tool = gso->brush->gpencil_sculpt_tool;
switch (tool) {
case GPSCULPT_TOOL_CLONE: {
@@ -1229,13 +1231,13 @@ static bool gpencil_sculpt_brush_init(bContext *C, wmOperator *op)
op->customdata = NULL;
return false;
}
- /* initialise customdata */
+ /* Initialize custom-data. */
gpencil_brush_clone_init(C, gso);
break;
}
case GPSCULPT_TOOL_GRAB: {
- /* initialise the cache needed for this brush */
+ /* Initialize the cache needed for this brush. */
gso->stroke_customdata = BLI_ghash_ptr_new("GP Grab Brush - Strokes Hash");
break;
}
@@ -1937,7 +1939,7 @@ static int gpencil_sculpt_brush_invoke(bContext *C, wmOperator *op, const wmEven
gso = op->customdata;
- /* initialise type-specific data (used for the entire session) */
+ /* Initialize type-specific data (used for the entire session). */
char tool = gso->brush->gpencil_sculpt_tool;
switch (tool) {
/* Brushes requiring timer... */
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index fd2760fafce..ddb41117b93 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1502,7 +1502,7 @@ void ED_gpencil_add_defaults(bContext *C, Object *ob)
if (ts->gp_sculpt.cur_falloff == NULL) {
ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_falloff_curve = ts->gp_sculpt.cur_falloff;
- BKE_curvemapping_initialize(gp_falloff_curve);
+ BKE_curvemapping_init(gp_falloff_curve);
BKE_curvemap_reset(gp_falloff_curve->cm,
&gp_falloff_curve->clipr,
CURVE_PRESET_GAUSS,
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index c36bc4388d7..b0dff6589da 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -727,7 +727,7 @@ static bool gpencil_vertexpaint_brush_init(bContext *C, wmOperator *op)
gso->brush = paint->brush;
srgb_to_linearrgb_v3_v3(gso->linear_color, gso->brush->rgb);
- BKE_curvemapping_initialize(gso->brush->curve);
+ BKE_curvemapping_init(gso->brush->curve);
gso->is_painting = false;
gso->first = true;
@@ -759,7 +759,7 @@ static bool gpencil_vertexpaint_brush_init(bContext *C, wmOperator *op)
/* Init multi-edit falloff curve data before doing anything,
* so we won't have to do it again later. */
if (gso->is_multiframe) {
- BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+ BKE_curvemapping_init(ts->gp_sculpt.cur_falloff);
}
/* Setup space conversions. */
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index e41146575e4..9d3e9c6ae45 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -295,7 +295,7 @@ static bool gpencil_weightpaint_brush_init(bContext *C, wmOperator *op)
gso->bmain = CTX_data_main(C);
gso->brush = paint->brush;
- BKE_curvemapping_initialize(gso->brush->curve);
+ BKE_curvemapping_init(gso->brush->curve);
gso->is_painting = false;
gso->first = true;
@@ -326,7 +326,7 @@ static bool gpencil_weightpaint_brush_init(bContext *C, wmOperator *op)
/* Init multi-edit falloff curve data before doing anything,
* so we won't have to do it again later. */
if (gso->is_multiframe) {
- BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+ BKE_curvemapping_init(ts->gp_sculpt.cur_falloff);
}
/* Setup space conversions. */
@@ -453,9 +453,9 @@ static void gpencil_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
/* To each point individually... */
pt = &gps->points[i];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
gpencil_save_selected_point(gso, gps_active, index, pc1);
}
@@ -469,9 +469,9 @@ static void gpencil_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
*/
if (i + 1 == gps->totpoints - 1) {
pt = &gps->points[i + 1];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1;
gpencil_save_selected_point(gso, gps_active, index, pc2);
include_last = false;
}
@@ -487,9 +487,9 @@ static void gpencil_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
* (but wasn't added then, to avoid double-ups).
*/
pt = &gps->points[i];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
gpencil_save_selected_point(gso, gps_active, index, pc1);
include_last = false;
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 71b7d35908b..ae99edc950a 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -73,7 +73,7 @@ void ED_region_exit(struct bContext *C, struct ARegion *region);
void ED_region_remove(struct bContext *C, struct ScrArea *area, struct ARegion *region);
void ED_region_pixelspace(struct ARegion *region);
void ED_region_update_rect(struct ARegion *region);
-void ED_region_floating_initialize(struct ARegion *region);
+void ED_region_floating_init(struct ARegion *region);
void ED_region_tag_redraw(struct ARegion *region);
void ED_region_tag_redraw_partial(struct ARegion *region, const struct rcti *rct, bool rebuild);
void ED_region_tag_redraw_cursor(struct ARegion *region);
@@ -171,7 +171,7 @@ void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
/* areas */
-void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area);
+void ED_area_init(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area);
void ED_area_exit(struct bContext *C, struct ScrArea *area);
int ED_screen_area_active(const struct bContext *C);
void ED_screen_global_areas_refresh(struct wmWindow *win);
@@ -221,7 +221,7 @@ ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area);
vert_name->next)
/* screens */
-void ED_screens_initialize(struct Main *bmain, struct wmWindowManager *wm);
+void ED_screens_init(struct Main *bmain, struct wmWindowManager *wm);
void ED_screen_draw_edges(struct wmWindow *win);
void ED_screen_draw_join_shape(struct ScrArea *sa1, struct ScrArea *sa2);
void ED_screen_draw_split_preview(struct ScrArea *area, const int dir, const float fac);
diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c
index 1f8af7b9e6e..1773a7b3057 100644
--- a/source/blender/editors/interface/interface_region_hud.c
+++ b/source/blender/editors/interface/interface_region_hud.c
@@ -367,7 +367,7 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *area)
ED_area_update_region_sizes(wm, win, area);
}
- ED_region_floating_initialize(region);
+ ED_region_floating_init(region);
ED_region_tag_redraw(region);
/* Reset zoom level (not well supported). */
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 2ad7e517c60..13c85952f52 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -759,7 +759,7 @@ uiBlock *ui_popup_block_refresh(bContext *C,
ui_popup_block_scrolltest(block);
/* adds subwindow */
- ED_region_floating_initialize(region);
+ ED_region_floating_init(region);
/* get winmat now that we actually have the subwindow */
wmGetProjectionMatrix(block->winmat, &region->winrct);
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index a9e87f4cc07..80155e3e871 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -819,7 +819,7 @@ ARegion *ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiBut *but
}
/* adds subwindow */
- ED_region_floating_initialize(region);
+ ED_region_floating_init(region);
/* notify change and redraw */
ED_region_tag_redraw(region);
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c
index 7c64e4c2709..41b41cb3d75 100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@ -1386,7 +1386,7 @@ static ARegion *ui_tooltip_create_with_data(bContext *C,
}
/* adds subwindow */
- ED_region_floating_initialize(region);
+ ED_region_floating_init(region);
/* notify change and redraw */
ED_region_tag_redraw(region);
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 0cbf73280a3..3efed43e08c 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -242,7 +242,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
bool tot_changed = false, do_init;
const uiStyle *style = UI_style_get();
- do_init = (v2d->flag & V2D_IS_INITIALISED) == 0;
+ do_init = (v2d->flag & V2D_IS_INIT) == 0;
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
@@ -374,8 +374,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
break;
}
- /* set initialized flag so that View2D doesn't get reinitialised next time again */
- v2d->flag |= V2D_IS_INITIALISED;
+ /* set initialized flag so that View2D doesn't get reinitialized next time again */
+ v2d->flag |= V2D_IS_INIT;
/* store view size */
v2d->winx = winx;
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 64cacd44e3d..d62058699d9 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -56,7 +56,7 @@ static bool view2d_poll(bContext *C)
{
ARegion *region = CTX_wm_region(C);
- return (region != NULL) && (region->v2d.flag & V2D_IS_INITIALISED);
+ return (region != NULL) && (region->v2d.flag & V2D_IS_INIT);
}
/** \} */
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index f92dafcc7f9..f9e6c531b39 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1237,7 +1237,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
break;
}
- /* if this is a new object, initialise default stuff (colors, etc.) */
+ /* If this is a new object, initialize default stuff (colors, etc.) */
if (newob) {
/* set default viewport color to black */
copy_v3_fl(ob->color, 0.0f);
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 926a47b1ec8..cb92fab3cb0 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -673,7 +673,7 @@ static void build_image_lookup(Main *bmain, Object *ob, BakeImages *bake_images)
/*
* returns the total number of pixels
*/
-static size_t initialize_internal_images(BakeImages *bake_images, ReportList *reports)
+static size_t init_internal_images(BakeImages *bake_images, ReportList *reports)
{
int i;
size_t tot_size = 0;
@@ -828,7 +828,7 @@ static int bake(Render *re,
build_image_lookup(bmain, ob_low, &bake_images);
if (is_save_internal) {
- num_pixels = initialize_internal_images(&bake_images, reports);
+ num_pixels = init_internal_images(&bake_images, reports);
if (num_pixels == 0) {
goto cleanup;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 749c6cd640e..82a1139c860 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4346,7 +4346,7 @@ static int brush_add(const bContext *C, PEData *data, short number)
}
pa->size = 1.0f;
- initialize_particle(&sim, pa);
+ init_particle(&sim, pa);
reset_particle(&sim, pa, 0.0, 1.0);
point->flag |= PEP_EDIT_RECALC;
if (pe_x_mirror(ob)) {
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 3d3936523f9..d279958df8a 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -962,7 +962,7 @@ static void screen_opengl_render_cancel(bContext *C, wmOperator *op)
}
/* share between invoke and exec */
-static bool screen_opengl_render_anim_initialize(bContext *C, wmOperator *op)
+static bool screen_opengl_render_anim_init(bContext *C, wmOperator *op)
{
/* initialize animation */
OGLRender *oglrender;
@@ -1256,7 +1256,7 @@ static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEven
}
if (anim) {
- if (!screen_opengl_render_anim_initialize(C, op)) {
+ if (!screen_opengl_render_anim_init(C, op)) {
return OPERATOR_CANCELLED;
}
}
@@ -1292,7 +1292,7 @@ static int screen_opengl_render_exec(bContext *C, wmOperator *op)
bool ret = true;
- if (!screen_opengl_render_anim_initialize(C, op)) {
+ if (!screen_opengl_render_anim_init(C, op)) {
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index be76254fef5..7c822bd01e5 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -813,7 +813,7 @@ void ED_workspace_status_text(bContext *C, const char *str)
/* ************************************************************ */
-static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea *area)
+static void area_azone_init(wmWindow *win, const bScreen *screen, ScrArea *area)
{
AZone *az;
@@ -883,7 +883,7 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea
}
}
-static void fullscreen_azone_initialize(ScrArea *area, ARegion *region)
+static void fullscreen_azone_init(ScrArea *area, ARegion *region)
{
AZone *az;
@@ -1007,10 +1007,10 @@ static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscre
return true;
}
-static void region_azone_edge_initialize(ScrArea *area,
- ARegion *region,
- AZEdge edge,
- const bool is_fullscreen)
+static void region_azone_edge_init(ScrArea *area,
+ ARegion *region,
+ AZEdge edge,
+ const bool is_fullscreen)
{
AZone *az = NULL;
const bool is_hidden = (region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
@@ -1033,9 +1033,9 @@ static void region_azone_edge_initialize(ScrArea *area,
}
}
-static void region_azone_scrollbar_initialize(ScrArea *area,
- ARegion *region,
- AZScrollDirection direction)
+static void region_azone_scrollbar_init(ScrArea *area,
+ ARegion *region,
+ AZScrollDirection direction)
{
rcti scroller_vert = (direction == AZ_SCROLL_VERT) ? region->v2d.vert : region->v2d.hor;
AZone *az = MEM_callocN(sizeof(*az), __func__);
@@ -1061,16 +1061,16 @@ static void region_azone_scrollbar_initialize(ScrArea *area,
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
-static void region_azones_scrollbars_initialize(ScrArea *area, ARegion *region)
+static void region_azones_scrollbars_init(ScrArea *area, ARegion *region)
{
const View2D *v2d = &region->v2d;
if ((v2d->scroll & V2D_SCROLL_VERTICAL) && ((v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES) == 0)) {
- region_azone_scrollbar_initialize(area, region, AZ_SCROLL_VERT);
+ region_azone_scrollbar_init(area, region, AZ_SCROLL_VERT);
}
if ((v2d->scroll & V2D_SCROLL_HORIZONTAL) &&
((v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES) == 0)) {
- region_azone_scrollbar_initialize(area, region, AZ_SCROLL_HOR);
+ region_azone_scrollbar_init(area, region, AZ_SCROLL_HOR);
}
}
@@ -1083,16 +1083,16 @@ static void region_azones_add_edge(ScrArea *area,
/* edge code (t b l r) is along which area edge azone will be drawn */
if (alignment == RGN_ALIGN_TOP) {
- region_azone_edge_initialize(area, region, AE_BOTTOM_TO_TOPLEFT, is_fullscreen);
+ region_azone_edge_init(area, region, AE_BOTTOM_TO_TOPLEFT, is_fullscreen);
}
else if (alignment == RGN_ALIGN_BOTTOM) {
- region_azone_edge_initialize(area, region, AE_TOP_TO_BOTTOMRIGHT, is_fullscreen);
+ region_azone_edge_init(area, region, AE_TOP_TO_BOTTOMRIGHT, is_fullscreen);
}
else if (alignment == RGN_ALIGN_RIGHT) {
- region_azone_edge_initialize(area, region, AE_LEFT_TO_TOPRIGHT, is_fullscreen);
+ region_azone_edge_init(area, region, AE_LEFT_TO_TOPRIGHT, is_fullscreen);
}
else if (alignment == RGN_ALIGN_LEFT) {
- region_azone_edge_initialize(area, region, AE_RIGHT_TO_TOPLEFT, is_fullscreen);
+ region_azone_edge_init(area, region, AE_RIGHT_TO_TOPLEFT, is_fullscreen);
}
}
@@ -1116,10 +1116,10 @@ static void region_azones_add(const bScreen *screen, ScrArea *area, ARegion *reg
}
if (is_fullscreen) {
- fullscreen_azone_initialize(area, region);
+ fullscreen_azone_init(area, region);
}
- region_azones_scrollbars_initialize(area, region);
+ region_azones_scrollbars_init(area, region);
}
/* dir is direction to check, not the splitting edge direction! */
@@ -1832,7 +1832,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
region_rect_recursive(area, area->regionbase.first, &rect, &overlap_rect, 0);
/* Dynamically sized regions may have changed region sizes, so we have to force azone update. */
- area_azone_initialize(win, screen, area);
+ area_azone_init(win, screen, area);
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
region_subwindow(region);
@@ -1851,7 +1851,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
}
/* called in screen_refresh, or screens_init, also area size changes */
-void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *area)
+void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
{
WorkSpace *workspace = WM_window_get_active_workspace(win);
const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook);
@@ -1894,7 +1894,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *area)
}
/* clear all azones, add the area triangle widgets */
- area_azone_initialize(win, screen, area);
+ area_azone_init(win, screen, area);
/* region windows, default and own handlers */
for (region = area->regionbase.first; region; region = region->next) {
@@ -1948,7 +1948,7 @@ void ED_region_update_rect(ARegion *region)
}
/* externally called for floating regions like menus */
-void ED_region_floating_initialize(ARegion *region)
+void ED_region_floating_init(ARegion *region)
{
BLI_assert(region->alignment == RGN_ALIGN_FLOAT);
@@ -1984,7 +1984,7 @@ void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *reg
WM_event_remove_handlers(C, &region->handlers);
}
- ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), area);
+ ED_area_init(CTX_wm_manager(C), CTX_wm_window(C), area);
ED_area_tag_redraw(area);
}
@@ -2070,8 +2070,8 @@ void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2)
ED_area_data_copy(tmp, sa1, false);
ED_area_data_copy(sa1, sa2, true);
ED_area_data_copy(sa2, tmp, true);
- ED_area_initialize(CTX_wm_manager(C), win, sa1);
- ED_area_initialize(CTX_wm_manager(C), win, sa2);
+ ED_area_init(CTX_wm_manager(C), win, sa1);
+ ED_area_init(CTX_wm_manager(C), win, sa2);
BKE_screen_area_free(tmp);
MEM_freeN(tmp);
@@ -2208,7 +2208,7 @@ void ED_area_newspace(bContext *C, ScrArea *area, int type, const bool skip_regi
}
}
- ED_area_initialize(CTX_wm_manager(C), win, area);
+ ED_area_init(CTX_wm_manager(C), win, area);
/* tell WM to refresh, cursor types etc */
WM_event_add_mousemove(win);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index b6f210d7f13..ee998e0605a 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -516,7 +516,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
ED_screen_areas_iter (win, screen, area) {
/* set spacetype and region callbacks, calls init() */
/* sets subwindows for regions, adds handlers */
- ED_area_initialize(wm, win, area);
+ ED_area_init(wm, win, area);
}
/* wake up animtimer */
@@ -536,7 +536,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
}
/* file read, set all screens, ... */
-void ED_screens_initialize(Main *bmain, wmWindowManager *wm)
+void ED_screens_init(Main *bmain, wmWindowManager *wm)
{
wmWindow *win;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index fde1498bc5e..f4d36a15d30 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -5184,7 +5184,7 @@ static void region_blend_end(bContext *C, ARegion *region, const bool is_running
else {
if (rgi->hidden) {
rgi->region->flag |= rgi->hidden;
- ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), rgi->area);
+ ED_area_init(CTX_wm_manager(C), CTX_wm_window(C), rgi->area);
}
/* area decoration needs redraw in end */
ED_area_tag_redraw(rgi->area);
@@ -5215,7 +5215,7 @@ void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARe
/* blend in, reinitialize regions because it got unhidden */
if (rgi->hidden == 0) {
- ED_area_initialize(wm, win, area);
+ ED_area_init(wm, win, area);
}
else {
WM_event_remove_handlers(C, &region->handlers);
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index da39fbcf0ce..9398e4443f3 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -455,7 +455,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
}
buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex");
- BKE_curvemapping_initialize(br->curve);
+ BKE_curvemapping_init(br->curve);
LoadTexData data = {
.br = br,
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 5991032536b..af2762889e8 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -6173,7 +6173,7 @@ static bool texture_paint_image_from_view_poll(bContext *C)
CTX_wm_operator_poll_msg_set(C, "No 3D viewport found to create image from");
return false;
}
- if (G.background || !GPU_is_initialized()) {
+ if (G.background || !GPU_is_init()) {
return false;
}
return true;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index caecc7b708a..b9361726826 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -920,9 +920,9 @@ PaintStroke *paint_stroke_new(bContext *C,
ups->average_stroke_counter = 0;
/* initialize here to avoid initialization conflict with threaded strokes */
- BKE_curvemapping_initialize(br->curve);
+ BKE_curvemapping_init(br->curve);
if (p->flags & PAINT_USE_CAVITY_MASK) {
- BKE_curvemapping_initialize(p->cavity_curve);
+ BKE_curvemapping_init(p->cavity_curve);
}
BKE_paint_set_overlay_override(br->overlay_flags);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index 6965946d2ce..83d76c166ce 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -811,7 +811,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
VPaint *wp = ts->wpaint;
struct Brush *brush = BKE_paint_brush(&wp->paint);
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
data.brush = brush;
data.weightpaint = BKE_brush_weight_get(scene, brush);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 2c110e23ac0..a3396a80444 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2966,7 +2966,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
/* XXX - this shouldn't be necessary, but sculpting crashes in blender2.8 otherwise
* initialize before threads so they can do curve mapping. */
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
/* Threaded loop over nodes. */
SculptThreadedTaskData data = {
@@ -3043,7 +3043,7 @@ static void do_draw_sharp_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
/* XXX - this shouldn't be necessary, but sculpting crashes in blender2.8 otherwise
* initialize before threads so they can do curve mapping. */
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
/* Threaded loop over nodes. */
SculptThreadedTaskData data = {
@@ -3273,7 +3273,7 @@ static void do_slide_relax_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int t
return;
}
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
SculptThreadedTaskData data = {
.sd = sd,
@@ -6390,7 +6390,7 @@ static void sculpt_update_cache_invariants(
brush = br;
cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
BKE_brush_size_set(scene, brush, size);
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
}
}
}
@@ -6458,7 +6458,7 @@ static void sculpt_update_cache_invariants(
#define PIXEL_INPUT_THRESHHOLD 5
if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
- cache->dial = BLI_dial_initialize(cache->initial_mouse, PIXEL_INPUT_THRESHHOLD);
+ cache->dial = BLI_dial_init(cache->initial_mouse, PIXEL_INPUT_THRESHHOLD);
}
#undef PIXEL_INPUT_THRESHHOLD
diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index 39cab883100..371f673625e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -477,7 +477,7 @@ static SculptClothSimulation *cloth_brush_simulation_create(SculptSession *ss,
cloth_sim->length_constraint_tweak = MEM_calloc_arrayN(
totverts, sizeof(float), "cloth sim length tweak");
- /* Brush can be NULL for tools that neeed the solver but don't rely on constraint to deformation
+ /* Brush can be NULL for tools that need the solver but don't rely on constraint to deformation
* positions. */
if (brush && SCULPT_is_cloth_deform_brush(brush)) {
cloth_sim->deformation_pos = MEM_calloc_arrayN(
@@ -680,7 +680,7 @@ static void cloth_brush_apply_brush_foces(Sculpt *sd, Object *ob, PBVHNode **nod
.mat = imat,
};
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
/* Init the grab delta. */
copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry);
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c
index 1940b007cb0..5cc32be331e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_face_set.c
+++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c
@@ -192,7 +192,7 @@ void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, in
SculptSession *ss = ob->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
/* Threaded loop over nodes. */
SculptThreadedTaskData data = {
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
index f01a914fdd3..00a59949130 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
@@ -255,7 +255,7 @@ void SCULPT_do_paint_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
return;
}
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
float area_no[3];
float mat[4][4];
@@ -468,7 +468,7 @@ void SCULPT_do_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
}
}
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
SculptThreadedTaskData data = {
.sd = sd,
diff --git a/source/blender/editors/sculpt_paint/sculpt_pose.c b/source/blender/editors/sculpt_paint/sculpt_pose.c
index a338b5346af..976006b3958 100644
--- a/source/blender/editors/sculpt_paint/sculpt_pose.c
+++ b/source/blender/editors/sculpt_paint/sculpt_pose.c
@@ -1000,7 +1000,7 @@ void SCULPT_pose_brush_init(Sculpt *sd, Object *ob, SculptSession *ss, Brush *br
static void sculpt_pose_do_translate_deform(SculptSession *ss, Brush *brush)
{
SculptPoseIKChain *ik_chain = ss->cache->pose_ik_chain;
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
pose_solve_translate_chain(ik_chain, ss->cache->grab_delta);
}
@@ -1041,7 +1041,7 @@ static void sculpt_pose_do_twist_deform(SculptSession *ss, Brush *brush)
/* Calculate the maximum roll. 0.02 radians per pixel works fine. */
float roll = (ss->cache->initial_mouse[0] - ss->cache->mouse[0]) * ss->cache->bstrength * 0.02f;
- BKE_curvemapping_initialize(brush->curve);
+ BKE_curvemapping_init(brush->curve);
pose_solve_roll_chain(ik_chain, brush, roll);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 4b3df2dfea2..be509f4aed6 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -488,7 +488,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
op->customdata = data;
- BKE_curvemapping_initialize(ts->uvsculpt->paint.brush->curve);
+ BKE_curvemapping_init(ts->uvsculpt->paint.brush->curve);
if (data) {
int counter = 0, i;
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 37d5f602291..0aea7e4b73c 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -684,7 +684,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
if (main_visible) {
if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) {
region_main->flag &= ~RGN_FLAG_HIDDEN;
- region_main->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_main->v2d.flag &= ~V2D_IS_INIT;
view_changed = true;
}
@@ -696,7 +696,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
else {
if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) {
region_main->flag |= RGN_FLAG_HIDDEN;
- region_main->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_main->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_main->handlers);
view_changed = true;
}
@@ -709,7 +709,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
if (properties_visible) {
if (region_properties && (region_properties->flag & RGN_FLAG_HIDDEN)) {
region_properties->flag &= ~RGN_FLAG_HIDDEN;
- region_properties->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_properties->v2d.flag &= ~V2D_IS_INIT;
view_changed = true;
}
if (region_properties && region_properties->alignment != RGN_ALIGN_RIGHT) {
@@ -720,7 +720,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
else {
if (region_properties && !(region_properties->flag & RGN_FLAG_HIDDEN)) {
region_properties->flag |= RGN_FLAG_HIDDEN;
- region_properties->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_properties->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_properties->handlers);
view_changed = true;
}
@@ -733,7 +733,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
if (tools_visible) {
if (region_tools && (region_tools->flag & RGN_FLAG_HIDDEN)) {
region_tools->flag &= ~RGN_FLAG_HIDDEN;
- region_tools->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_tools->v2d.flag &= ~V2D_IS_INIT;
view_changed = true;
}
if (region_tools && region_tools->alignment != RGN_ALIGN_LEFT) {
@@ -744,7 +744,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
else {
if (region_tools && !(region_tools->flag & RGN_FLAG_HIDDEN)) {
region_tools->flag |= RGN_FLAG_HIDDEN;
- region_tools->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_tools->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_tools->handlers);
view_changed = true;
}
@@ -757,7 +757,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
if (preview_visible) {
if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) {
region_preview->flag &= ~RGN_FLAG_HIDDEN;
- region_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_preview->v2d.flag &= ~V2D_IS_INIT;
region_preview->v2d.cur = region_preview->v2d.tot;
view_changed = true;
}
@@ -769,7 +769,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
else {
if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) {
region_preview->flag |= RGN_FLAG_HIDDEN;
- region_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_preview->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_preview->handlers);
view_changed = true;
}
@@ -782,7 +782,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
if (channels_visible) {
if (region_channels && (region_channels->flag & RGN_FLAG_HIDDEN)) {
region_channels->flag &= ~RGN_FLAG_HIDDEN;
- region_channels->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_channels->v2d.flag &= ~V2D_IS_INIT;
view_changed = true;
}
if (region_channels && region_channels->alignment != RGN_ALIGN_LEFT) {
@@ -793,7 +793,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
else {
if (region_channels && !(region_channels->flag & RGN_FLAG_HIDDEN)) {
region_channels->flag |= RGN_FLAG_HIDDEN;
- region_channels->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_channels->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_channels->handlers);
view_changed = true;
}
@@ -804,7 +804,7 @@ static void clip_refresh(const bContext *C, ScrArea *area)
}
if (view_changed) {
- ED_area_initialize(wm, window, area);
+ ED_area_init(wm, window, area);
ED_area_tag_redraw(area);
}
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 43939b9ff54..355597cddf1 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -235,7 +235,7 @@ static void file_ensure_valid_region_state(bContext *C,
ARegion *region_ui = BKE_area_find_region_type(area, RGN_TYPE_UI);
ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS);
ARegion *region_execute = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE);
- bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */
+ bool needs_init = false; /* To avoid multiple ED_area_init() calls. */
/* If there's an file-operation, ensure we have the option and execute region */
if (sfile->op && (region_props == NULL)) {
@@ -261,7 +261,7 @@ static void file_ensure_valid_region_state(bContext *C,
}
if (needs_init) {
- ED_area_initialize(wm, win, area);
+ ED_area_init(wm, win, area);
}
}
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 68fdef54a53..90fe95c6818 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1487,7 +1487,7 @@ static int graphkeys_decimate_invoke(bContext *C, wmOperator *op, const wmEvent
dgo->area = CTX_wm_area(C);
dgo->region = CTX_wm_region(C);
- /* initialise percentage so that it will have the correct value before the first mouse move. */
+ /* Initialize percentage so that it will have the correct value before the first mouse move. */
decimate_mouse_update_percentage(dgo, op, event);
decimate_draw_status_header(op, dgo);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index d05fe215840..1a98ec0e7c1 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3714,7 +3714,7 @@ static void draw_fill_tile(PointerRNA *ptr, uiLayout *layout)
uiItemR(col[1], ptr, "float", 0, NULL, ICON_NONE);
}
-static void initialize_fill_tile(PointerRNA *ptr, Image *ima, ImageTile *tile)
+static void tile_fill_init(PointerRNA *ptr, Image *ima, ImageTile *tile)
{
ImageUser iuser;
BKE_imageuser_default(&iuser);
@@ -3827,7 +3827,7 @@ static int tile_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev
}
ImageTile *tile = BLI_findlink(&ima->tiles, ima->active_tile_index);
- initialize_fill_tile(op->ptr, ima, tile);
+ tile_fill_init(op->ptr, ima, tile);
RNA_int_set(op->ptr, "number", next_number);
RNA_int_set(op->ptr, "count", 1);
@@ -3973,7 +3973,7 @@ static int tile_fill_exec(bContext *C, wmOperator *op)
static int tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
- initialize_fill_tile(op->ptr, CTX_data_edit_image(C), NULL);
+ tile_fill_init(op->ptr, CTX_data_edit_image(C), NULL);
return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 2f85eb10e77..4dcf5822bb2 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2924,8 +2924,8 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
}
/* This moves strips from meta to parent, sating within same edit and no new strips are
- * allocated. If the UUID was unique already (as it should) it will stay unique. Nn need to
- * re-generate the UUIDs.*/
+ * allocated. If the UUID was unique already (as it should) it will stay unique.
+ * No need to re-generate the UUIDs. */
BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase);
BLI_listbase_clear(&last_seq->seqbase);
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 926752c6488..fa5e2ea02ff 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -231,12 +231,12 @@ static void sequencer_refresh(const bContext *C, ScrArea *area)
case SEQ_VIEW_SEQUENCE:
if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) {
region_main->flag &= ~RGN_FLAG_HIDDEN;
- region_main->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_main->v2d.flag &= ~V2D_IS_INIT;
view_changed = true;
}
if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) {
region_preview->flag |= RGN_FLAG_HIDDEN;
- region_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_preview->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_preview->handlers);
view_changed = true;
}
@@ -252,13 +252,13 @@ static void sequencer_refresh(const bContext *C, ScrArea *area)
case SEQ_VIEW_PREVIEW:
if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) {
region_main->flag |= RGN_FLAG_HIDDEN;
- region_main->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_main->v2d.flag &= ~V2D_IS_INIT;
WM_event_remove_handlers((bContext *)C, &region_main->handlers);
view_changed = true;
}
if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) {
region_preview->flag &= ~RGN_FLAG_HIDDEN;
- region_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_preview->v2d.flag &= ~V2D_IS_INIT;
region_preview->v2d.cur = region_preview->v2d.tot;
view_changed = true;
}
@@ -281,13 +281,13 @@ static void sequencer_refresh(const bContext *C, ScrArea *area)
* 'full window' views before, though... Better than nothing. */
if (region_main->flag & RGN_FLAG_HIDDEN) {
region_main->flag &= ~RGN_FLAG_HIDDEN;
- region_main->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_main->v2d.flag &= ~V2D_IS_INIT;
region_preview->sizey = (int)(height - region_main->sizey);
view_changed = true;
}
if (region_preview->flag & RGN_FLAG_HIDDEN) {
region_preview->flag &= ~RGN_FLAG_HIDDEN;
- region_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+ region_preview->v2d.flag &= ~V2D_IS_INIT;
region_preview->v2d.cur = region_preview->v2d.tot;
region_main->sizey = (int)(height - region_preview->sizey);
view_changed = true;
@@ -312,7 +312,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *area)
}
if (view_changed) {
- ED_area_initialize(wm, window, area);
+ ED_area_init(wm, window, area);
ED_area_tag_redraw(area);
}
}
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index 9eae722d5c8..92f9c187ce5 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -115,7 +115,7 @@ static void userpref_main_region_init(wmWindowManager *wm, ARegion *region)
{
/* do not use here, the properties changed in userprefs do a system-wide refresh,
* then scroller jumps back */
- /* region->v2d.flag &= ~V2D_IS_INITIALISED; */
+ /* region->v2d.flag &= ~V2D_IS_INIT; */
region->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c
index c3b9c14cc4a..8f4a44c6a34 100644
--- a/source/blender/editors/transform/transform_convert_gpencil.c
+++ b/source/blender/editors/transform/transform_convert_gpencil.c
@@ -121,7 +121,7 @@ void createTransGPencil(bContext *C, TransInfo *t)
/* initialize falloff curve */
if (is_multiedit) {
- BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+ BKE_curvemapping_init(ts->gp_sculpt.cur_falloff);
}
/* First Pass: Count the number of data-points required for the strokes,
diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c
index 2e0f7a3a113..6f447997fb0 100644
--- a/source/blender/editors/transform/transform_convert_mesh.c
+++ b/source/blender/editors/transform/transform_convert_mesh.c
@@ -472,7 +472,7 @@ static void editmesh_mirror_data_calc(BMEditMesh *em,
BMIter iter;
int i, flag, totvert = bm->totvert;
- vert_map = MEM_mallocN(totvert * sizeof(*vert_map), __func__);
+ vert_map = MEM_callocN(totvert * sizeof(*vert_map), __func__);
float select_sum[3] = {0};
BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) {
@@ -498,7 +498,8 @@ static void editmesh_mirror_data_calc(BMEditMesh *em,
uint mirror_elem_len = 0;
int *index[3] = {NULL, NULL, NULL};
- bool test_selected_only = use_select && (mirror_axis[0] + mirror_axis[1] + mirror_axis[2]) == 1;
+ bool is_single_mirror_axis = (mirror_axis[0] + mirror_axis[1] + mirror_axis[2]) == 1;
+ bool test_selected_only = use_select && is_single_mirror_axis;
for (int a = 0; a < 3; a++) {
if (!mirror_axis[a]) {
continue;
@@ -523,13 +524,23 @@ static void editmesh_mirror_data_calc(BMEditMesh *em,
if (!is_in_quadrant_v3(eve->co, quadrant, TRANSFORM_MAXDIST_MIRROR)) {
continue;
}
+ if (vert_map[i_mirr].flag != 0) {
+ /* One mirror per element.
+ * It can happen when vertices occupy the same position. */
+ continue;
+ }
vert_map[i_mirr] = (struct MirrorDataVert){i, flag};
mirror_elem_len++;
}
}
- if (mirror_elem_len) {
+ if (!mirror_elem_len) {
+ MEM_freeN(vert_map);
+ vert_map = NULL;
+ }
+ else if (!is_single_mirror_axis) {
+ /* Adjustment for elements that are mirrors of mirrored elements. */
for (int a = 0; a < 3; a++) {
if (!mirror_axis[a]) {
continue;
@@ -551,10 +562,6 @@ static void editmesh_mirror_data_calc(BMEditMesh *em,
}
}
}
- else {
- MEM_freeN(vert_map);
- vert_map = NULL;
- }
MEM_SAFE_FREE(index[0]);
MEM_SAFE_FREE(index[1]);
diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c
index 4c354ab5940..151c881a466 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -1263,11 +1263,13 @@ static void uv_select_linked_multi(Scene *scene,
Object **objects,
const uint objects_len,
UvNearestHit *hit_final,
- bool extend,
+ const bool extend,
bool deselect,
- bool toggle,
- bool select_faces)
+ const bool toggle,
+ const bool select_faces)
{
+ const bool uv_sync_select = (scene->toolsettings->uv_flag & UV_SYNC_SELECTION);
+
/* loop over objects, or just use hit_final->ob */
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
if (hit_final && ob_index != 0) {
@@ -1278,7 +1280,6 @@ static void uv_select_linked_multi(Scene *scene,
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
- MLoopUV *luv;
UvVertMap *vmap;
UvMapVert *vlist, *iterv, *startv;
int i, stacksize = 0, *stack;
@@ -1296,7 +1297,7 @@ static void uv_select_linked_multi(Scene *scene,
*
* Better solve this by having a delimit option for select-linked operator,
* keeping island-select working as is. */
- vmap = BM_uv_vert_map_create(em->bm, !select_faces, false);
+ vmap = BM_uv_vert_map_create(em->bm, !uv_sync_select, false);
if (vmap == NULL) {
continue;
@@ -1318,14 +1319,42 @@ static void uv_select_linked_multi(Scene *scene,
}
else {
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
- luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-
- if (luv->flag & MLOOPUV_VERTSEL) {
- stack[stacksize] = a;
- stacksize++;
- flag[a] = 1;
+ if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) {
+ bool add_to_stack = true;
+ if (uv_sync_select && !select_faces) {
+ /* Special case, vertex/edge & sync select being enabled.
+ *
+ * Without this, a second linked select will 'grow' each time as each new
+ * selection reaches the boundaries of islands that share vertices but not UV's.
+ *
+ * Rules applied here:
+ * - This loops face isn't selected.
+ * - The only other fully selected face is connected or,
+ * - There are no connected fully selected faces UV-connected to this loop.
+ */
+ if (uvedit_face_select_test(scene, l->f, cd_loop_uv_offset)) {
+ /* pass */
+ }
+ else {
+ BMIter liter_other;
+ BMLoop *l_other;
+ BM_ITER_ELEM (l_other, &liter_other, l->v, BM_LOOPS_OF_VERT) {
+ if ((l != l_other) &&
+ !BM_loop_uv_share_vert_check(l, l_other, cd_loop_uv_offset) &&
+ uvedit_face_select_test(scene, l_other->f, cd_loop_uv_offset)) {
+ add_to_stack = false;
+ break;
+ }
+ }
+ }
+ }
- break;
+ if (add_to_stack) {
+ stack[stacksize] = a;
+ stacksize++;
+ flag[a] = 1;
+ break;
+ }
}
}
}
@@ -1394,10 +1423,9 @@ static void uv_select_linked_multi(Scene *scene,
}
else {
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
- luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-
- if (luv->flag & MLOOPUV_VERTSEL) {
+ if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) {
found_selected = true;
+ break;
}
}
@@ -1414,10 +1442,7 @@ static void uv_select_linked_multi(Scene *scene,
BM_face_select_set(em->bm, efa, value); \
} \
else { \
- BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { \
- luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); \
- luv->flag = (value) ? (luv->flag | MLOOPUV_VERTSEL) : (luv->flag & ~MLOOPUV_VERTSEL); \
- } \
+ uvedit_face_select_set(scene, em, efa, value, false, cd_loop_uv_offset); \
} \
(void)0
@@ -1442,6 +1467,17 @@ static void uv_select_linked_multi(Scene *scene,
MEM_freeN(stack);
MEM_freeN(flag);
BM_uv_vert_map_free(vmap);
+
+ if (uv_sync_select) {
+ if (deselect) {
+ EDBM_deselect_flush(em);
+ }
+ else {
+ if (!select_faces) {
+ EDBM_selectmode_flush(em);
+ }
+ }
+ }
}
}
@@ -2263,13 +2299,6 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent
UvNearestHit hit = UV_NEAREST_HIT_INIT;
- if ((ts->uv_flag & UV_SYNC_SELECTION) && !(ts->selectmode & SCE_SELECT_FACE)) {
- BKE_report(op->reports,
- RPT_ERROR,
- "Select linked only works in face select mode when sync selection is enabled");
- return OPERATOR_CANCELLED;
- }
-
if (pick) {
extend = RNA_boolean_get(op->ptr, "extend");
deselect = RNA_boolean_get(op->ptr, "deselect");
@@ -2300,7 +2329,7 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent
}
}
- if (!extend) {
+ if (!extend && !deselect) {
uv_select_all_perform_multi(scene, objects, objects_len, SEL_DESELECT);
}
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h
index 876f40b211f..71d7dd03ef3 100644
--- a/source/blender/freestyle/FRS_freestyle.h
+++ b/source/blender/freestyle/FRS_freestyle.h
@@ -43,7 +43,7 @@ struct FreestyleGlobals {
extern struct FreestyleGlobals g_freestyle;
/* Rendering */
-void FRS_initialize(void);
+void FRS_init(void);
void FRS_set_context(struct bContext *C);
int FRS_is_freestyle_enabled(struct ViewLayer *view_layer);
void FRS_init_stroke_renderer(struct Render *re);
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 51ac281e330..2b43e913b3d 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -100,7 +100,7 @@ static bCallbackFuncStore load_post_callback_funcstore = {
// Initialization
//=======================================================
-void FRS_initialize()
+void FRS_init()
{
if (freestyle_is_initialized) {
return;
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
index 33078e6ba6a..9796dcda964 100644
--- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
@@ -264,7 +264,7 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
return NULL;
}
cumap = (CurveMapping *)py_srna->ptr.data;
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
/* disable extrapolation if enabled */
if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE)) {
cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
index 03137a5cf23..21a8962b131 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
@@ -69,7 +69,7 @@ static void initData(GpencilModifierData *md)
gpmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curve_intensity) {
CurveMapping *curve = gpmd->curve_intensity;
- BKE_curvemapping_initialize(curve);
+ BKE_curvemapping_init(curve);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
index 97cc0c2c4d9..4fc5d25f1df 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
@@ -94,7 +94,7 @@ static void initData(GpencilModifierData *md)
gpmd->falloff_type = eGPHook_Falloff_Smooth;
gpmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curfalloff) {
- BKE_curvemapping_initialize(gpmd->curfalloff);
+ BKE_curvemapping_init(gpmd->curfalloff);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index 0d8a5f7914e..67c26bf2584 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
@@ -79,7 +79,7 @@ static void initData(GpencilModifierData *md)
if (gpmd->curve_intensity) {
CurveMapping *curve = gpmd->curve_intensity;
BKE_curvemap_reset(curve->cm, &curve->clipr, CURVE_PRESET_BELL, CURVEMAP_SLOPE_POSITIVE);
- BKE_curvemapping_initialize(curve);
+ BKE_curvemapping_init(curve);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
index 34142709c18..efa58cc4ae0 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
@@ -70,7 +70,7 @@ static void initData(GpencilModifierData *md)
gpmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curve_intensity) {
CurveMapping *curve = gpmd->curve_intensity;
- BKE_curvemapping_initialize(curve);
+ BKE_curvemapping_init(curve);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
index 175a6d81b1b..a95c4ee63fc 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
@@ -66,7 +66,7 @@ static void initData(GpencilModifierData *md)
gpmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curve_intensity) {
CurveMapping *curve = gpmd->curve_intensity;
- BKE_curvemapping_initialize(curve);
+ BKE_curvemapping_init(curve);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
index 4fa47a592ba..68547614776 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
@@ -65,7 +65,7 @@ static void initData(GpencilModifierData *md)
gpmd->material = NULL;
gpmd->curve_thickness = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curve_thickness) {
- BKE_curvemapping_initialize(gpmd->curve_thickness);
+ BKE_curvemapping_init(gpmd->curve_thickness);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
index da7d33839f1..9d10fcbe49b 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
@@ -96,7 +96,7 @@ static void initData(GpencilModifierData *md)
gpmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
if (gpmd->curve_intensity) {
CurveMapping *curve = gpmd->curve_intensity;
- BKE_curvemapping_initialize(curve);
+ BKE_curvemapping_init(curve);
}
}
diff --git a/source/blender/gpu/GPU_init_exit.h b/source/blender/gpu/GPU_init_exit.h
index 3e30a1ddcf5..58b9505cdb1 100644
--- a/source/blender/gpu/GPU_init_exit.h
+++ b/source/blender/gpu/GPU_init_exit.h
@@ -32,7 +32,7 @@ extern "C" {
void GPU_init(void);
void GPU_exit(void);
-bool GPU_is_initialized(void);
+bool GPU_is_init(void);
#ifdef __cplusplus
}
diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c
index 54ddb9351b9..c5061ec9ba3 100644
--- a/source/blender/gpu/intern/gpu_init_exit.c
+++ b/source/blender/gpu/intern/gpu_init_exit.c
@@ -95,7 +95,7 @@ void GPU_exit(void)
initialized = false;
}
-bool GPU_is_initialized(void)
+bool GPU_is_init(void)
{
return initialized;
}
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index 8a3a8a382f8..014f82f83de 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -2177,7 +2177,7 @@ void GPU_samplers_init(void)
glGenSamplers(1, &GG.icon_sampler);
glSamplerParameteri(GG.icon_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glSamplerParameteri(GG.icon_sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glSamplerParameteri(GG.icon_sampler, GL_TEXTURE_LOD_BIAS, -0.5f);
+ glSamplerParameterf(GG.icon_sampler, GL_TEXTURE_LOD_BIAS, -0.5f);
}
void GPU_sampler_icon_bind(int unit)
diff --git a/source/blender/ikplugin/BIK_api.h b/source/blender/ikplugin/BIK_api.h
index 2c2053b47a6..99f68983c21 100644
--- a/source/blender/ikplugin/BIK_api.h
+++ b/source/blender/ikplugin/BIK_api.h
@@ -36,7 +36,7 @@ struct bConstraint;
struct bPose;
struct bPoseChannel;
-void BIK_initialize_tree(struct Depsgraph *depsgraph,
+void BIK_init_tree(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
float ctime);
diff --git a/source/blender/ikplugin/intern/ikplugin_api.c b/source/blender/ikplugin/intern/ikplugin_api.c
index 5e683d36408..233150a77aa 100644
--- a/source/blender/ikplugin/intern/ikplugin_api.c
+++ b/source/blender/ikplugin/intern/ikplugin_api.c
@@ -80,7 +80,7 @@ static IKPlugin *get_plugin(bPose *pose)
/*----------------------------------------*/
/* Plugin API */
-void BIK_initialize_tree(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime)
+void BIK_init_tree(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime)
{
IKPlugin *plugin = get_plugin(ob->pose);
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index c9b3db39976..136d191c6a0 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -3958,7 +3958,7 @@ static void curve_mapping_to_ocio_settings(CurveMapping *curve_mapping,
{
int i;
- BKE_curvemapping_initialize(curve_mapping);
+ BKE_curvemapping_init(curve_mapping);
BKE_curvemapping_premultiply(curve_mapping, false);
BKE_curvemapping_table_RGBA(
curve_mapping, &curve_mapping_settings->lut, &curve_mapping_settings->lut_size);
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 5154f50c7e8..f81c005bf06 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -651,7 +651,7 @@ BLI_INLINE int DOWNSAMPLE_FLOAT_TO_16BIT(const float _val)
#define COMP_24_CS 1041666 /*Maximum size per color component for 2K & 4K @ 24fps*/
#define COMP_48_CS 520833 /*Maximum size per color component for 2K @ 48fps*/
-static int initialise_4K_poc(opj_poc_t *POC, int numres)
+static int init_4K_poc(opj_poc_t *POC, int numres)
{
POC[0].tile = 1;
POC[0].resno0 = 0;
@@ -750,7 +750,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,
else {
parameters->cp_rsiz = DCP_CINEMA2K;
}
- parameters->numpocs = initialise_4K_poc(parameters->POC, parameters->numresolution);
+ parameters->numpocs = init_4K_poc(parameters->POC, parameters->numresolution);
break;
case OPJ_OFF:
/* do nothing */
diff --git a/source/blender/imbuf/intern/stereoimbuf.c b/source/blender/imbuf/intern/stereoimbuf.c
index 5569e119b95..0d532b0e1fb 100644
--- a/source/blender/imbuf/intern/stereoimbuf.c
+++ b/source/blender/imbuf/intern/stereoimbuf.c
@@ -669,7 +669,7 @@ static void imb_stereo3d_squeeze_rect(
/*************************** preparing to call the write functions **************************/
-static void imb_stereo3d_data_initialize(Stereo3DData *s3d_data,
+static void imb_stereo3d_data_init(Stereo3DData *s3d_data,
const bool is_float,
const size_t x,
const size_t y,
@@ -709,7 +709,7 @@ int *IMB_stereo3d_from_rect(ImageFormatData *im_format,
im_format->stereo3d_format.display_mode, false, x, y, &width, &height);
r_rect = MEM_mallocN(channels * sizeof(int) * width * height, __func__);
- imb_stereo3d_data_initialize(
+ imb_stereo3d_data_init(
&s3d_data, is_float, x, y, channels, rect_left, rect_right, r_rect, NULL, NULL, NULL);
imb_stereo3d_write_doit(&s3d_data, &im_format->stereo3d_format);
imb_stereo3d_squeeze_rect(r_rect, &im_format->stereo3d_format, x, y, channels);
@@ -733,7 +733,7 @@ float *IMB_stereo3d_from_rectf(ImageFormatData *im_format,
im_format->stereo3d_format.display_mode, false, x, y, &width, &height);
r_rectf = MEM_mallocN(channels * sizeof(float) * width * height, __func__);
- imb_stereo3d_data_initialize(
+ imb_stereo3d_data_init(
&s3d_data, is_float, x, y, channels, NULL, NULL, NULL, rectf_left, rectf_right, r_rectf);
imb_stereo3d_write_doit(&s3d_data, &im_format->stereo3d_format);
imb_stereo3d_squeeze_rectf(r_rectf, &im_format->stereo3d_format, x, y, channels);
@@ -759,7 +759,7 @@ ImBuf *IMB_stereo3d_ImBuf(ImageFormatData *im_format, ImBuf *ibuf_left, ImBuf *i
ibuf_stereo->flags = ibuf_left->flags;
- imb_stereo3d_data_initialize(&s3d_data,
+ imb_stereo3d_data_init(&s3d_data,
is_float,
ibuf_left->x,
ibuf_left->y,
@@ -1286,7 +1286,7 @@ void IMB_ImBufFromStereo3d(Stereo3dFormat *s3d,
&height);
imb_stereo3d_unsqueeze_ImBuf(ibuf_stereo3d, s3d, width, height);
- imb_stereo3d_data_initialize(&s3d_data,
+ imb_stereo3d_data_init(&s3d_data,
is_float,
ibuf_left->x,
ibuf_left->y,
@@ -1310,7 +1310,7 @@ void IMB_ImBufFromStereo3d(Stereo3dFormat *s3d,
addzbufImBuf(ibuf_right);
}
- imb_stereo3d_data_initialize(&s3d_data,
+ imb_stereo3d_data_init(&s3d_data,
is_float,
ibuf_left->x,
ibuf_left->y,
diff --git a/source/blender/io/usd/tests/usd_stage_creation_test.cc b/source/blender/io/usd/tests/usd_stage_creation_test.cc
index e6bd0bab6ce..97d23f57175 100644
--- a/source/blender/io/usd/tests/usd_stage_creation_test.cc
+++ b/source/blender/io/usd/tests/usd_stage_creation_test.cc
@@ -28,7 +28,7 @@
extern "C" {
/* Workaround to make it possible to pass a path at runtime to USD. See creator.c. */
-void usd_initialise_plugin_path(const char *datafiles_usd_path);
+void usd_init_plugin_path(const char *datafiles_usd_path);
}
namespace blender::io::usd {
@@ -46,7 +46,7 @@ TEST_F(USDStageCreationTest, JSONFileLoadingTest)
char usd_datafiles_dir[FILE_MAX];
BLI_path_join(usd_datafiles_dir, FILE_MAX, release_dir.c_str(), "datafiles", "usd", nullptr);
- usd_initialise_plugin_path(usd_datafiles_dir);
+ usd_init_plugin_path(usd_datafiles_dir);
/* Simply the ability to create a USD Stage for a specific filename means that the extension
* has been recognized by the USD library, and that a USD plugin has been loaded to write such
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index 8734a73c07a..30eafb34ba6 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -137,7 +137,7 @@ enum {
/* apply pixel offsets on y-axis when setting view matrices */
V2D_PIXELOFS_Y = (1 << 3),
/* view settings need to be set still... */
- V2D_IS_INITIALISED = (1 << 10),
+ V2D_IS_INIT = (1 << 10),
};
/* scroller flags for View2D (v2d->scroll) */
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index a07b8f81d96..668818b17bb 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -198,8 +198,8 @@ typedef struct wmWindowManager {
/* wmWindowManager.initialized */
enum {
- WM_WINDOW_IS_INITIALIZED = (1 << 0),
- WM_KEYCONFIG_IS_INITIALIZED = (1 << 1),
+ WM_WINDOW_IS_INIT = (1 << 0),
+ WM_KEYCONFIG_IS_INIT = (1 << 1),
};
/* wmWindowManager.outliner_sync_select_dirty */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 826fc53dce4..026274e5b22 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -1548,7 +1548,6 @@ int main(int argc, char **argv)
# pragma GCC poison int8_t
#endif
-#include "DNA_session_uuid_types.h"
#include "DNA_ID.h"
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
@@ -1603,6 +1602,7 @@ int main(int argc, char **argv)
#include "DNA_screen_types.h"
#include "DNA_sdna_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_session_uuid_types.h"
#include "DNA_shader_fx_types.h"
#include "DNA_simulation_types.h"
#include "DNA_sound_types.h"
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 045d098bf6a..6169b72a7fa 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -5146,7 +5146,7 @@ int main(int argc, char **argv)
{
int return_status = 0;
- MEM_initialize_memleak_detection();
+ MEM_init_memleak_detection();
MEM_set_error_callback(mem_error_cb);
CLG_init();
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 56ad8e2677b..60b6cc40792 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -702,7 +702,7 @@ static float rna_CurveMapping_evaluateF(struct CurveMapping *cumap,
static void rna_CurveMap_initialize(struct CurveMapping *cumap)
{
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
}
#else
diff --git a/source/blender/makesrna/intern/rna_curveprofile.c b/source/blender/makesrna/intern/rna_curveprofile.c
index ce91fc79085..ee1c659fcd5 100644
--- a/source/blender/makesrna/intern/rna_curveprofile.c
+++ b/source/blender/makesrna/intern/rna_curveprofile.c
@@ -146,7 +146,7 @@ static void rna_CurveProfile_evaluate(struct CurveProfile *profile,
static void rna_CurveProfile_initialize(struct CurveProfile *profile, int segments_len)
{
- BKE_curveprofile_initialize(profile, (short)segments_len);
+ BKE_curveprofile_init(profile, (short)segments_len);
}
static void rna_CurveProfile_update(struct CurveProfile *profile)
diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c
index ab8f97ae3c2..3af783f1bb1 100644
--- a/source/blender/makesrna/intern/rna_fluid.c
+++ b/source/blender/makesrna/intern/rna_fluid.c
@@ -2048,6 +2048,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop,
"Start",
"Frame on which the simulation starts. This is the first frame that will be baked");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop = RNA_def_property(srna, "cache_frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "cache_frame_end");
@@ -2057,6 +2058,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop,
"End",
"Frame on which the simulation stops. This is the last frame that will be baked");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop = RNA_def_property(srna, "cache_frame_offset", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "cache_frame_offset");
@@ -2066,6 +2068,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
"Offset",
"Frame offset that is used when loading the simulation from the cache. It is not considered "
"when baking the simulation, only when loading it");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop = RNA_def_property(srna, "cache_frame_pause_data", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_data");
@@ -2089,6 +2092,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, NULL, "rna_Fluid_cachetype_mesh_set", "rna_Fluid_cachetype_mesh_itemf");
RNA_def_property_ui_text(
prop, "File Format", "Select the file format to be used for caching surface data");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
prop = RNA_def_property(srna, "cache_data_format", PROP_ENUM, PROP_NONE);
@@ -2098,6 +2102,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, NULL, "rna_Fluid_cachetype_data_set", "rna_Fluid_cachetype_volume_itemf");
RNA_def_property_ui_text(
prop, "File Format", "Select the file format to be used for caching volumetric data");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
prop = RNA_def_property(srna, "cache_particle_format", PROP_ENUM, PROP_NONE);
@@ -2107,6 +2112,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, NULL, "rna_Fluid_cachetype_particle_set", "rna_Fluid_cachetype_particle_itemf");
RNA_def_property_ui_text(
prop, "File Format", "Select the file format to be used for caching particle data");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
prop = RNA_def_property(srna, "cache_noise_format", PROP_ENUM, PROP_NONE);
@@ -2116,6 +2122,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, NULL, "rna_Fluid_cachetype_noise_set", "rna_Fluid_cachetype_volume_itemf");
RNA_def_property_ui_text(
prop, "File Format", "Select the file format to be used for caching noise data");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_noisecache_reset");
prop = RNA_def_property(srna, "cache_type", PROP_ENUM, PROP_NONE);
@@ -2123,6 +2130,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, cache_types);
RNA_def_property_enum_funcs(prop, NULL, "rna_Fluid_cachetype_set", NULL);
RNA_def_property_ui_text(prop, "Type", "Change the cache type of the simulation");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_domain_data_reset");
prop = RNA_def_property(srna, "cache_resumable", PROP_BOOLEAN, PROP_NONE);
@@ -2133,6 +2141,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
"Additional data will be saved so that the bake jobs can be resumed after pausing. Because "
"more data will be written to disk it is recommended to avoid enabling this option when "
"baking at high resolutions");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
prop = RNA_def_property(srna, "cache_directory", PROP_STRING, PROP_DIRPATH);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 86f05c350f3..d4b1009df4d 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1163,7 +1163,7 @@ static void rna_BevelModifier_update_segments(Main *bmain, Scene *scene, Pointer
BevelModifierData *bmd = (BevelModifierData *)ptr->data;
if (RNA_enum_get(ptr, "profile_type") == MOD_BEVEL_PROFILE_CUSTOM) {
short segments = (short)RNA_int_get(ptr, "segments");
- BKE_curveprofile_initialize(bmd->custom_profile, segments);
+ BKE_curveprofile_init(bmd->custom_profile, segments);
}
rna_Modifier_update(bmain, scene, ptr);
}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 24c4818694f..fb2a60db0fd 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -231,7 +231,7 @@ static int rna_Area_ui_type_get(PointerRNA *ptr)
* the area type is changing.
* So manually do the lookup in those cases, but do not actually change area->type
* since that prevents a proper exit when the area type is changing.
- * Logic copied from `ED_area_initialize()`.*/
+ * Logic copied from `ED_area_init()`.*/
SpaceType *type = area->type;
if (type == NULL || area_changing) {
type = BKE_spacetype_from_id(area_type);
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 861d5ea7435..0d3468f4bb8 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -284,7 +284,7 @@ static void deformVerts_do(HookModifierData *hmd,
}
if (hmd->curfalloff) {
- BKE_curvemapping_initialize(hmd->curfalloff);
+ BKE_curvemapping_init(hmd->curfalloff);
}
/* Generic data needed for applying per-vertex calculations (initialize all members) */
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index cbe774e91da..2657e3d894a 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -236,7 +236,7 @@ static void warpModifier_do(WarpModifierData *wmd,
}
if (wmd->curfalloff) {
- BKE_curvemapping_initialize(wmd->curfalloff);
+ BKE_curvemapping_init(wmd->curfalloff);
}
invert_m4_m4(obinv, ob->obmat);
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 54d3aa46344..8d6a8f25e22 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -83,7 +83,7 @@ void weightvg_do_map(
}
if (cmap && falloff_type == MOD_WVG_MAPPING_CURVE) {
- BKE_curvemapping_initialize(cmap);
+ BKE_curvemapping_init(cmap);
}
/* Map each weight (vertex) to its new value, accordingly to the chosen mode. */
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 8039856172a..6bb4f3dc1b5 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -72,7 +72,7 @@ static void initData(ModifierData *md)
wmd->default_weight = 0.0f;
wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
- BKE_curvemapping_initialize(wmd->cmap_curve);
+ BKE_curvemapping_init(wmd->cmap_curve);
wmd->rem_threshold = 0.01f;
wmd->add_threshold = 0.01f;
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c
index 9efbdc079e6..b2309abe32e 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -73,7 +73,7 @@ void *node_initexec_curves(bNodeExecContext *UNUSED(context),
bNode *node,
bNodeInstanceKey UNUSED(key))
{
- BKE_curvemapping_initialize(node->storage);
+ BKE_curvemapping_init(node->storage);
return NULL; /* unused return */
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c
index 68f252cb092..06aaf9e74cb 100644
--- a/source/blender/nodes/shader/nodes/node_shader_curves.c
+++ b/source/blender/nodes/shader/nodes/node_shader_curves.c
@@ -168,7 +168,7 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat,
CurveMapping *cumap = node->storage;
- BKE_curvemapping_initialize(cumap);
+ BKE_curvemapping_init(cumap);
BKE_curvemapping_table_RGBA(cumap, &array, &size);
GPUNodeLink *tex = GPU_color_band(mat, size, array, &layer);
diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c
index d42985ba041..70f7e731720 100644
--- a/source/blender/nodes/texture/nodes/node_texture_curves.c
+++ b/source/blender/nodes/texture/nodes/node_texture_curves.c
@@ -39,7 +39,7 @@ static void time_colorfn(
fac = (p->cfra - node->custom1) / (float)(node->custom2 - node->custom1);
}
- BKE_curvemapping_initialize(node->storage);
+ BKE_curvemapping_init(node->storage);
fac = BKE_curvemapping_evaluateF(node->storage, 0, fac);
out[0] = CLAMPIS(fac, 0.0f, 1.0f);
}
diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c
index 1379c0e557a..da7674eb7f9 100644
--- a/source/blender/python/gpu/gpu_py_api.c
+++ b/source/blender/python/gpu/gpu_py_api.c
@@ -43,9 +43,9 @@
/** \name Utils to invalidate functions
* \{ */
-bool bpygpu_is_initialized_or_error(void)
+bool bpygpu_is_init_or_error(void)
{
- if (!GPU_is_initialized()) {
+ if (!GPU_is_init()) {
PyErr_SetString(PyExc_SystemError,
"GPU functions for drawing are not available in background mode");
diff --git a/source/blender/python/gpu/gpu_py_api.h b/source/blender/python/gpu/gpu_py_api.h
index e278bb63a49..916b1ac6e49 100644
--- a/source/blender/python/gpu/gpu_py_api.h
+++ b/source/blender/python/gpu/gpu_py_api.h
@@ -25,14 +25,14 @@ int bpygpu_ParsePrimType(PyObject *o, void *p);
PyObject *BPyInit_gpu(void);
-bool bpygpu_is_initialized_or_error(void);
+bool bpygpu_is_init_or_error(void);
#define BPYGPU_IS_INIT_OR_ERROR_OBJ \
- if (UNLIKELY(!bpygpu_is_initialized_or_error())) { \
+ if (UNLIKELY(!bpygpu_is_init_or_error())) { \
return NULL; \
} \
((void)0)
#define BPYGPU_IS_INIT_OR_ERROR_INT \
- if (UNLIKELY(!bpygpu_is_initialized_or_error())) { \
+ if (UNLIKELY(!bpygpu_is_init_or_error())) { \
return -1; \
} \
((void)0)
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index ade80898131..fa53ad522a6 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1879,14 +1879,14 @@ const char *RE_GetActiveRenderView(Render *re)
}
/* evaluating scene options for general Blender render */
-static int render_initialize_from_main(Render *re,
- const RenderData *rd,
- Main *bmain,
- Scene *scene,
- ViewLayer *single_layer,
- Object *camera_override,
- int anim,
- int anim_init)
+static int render_init_from_main(Render *re,
+ const RenderData *rd,
+ Main *bmain,
+ Scene *scene,
+ ViewLayer *single_layer,
+ Object *camera_override,
+ int anim,
+ int anim_init)
{
int winx, winy;
rcti disprect;
@@ -2004,8 +2004,7 @@ void RE_RenderFrame(Render *re,
scene->r.cfra = frame;
- if (render_initialize_from_main(
- re, &scene->r, bmain, scene, single_layer, camera_override, 0, 0)) {
+ if (render_init_from_main(re, &scene->r, bmain, scene, single_layer, camera_override, 0, 0)) {
const RenderData rd = scene->r;
MEM_reset_peak_memory();
@@ -2058,7 +2057,7 @@ void RE_RenderFrame(Render *re,
void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene, int render)
{
re->result_ok = 0;
- if (render_initialize_from_main(re, &scene->r, bmain, scene, NULL, NULL, 0, 0)) {
+ if (render_init_from_main(re, &scene->r, bmain, scene, NULL, NULL, 0, 0)) {
if (render) {
do_render_3d(re);
}
@@ -2422,7 +2421,7 @@ void RE_RenderAnim(Render *re,
(rd.im_format.views_format == R_IMF_VIEWS_INDIVIDUAL));
/* do not fully call for each frame, it initializes & pops output window */
- if (!render_initialize_from_main(re, &rd, bmain, scene, single_layer, camera_override, 0, 1)) {
+ if (!render_init_from_main(re, &rd, bmain, scene, single_layer, camera_override, 0, 1)) {
return;
}
@@ -2501,7 +2500,7 @@ void RE_RenderAnim(Render *re,
render_update_depsgraph(re);
/* only border now, todo: camera lens. (ton) */
- render_initialize_from_main(re, &rd, bmain, scene, single_layer, camera_override, 1, 0);
+ render_init_from_main(re, &rd, bmain, scene, single_layer, camera_override, 1, 0);
if (nfra != scene->r.cfra) {
/* Skip this frame, but could update for physics and particles system. */
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 8daad33b477..c49cf6203e0 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -557,7 +557,7 @@ static float density_falloff(PointDensityRangeData *pdr, int index, float square
}
if (pdr->density_curve && dist != 0.0f) {
- BKE_curvemapping_initialize(pdr->density_curve);
+ BKE_curvemapping_init(pdr->density_curve);
density = BKE_curvemapping_evaluateF(pdr->density_curve, 0, density / dist) * dist;
}
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 2112477e62a..43c08a2b980 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -293,7 +293,7 @@ void WM_keyconfig_init(bContext *C)
/* initialize only after python init is done, for keymaps that
* use python operators */
- if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INITIALIZED) == 0) {
+ if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
/* create default key config, only initialize once,
* it's persistent across sessions */
if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
@@ -308,7 +308,7 @@ void WM_keyconfig_init(bContext *C)
WM_keyconfig_update_tag(NULL, NULL);
WM_keyconfig_update(wm);
- wm->initialized |= WM_KEYCONFIG_IS_INITIALIZED;
+ wm->initialized |= WM_KEYCONFIG_IS_INIT;
}
}
@@ -334,7 +334,7 @@ void WM_check(bContext *C)
if (!G.background) {
/* case: fileread */
- if ((wm->initialized & WM_WINDOW_IS_INITIALIZED) == 0) {
+ if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
WM_keyconfig_init(C);
WM_autosave_init(wm);
}
@@ -345,9 +345,9 @@ void WM_check(bContext *C)
/* case: fileread */
/* note: this runs in bg mode to set the screen context cb */
- if ((wm->initialized & WM_WINDOW_IS_INITIALIZED) == 0) {
- ED_screens_initialize(bmain, wm);
- wm->initialized |= WM_WINDOW_IS_INITIALIZED;
+ if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
+ ED_screens_init(bmain, wm);
+ wm->initialized |= WM_WINDOW_IS_INIT;
}
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index f431a6f431b..f39fc0aecf2 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -258,7 +258,7 @@ static void wm_window_match_keep_current_wm(const bContext *C,
bScreen *screen = NULL;
/* match oldwm to new dbase, only old files */
- wm->initialized &= ~WM_WINDOW_IS_INITIALIZED;
+ wm->initialized &= ~WM_WINDOW_IS_INIT;
/* when loading without UI, no matching needed */
if (load_ui && (screen = CTX_wm_screen(C))) {
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index d7102a1e8af..f0ad5f1e9c6 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -363,7 +363,7 @@ void WM_keyconfig_set_active(wmWindowManager *wm, const char *idname)
WM_keyconfig_update(wm);
BLI_strncpy(U.keyconfigstr, idname, sizeof(U.keyconfigstr));
- if (wm->initialized & WM_KEYCONFIG_IS_INITIALIZED) {
+ if (wm->initialized & WM_KEYCONFIG_IS_INIT) {
U.runtime.is_dirty = true;
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index d1f65b6271b..1c277b27943 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2322,7 +2322,7 @@ static void radial_control_paint_curve(uint pos, Brush *br, float radius, int li
GPU_line_width(2.0f);
immUniformColor4f(0.8f, 0.8f, 0.8f, 0.85f);
float step = (radius * 2.0f) / (float)line_segments;
- BKE_curvemapping_initialize(br->curve);
+ BKE_curvemapping_init(br->curve);
immBegin(GPU_PRIM_LINES, line_segments * 2);
for (int i = 0; i < line_segments; i++) {
float h1 = BKE_brush_curve_strength_clamped(br, fabsf((i * step) - radius), radius);
@@ -2968,7 +2968,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
if (rc->subtype == PROP_ANGLE) {
float initial_position[2] = {UNPACK2(rc->initial_mouse)};
float current_position[2] = {UNPACK2(rc->slow_mouse)};
- rc->dial = BLI_dial_initialize(initial_position, 0.0f);
+ rc->dial = BLI_dial_init(initial_position, 0.0f);
/* immediately set the position to get a an initial direction */
BLI_dial_angle(rc->dial, current_position);
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index e444c5b2109..fc04323333b 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1206,7 +1206,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
/* Ghost now can call this function for life resizes,
* but it should return if WM didn't initialize yet.
* Can happen on file read (especially full size window). */
- if ((wm->initialized & WM_WINDOW_IS_INITIALIZED) == 0) {
+ if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
return 1;
}
if (!ghostwin) {
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index aed2a9350bb..8784d9f1744 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -694,6 +694,23 @@ elseif(WIN32)
)
endif()
+ if(WITH_GMP)
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmp-10.dll
+ DESTINATION "."
+ )
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmpxx.dll
+ DESTINATION "."
+ CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+ )
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmpxx_d.dll
+ DESTINATION "."
+ CONFIGURATIONS Debug
+ )
+ endif()
+
if(WITH_WINDOWS_PDB)
if(WITH_WINDOWS_STRIPPED_PDB)
# Icky hack for older cmake from https://stackoverflow.com/a/21198501
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9268ed15923..d53d2cb053d 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -127,7 +127,7 @@ void main_python_exit(void);
*
* This function is implemented in the USD source code, `pxr/base/lib/plug/initConfig.cpp`.
*/
-void usd_initialise_plugin_path(const char *datafiles_usd_path);
+void usd_init_plugin_path(const char *datafiles_usd_path);
#endif
/* written to by 'creator_args.c' */
@@ -295,7 +295,7 @@ int main(int argc,
break;
}
}
- MEM_initialize_memleak_detection();
+ MEM_init_memleak_detection();
}
#ifdef BUILD_DATE
@@ -443,7 +443,7 @@ int main(int argc,
#ifdef WITH_USD
/* Tell USD which directory to search for its JSON files. If 'datafiles/usd'
* does not exist, the USD library will not be able to read or write any files. */
- usd_initialise_plugin_path(BKE_appdir_folder_id(BLENDER_DATAFILES, "usd"));
+ usd_init_plugin_path(BKE_appdir_folder_id(BLENDER_DATAFILES, "usd"));
#endif
if (G.background == 0) {
@@ -488,7 +488,7 @@ int main(int argc,
#ifdef WITH_FREESTYLE
/* Initialize Freestyle. */
- FRS_initialize();
+ FRS_init();
FRS_set_context(C);
#endif
diff --git a/tests/gtests/blenloader/blendfile_loading_base_test.h b/tests/gtests/blenloader/blendfile_loading_base_test.h
index 6ed32168737..a5e75ef6df8 100644
--- a/tests/gtests/blenloader/blendfile_loading_base_test.h
+++ b/tests/gtests/blenloader/blendfile_loading_base_test.h
@@ -47,7 +47,7 @@ class BlendfileLoadingBaseTest : public testing::Test {
* Requires the CLI argument --test-asset-dir to point to ../../lib/tests.
*
* WARNING: only files saved with Blender 2.80+ can be loaded. Since Blender
- * is only partially initialised (most importantly, without window manager),
+ * is only partially initialized (most importantly, without window manager),
* the space types are not registered, so any versioning code that handles
* those will SEGFAULT.
*/
diff --git a/tests/gtests/runner/BlenderAddTests.cmake b/tests/gtests/runner/BlenderAddTests.cmake
deleted file mode 100644
index c4f5c8aba8a..00000000000
--- a/tests/gtests/runner/BlenderAddTests.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-# Disable ASAN leak detection when trying to discover tests.
-set(ENV{ASAN_OPTIONS} "detect_leaks=0")
-include(GoogleTestAddTests)
diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt
index 954fcf914a9..4153567ff42 100644
--- a/tests/gtests/runner/CMakeLists.txt
+++ b/tests/gtests/runner/CMakeLists.txt
@@ -35,10 +35,8 @@ endif()
# Test libraries need to be linked "whole archive", because they're not
# directly referenced from other code.
get_property(_test_libs GLOBAL PROPERTY BLENDER_TEST_LIBS)
-if(WIN32)
- # Win32 is set using target_link_options after target creation.
-elseif(APPLE)
- list(APPEND TEST_LIBS "-Wl,-force_load" ${_test_libs})
+if(WIN32 OR APPLE)
+ # Windows and macOS set target_link_options after target creation.
elseif(UNIX)
list(APPEND TEST_LIBS "-Wl,--whole-archive" ${_test_libs} "-Wl,--no-whole-archive")
else()
@@ -63,6 +61,13 @@ if(WIN32)
target_link_libraries(blender_test ${_lib})
target_link_options(blender_test PRIVATE /wholearchive:$<TARGET_FILE:${_lib}>)
endforeach()
+elseif(APPLE)
+ foreach(_lib ${_test_libs})
+ # We need -force_load for every test library and target_link_libraries will
+ # deduplicate it. So explicitly set as linker option for every test lib.
+ target_link_libraries(blender_test ${_lib})
+ target_link_options(blender_test PRIVATE "LINKER:-force_load,$<TARGET_FILE:${_lib}>")
+ endforeach()
endif()
unset(_test_libs)
@@ -70,10 +75,12 @@ unset(_test_libs)
# This runs the blender_test executable with `--gtest_list_tests`, then
# exposes those tests individually to the ctest runner.
# See https://cmake.org/cmake/help/v3.18/module/GoogleTest.html
-include(GoogleTest)
+#
+# We have our own modified copy of this CMake module.
+include(GTest)
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
- ${CMAKE_CURRENT_LIST_DIR}/BlenderAddTests.cmake
+ ${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/GTestAddTests.cmake
)
gtest_discover_tests(blender_test
diff --git a/tests/gtests/testing/testing_main.cc b/tests/gtests/testing/testing_main.cc
index 9816e71526b..36d39a1b3b9 100644
--- a/tests/gtests/testing/testing_main.cc
+++ b/tests/gtests/testing/testing_main.cc
@@ -48,7 +48,7 @@ const std::string &flags_test_release_dir()
int main(int argc, char **argv)
{
- MEM_initialize_memleak_detection();
+ MEM_init_memleak_detection();
testing::InitGoogleTest(&argc, argv);
BLENDER_GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);