[Bf-blender-cvs] [222c71ec4b2] temp-sculpt-normals-masking: temp-sculpt-normals-masking: cleanup code a bit

2022-09-28 Thread Joseph Eagar
Commit: 222c71ec4b298ff7fe4c0a3272fde31af880b948
Author: Joseph Eagar
Date:   Wed Sep 28 22:53:52 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rB222c71ec4b298ff7fe4c0a3272fde31af880b948

temp-sculpt-normals-masking: cleanup code a bit

Also, don't reuse automask stroke id if view normal
occlusion is on.

===

M   source/blender/editors/sculpt_paint/sculpt_automasking.cc

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc 
b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index 86b879440b9..ef64cbabe4f 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -857,7 +857,7 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt *sd, 
Brush *brush, Object
 }
   }
 
-  if (SCULPT_is_automasking_mode_enabled(sd, brush, 
BRUSH_AUTOMASKING_CAVITY_ALL)) {
+  if (mode & BRUSH_AUTOMASKING_CAVITY_ALL) {
 use_stroke_id = true;
 
 if (SCULPT_is_automasking_mode_enabled(sd, brush, 
BRUSH_AUTOMASKING_CAVITY_USE_CURVE)) {
@@ -868,14 +868,21 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt 
*sd, Brush *brush, Object
 if (!ss->attrs.automasking_cavity) {
   SculptAttributeParams params = {0};
   ss->attrs.automasking_cavity = BKE_sculpt_attribute_ensure(
-  ob, ATTR_DOMAIN_POINT, CD_PROP_FLOAT, 
SCULPT_ATTRIBUTE_NAME(automasking_cavity), );
+  ob,
+  ATTR_DOMAIN_POINT,
+  CD_PROP_FLOAT,
+  SCULPT_ATTRIBUTE_NAME(automasking_cavity),
+  );
 }
   }
 
   if (use_stroke_id) {
 SCULPT_stroke_id_ensure(ob);
 
-if (brush && SCULPT_tool_can_reuse_automask(brush->sculpt_tool)) {
+bool have_occlusion = (mode & BRUSH_AUTOMASKING_VIEW_OCCLUSION) &&
+  (mode & BRUSH_AUTOMASKING_VIEW_NORMAL);
+
+if (brush && SCULPT_tool_can_reuse_automask(brush->sculpt_tool) && 
!have_occlusion) {
   int hash = SCULPT_automasking_settings_hash(ob, automasking);
 
   if (hash == ss->last_automasking_settings_hash) {
@@ -883,7 +890,8 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt *sd, 
Brush *brush, Object
 automasking->can_reuse_mask = true;
   }
 }
-else {
+
+if (!automasking->can_reuse_mask) {
   ss->last_automask_stroke_id = ss->stroke_id;
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a4ff106c586] master: Cleanup: Remove more unused CustomData API functions

2022-09-28 Thread Hans Goudey
Commit: a4ff106c5864343dd40cc945a5bdc74ed22d4274
Author: Hans Goudey
Date:   Wed Sep 28 23:07:19 2022 -0500
Branches: master
https://developer.blender.org/rBa4ff106c5864343dd40cc945a5bdc74ed22d4274

Cleanup: Remove more unused CustomData API functions

Due to increased usage of typed arrays in C++ and name/offset based
access for BMesh, these are unlikely to be used again, and haven't been
used in many years.

===

M   source/blender/blenkernel/BKE_customdata.h
M   source/blender/blenkernel/intern/customdata.cc

===

diff --git a/source/blender/blenkernel/BKE_customdata.h 
b/source/blender/blenkernel/BKE_customdata.h
index 3b31183f2c4..61f3a0e1d5e 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -464,18 +464,6 @@ void CustomData_bmesh_set(const struct CustomData *data,
 
 void CustomData_bmesh_set_n(
 struct CustomData *data, void *block, int type, int n, const void *source);
-/**
- * Sets the data of the block at physical layer n.
- * no real type checking is performed.
- */
-void CustomData_bmesh_set_layer_n(struct CustomData *data, void *block, int n, 
const void *source);
-
-/**
- * Set the pointer of to the first layer of type. the old data is not freed.
- * returns the value of `ptr` if the layer is found, NULL otherwise.
- */
-void *CustomData_set_layer(const struct CustomData *data, int type, void *ptr);
-void *CustomData_set_layer_n(const struct CustomData *data, int type, int n, 
void *ptr);
 
 /**
  * Sets the nth layer of type as active.
@@ -584,7 +572,6 @@ void CustomData_bmesh_init_pool(struct CustomData *data, 
int totelem, char htype
  * \return True if some errors were found.
  */
 bool CustomData_layer_validate(struct CustomDataLayer *layer, uint totitems, 
bool do_fixes);
-void CustomData_layers__print(struct CustomData *data);
 
 /* External file storage */
 
diff --git a/source/blender/blenkernel/intern/customdata.cc 
b/source/blender/blenkernel/intern/customdata.cc
index c79f874b69b..4bbb9b62549 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -3611,31 +3611,6 @@ const char *CustomData_get_layer_name(const CustomData 
*data, const int type, co
   return (layer_index == -1) ? nullptr : data->layers[layer_index].name;
 }
 
-void *CustomData_set_layer(const CustomData *data, const int type, void *ptr)
-{
-  int layer_index = CustomData_get_active_layer_index(data, type);
-
-  if (layer_index == -1) {
-return nullptr;
-  }
-
-  data->layers[layer_index].data = ptr;
-
-  return ptr;
-}
-
-void *CustomData_set_layer_n(const CustomData *data, const int type, const int 
n, void *ptr)
-{
-  int layer_index = CustomData_get_layer_index_n(data, type, n);
-  if (layer_index == -1) {
-return nullptr;
-  }
-
-  data->layers[layer_index].data = ptr;
-
-  return ptr;
-}
-
 /* BMesh functions */
 
 void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData 
*ldata)
@@ -4183,23 +4158,6 @@ void CustomData_bmesh_set_n(
   }
 }
 
-void CustomData_bmesh_set_layer_n(CustomData *data, void *block, const int n, 
const void *source)
-{
-  void *dest = CustomData_bmesh_get_layer_n(data, block, n);
-  const LayerTypeInfo *typeInfo = layerType_getInfo(data->layers[n].type);
-
-  if (!dest) {
-return;
-  }
-
-  if (typeInfo->copy) {
-typeInfo->copy(source, dest, 1);
-  }
-  else {
-memcpy(dest, source, typeInfo->size);
-  }
-}
-
 void CustomData_bmesh_interp_n(CustomData *data,
const void **src_blocks_ofs,
const float *weights,
@@ -4622,30 +4580,6 @@ bool CustomData_layer_validate(CustomDataLayer *layer, 
const uint totitems, cons
   return false;
 }
 
-void CustomData_layers__print(CustomData *data)
-{
-  printf("{\n");
-
-  int i;
-  const CustomDataLayer *layer;
-  for (i = 0, layer = data->layers; i < data->totlayer; i++, layer++) {
-const char *name = CustomData_layertype_name(layer->type);
-const int size = CustomData_sizeof(layer->type);
-const char *structname;
-int structnum;
-CustomData_file_write_info(layer->type, , );
-printf("dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, 
length=%d),\n",
-   name,
-   structname,
-   layer->type,
-   (const void *)layer->data,
-   size,
-   (int)(MEM_allocN_len(layer->data) / size));
-  }
-
-  printf("}\n");
-}
-
 /** \} */
 
 /*  */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ff353842bdb] master: Cleanup: Deduplicate logic in CustomData access functions

2022-09-28 Thread Hans Goudey
Commit: ff353842bdbcd9bbc71e873121bb284c3d0afacd
Author: Hans Goudey
Date:   Wed Sep 28 22:49:49 2022 -0500
Branches: master
https://developer.blender.org/rBff353842bdbcd9bbc71e873121bb284c3d0afacd

Cleanup: Deduplicate logic in CustomData access functions

Also remove comments that just restated what the next line
was doing, often incorrectly.

===

M   source/blender/blenkernel/intern/customdata.cc

===

diff --git a/source/blender/blenkernel/intern/customdata.cc 
b/source/blender/blenkernel/intern/customdata.cc
index ea23ec245c2..c79f874b69b 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -3135,7 +3135,6 @@ static void 
*customData_duplicate_referenced_layer_index(CustomData *data,
 
 void *CustomData_duplicate_referenced_layer(CustomData *data, const int type, 
const int totelem)
 {
-  /* get the layer index of the first layer of type */
   int layer_index = CustomData_get_active_layer_index(data, type);
 
   return customData_duplicate_referenced_layer_index(data, layer_index, 
totelem);
@@ -3187,7 +3186,6 @@ void CustomData_duplicate_referenced_layers(CustomData 
*data, const int totelem)
 
 bool CustomData_is_referenced_layer(CustomData *data, const int type)
 {
-  /* get the layer index of the first layer of type */
   int layer_index = CustomData_get_active_layer_index(data, type);
   if (layer_index == -1) {
 return false;
@@ -3515,36 +3513,26 @@ void CustomData_swap(CustomData *data, const int 
index_a, const int index_b)
 void *CustomData_get(const CustomData *data, const int index, const int type)
 {
   BLI_assert(index >= 0);
-
-  /* get the layer index of the active layer of type */
-  int layer_index = CustomData_get_active_layer_index(data, type);
-  if (layer_index == -1) {
+  void *layer_data = CustomData_get_layer(data, type);
+  if (!layer_data) {
 return nullptr;
   }
-
-  /* get the offset of the desired element */
-  const size_t offset = size_t(index) * layerType_getInfo(type)->size;
-
-  return POINTER_OFFSET(data->layers[layer_index].data, offset);
+  return POINTER_OFFSET(layer_data, size_t(index) * 
layerType_getInfo(type)->size);
 }
 
 void *CustomData_get_n(const CustomData *data, const int type, const int 
index, const int n)
 {
-  BLI_assert(index >= 0 && n >= 0);
-
-  /* get the layer index of the first layer of type */
-  int layer_index = data->typemap[type];
-  if (layer_index == -1) {
+  BLI_assert(index >= 0);
+  void *layer_data = CustomData_get_layer_n(data, type, n);
+  if (!layer_data) {
 return nullptr;
   }
 
-  const size_t offset = size_t(index) * layerType_getInfo(type)->size;
-  return POINTER_OFFSET(data->layers[layer_index + n].data, offset);
+  return POINTER_OFFSET(layer_data, size_t(index) * 
layerType_getInfo(type)->size);
 }
 
 void *CustomData_get_layer(const CustomData *data, const int type)
 {
-  /* get the layer index of the active layer of type */
   int layer_index = CustomData_get_active_layer_index(data, type);
   if (layer_index == -1) {
 return nullptr;
@@ -3555,7 +3543,6 @@ void *CustomData_get_layer(const CustomData *data, const 
int type)
 
 void *CustomData_get_layer_n(const CustomData *data, const int type, const int 
n)
 {
-  /* get the layer index of the active layer of type */
   int layer_index = CustomData_get_layer_index_n(data, type, n);
   if (layer_index == -1) {
 return nullptr;
@@ -3576,7 +3563,6 @@ void *CustomData_get_layer_named(const CustomData *data, 
const int type, const c
 
 int CustomData_get_offset(const CustomData *data, const int type)
 {
-  /* get the layer index of the active layer of type */
   int layer_index = CustomData_get_active_layer_index(data, type);
   if (layer_index == -1) {
 return -1;
@@ -3587,7 +3573,6 @@ int CustomData_get_offset(const CustomData *data, const 
int type)
 
 int CustomData_get_n_offset(const CustomData *data, const int type, const int 
n)
 {
-  /* get the layer index of the active layer of type */
   int layer_index = CustomData_get_layer_index_n(data, type, n);
   if (layer_index == -1) {
 return -1;
@@ -3608,7 +3593,6 @@ int CustomData_get_offset_named(const CustomData *data, 
int type, const char *na
 
 bool CustomData_set_layer_name(CustomData *data, const int type, const int n, 
const char *name)
 {
-  /* get the layer index of the first layer of type */
   const int layer_index = CustomData_get_layer_index_n(data, type, n);
 
   if ((layer_index == -1) || !name) {
@@ -3629,7 +3613,6 @@ const char *CustomData_get_layer_name(const CustomData 
*data, const int type, co
 
 void *CustomData_set_layer(const CustomData *data, const int type, void *ptr)
 {
-  /* get the layer index of the first layer of type */
   int layer_index = CustomData_get_active_layer_index(data, type);
 
   if (layer_index == -1) {
@@ -3643,7 +3626,6 @@ void 

[Bf-blender-cvs] [57620af33c3] master: Cleanup: Remove unused BMesh function

2022-09-28 Thread Hans Goudey
Commit: 57620af33c3d11028afc43a7311cb69e8c3d573c
Author: Hans Goudey
Date:   Wed Sep 28 22:36:06 2022 -0500
Branches: master
https://developer.blender.org/rB57620af33c3d11028afc43a7311cb69e8c3d573c

Cleanup: Remove unused BMesh function

===

M   source/blender/blenkernel/BKE_customdata.h
M   source/blender/blenkernel/intern/customdata.cc

===

diff --git a/source/blender/blenkernel/BKE_customdata.h 
b/source/blender/blenkernel/BKE_customdata.h
index 22e4a2bce87..3b31183f2c4 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -457,12 +457,6 @@ const char *CustomData_get_active_layer_name(const struct 
CustomData *data, int
  */
 const char *CustomData_get_render_layer_name(const struct CustomData *data, 
int type);
 
-/**
- * Copies the data from source to the data element at index in the first layer 
of type
- * no effect if there is no layer of type.
- */
-void CustomData_set(const struct CustomData *data, int index, int type, const 
void *source);
-
 void CustomData_bmesh_set(const struct CustomData *data,
   void *block,
   int type,
diff --git a/source/blender/blenkernel/intern/customdata.cc 
b/source/blender/blenkernel/intern/customdata.cc
index 66b929d7c55..ea23ec245c2 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -3654,23 +3654,6 @@ void *CustomData_set_layer_n(const CustomData *data, 
const int type, const int n
   return ptr;
 }
 
-void CustomData_set(const CustomData *data, const int index, const int type, 
const void *source)
-{
-  void *dest = CustomData_get(data, index, type);
-  const LayerTypeInfo *typeInfo = layerType_getInfo(type);
-
-  if (!dest) {
-return;
-  }
-
-  if (typeInfo->copy) {
-typeInfo->copy(source, dest, 1);
-  }
-  else {
-memcpy(dest, source, typeInfo->size);
-  }
-}
-
 /* BMesh functions */
 
 void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData 
*ldata)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0c282c068f1] master: Cleanup: cmake indentation

2022-09-28 Thread Campbell Barton
Commit: 0c282c068f1a132b1689ca0d5142a86a6d238895
Author: Campbell Barton
Date:   Thu Sep 29 12:00:18 2022 +1000
Branches: master
https://developer.blender.org/rB0c282c068f1a132b1689ca0d5142a86a6d238895

Cleanup: cmake indentation

===

M   CMakeLists.txt
M   build_files/build_environment/cmake/dpcpp.cmake
M   build_files/cmake/Modules/FindSYCL.cmake
M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   intern/cycles/cmake/external_libs.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68eb07e34f2..514896161a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -648,8 +648,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES 
"Clang")
 unset(_asan_defaults)
 
 if(MSVC)
-find_library(
-  COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
+  find_library(
+COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
 PATHS
 
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
 
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
@@ -828,7 +828,7 @@ endif()
 set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO  OFF)
 
 if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
-   WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
+  WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
   message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
   set(WITH_BOOST OFF)
 endif()
diff --git a/build_files/build_environment/cmake/dpcpp.cmake 
b/build_files/build_environment/cmake/dpcpp.cmake
index 3c3fe201073..dbba97b8264 100644
--- a/build_files/build_environment/cmake/dpcpp.cmake
+++ b/build_files/build_environment/cmake/dpcpp.cmake
@@ -68,7 +68,7 @@ set(DPCPP_EXTRA_ARGS
 )
 
 if(WIN32)
-   list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
+  list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
 endif()
 
 ExternalProject_Add(external_dpcpp
diff --git a/build_files/cmake/Modules/FindSYCL.cmake 
b/build_files/cmake/Modules/FindSYCL.cmake
index ac90cbfbe43..7aead43dd2a 100644
--- a/build_files/cmake/Modules/FindSYCL.cmake
+++ b/build_files/cmake/Modules/FindSYCL.cmake
@@ -44,7 +44,7 @@ FIND_PROGRAM(SYCL_COMPILER
 # compiler.
 if(NOT SYCL_COMPILER)
   FIND_PROGRAM(SYCL_COMPILER
-   NAMES
+NAMES
   dpcpp
 HINTS
   ${_sycl_search_dirs}
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 2d1803ec376..04fa1561f88 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -30,7 +30,7 @@ macro(add_bundled_libraries library)
 list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
 unset(_all_library_versions)
 unset(_library_dir)
- endif()
+  endif()
 endmacro()
 
 # 
@@ -324,7 +324,7 @@ if(WITH_LLVM)
   if(WITH_CLANG)
 find_package(Clang)
 if(NOT CLANG_FOUND)
-   message(FATAL_ERROR "Clang not found.")
+  message(FATAL_ERROR "Clang not found.")
 endif()
   endif()
 
diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index 6ad4547fa00..47410b5f368 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -89,7 +89,7 @@ macro(add_bundled_libraries library)
 file(GLOB _all_library_versions ${LIBDIR}/${library}/lib/*\.so*)
 list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
 unset(_all_library_versions)
- endif()
+  endif()
 endmacro()
 
 # 
diff --git a/intern/cycles/cmake/external_libs.cmake 
b/intern/cycles/cmake/external_libs.cmake
index 184bf7d6ae3..ac508e36965 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -545,7 +545,7 @@ endif()
 
 if(CYCLES_STANDALONE_REPOSITORY)
   if((WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) OR
- WITH_CYCLES_HYDRA_RENDER_DELEGATE)
+WITH_CYCLES_HYDRA_RENDER_DELEGATE)
 if(MSVC AND EXISTS ${_cycles_lib_dir})
   set(Epoxy_LIBRARIES "${_cycles_lib_dir}/epoxy/lib/epoxy.lib")
   set(Epoxy_INCLUDE_DIRS "${_cycles_lib_dir}/epoxy/include")
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 05577406b48..13a311cb55c 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1157,10 +1157,10 @@ elseif(APPLE)
   )
 
   if(WITH_BLENDER_THUMBNAILER)
-  install(
-TARGETS blender-thumbnailer
-DESTINATION Blender.app/Contents/MacOS/
-  )
+

[Bf-blender-cvs] [f96020fb9af] master: Cleanup: remove '.' from the end of descriptions

2022-09-28 Thread Campbell Barton
Commit: f96020fb9af08a81391f8bb9961e394a0b0337eb
Author: Campbell Barton
Date:   Thu Sep 29 11:59:41 2022 +1000
Branches: master
https://developer.blender.org/rBf96020fb9af08a81391f8bb9961e394a0b0337eb

Cleanup: remove '.' from the end of descriptions

Quiet warnings at startup & build time.

===

M   source/blender/editors/sculpt_paint/sculpt_ops.c
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c 
b/source/blender/editors/sculpt_paint/sculpt_ops.c
index 3c8539a9b75..e56d967808f 100644
--- a/source/blender/editors/sculpt_paint/sculpt_ops.c
+++ b/source/blender/editors/sculpt_paint/sculpt_ops.c
@@ -1239,7 +1239,7 @@ static void SCULPT_OT_mask_from_cavity(wmOperatorType *ot)
   "use_automask_settings",
   false,
   "Use Automask Settings",
-  "Use default settings from Options panel in sculpt mode.");
+  "Use default settings from Options panel in sculpt mode");
 
   RNA_def_float(ot->srna,
 "factor",
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index 5962e6cd81d..3f4542a0f64 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -3257,7 +3257,7 @@ static void rna_def_brush(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, 
PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "automasking_cavity_blur_steps");
-  RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity 
mask is blurred.");
+  RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity 
mask is blurred");
   RNA_def_property_range(prop, 0.0f, 25.0f);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
   RNA_def_property_update(prop, 0, "rna_Brush_update");

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [91db47e914e] master: Cleanup: simplify storage when uv island packing

2022-09-28 Thread Chris Blackbourn
Commit: 91db47e914e73f619b0b6f70a8c04e77794bab5f
Author: Chris Blackbourn
Date:   Thu Sep 29 15:44:30 2022 +1300
Branches: master
https://developer.blender.org/rB91db47e914e73f619b0b6f70a8c04e77794bab5f

Cleanup: simplify storage when uv island packing

Refactor ahead of upcoming packing changes.

Differential Revision: https://developer.blender.org/D16096

===

M   source/blender/editors/uvedit/uvedit_islands.cc

===

diff --git a/source/blender/editors/uvedit/uvedit_islands.cc 
b/source/blender/editors/uvedit/uvedit_islands.cc
index d28aba9816f..1ac2985aafb 100644
--- a/source/blender/editors/uvedit/uvedit_islands.cc
+++ b/source/blender/editors/uvedit/uvedit_islands.cc
@@ -75,7 +75,7 @@ static void 
bm_face_uv_translate_and_scale_around_pivot(BMFace *f,
  * \{ */
 
 static void bm_face_array_calc_bounds(BMFace **faces,
-  int faces_len,
+  const int faces_len,
   const int cd_loop_uv_offset,
   rctf *r_bounds_rect)
 {
@@ -276,7 +276,7 @@ static float uv_nearest_image_tile_distance(const Image 
*image,
  * Calculates distance to nearest UDIM grid tile in UV space and its UDIM tile 
number.
  */
 static float uv_nearest_grid_tile_distance(const int udim_grid[2],
-   float coords[2],
+   const float coords[2],
float nearest_tile_co[2])
 {
   const float coords_floor[2] = {floorf(coords[0]), floorf(coords[1])};
@@ -419,7 +419,7 @@ int bm_mesh_calc_uv_islands(const Scene *scene,
 /*  */
 /** \name Public UV Island Packing
  *
- * \note This behavior follows #param_pack.
+ * \note This behavior loosely follows #GEO_uv_parametrizer_pack.
  * \{ */
 
 void ED_uvedit_pack_islands_multi(const Scene *scene,
@@ -428,17 +428,13 @@ void ED_uvedit_pack_islands_multi(const Scene *scene,
   const struct UVMapUDIM_Params *udim_params,
   const struct UVPackIsland_Params *params)
 {
-  /* Align to the Y axis, could make this configurable. */
-  const int rotate_align_axis = 1;
-  ListBase island_list = {NULL};
-  int island_list_len = 0;
+  blender::Vector island_vector;
 
   for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
 Object *obedit = objects[ob_index];
 BMEditMesh *em = BKE_editmesh_from_object(obedit);
-BMesh *bm = em->bm;
 
-const int cd_loop_uv_offset = CustomData_get_offset(>ldata, 
CD_MLOOPUV);
+const int cd_loop_uv_offset = CustomData_get_offset(>bm->ldata, 
CD_MLOOPUV);
 if (cd_loop_uv_offset == -1) {
   continue;
 }
@@ -452,34 +448,38 @@ void ED_uvedit_pack_islands_multi(const Scene *scene,
   }
 }
 
-island_list_len += bm_mesh_calc_uv_islands(scene,
-   bm,
-   _list,
-   params->only_selected_faces,
-   params->only_selected_uvs,
-   params->use_seams,
-   aspect_y,
-   cd_loop_uv_offset);
+ListBase island_list = {NULL};
+bm_mesh_calc_uv_islands(scene,
+em->bm,
+_list,
+params->only_selected_faces,
+params->only_selected_uvs,
+params->use_seams,
+aspect_y,
+cd_loop_uv_offset);
+
+int index;
+LISTBASE_FOREACH_INDEX (struct FaceIsland *, island, _list, index) {
+  island_vector.append(island);
+}
   }
 
-  if (island_list_len == 0) {
+  if (island_vector.size() == 0) {
 return;
   }
 
   float margin = scene->toolsettings->uvcalc_margin;
   double area = 0.0f;
 
-  struct FaceIsland **island_array = static_cast(
-  MEM_mallocN(sizeof(*island_array) * island_list_len, __func__));
   BoxPack *boxarray = static_cast(
-  MEM_mallocN(sizeof(*boxarray) * island_list_len, __func__));
+  MEM_mallocN(sizeof(*boxarray) * island_vector.size(), __func__));
 
-  int index;
   /* Coordinates of bounding box containing all selected UVs. */
   float selection_min_co[2], selection_max_co[2];
   INIT_MINMAX2(selection_min_co, selection_max_co);
 
-  LISTBASE_FOREACH_INDEX (struct FaceIsland *, island, _list, index) {
+  for (int index = 0; index < island_vector.size(); index++) {
+FaceIsland *island = island_vector[index];
 
 /* Skip calculation if using specified UDIM option. */
 if (udim_params && 

[Bf-blender-cvs] [e2df1958449] master: Fix wrong version bump to 3.4.1, we are still on 3.4.0

2022-09-28 Thread Brecht Van Lommel
Commit: e2df1958449ae94c9178686795e889cead7b960a
Author: Brecht Van Lommel
Date:   Thu Sep 29 03:56:12 2022 +0200
Branches: master
https://developer.blender.org/rBe2df1958449ae94c9178686795e889cead7b960a

Fix wrong version bump to 3.4.1, we are still on 3.4.0

The patch levels are reserved for bugfix releases.

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index b6dd25d9f29..4bbe3ab8596 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -19,7 +19,7 @@ extern "C" {
 /* Blender major and minor version. */
 #define BLENDER_VERSION 304
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 1
+#define BLENDER_VERSION_PATCH 0
 /** Blender release cycle stage: alpha/beta/rc/release. */
 #define BLENDER_VERSION_CYCLE alpha

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c64d3a692d9] master: Cleanup: use doxy-sections in anim_channels_edit.c

2022-09-28 Thread Campbell Barton
Commit: c64d3a692d9655313978f1129834f5567adb63a3
Author: Campbell Barton
Date:   Thu Sep 29 10:28:56 2022 +1000
Branches: master
https://developer.blender.org/rBc64d3a692d9655313978f1129834f5567adb63a3

Cleanup: use doxy-sections in anim_channels_edit.c

===

M   source/blender/editors/animation/anim_channels_edit.c

===

diff --git a/source/blender/editors/animation/anim_channels_edit.c 
b/source/blender/editors/animation/anim_channels_edit.c
index 0c9b82d2afc..7402e1efa53 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -54,10 +54,9 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
-/* ** 
*/
-/* CHANNELS API - Exposed API */
-
-/* -- Selection - 
*/
+/*  */
+/** \name Public Channel Selection API
+ * \{ */
 
 void ANIM_set_active_channel(bAnimContext *ac,
  void *data,
@@ -463,7 +462,11 @@ void ANIM_anim_channels_select_toggle(bAnimContext *ac)
   ANIM_animdata_freelist(_data);
 }
 
-/*  Graph Editor 
- */
+/** \} */
+
+/*  */
+/** \name Public Graph Editor API
+ * \{ */
 
 /* Copy a certain channel setting to parents of the modified channel. */
 static void anim_flush_channel_setting_up(bAnimContext *ac,
@@ -627,7 +630,11 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac,
   anim_flush_channel_setting_down(ac, setting, mode, match, matchLevel);
 }
 
-/* -- F-Curves - */
+/** \} */
+
+/*  */
+/** \name Public F-Curves API
+ * \{ */
 
 void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve 
*fcu)
 {
@@ -699,10 +706,11 @@ bool ANIM_remove_empty_action_from_animdata(struct 
AnimData *adt)
   return false;
 }
 
-/* ** 
*/
-/* OPERATORS */
+/** \} */
 
-/* ** Operator Utilities ** */
+/*  */
+/** \name Operator Utilities
+ * \{ */
 
 /* poll callback for being in an Animation Editor channels list region */
 static bool animedit_poll_channels_active(bContext *C)
@@ -748,7 +756,11 @@ static bool 
animedit_poll_channels_nla_tweakmode_off(bContext *C)
   return true;
 }
 
-/* ** Rearrange Channels Operator *** */
+/** \} */
+
+/*  */
+/** \name Move (Rearrange) Channels Operator
+ * \{ */
 
 /* constants for channel rearranging */
 /* WARNING: don't change existing ones without modifying rearrange func 
accordingly */
@@ -1581,7 +1593,11 @@ static void ANIM_OT_channels_move(wmOperatorType *ot)
   "");
 }
 
-/*  Group Channel Operator  */
+/** \} */
+
+/*  */
+/** \name Group Channel Operator
+ * \{ */
 
 static bool animchannels_grouping_poll(bContext *C)
 {
@@ -1739,7 +1755,11 @@ static void ANIM_OT_channels_group(wmOperatorType *ot)
   // RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
 }
 
-/* --- */
+/** \} */
+
+/*  */
+/** \name Ungroup Channels Operator
+ * \{ */
 
 static int animchannels_ungroup_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -1805,7 +1825,11 @@ static void ANIM_OT_channels_ungroup(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/*  Delete Channel Operator *** */
+/** \} */
+
+/*  */
+/** \name Delete Channel Operator
+ * \{ */
 
 static void tag_update_animation_element(bAnimListElem *ale)
 {
@@ -1976,7 +2000,11 @@ static void ANIM_OT_channels_delete(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* ** Set Flags Operator *** */
+/** \} */
+
+/*  */
+/** \name Set/Toggle Channel Flags Operator Utilities
+ * \{ */
 
 /* defines for setting animation-channel flags */
 static const EnumPropertyItem prop_animchannel_setflag_types[] = {
@@ -2223,7 +2251,11 @@ static void 
ANIM_OT_channels_editable_toggle(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_HIDDEN); /* 

[Bf-blender-cvs] [c1548938a46] master: Cleanup: spelling in comments

2022-09-28 Thread Campbell Barton
Commit: c1548938a46ffcfe4b2a2cbeaee0e0ca02cedfc1
Author: Campbell Barton
Date:   Thu Sep 29 10:28:39 2022 +1000
Branches: master
https://developer.blender.org/rBc1548938a46ffcfe4b2a2cbeaee0e0ca02cedfc1

Cleanup: spelling in comments

===

M   source/blender/blenkernel/intern/mesh.cc
M   source/blender/draw/intern/draw_pbvh.cc
M   source/blender/editors/animation/anim_channels_edit.c
M   source/blender/editors/sculpt_paint/sculpt_paint_color.c
M   source/blender/editors/space_graph/space_graph.c
M   source/blender/editors/space_node/drawnode.cc
M   source/blender/editors/space_node/node_relationships.cc
M   source/blender/editors/space_outliner/outliner_draw.cc

===

diff --git a/source/blender/blenkernel/intern/mesh.cc 
b/source/blender/blenkernel/intern/mesh.cc
index 4d98efde5f9..9e7821428d1 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -494,7 +494,7 @@ static int customdata_compare(
   }
 
   if (layer_count1 != layer_count2) {
-/* TODO(@HooglyBoogly): Reenable after tests are updated for material 
index refactor. */
+/* TODO(@HooglyBoogly): Re-enable after tests are updated for material 
index refactor. */
 // return MESHCMP_CDLAYERS_MISMATCH;
   }
 
diff --git a/source/blender/draw/intern/draw_pbvh.cc 
b/source/blender/draw/intern/draw_pbvh.cc
index 94965c25950..7b36cb16cac 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -4,8 +4,8 @@
 /** \file
  * \ingroup gpu
  *
- * PBVH drawing.  Embedds GPU meshes inside of PBVH nodes,
- * used by mesh sculpt mode.
+ * PBVH drawing.
+ * Embeds GPU meshes inside of PBVH nodes, used by mesh sculpt mode.
  */
 
 #include 
diff --git a/source/blender/editors/animation/anim_channels_edit.c 
b/source/blender/editors/animation/anim_channels_edit.c
index ea631da27af..0c9b82d2afc 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2422,7 +2422,7 @@ static void ANIM_OT_channels_clean_empty(wmOperatorType 
*ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* *** Reenable Disabled Operator *** */
+/* *** Re-enable Disabled Operator *** */
 
 static bool animchannels_enable_poll(bContext *C)
 {
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c 
b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
index f16a8769166..e717c15d6dc 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
@@ -195,9 +195,8 @@ static void do_paint_brush_task_cb_ex(void *__restrict 
userdata,
 paint_color, paint_color, wet_mix_color, 
ss->cache->paint_brush.wet_mix);
 blend_color_mix_float(color_buffer->color[vd.i], 
color_buffer->color[vd.i], paint_color);
 
-/* Final mix over the original color using brush alpha. We apply 
automaking again
- * at this point to avoid washing out non-binary masking modes like cavity 
masking.
- */
+/* Final mix over the original color using brush alpha. We apply 
auto-making again
+ * at this point to avoid washing out non-binary masking modes like cavity 
masking. */
 float automasking = SCULPT_automasking_factor_get(ss->cache->automasking, 
ss, vd.vertex);
 mul_v4_v4fl(buffer_color, color_buffer->color[vd.i], brush->alpha * 
automasking);
 
diff --git a/source/blender/editors/space_graph/space_graph.c 
b/source/blender/editors/space_graph/space_graph.c
index fa2029db835..1dc02fee59d 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -838,7 +838,7 @@ static void graph_blend_write(BlendWriter *writer, 
SpaceLink *sl)
 BLO_write_struct(writer, bDopeSheet, sipo->ads);
   }
 
-  /* reenable ghost curves */
+  /* Re-enable ghost curves. */
   sipo->runtime.ghost_curves = tmpGhosts;
 }
 
diff --git a/source/blender/editors/space_node/drawnode.cc 
b/source/blender/editors/space_node/drawnode.cc
index 13d13b10339..93166c6de59 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -1983,7 +1983,7 @@ static void node_draw_link_end_marker(const float2 center,
 
   UI_draw_roundbox_corner_set(UI_CNR_ALL);
   UI_draw_roundbox_4fv(, true, radius, color);
-  /* Roundbox disables alpha. Reenable it for node links that are drawn after 
this one. */
+  /* Round-box disables alpha. Re-enable it for node links that are drawn 
after this one. */
   GPU_blend(GPU_BLEND_ALPHA);
 }
 
diff --git a/source/blender/editors/space_node/node_relationships.cc 
b/source/blender/editors/space_node/node_relationships.cc
index 84cef798907..d9f87433c53 100644
--- 

[Bf-blender-cvs] [d459219307f] master: Cleanup: quiet deprecated copy warning

2022-09-28 Thread Campbell Barton
Commit: d459219307fef6d00c333c5d89707e007d18ebdb
Author: Campbell Barton
Date:   Thu Sep 29 10:28:11 2022 +1000
Branches: master
https://developer.blender.org/rBd459219307fef6d00c333c5d89707e007d18ebdb

Cleanup: quiet deprecated copy warning

===

M   source/blender/editors/sculpt_paint/sculpt_automasking.cc

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc 
b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index cb59b591e5c..43225443ea0 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -164,16 +164,7 @@ struct CavityBlurVert {
   {
   }
 
-  CavityBlurVert()
-  {
-  }
-
-  CavityBlurVert(const CavityBlurVert )
-  {
-vertex = b.vertex;
-dist = b.dist;
-depth = b.depth;
-  }
+  CavityBlurVert() = default;
 };
 
 static void sculpt_calc_blurred_cavity(SculptSession *ss,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ec8118a59e0] master: Cleanup: replace UNUSED() with commented arguments

2022-09-28 Thread Campbell Barton
Commit: ec8118a59e02260945050febf8b7c0080e8c1c4e
Author: Campbell Barton
Date:   Thu Sep 29 10:25:01 2022 +1000
Branches: master
https://developer.blender.org/rBec8118a59e02260945050febf8b7c0080e8c1c4e

Cleanup: replace UNUSED() with commented arguments

This is the conventional way of dealing with unused arguments in C++.

Also quiet enum conversion warnings.

===

M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/draw/intern/draw_manager_data.c
M   source/blender/draw/intern/draw_pbvh.cc
M   source/blender/editors/sculpt_paint/sculpt_ops.c

===

diff --git a/source/blender/blenkernel/intern/pbvh.c 
b/source/blender/blenkernel/intern/pbvh.c
index a1de8e40fe3..5061fecbccb 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1366,7 +1366,7 @@ static void pbvh_update_draw_buffer_cb(void *__restrict 
userdata,
   }
 }
 
-void pbvh_free_draw_buffers(PBVH *pbvh, PBVHNode *node)
+void pbvh_free_draw_buffers(PBVH *UNUSED(pbvh), PBVHNode *node)
 {
   if (node->draw_batches) {
 DRW_pbvh_node_free(node->draw_batches);
diff --git a/source/blender/draw/intern/draw_manager_data.c 
b/source/blender/draw/intern/draw_manager_data.c
index 060617764f7..eb05e03402c 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -1349,15 +1349,16 @@ void DRW_shgroup_call_sculpt(DRWShadingGroup *shgroup,
 
   memset(attrs, 0, sizeof(attrs));
 
-  attrs[attrs_num++].type = CD_PBVH_CO_TYPE;
-  attrs[attrs_num++].type = CD_PBVH_NO_TYPE;
+  /* NOTE: these are NOT #eCustomDataType, they are extended values, ASAN may 
warn about this. */
+  attrs[attrs_num++].type = (eCustomDataType)CD_PBVH_CO_TYPE;
+  attrs[attrs_num++].type = (eCustomDataType)CD_PBVH_NO_TYPE;
 
   if (use_mask) {
-attrs[attrs_num++].type = CD_PBVH_MASK_TYPE;
+attrs[attrs_num++].type = (eCustomDataType)CD_PBVH_MASK_TYPE;
   }
 
   if (use_fset) {
-attrs[attrs_num++].type = CD_PBVH_FSET_TYPE;
+attrs[attrs_num++].type = (eCustomDataType)CD_PBVH_FSET_TYPE;
   }
 
   Mesh *me = BKE_object_get_original_mesh(ob);
@@ -1421,8 +1422,9 @@ void 
DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups,
   memset(attrs, 0, sizeof(PBVHAttrReq) * attrs_num);
   int attrs_i = 0;
 
-  attrs[attrs_i++].type = CD_PBVH_CO_TYPE;
-  attrs[attrs_i++].type = CD_PBVH_NO_TYPE;
+  /* NOTE: these are NOT #eCustomDataType, they are extended values, ASAN may 
warn about this. */
+  attrs[attrs_i++].type = (eCustomDataType)CD_PBVH_CO_TYPE;
+  attrs[attrs_i++].type = (eCustomDataType)CD_PBVH_NO_TYPE;
 
   for (int i = 0; i < draw_attrs.num_requests; i++) {
 DRW_AttributeRequest *req = draw_attrs.requests + i;
diff --git a/source/blender/draw/intern/draw_pbvh.cc 
b/source/blender/draw/intern/draw_pbvh.cc
index 2e92598a955..94965c25950 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -289,8 +289,10 @@ struct PBVHBatches {
   }
 
   void fill_vbo_normal_faces(
+  PBVHVbo & /*vbo*/,
   PBVH_GPU_Args *args,
-  std::function 
callback)> foreach_faces,
+  std::function 
callback)>
+  foreach_faces,
   GPUVertBufRaw *access)
   {
 float fno[3];
@@ -298,7 +300,7 @@ struct PBVHBatches {
 int last_poly = -1;
 bool smooth = false;
 
-foreach_faces([&](int UNUSED(tri_i), int vertex_i, const MLoopTri *tri) {
+foreach_faces([&](int /*buffer_i*/, int /*tri_i*/, int vertex_i, const 
MLoopTri *tri) {
   const MPoly *mp = args->mpoly + tri->poly;
 
   if (tri->poly != last_poly) {
@@ -335,7 +337,7 @@ struct PBVHBatches {
 int existing_num = GPU_vertbuf_get_vertex_len(vbo.vert_buf);
 void *existing_data = GPU_vertbuf_get_data(vbo.vert_buf);
 
-if (existing_data == NULL || existing_num != vert_count) {
+if (existing_data == nullptr || existing_num != vert_count) {
   /* Allocate buffer if not allocated yet or size changed. */
   GPU_vertbuf_data_alloc(vbo.vert_buf, vert_count);
 }
@@ -345,48 +347,44 @@ struct PBVHBatches {
 
 switch (vbo.type) {
   case CD_PBVH_CO_TYPE:
-foreach_grids(
-[&](int UNUSED(x), int UNUSED(y), int UNUSED(grid_index), CCGElem 
*elems[4], int i) {
-  float *co = CCG_elem_co(>ccg_key, elems[i]);
+foreach_grids([&](int /*x*/, int /*y*/, int /*grid_index*/, CCGElem 
*elems[4], int i) {
+  float *co = CCG_elem_co(>ccg_key, elems[i]);
 
-  *static_cast(GPU_vertbuf_raw_step()) = co;
-});
+  *static_cast(GPU_vertbuf_raw_step()) = co;
+});
 break;
 
   case CD_PBVH_NO_TYPE:
-foreach_grids(
-[&](int UNUSED(x), int UNUSED(y), int grid_index, CCGElem 
*elems[4], int UNUSED(i)) {
-  float3 no(0.0f, 0.0f, 0.0f);
+foreach_grids([&](int 

[Bf-blender-cvs] [c63d6e3698f] temp-sculpt-normals-masking: Merge branch 'master' into temp-sculpt-normals-masking

2022-09-28 Thread Joseph Eagar
Commit: c63d6e3698f89e310db91f72e3920a8be18e451c
Author: Joseph Eagar
Date:   Wed Sep 28 17:19:29 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rBc63d6e3698f89e310db91f72e3920a8be18e451c

Merge branch 'master' into temp-sculpt-normals-masking

===



===

diff --cc release/scripts/startup/bl_ui/properties_paint_common.py
index 34e93966b19,a4a328fce1a..72a87703bd5
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@@ -943,26 -943,22 +943,39 @@@ def brush_settings_advanced(layout, con
  # boundary edges/face sets automasking
  col.prop(brush, "use_automasking_boundary_edges", text="Mesh 
Boundary")
  col.prop(brush, "use_automasking_boundary_face_sets", text="Face Sets 
Boundary")
- col.prop(brush, "automasking_boundary_edges_propagation_steps")
- 
+ col.prop(brush, "use_automasking_cavity", text="Cavity")
+ col.prop(brush, "use_automasking_cavity_inverted", text="Cavity 
(Inverted)")
 +col.prop(brush, "use_automasking_start_normal", text="Area Normal")
 +col.prop(brush, "use_automasking_view_normal", text="View Normal")
  
+ col.separator()
+ col.prop(brush, "automasking_boundary_edges_propagation_steps")
+ 
 +sculpt = context.tool_settings.sculpt
 +
 +if brush.use_automasking_start_normal:
 +col.separator()
 +
 +col.prop(sculpt, "automasking_start_normal_limit")
 +col.prop(sculpt, "automasking_start_normal_falloff")
 +
 +if brush.use_automasking_view_normal:
 +col.separator()
 +
 +col.prop(brush, "use_automasking_view_occlusion", 
text="Occlusion")
 +col.prop(sculpt, "automasking_view_normal_limit")
 +col.prop(sculpt, "automasking_view_normal_falloff")
 +
+ if brush.use_automasking_cavity or 
brush.use_automasking_cavity_inverted:
+ col.separator()
+ 
+ col.prop(brush, "automasking_cavity_factor", text="Cavity Factor")
+ col.prop(brush, "automasking_cavity_blur_steps", text="Cavity 
Blur")
+ col.prop(brush, "use_automasking_custom_cavity_curve", text="Use 
Curve")
+ 
+ if brush.use_automasking_custom_cavity_curve:
+ col.template_curve_mapping(brush, "automasking_cavity_curve")
+ 
  layout.separator()
  
  # sculpt plane settings
diff --cc release/scripts/startup/bl_ui/space_view3d.py
index 7518e7171a8,fcf00ee80f6..ada2993a16f
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@@ -5493,8 -5495,8 +5495,10 @@@ class VIEW3D_MT_sculpt_automasking_pie(
  pie.prop(sculpt, "use_automasking_face_sets", text="Face Sets")
  pie.prop(sculpt, "use_automasking_boundary_edges", text="Mesh 
Boundary")
  pie.prop(sculpt, "use_automasking_boundary_face_sets", text="Face 
Sets Boundary")
+ pie.prop(sculpt, "use_automasking_cavity", text="Cavity")
+ pie.prop(sculpt, "use_automasking_cavity_inverted", text="Cavity 
(Inverted)")
 +pie.prop(sculpt, "use_automasking_start_normal", text="Area Normal")
 +pie.prop(sculpt, "use_automasking_view_normal", text="View Normal")
  
  
  class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
diff --cc release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 74017b2e1be,153bce78ec2..f0c2bca96a9
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@@ -971,22 -971,29 +971,44 @@@ class VIEW3D_PT_sculpt_options(Panel, V
  col.prop(sculpt, "use_automasking_face_sets", text="Face Sets")
  col.prop(sculpt, "use_automasking_boundary_edges", text="Mesh 
Boundary")
  col.prop(sculpt, "use_automasking_boundary_face_sets", text="Face 
Sets Boundary")
+ col.prop(sculpt, "use_automasking_cavity", text="Cavity")
+ col.prop(sculpt, "use_automasking_cavity_inverted", text="Cavity 
(Inverted)")
 +col.prop(sculpt, "use_automasking_start_normal", text="Area Normal")
 +col.prop(sculpt, "use_automasking_view_normal", text="View Normal")
 +
 +if sculpt.use_automasking_start_normal:
 +col.separator()
 +
 +col.prop(sculpt, "automasking_start_normal_limit")
 +col.prop(sculpt, "automasking_start_normal_falloff")
 +
 +if sculpt.use_automasking_view_normal:
 +col.separator()
 +
 +col.prop(sculpt, "use_automasking_view_occlusion", 
text="Occlusion")
 +col.prop(sculpt, "automasking_view_normal_limit")
 +col.prop(sculpt, "automasking_view_normal_falloff")
  
+ col.separator()
+ col.prop(sculpt.brush, "automasking_boundary_edges_propagation_steps")
+ 
+

[Bf-blender-cvs] [9cfa8b945a2] master: Cleanup: format

2022-09-28 Thread Campbell Barton
Commit: 9cfa8b945a2f24e96005223c4801497191fab281
Author: Campbell Barton
Date:   Thu Sep 29 09:46:46 2022 +1000
Branches: master
https://developer.blender.org/rB9cfa8b945a2f24e96005223c4801497191fab281

Cleanup: format

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/draw/intern/draw_manager_data.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_automasking.cc
M   source/blender/editors/sculpt_paint/sculpt_ops.c
M   source/blender/makesdna/DNA_brush_types.h
M   source/blender/makesrna/intern/rna_brush.c
M   
source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 153bce78ec2..d18b75e78af 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -939,6 +939,7 @@ class VIEW3D_PT_sculpt_voxel_remesh(Panel, 
View3DPaintPanel):
 
 layout.operator("object.voxel_remesh", text="Remesh")
 
+
 # TODO, move to space_view3d.py
 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
@@ -985,10 +986,10 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 props.use_automask_settings = True
 
 col2 = col.column()
-
+
 col2.prop(sculpt, "automasking_cavity_factor", text="Cavity 
Factor")
 col2.prop(sculpt, "automasking_cavity_blur_steps", text="Cavity 
Blur")
-
+
 col2.prop(sculpt, "use_automasking_custom_cavity_curve", text="Use 
Curve")
 
 if sculpt.use_automasking_custom_cavity_curve:
diff --git a/source/blender/draw/intern/draw_manager_data.c 
b/source/blender/draw/intern/draw_manager_data.c
index 3e0708d8b49..060617764f7 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -34,9 +34,9 @@
 #include "BLI_hash.h"
 #include "BLI_link_utils.h"
 #include "BLI_listbase.h"
+#include "BLI_math_bits.h"
 #include "BLI_memblock.h"
 #include "BLI_mempool.h"
-#include "BLI_math_bits.h"
 
 #ifdef DRW_DEBUG_CULLING
 #  include "BLI_math_bits.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index ac77e007081..54810436d20 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3548,7 +3548,8 @@ static void do_brush_action(Sculpt *sd,
 SCULPT_bmesh_topology_rake(sd, ob, nodes, totnode, 
brush->topology_rake_factor);
   }
 
-  if (!SCULPT_tool_can_reuse_cavity_mask(brush->sculpt_tool) || 
(ss->cache->supports_gravity && sd->gravity_factor > 0.0f)) {
+  if (!SCULPT_tool_can_reuse_cavity_mask(brush->sculpt_tool) ||
+  (ss->cache->supports_gravity && sd->gravity_factor > 0.0f)) {
 /* Clear cavity mask cache. */
 ss->last_automasking_settings_hash = 0;
   }
diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc 
b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index 47856c50b57..cb59b591e5c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -141,8 +141,7 @@ static bool SCULPT_automasking_needs_factors_cache(const 
Sculpt *sd, const Brush
   return false;
 }
 
-static float sculpt_cavity_calc_factor(AutomaskingCache *automasking,
-   float factor)
+static float sculpt_cavity_calc_factor(AutomaskingCache *automasking, float 
factor)
 {
   float sign = signf(factor);
 
@@ -323,14 +322,14 @@ int SCULPT_automasking_settings_hash(Object *ob, 
AutomaskingCache *automasking)
 
   if (automasking->settings.flags & BRUSH_AUTOMASKING_CAVITY_ALL) {
 hash = BLI_hash_int_2d(hash, automasking->settings.cavity_blur_steps);
-hash = BLI_hash_int_2d(hash, 
*reinterpret_cast(>settings.cavity_factor));
+hash = BLI_hash_int_2d(hash, *reinterpret_cast(>settings.cavity_factor));
 
 if (automasking->settings.cavity_curve) {
   CurveMap *cm = automasking->settings.cavity_curve->cm;
 
   for (int i = 0; i < cm->totpoint; i++) {
-hash = BLI_hash_int_2d(hash, 
*reinterpret_cast(>curve[i].x));
-hash = BLI_hash_int_2d(hash, 
*reinterpret_cast(>curve[i].y));
+hash = BLI_hash_int_2d(hash, *reinterpret_cast(>curve[i].x));
+hash = BLI_hash_int_2d(hash, *reinterpret_cast(>curve[i].y));
 hash = BLI_hash_int_2d(hash, (uint)cm->curve[i].flag);
 hash = BLI_hash_int_2d(hash, (uint)cm->curve[i].shorty);
   }
diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c 
b/source/blender/editors/sculpt_paint/sculpt_ops.c

[Bf-blender-cvs] [c087d09c16c] master: Cleanup: fix unused variable warnings in draw_pbvh.cc

2022-09-28 Thread Joseph Eagar
Commit: c087d09c16c6cc6e575e35a3637e24037617f8ed
Author: Joseph Eagar
Date:   Wed Sep 28 16:39:21 2022 -0700
Branches: master
https://developer.blender.org/rBc087d09c16c6cc6e575e35a3637e24037617f8ed

Cleanup: fix unused variable warnings in draw_pbvh.cc

===

M   source/blender/draw/intern/draw_pbvh.cc

===

diff --git a/source/blender/draw/intern/draw_pbvh.cc 
b/source/blender/draw/intern/draw_pbvh.cc
index 11788e3d044..2e92598a955 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -289,10 +289,8 @@ struct PBVHBatches {
   }
 
   void fill_vbo_normal_faces(
-  PBVHVbo ,
   PBVH_GPU_Args *args,
-  std::function 
callback)>
-  foreach_faces,
+  std::function 
callback)> foreach_faces,
   GPUVertBufRaw *access)
   {
 float fno[3];
@@ -300,7 +298,7 @@ struct PBVHBatches {
 int last_poly = -1;
 bool smooth = false;
 
-foreach_faces([&](int buffer_i, int tri_i, int vertex_i, const MLoopTri 
*tri) {
+foreach_faces([&](int UNUSED(tri_i), int vertex_i, const MLoopTri *tri) {
   const MPoly *mp = args->mpoly + tri->poly;
 
   if (tri->poly != last_poly) {
@@ -347,44 +345,48 @@ struct PBVHBatches {
 
 switch (vbo.type) {
   case CD_PBVH_CO_TYPE:
-foreach_grids([&](int x, int y, int grid_index, CCGElem *elems[4], int 
i) {
-  float *co = CCG_elem_co(>ccg_key, elems[i]);
+foreach_grids(
+[&](int UNUSED(x), int UNUSED(y), int UNUSED(grid_index), CCGElem 
*elems[4], int i) {
+  float *co = CCG_elem_co(>ccg_key, elems[i]);
 
-  *static_cast(GPU_vertbuf_raw_step()) = co;
-});
+  *static_cast(GPU_vertbuf_raw_step()) = co;
+});
 break;
 
   case CD_PBVH_NO_TYPE:
-foreach_grids([&](int x, int y, int grid_index, CCGElem *elems[4], int 
i) {
-  float3 no(0.0f, 0.0f, 0.0f);
+foreach_grids(
+[&](int UNUSED(x), int UNUSED(y), int grid_index, CCGElem 
*elems[4], int UNUSED(i)) {
+  float3 no(0.0f, 0.0f, 0.0f);
 
-  const bool smooth = args->grid_flag_mats[grid_index].flag & 
ME_SMOOTH;
+  const bool smooth = args->grid_flag_mats[grid_index].flag & 
ME_SMOOTH;
 
-  if (smooth) {
-no = CCG_elem_no(>ccg_key, elems[0]);
-  }
-  else {
-for (int j = 0; j < 4; j++) {
-  no += CCG_elem_no(>ccg_key, elems[j]);
-}
-  }
+  if (smooth) {
+no = CCG_elem_no(>ccg_key, elems[0]);
+  }
+  else {
+for (int j = 0; j < 4; j++) {
+  no += CCG_elem_no(>ccg_key, elems[j]);
+}
+  }
 
-  normalize_v3(no);
-  short sno[3];
+  normalize_v3(no);
+  short sno[3];
 
-  normal_float_to_short_v3(sno, no);
+  normal_float_to_short_v3(sno, no);
 
-  *static_cast(GPU_vertbuf_raw_step()) = sno;
-});
+  *static_cast(GPU_vertbuf_raw_step()) = sno;
+});
 break;
 
   case CD_PBVH_MASK_TYPE:
-foreach_grids([&](int x, int y, int grid_index, CCGElem *elems[4], int 
i) {
-  float *mask = CCG_elem_mask(>ccg_key, elems[i]);
-
-  *static_cast(GPU_vertbuf_raw_step()) = mask ? 
(uchar)(*mask * 255.0f) :
-255;
-});
+foreach_grids(
+[&](int UNUSED(x), int UNUSED(y), int UNUSED(grid_index), CCGElem 
*elems[4], int i) {
+  float *mask = CCG_elem_mask(>ccg_key, elems[i]);
+
+  *static_cast(GPU_vertbuf_raw_step()) = mask ?
+ 
(uchar)(*mask * 255.0f) :
+ 255;
+});
 break;
 
   case CD_PBVH_FSET_TYPE: {
@@ -393,12 +395,20 @@ struct PBVHBatches {
 if (!face_sets) {
   uchar white[3] = {UCHAR_MAX, UCHAR_MAX, UCHAR_MAX};
 
-  foreach_grids([&](int x, int y, int grid_index, CCGElem *elems[4], 
int i) {
+  foreach_grids([&](int UNUSED(x),
+int UNUSED(y),
+int UNUSED(grid_index),
+CCGElem *UNUSED(elems)[4],
+int UNUSED(i)) {
 *static_cast(GPU_vertbuf_raw_step()) = white;
   });
 }
 else {
-  foreach_grids([&](int x, int y, int grid_index, CCGElem *elems[4], 
int i) {
+  foreach_grids([&](int UNUSED(x),
+int UNUSED(y),
+int grid_index,
+CCGElem *UNUSED(elems)[4],
+int 

[Bf-blender-cvs] [0156a677c7d] master: Sculpt: New Cavity Automasking Mode

2022-09-28 Thread Joseph Eagar
Commit: 0156a677c7d13106a1d049d74fca43b5311eb53e
Author: Joseph Eagar
Date:   Wed Sep 28 16:22:34 2022 -0700
Branches: master
https://developer.blender.org/rB0156a677c7d13106a1d049d74fca43b5311eb53e

Sculpt: New Cavity Automasking Mode

Add new cavity automasking mode based on local mesh
curvature.  Cavity masking is a great way to quickly add
detail in crevices and the like.  It's meant to be used
with the Paint brush in color attribute mode.  It does
work with other brushes but the results can be unpredictable.

{F13131497}

The old "dirty mask" operator has been replace with a new
"mask from cavity" operator that shares the same code with
cavity automasking.

Differences from the sculpt-dev implementation:
* It uses the word "cavity."  When I first implemented
this I wasn't aware
  this feature existed in other software (and other
paint modes in Blender),
  and for reasons that escape me today I initially
decided to call it a concave or
  concavity mask.
* The cavity factor works a bit differently.  It's
  no longer non-linear and functions as a simple
  scale around 0.5f.
* Supports custom curves.
* Supports blurring.

Reviewed By: Julian Kaspar, Jeroen Bakker and Campbell Barton
Differential Revision: https://developer.blender.org/D15122
Ref D15122

===

M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/brush.cc
M   source/blender/blenkernel/intern/paint.cc
M   source/blender/blenkernel/intern/scene.cc
M   source/blender/blenloader/intern/versioning_300.cc
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_automasking.cc
M   source/blender/editors/sculpt_paint/sculpt_expand.c
M   source/blender/editors/sculpt_paint/sculpt_filter_color.c
M   source/blender/editors/sculpt_paint/sculpt_filter_mask.c
M   source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
M   source/blender/editors/sculpt_paint/sculpt_intern.h
M   source/blender/editors/sculpt_paint/sculpt_ops.c
M   source/blender/editors/sculpt_paint/sculpt_paint_color.c
M   source/blender/makesdna/DNA_brush_defaults.h
M   source/blender/makesdna/DNA_brush_enums.h
M   source/blender/makesdna/DNA_brush_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_brush.c
M   source/blender/makesrna/intern/rna_internal.h
M   source/blender/makesrna/intern/rna_sculpt_paint.c
M   tests/python/bl_run_operators.py

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 9b1cf11f6e7..a4a328fce1a 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -943,8 +943,22 @@ def brush_settings_advanced(layout, context, brush, 
popover=False):
 # boundary edges/face sets automasking
 col.prop(brush, "use_automasking_boundary_edges", text="Mesh Boundary")
 col.prop(brush, "use_automasking_boundary_face_sets", text="Face Sets 
Boundary")
+col.prop(brush, "use_automasking_cavity", text="Cavity")
+col.prop(brush, "use_automasking_cavity_inverted", text="Cavity 
(Inverted)")
+
+col.separator()
 col.prop(brush, "automasking_boundary_edges_propagation_steps")
 
+if brush.use_automasking_cavity or 
brush.use_automasking_cavity_inverted:
+col.separator()
+
+col.prop(brush, "automasking_cavity_factor", text="Cavity Factor")
+col.prop(brush, "automasking_cavity_blur_steps", text="Cavity 
Blur")
+col.prop(brush, "use_automasking_custom_cavity_curve", text="Use 
Curve")
+
+if brush.use_automasking_custom_cavity_curve:
+col.template_curve_mapping(brush, "automasking_cavity_curve")
+
 layout.separator()
 
 # sculpt plane settings
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 092fae671e0..fcf00ee80f6 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3298,7 +3298,8 @@ class VIEW3D_MT_mask(Menu):
 
 layout.separator()
 
-props = layout.operator("sculpt.dirty_mask", text='Dirty Mask')
+props = layout.operator("sculpt.mask_from_cavity", text="Mask From 
Cavity")
+props.use_automask_settings = False
 
 layout.separator()
 
@@ -5494,6 +5495,8 @@ class VIEW3D_MT_sculpt_automasking_pie(Menu):
 pie.prop(sculpt, 

[Bf-blender-cvs] [b1b76cb4b46] temp-sculpt-cavity-mask: temp-sculpt-cavity-mask: Bump subversion

2022-09-28 Thread Joseph Eagar
Commit: b1b76cb4b469ab25319a43565ed564b7947dc60f
Author: Joseph Eagar
Date:   Wed Sep 28 16:09:26 2022 -0700
Branches: temp-sculpt-cavity-mask
https://developer.blender.org/rBb1b76cb4b469ab25319a43565ed564b7947dc60f

temp-sculpt-cavity-mask: Bump subversion

===

M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenloader/intern/versioning_300.cc

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 808708922f8..b6dd25d9f29 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -25,7 +25,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 1
+#define BLENDER_FILE_SUBVERSION 2
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the 
file
diff --git a/source/blender/blenloader/intern/versioning_300.cc 
b/source/blender/blenloader/intern/versioning_300.cc
index 7ee14628f30..878a4078295 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3528,13 +3528,6 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 BKE_main_namemap_validate_and_fix(bmain);
   }
 
-  if (!MAIN_VERSION_ATLEAST(bmain, 304, 1)) {
-/* Initialize brush curves sculpt settings. */
-LISTBASE_FOREACH (Brush *, brush, >brushes) {
-  brush->automasking_cavity_factor = 0.5f;
-}
-  }
-
   if (!MAIN_VERSION_ATLEAST(bmain, 304, 1)) {
 /* Image generation information transferred to tiles. */
 if (!DNA_struct_elem_find(fd->filesdna, "ImageTile", "int", "gen_x")) {
@@ -3591,6 +3584,13 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 FOREACH_NODETREE_END;
   }
 
+  if (!MAIN_VERSION_ATLEAST(bmain, 304, 2)) {
+/* Initialize brush curves sculpt settings. */
+LISTBASE_FOREACH (Brush *, brush, >brushes) {
+  brush->automasking_cavity_factor = 0.5f;
+}
+  }
+
   /**
* Versioning code until next subversion bump goes here.
*

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [78969525197] temp-sculpt-cavity-mask: temp-sculpt-cavity-mask: Fix python styling

2022-09-28 Thread Joseph Eagar
Commit: 789695251971ae7b830a0ceedc2f867fad278bd2
Author: Joseph Eagar
Date:   Wed Sep 28 16:11:45 2022 -0700
Branches: temp-sculpt-cavity-mask
https://developer.blender.org/rB789695251971ae7b830a0ceedc2f867fad278bd2

temp-sculpt-cavity-mask: Fix python styling

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 16acfbfd1f7..153bce78ec2 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1018,6 +1018,7 @@ class VIEW3D_PT_sculpt_options_gravity(Panel, 
View3DPaintPanel):
 col.prop(sculpt, "gravity", slider=True, text="Factor")
 col.prop(sculpt, "gravity_object")
 
+
 # TODO, move to space_view3d.py
 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
 bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [77067802528] temp-sculpt-cavity-mask: temp-sculpt-cavity-mask: Fix a few warnings

2022-09-28 Thread Joseph Eagar
Commit: 770678025283934bfe10a84c82d6364f45ad6b88
Author: Joseph Eagar
Date:   Wed Sep 28 16:05:31 2022 -0700
Branches: temp-sculpt-cavity-mask
https://developer.blender.org/rB770678025283934bfe10a84c82d6364f45ad6b88

temp-sculpt-cavity-mask: Fix a few warnings

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/editors/sculpt_paint/sculpt_automasking.cc
M   source/blender/editors/sculpt_paint/sculpt_intern.h

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 2b4bdfdc09e..386fecfd278 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -913,7 +913,7 @@ bool BKE_paint_canvas_image_get(struct PaintModeSettings 
*settings,
 int BKE_paint_canvas_uvmap_layer_index_get(const struct PaintModeSettings 
*settings,
struct Object *ob);
 void BKE_sculpt_check_cavity_curves(struct Sculpt *sd);
-struct CurveMapping *BKE_sculpt_default_cavity_curve();
+struct CurveMapping *BKE_sculpt_default_cavity_curve(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc 
b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index 8334e59c3a4..47856c50b57 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -141,44 +141,7 @@ static bool SCULPT_automasking_needs_factors_cache(const 
Sculpt *sd, const Brush
   return false;
 }
 
-float SCULPT_calc_cavity(SculptSession *ss, const PBVHVertRef vertex)
-{
-  SculptVertexNeighborIter ni;
-  const float *co = SCULPT_vertex_co_get(ss, vertex);
-  float3 avg(0.0f);
-  float length_sum = 0.0f;
-  int valence = 0;
-
-  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vertex, ni) {
-const float *co2 = SCULPT_vertex_co_get(ss, ni.vertex);
-
-length_sum += len_v3v3(co, co2);
-valence++;
-
-avg += co2;
-  }
-  SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
-
-  if (!valence) {
-return 0.0f;
-  }
-
-  avg /= (float)valence;
-  length_sum /= (float)valence;
-
-  float3 no;
-  SCULPT_vertex_normal_get(ss, vertex, no);
-
-  avg -= co;
-
-  /* Use distance to plane. */
-  float factor = dot_v3v3(avg, no) / length_sum;
-
-  return factor;
-}
-
-static float sculpt_cavity_calc_factor(SculptSession *ss,
-   AutomaskingCache *automasking,
+static float sculpt_cavity_calc_factor(AutomaskingCache *automasking,
float factor)
 {
   float sign = signf(factor);
@@ -342,7 +305,7 @@ static void sculpt_calc_blurred_cavity(SculptSession *ss,
   float3 vec = sco1 - sco2;
   float factor_sum = dot_v3v3(vec, sno2) / len1_sum;
 
-  factor_sum = sculpt_cavity_calc_factor(ss, automasking, factor_sum);
+  factor_sum = sculpt_cavity_calc_factor(automasking, factor_sum);
 
   *(float *)SCULPT_vertex_attr_get(vertex, ss->attrs.cavity) = factor_sum;
   *(uchar *)SCULPT_vertex_attr_get(vertex, ss->attrs.stroke_id) = 
automasking->cavity_stroke_id;
@@ -554,21 +517,6 @@ static void sculpt_face_sets_automasking_init(Sculpt *sd, 
Object *ob)
   }
 }
 
-static void sculpt_cavity_automasking_init(Sculpt *sd, Object *ob, 
AutomaskingCache *automasking)
-{
-  SculptSession *ss = ob->sculpt;
-  Brush *brush = BKE_paint_brush(>paint);
-
-  if (!SCULPT_is_automasking_enabled(sd, ss, brush)) {
-return;
-  }
-
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && !ss->pmap) {
-BLI_assert_msg(0, "Cavity mask automasking: pmap missing");
-return;
-  }
-}
-
 #define EDGE_DISTANCE_INF -1
 
 static void SCULPT_boundary_automasking_init(Object *ob,
@@ -746,10 +694,6 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt 
*sd, Brush *brush, Object
 SCULPT_boundary_automasking_init(
 ob, AUTOMASK_INIT_BOUNDARY_FACE_SETS, boundary_propagation_steps);
   }
-  if (SCULPT_is_automasking_mode_enabled(sd, brush, 
BRUSH_AUTOMASKING_CAVITY_ALL)) {
-SCULPT_vertex_random_access_ensure(ss);
-sculpt_cavity_automasking_init(sd, ob, automasking);
-  }
 
   return automasking;
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h 
b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 91a218cc082..a28c18359e5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -1829,7 +1829,6 @@ void SCULPT_bmesh_topology_rake(
 /* sculpt_ops.c */
 
 void SCULPT_OT_brush_stroke(struct wmOperatorType *ot);
-float SCULPT_calc_cavity(SculptSession *ss, const int vertex);
 
 /* end sculpt_ops.c */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cccb1d22d51] temp-sculpt-cavity-mask: Merge branch 'master' into temp-sculpt-cavity-mask

2022-09-28 Thread Joseph Eagar
Commit: cccb1d22d512759bb8a4761aa6516ecf651f1637
Author: Joseph Eagar
Date:   Wed Sep 28 15:51:22 2022 -0700
Branches: temp-sculpt-cavity-mask
https://developer.blender.org/rBcccb1d22d512759bb8a4761aa6516ecf651f1637

Merge branch 'master' into temp-sculpt-cavity-mask

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [53ac3192ba0] master: Cleanup: remove duplicate declaration

2022-09-28 Thread Joseph Eagar
Commit: 53ac3192ba07c4271c86479186ed0d0b8cd7846f
Author: Joseph Eagar
Date:   Wed Sep 28 15:50:09 2022 -0700
Branches: master
https://developer.blender.org/rB53ac3192ba07c4271c86479186ed0d0b8cd7846f

Cleanup: remove duplicate declaration

Also got rid of ATTR_NO_OPT macro.

===

M   source/blender/blenkernel/BKE_customdata.h
M   source/blender/draw/intern/draw_pbvh.cc

===

diff --git a/source/blender/blenkernel/BKE_customdata.h 
b/source/blender/blenkernel/BKE_customdata.h
index 0e172abd9a2..22e4a2bce87 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -450,7 +450,6 @@ int CustomData_get_stencil_layer(const struct CustomData 
*data, int type);
  * if no such active layer is defined.
  */
 const char *CustomData_get_active_layer_name(const struct CustomData *data, 
int type);
-const char *CustomData_get_render_layer_name(const struct CustomData *data, 
int type);
 
 /**
  * Returns name of the default layer of the given type or NULL
diff --git a/source/blender/draw/intern/draw_pbvh.cc 
b/source/blender/draw/intern/draw_pbvh.cc
index 126ba98d06c..11788e3d044 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -8,17 +8,6 @@
  * used by mesh sculpt mode.
  */
 
-/* Disable optimization for a function (for debugging use only!)*/
-#ifdef __clang__
-#  define ATTR_NO_OPT __attribute__((optnone))
-#elif defined(_MSC_VER)
-#  define ATTR_NO_OPT __pragma(optimize("", off))
-#elif defined(__GNUC__)
-#  define ATTR_NO_OPT __attribute__((optimize("O0")))
-#else
-#  define ATTR_NO_OPT
-#endif
-
 #include 
 #include 
 #include 
@@ -48,9 +37,9 @@
 #include "DRW_engine.h"
 #include "DRW_pbvh.h"
 
+#include "bmesh.h"
 #include "draw_pbvh.h"
 #include "gpu_private.h"
-#include "bmesh.h"
 
 #define MAX_PBVH_BATCH_KEY 512
 #define MAX_PBVH_VBOS 16
@@ -493,7 +482,6 @@ struct PBVHBatches {
 }
   }
 
-  ATTR_NO_OPT
   void fill_vbo_faces(PBVHVbo , PBVH_GPU_Args *args)
   {
 int totvert = args->totprim * 3;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [994c33ae710] blender-projects-basics: Merge branch 'master' into blender-projects-basics

2022-09-28 Thread Julian Eisel
Commit: 994c33ae710dbb477c7a561d39194100ccd27b43
Author: Julian Eisel
Date:   Thu Sep 29 00:17:53 2022 +0200
Branches: blender-projects-basics
https://developer.blender.org/rB994c33ae710dbb477c7a561d39194100ccd27b43

Merge branch 'master' into blender-projects-basics

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [939f20490d6] blender-projects-basics: Handle and test both Unix and Windows style slashes

2022-09-28 Thread Julian Eisel
Commit: 939f20490d6fa2063171efa6c7ed529da0718f11
Author: Julian Eisel
Date:   Thu Sep 29 00:09:33 2022 +0200
Branches: blender-projects-basics
https://developer.blender.org/rB939f20490d6fa2063171efa6c7ed529da0718f11

Handle and test both Unix and Windows style slashes

When unit testing on Unix with Windows style slashes, the project
directories would have the backslash in the name, rather than
recognizing it as nested directory. We could just expect native paths
only like most BLI functions, but it's not a big problem to just support
any format and just convert it internally. The most important part is
that the API defines well how it deals with the different formats, and
that this is unit tested. Ideally we'd have some path object type that
abstracts away the difference.

===

M   source/blender/blenkernel/BKE_project_settings.hh
M   source/blender/blenkernel/intern/project_settings.cc
M   source/blender/blenkernel/intern/project_settings_test.cc

===

diff --git a/source/blender/blenkernel/BKE_project_settings.hh 
b/source/blender/blenkernel/BKE_project_settings.hh
index 536df0dd18e..646a38196bb 100644
--- a/source/blender/blenkernel/BKE_project_settings.hh
+++ b/source/blender/blenkernel/BKE_project_settings.hh
@@ -13,6 +13,7 @@
 namespace blender::bke {
 
 class ProjectSettings {
+  /* Path to the project root using slashes in the OS native format. */
   std::string project_root_path_;
 
  public:
@@ -21,6 +22,7 @@ class ProjectSettings {
   /**
* Initializes a blender project by creating a .blender_project directory at 
the given \a
* project_root_path.
+   * Both Unix and Windows style slashes are allowed.
* \return True if the settings directory was created, or already existed. 
False on failure.
*/
   static auto create_settings_directory(StringRef project_root_path) -> bool;
@@ -28,6 +30,7 @@ class ProjectSettings {
   /**
* Read project settings from the given \a project_path, which may be either 
a project root
* directory or the .blender_project directory.
+   * Both Unix and Windows style slashes are allowed.
* \return The read project settings or null in case of failure.
*/
   static auto load_from_disk [[nodiscard]] (StringRef project_path)
diff --git a/source/blender/blenkernel/intern/project_settings.cc 
b/source/blender/blenkernel/intern/project_settings.cc
index 8645f0e63d4..5e4f2d7f303 100644
--- a/source/blender/blenkernel/intern/project_settings.cc
+++ b/source/blender/blenkernel/intern/project_settings.cc
@@ -7,6 +7,7 @@
 #include "BKE_project_settings.hh"
 
 #include "BLI_fileops.h"
+#include "BLI_path_util.h"
 
 namespace blender::bke {
 
@@ -17,24 +18,44 @@ ProjectSettings::ProjectSettings(StringRef 
project_root_path)
 
 bool ProjectSettings::create_settings_directory(StringRef project_root_path)
 {
-  return BLI_dir_create_recursive(std::string(project_root_path + "/" + 
SETTINGS_DIRNAME).c_str());
+  std::string project_root_path_native = project_root_path;
+  BLI_path_slash_native(project_root_path_native.data());
+
+  return BLI_dir_create_recursive(
+  std::string(project_root_path_native + SEP + SETTINGS_DIRNAME).c_str());
+}
+
+static StringRef path_strip_trailing_native_slash(StringRef path)
+{
+  const int64_t pos_before_trailing_slash = path.find_last_not_of(SEP);
+  return (pos_before_trailing_slash == StringRef::not_found) ?
+ path :
+ path.substr(0, pos_before_trailing_slash + 1);
+}
+
+static bool path_contains_project_settings(StringRef path)
+{
+  return BLI_exists(std::string(path + SEP_STR + 
ProjectSettings::SETTINGS_DIRNAME).c_str());
 }
 
 std::unique_ptr ProjectSettings::load_from_disk(StringRef 
project_path)
 {
-  if (!BLI_exists(std::string(project_path).c_str())) {
+  std::string project_path_native = project_path;
+  BLI_path_slash_native(project_path_native.data());
+
+  if (!BLI_exists(project_path_native.c_str())) {
 return nullptr;
   }
 
-  StringRef project_root_path = project_path;
+  StringRef project_root_path = project_path_native;
 
-  const int64_t pos_before_trailing_slash = 
project_path.find_last_not_of("\\/");
-  const StringRef path_no_trailing_slashes = (pos_before_trailing_slash == 
StringRef::not_found) ?
- project_path :
- project_path.substr(
- 0, 
pos_before_trailing_slash + 1);
+  const StringRef path_no_trailing_slashes = 
path_strip_trailing_native_slash(project_path_native);
   if (path_no_trailing_slashes.endswith(SETTINGS_DIRNAME)) {
-project_root_path = project_path.drop_suffix(SETTINGS_DIRNAME.size() + 1);
+project_root_path = 
StringRef(project_path_native).drop_suffix(SETTINGS_DIRNAME.size() + 1);
+  }
+
+  if (!path_contains_project_settings(project_root_path)) {
+ 

[Bf-blender-cvs] [6d7a301b044] blender-projects-basics: Test project paths with unicode characters & trailing slashes

2022-09-28 Thread Julian Eisel
Commit: 6d7a301b0440716a740791f47c9d6322583aee58
Author: Julian Eisel
Date:   Wed Sep 28 12:47:44 2022 +0200
Branches: blender-projects-basics
https://developer.blender.org/rB6d7a301b0440716a740791f47c9d6322583aee58

Test project paths with unicode characters & trailing slashes

===

M   source/blender/blenkernel/intern/project_settings_test.cc

===

diff --git a/source/blender/blenkernel/intern/project_settings_test.cc 
b/source/blender/blenkernel/intern/project_settings_test.cc
index ccd9ca26812..ce11cce4c4d 100644
--- a/source/blender/blenkernel/intern/project_settings_test.cc
+++ b/source/blender/blenkernel/intern/project_settings_test.cc
@@ -5,81 +5,102 @@
 #include "BKE_project_settings.hh"
 
 #include "BLI_fileops.h"
+#include "BLI_function_ref.hh"
 
 #include "testing/testing.h"
 
 namespace blender::bke::tests {
 
 class ProjectSettingsTest : public testing::Test {
- public:
-  std::string temp_project_root_path_;
+  struct ProjectDirectoryRAIIWrapper {
+std::string project_path_;
+
+ProjectDirectoryRAIIWrapper(StringRefNull project_path)
+{
+  /** Assert would be preferable but that would only run in debug builds, 
and #ASSERT_TRUE()
+   * doesn't support printing a message. */
+  if (BLI_exists(project_path.c_str())) {
+throw std::runtime_error("Can't execute test, temporary path '" + 
project_path +
+ "' already exists");
+  }
+
+  BLI_dir_create_recursive(project_path.c_str());
+  if (!BLI_exists(project_path.c_str())) {
+throw std::runtime_error("Can't execute test, failed to create path '" 
+ project_path +
+ "'");
+  }
+  project_path_ = project_path;
+}
 
-  void TearDown() override
-  {
-if (!temp_project_root_path_.empty()) {
-  BLI_delete(temp_project_root_path_.c_str(), true, true);
-  temp_project_root_path_ = "";
+~ProjectDirectoryRAIIWrapper()
+{
+  if (!project_path_.empty()) {
+BLI_delete(project_path_.c_str(), true, true);
+  }
 }
-  }
+  };
 
-  StringRefNull create_temp_project_path()
+ public:
+  /* Run the test on multiple paths or variations of the same path. Useful to 
test things like
+   * unicode paths, with or without trailing slash, etc. */
+  void test_foreach_project_path(FunctionRef fn)
   {
-BKE_tempdir_init("");
-const std::string tempdir = BKE_tempdir_session();
-temp_project_root_path_ = tempdir + "test-temporary-project-root";
+std::vector subpaths = {
+"temporary-project-root",
+"test-temporary-unicode-dir-Ružena/temporary-project-root",
+/* Same but with trailing slash. */
+"test-temporary-unicode-dir-Ružena/temporary-project-root/",
+};
 
-/** Assert would be preferable but that would only run in debug builds, 
and #ASSERT_TRUE()
- * doesn't support printing a message. */
-if (BLI_exists(temp_project_root_path_.c_str())) {
-  throw std::runtime_error("Can't execute test, temporary path '" + 
temp_project_root_path_ +
-   "' already exists");
-}
+BKE_tempdir_init("");
 
-BLI_dir_create_recursive(temp_project_root_path_.c_str());
-if (!BLI_exists(temp_project_root_path_.c_str())) {
-  throw std::runtime_error("Can't execute test, failed to create path '" +
-   temp_project_root_path_ + "'");
+const std::string tempdir = BKE_tempdir_session();
+for (StringRefNull subpath : subpaths) {
+  ProjectDirectoryRAIIWrapper temp_project_path(tempdir + subpath);
+  fn(temp_project_path.project_path_);
 }
-return temp_project_root_path_;
   }
 };
 
 TEST_F(ProjectSettingsTest, create)
 {
-  StringRefNull project_path = create_temp_project_path();
-
-  if (!ProjectSettings::create_settings_directory(project_path)) {
-/* Not a regular test failure, this may fail if there is a permission 
issue for example. */
-FAIL() << "Failed to create project directory in '" << project_path << "', 
check permissions";
-  }
-  std::string project_settings_dir = project_path + "/" + 
ProjectSettings::SETTINGS_DIRNAME;
-  EXPECT_TRUE(BLI_exists(project_settings_dir.c_str()))
-  << project_settings_dir + " was not created";
+  test_foreach_project_path([](StringRefNull project_path) {
+if (!ProjectSettings::create_settings_directory(project_path)) {
+  /* Not a regular test failure, this may fail if there is a permission 
issue for example. */
+  FAIL() << "Failed to create project directory in '" << project_path
+ << "', check permissions";
+}
+std::string project_settings_dir = project_path + "/" + 
ProjectSettings::SETTINGS_DIRNAME;
+EXPECT_TRUE(BLI_exists(project_settings_dir.c_str()))
+<< project_settings_dir + " was not created";
+  });
 }
 
 /* Load the project by 

[Bf-blender-cvs] [fa61c57dd42] temp-sculpt-cavity-mask: Merge branch 'master' into temp-sculpt-cavity-mask

2022-09-28 Thread Joseph Eagar
Commit: fa61c57dd42fab9c77bfb0e8c582ea3af2124a1e
Author: Joseph Eagar
Date:   Wed Sep 28 15:00:53 2022 -0700
Branches: temp-sculpt-cavity-mask
https://developer.blender.org/rBfa61c57dd42fab9c77bfb0e8c582ea3af2124a1e

Merge branch 'master' into temp-sculpt-cavity-mask

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [65900d88a83] master: Sculpt: Rewrite PBVH draw

2022-09-28 Thread Joseph Eagar
Commit: 65900d88a8317c207885ae4a3993272112114f36
Author: Joseph Eagar
Date:   Wed Sep 28 14:51:23 2022 -0700
Branches: master
https://developer.blender.org/rB65900d88a8317c207885ae4a3993272112114f36

Sculpt: Rewrite PBVH draw

Rewrite PBVH draw to allocate attributes into individual VBOs.
The old system tried to create a single VBO that could feed
every open viewport.  This required uploading every color and
UV attribute  to the viewport whether needed or not, often exceeding
the VBO limit.

This new system creates one VBO per attribute.  Each attribute layout is
given its own GPU batch which is cached inside the owning PBVH node.

Notes:

* This is a full C++ rewrite.  The old code is still there; ripping it out
can happen later.
* PBVH nodes now have a collection of batches, PBVHBatches, that keeps
track of all the batches inside the node.
* Batches are built exclusively from a list of attributes.
* Each attribute has its own VBO.
* Overlays, workbench and EEVEE can all have different attribute
  layouts, each of which will get its own batch.

Reviewed by: Clement Foucault
Differential Revision: https://developer.blender.org/D15428
Ref D15428

===

M   source/blender/blenkernel/BKE_customdata.h
M   source/blender/blenkernel/BKE_pbvh.h
M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/blenkernel/intern/pbvh.cc
M   source/blender/blenkernel/intern/pbvh_bmesh.c
M   source/blender/blenkernel/intern/pbvh_intern.h
M   source/blender/blenlib/BLI_math_vec_types.hh
M   source/blender/draw/CMakeLists.txt
A   source/blender/draw/DRW_pbvh.h
M   source/blender/draw/engines/basic/basic_engine.c
M   source/blender/draw/engines/eevee/eevee_materials.c
M   source/blender/draw/engines/overlay/overlay_facing.cc
M   source/blender/draw/engines/overlay/overlay_fade.cc
M   source/blender/draw/engines/overlay/overlay_mode_transfer.cc
M   source/blender/draw/engines/overlay/overlay_sculpt.cc
M   source/blender/draw/engines/overlay/overlay_wireframe.cc
M   source/blender/draw/engines/workbench/workbench_engine.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_attributes.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache_extract.hh
M   source/blender/draw/intern/draw_cache_impl.h
M   source/blender/draw/intern/draw_cache_impl_mesh.cc
M   source/blender/draw/intern/draw_manager.h
M   source/blender/draw/intern/draw_manager_data.c
A   source/blender/draw/intern/draw_pbvh.cc
A   source/blender/draw/intern/draw_pbvh.h
M   source/blender/gpu/CMakeLists.txt
D   source/blender/gpu/GPU_buffers.h
D   source/blender/gpu/intern/gpu_buffers.c
M   source/blender/gpu/intern/gpu_init_exit.c

===

diff --git a/source/blender/blenkernel/BKE_customdata.h 
b/source/blender/blenkernel/BKE_customdata.h
index 22e4a2bce87..0e172abd9a2 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -450,6 +450,7 @@ int CustomData_get_stencil_layer(const struct CustomData 
*data, int type);
  * if no such active layer is defined.
  */
 const char *CustomData_get_active_layer_name(const struct CustomData *data, 
int type);
+const char *CustomData_get_render_layer_name(const struct CustomData *data, 
int type);
 
 /**
  * Returns name of the default layer of the given type or NULL
diff --git a/source/blender/blenkernel/BKE_pbvh.h 
b/source/blender/blenkernel/BKE_pbvh.h
index ff2140732cc..9e0884a8c76 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -16,6 +16,7 @@
 /* For embedding CCGKey in iterator. */
 #include "BKE_attribute.h"
 #include "BKE_ccg.h"
+#include "DNA_customdata_types.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -27,7 +28,6 @@ struct CCGElem;
 struct CCGKey;
 struct CustomData;
 struct DMFlagMat;
-struct GPU_PBVH_Buffers;
 struct IsectRayPrecalc;
 struct MLoop;
 struct MLoopTri;
@@ -36,7 +36,9 @@ struct MVert;
 struct Mesh;
 struct MeshElemMap;
 struct PBVH;
+struct PBVHBatches;
 struct PBVHNode;
+struct PBVH_GPU_Args;
 struct SubdivCCG;
 struct TaskParallelSettings;
 struct Image;
@@ -98,6 +100,12 @@ typedef struct PBVHPixelsNode {
   void *node_data;
 } PBVHPixelsNode;
 
+typedef struct PBVHAttrReq {
+  char name[MAX_CUSTOMDATA_LAYER_NAME];
+  eAttrDomain domain;
+  eCustomDataType type;
+} PBVHAttrReq;
+
 typedef enum {
   PBVH_Leaf = 1 << 0,
 
@@ -348,9 +356,13 @@ void BKE_pbvh_draw_cb(PBVH *pbvh,
   bool update_only_visible,
   PBVHFrustumPlanes *update_frustum,
   PBVHFrustumPlanes *draw_frustum,
-  void (*draw_fn)(void *user_data, struct GPU_PBVH_Buffers 
*buffers),
+  void (*draw_fn)(void *user_data,
+

[Bf-blender-cvs] [a790873d2a8] master: Cleanup: Typo in forward declaration

2022-09-28 Thread Hans Goudey
Commit: a790873d2a811e0c244266b090d92470cf378ef2
Author: Hans Goudey
Date:   Wed Sep 28 16:32:48 2022 -0500
Branches: master
https://developer.blender.org/rBa790873d2a811e0c244266b090d92470cf378ef2

Cleanup: Typo in forward declaration

===

M   source/blender/blenkernel/BKE_duplilist.h

===

diff --git a/source/blender/blenkernel/BKE_duplilist.h 
b/source/blender/blenkernel/BKE_duplilist.h
index 831cb5031c2..cc362495a24 100644
--- a/source/blender/blenkernel/BKE_duplilist.h
+++ b/source/blender/blenkernel/BKE_duplilist.h
@@ -17,7 +17,7 @@ struct Object;
 struct ParticleSystem;
 struct Scene;
 struct ViewerPath;
-struct GeomerySet;
+struct GeometrySet;
 
 /*  */
 /* Dupli-Geometry */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [aac32481aca] temp-pbvh-vbos: temp-pbvh-vbos: fix debug mode compile error

2022-09-28 Thread Joseph Eagar
Commit: aac32481acabfbfbc8541dcda720cc93e4ca0940
Author: Joseph Eagar
Date:   Wed Sep 28 13:43:12 2022 -0700
Branches: temp-pbvh-vbos
https://developer.blender.org/rBaac32481acabfbfbc8541dcda720cc93e4ca0940

temp-pbvh-vbos: fix debug mode compile error

===

M   source/blender/draw/intern/draw_cache_impl_mesh.cc

===

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.cc 
b/source/blender/draw/intern/draw_cache_impl_mesh.cc
index a79f3d3f850..acab4798ea8 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.cc
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.cc
@@ -994,8 +994,6 @@ void DRW_mesh_get_attributes(Object *object,
   DRW_MeshCDMask cd_needed = mesh_cd_calc_used_gpu_layers(
   object, me, gpumat_array, gpumat_array_len, _needed);
 
-  BLI_assert(gpumat_array_len == cache->mat_len);
-
   if (r_attrs) {
 *r_attrs = attrs_needed;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [73c26e99561] temp-pbvh-vbos: temp-pbvh-vbos: final patch revision

2022-09-28 Thread Joseph Eagar
Commit: 73c26e99561e3268dfe3f107161f8c2c0b7720ec
Author: Joseph Eagar
Date:   Wed Sep 28 13:34:28 2022 -0700
Branches: temp-pbvh-vbos
https://developer.blender.org/rB73c26e99561e3268dfe3f107161f8c2c0b7720ec

temp-pbvh-vbos: final patch revision

===

M   release/datafiles/locale
M   release/scripts/addons
M   release/scripts/addons_contrib
M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/blenkernel/intern/pbvh_bmesh.c
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/DRW_engine.h
A   source/blender/draw/DRW_pbvh.h
M   source/blender/draw/intern/draw_manager_data.c
M   source/blender/draw/intern/draw_pbvh.cc
M   source/tools

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 7be7aff5a18..1b891478f44 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 7be7aff5a18c550465b3f7634539ed4168af7c51
+Subproject commit 1b891478f44dd047c3a92fda3ebd17fae1c3acd3
diff --git a/release/scripts/addons b/release/scripts/addons
index 726d08c9036..67f1fbca148 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 726d08c9036b939f46b59bceb72a61e3102600cc
+Subproject commit 67f1fbca1482d9d9362a4001332e785c3fd5d230
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index c43c0b2bcf0..95107484d07 16
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit c43c0b2bcf08c34d933c3b56f096c9a23c8eff68
+Subproject commit 95107484d076bc965239942e857c83433bfa86d7
diff --git a/source/blender/blenkernel/intern/pbvh.c 
b/source/blender/blenkernel/intern/pbvh.c
index 23cefa14a73..a1de8e40fe3 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -25,7 +25,7 @@
 #include "BKE_pbvh.h"
 #include "BKE_subdiv_ccg.h"
 
-#include "DRW_engine.h"
+#include "DRW_pbvh.h"
 
 #include "PIL_time.h"
 
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c 
b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 795117a8f73..de908adac79 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -17,7 +17,7 @@
 #include "BKE_ccg.h"
 #include "BKE_pbvh.h"
 
-#include "DRW_engine.h"
+#include "DRW_pbvh.h"
 
 #include "bmesh.h"
 #include "pbvh_intern.h"
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index b477182dbb6..2acff89ce7e 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -208,6 +208,7 @@ set(SRC
 
   DRW_engine.h
   DRW_select_buffer.h
+  DRW_pbvh.h
   intern/DRW_gpu_wrapper.hh
   intern/DRW_render.h
   intern/draw_attributes.h
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index cfa122845f4..dec7a22aadb 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -7,12 +7,7 @@
 
 #pragma once
 
-#include "BLI_assert.h"
-#include "BLI_bitmap.h"
 #include "BLI_sys_types.h" /* for bool */
-#include "BLI_utildefines.h"
-
-#include "BKE_ccg.h"
 
 #include "DNA_object_enums.h"
 
@@ -32,16 +27,9 @@ struct GPUVertFormat;
 struct CustomDataLayer;
 struct CustomData;
 struct GPUViewport;
-struct PBVHAttrReq;
-struct GPUBatch;
 struct ID;
 struct Main;
 struct Object;
-struct PBVH_GPU_Args;
-struct PBVHBatches;
-struct PBVHNode;
-struct CCGElem;
-struct DMFlagMat;
 struct Render;
 struct RenderEngine;
 struct RenderEngineType;
@@ -239,68 +227,6 @@ void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat 
*format,
   const struct CustomDataLayer *cl,
   bool is_active_render,
   bool is_active_layer);
-
-/* PBVH */
-
-typedef struct PBVHBatches PBVHBatches;
-
-typedef struct PBVH_GPU_Args {
-  int pbvh_type;
-
-  struct BMesh *bm;
-  const struct Mesh *me;
-  const struct MVert *mvert;
-  const struct MLoop *mloop;
-  const struct MPoly *mpoly;
-  int mesh_verts_num, mesh_faces_num, mesh_grids_num;
-  struct CustomData *vdata, *ldata, *pdata;
-  const float (*vert_normals)[3];
-
-  int face_sets_color_seed, face_sets_color_default;
-  int *face_sets; /* for PBVH_FACES and PBVH_GRIDS */
-
-  struct SubdivCCG *subdiv_ccg;
-  const struct DMFlagMat *grid_flag_mats;
-  const int *grid_indices;
-  struct CCGKey ccg_key;
-  CCGElem **grids;
-  void **gridfaces;
-  BLI_bitmap **grid_hidden;
-
-  int *prim_indices;
-  int totprim;
-
-  bool *hide_poly;
-
-  int node_verts_num;
-
-  const struct MLoopTri *mlooptri;
-  struct PBVHNode *node;
-
-  /* BMesh. */
-  struct GSet *bm_unique_vert, *bm_other_verts, *bm_faces;
-  int cd_mask_layer;
-} PBVH_GPU_Args;
-
-typedef struct PBVHGPUFormat PBVHGPUFormat;
-
-void DRW_pbvh_node_update(struct PBVHBatches 

[Bf-blender-cvs] [ed80ba27876] temp-pbvh-vbos: Merge remote-tracking branch 'origin' into temp-pbvh-vbos

2022-09-28 Thread Joseph Eagar
Commit: ed80ba27876f6da0925e81d22c8be3e54ce0273e
Author: Joseph Eagar
Date:   Wed Sep 28 13:14:44 2022 -0700
Branches: temp-pbvh-vbos
https://developer.blender.org/rBed80ba27876f6da0925e81d22c8be3e54ce0273e

Merge remote-tracking branch 'origin' into temp-pbvh-vbos

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [482d431bb67] master: Geometry Nodes: Curve and mesh topology access nodes

2022-09-28 Thread Hans Goudey
Commit: 482d431bb6735e8206961bd1115d2be7e63572b1
Author: Hans Goudey
Date:   Wed Sep 28 14:38:27 2022 -0500
Branches: master
https://developer.blender.org/rB482d431bb6735e8206961bd1115d2be7e63572b1

Geometry Nodes: Curve and mesh topology access nodes

This patch contains an initial set of nodes to access basic
mesh topology information, as explored in T100020.

The nodes allow six direct topology mappings for meshes:
- **Corner -> Face** The face a corner is in, the index in the face
- **Vertex -> Edge** Choose an edge attached to the vertex
- **Vertex -> Corner** Choose a corner attached to the vertex
- **Corner -> Edge** The next and previous edge at each face corner
- **Corner -> Vertex** The vertex associated with a corner
- **Corner -> Corner** Offset a corner index within a face

And two new topology mappings for curves:
- **Curve -> Points** Choose a point within a curve
- **Point -> Curve** The curve a point is in, the index in the curve

The idea is that some of the 16 possible mesh mappings are more
important, and that this is a useful set of nodes to start exploring
this area. For mappings with an arbitrary number of connections, we
must sort them and use an index to choose a single element, because
geometry nodes does not support list fields. Note that the sort
index has repeating behavior as it goes over the "Total" number of
connections, and negative sort indices choose from the end.

Currently which of the "start" elements is used is determined by the
field context, so the "Field at Index" and "Interpolate Domain" nodes
will be quite important. Also, currently the "Sort Index" inputs are
clamped to the number of connections.

One important feature that isn't implemented here is using the winding
order for the output elements. This can be a separate mode for some
of these nodes. It will be optional because of the performance impact.

There are several todos for separate commits after this:
- Rename "Control Point Neighbors" to be consistent with this naming
- Version away the "Vertex Neighbors" node which is fully redundant now
- Implement a special case for when no weights are used for performance
- De-duplicating some of the sorting logic between the nodes
- Improve performance and memory use of topology mappings
- Look into caching some of the mappings on meshes

Differential Revision: https://developer.blender.org/D16029

===

M   release/scripts/startup/bl_ui/node_add_menu_geometry.py
M   source/blender/blenkernel/BKE_curves.hh
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/curves_geometry.cc
M   source/blender/blenkernel/intern/node.cc
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/geometry/CMakeLists.txt
M   source/blender/nodes/geometry/node_geometry_util.hh
A   
source/blender/nodes/geometry/nodes/node_geo_curve_topology_curve_of_point.cc
A   
source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
M   source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc
M   
source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_face.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_corner.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_face_of_corner.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc
A   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_vertex_of_corner.cc

===

diff --git a/release/scripts/startup/bl_ui/node_add_menu_geometry.py 
b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
index b29e607d413..73763c3d72c 100644
--- a/release/scripts/startup/bl_ui/node_add_menu_geometry.py
+++ b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
@@ -52,7 +52,6 @@ class NODE_MT_geometry_node_GEO_CURVE(Menu):
 node_add_menu.add_node_type(layout, "GeometryNodeSubdivideCurve")
 node_add_menu.add_node_type(layout, "GeometryNodeTrimCurve")
 layout.separator()
-node_add_menu.add_node_type(layout, 
"GeometryNodeInputControlPointNeighbors")
 node_add_menu.add_node_type(layout, 
"GeometryNodeInputCurveHandlePositions")
 node_add_menu.add_node_type(layout, "GeometryNodeInputTangent")
 node_add_menu.add_node_type(layout, "GeometryNodeInputCurveTilt")
@@ -88,6 +87,17 @@ class NODE_MT_geometry_node_GEO_PRIMITIVES_CURVE(Menu):
 node_add_menu.add_node_type(layout, 
"GeometryNodeCurvePrimitiveBezierSegment")
 
 
+class 

[Bf-blender-cvs] [25533dbe219] master: Mesh: Add C++ implementaiton of topology mappings

2022-09-28 Thread Hans Goudey
Commit: 25533dbe219f8bbcb3f04ffe2ff1e57599addf3f
Author: Hans Goudey
Date:   Wed Sep 28 14:31:32 2022 -0500
Branches: master
https://developer.blender.org/rB25533dbe219f8bbcb3f04ffe2ff1e57599addf3f

Mesh: Add C++ implementaiton of topology mappings

Because they are friendlier to use in C++ code than the existing mesh
mapping API, these mappings from one domain to another were often
reimplemented in separate files. This commit moves some basic
implementations to a `mesh_topology` namespace in the existing
mesh mapping header file. These is plenty of room for performance
improvement here, particularly by not using an array of Vectors, but
that can come later.

Split from D16029

===

M   source/blender/blenkernel/BKE_mesh_mapping.h
M   source/blender/blenkernel/intern/mesh_fair.cc
M   source/blender/blenkernel/intern/mesh_mapping.cc
M   source/blender/render/intern/texture_margin.cc

===

diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h 
b/source/blender/blenkernel/BKE_mesh_mapping.h
index 2ee50fbaaee..350c4c4bb36 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -6,6 +6,10 @@
  * \ingroup bke
  */
 
+#ifdef __cplusplus
+#  include "BLI_array.hh"
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -330,3 +334,19 @@ int *BKE_mesh_calc_smoothgroups(const struct MEdge *medge,
 #ifdef __cplusplus
 }
 #endif
+
+#ifdef __cplusplus
+namespace blender::mesh_topology {
+
+Array build_corner_to_poly_map(Span polys, int loops_num);
+
+Array> build_vert_to_edge_map(Span edges, int verts_num);
+Array> build_vert_to_corner_map(Span loops, int verts_num);
+
+inline int previous_poly_corner(const MPoly , int corner_i)
+{
+  return corner_i - 1 + (corner_i == poly.loopstart) * poly.totloop;
+}
+
+}  // namespace blender::mesh_topology
+#endif
diff --git a/source/blender/blenkernel/intern/mesh_fair.cc 
b/source/blender/blenkernel/intern/mesh_fair.cc
index bb0a5610cf4..df61169fa5c 100644
--- a/source/blender/blenkernel/intern/mesh_fair.cc
+++ b/source/blender/blenkernel/intern/mesh_fair.cc
@@ -26,6 +26,7 @@
 #include "MEM_guardedalloc.h"
 #include "eigen_capi.h"
 
+using blender::Array;
 using blender::Map;
 using blender::MutableSpan;
 using blender::Span;
@@ -220,12 +221,7 @@ class MeshFairingContext : public FairingContext {
   }
 }
 
-loop_to_poly_map_.reserve(mesh->totloop);
-for (int i = 0; i < mesh->totpoly; i++) {
-  for (int l = 0; l < mpoly_[i].totloop; l++) {
-loop_to_poly_map_[l + mpoly_[i].loopstart] = i;
-  }
-}
+loop_to_poly_map_ = 
blender::mesh_topology::build_corner_to_poly_map(mpoly_, mloop_.size());
   }
 
   ~MeshFairingContext() override
@@ -259,7 +255,7 @@ class MeshFairingContext : public FairingContext {
   Span mloop_;
   Span mpoly_;
   Span medge_;
-  Vector loop_to_poly_map_;
+  Array loop_to_poly_map_;
 };
 
 class BMeshFairingContext : public FairingContext {
diff --git a/source/blender/blenkernel/intern/mesh_mapping.cc 
b/source/blender/blenkernel/intern/mesh_mapping.cc
index 2db0adce033..c1523f0a525 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.cc
+++ b/source/blender/blenkernel/intern/mesh_mapping.cc
@@ -16,6 +16,7 @@
 #include "BLI_bitmap.h"
 #include "BLI_buffer.h"
 #include "BLI_math.h"
+#include "BLI_task.hh"
 #include "BLI_utildefines.h"
 
 #include "BKE_customdata.h"
@@ -552,6 +553,41 @@ void BKE_mesh_origindex_map_create_looptri(MeshElemMap 
**r_map,
   *r_mem = indices;
 }
 
+namespace blender::mesh_topology {
+
+Array build_corner_to_poly_map(const Span polys, const int 
loops_num)
+{
+  Array map(loops_num);
+  threading::parallel_for(polys.index_range(), 1024, [&](IndexRange range) {
+for (const int64_t poly_i : range) {
+  const MPoly  = polys[poly_i];
+  map.as_mutable_span().slice(poly.loopstart, 
poly.totloop).fill(int(poly_i));
+}
+  });
+  return map;
+}
+
+Array> build_vert_to_edge_map(const Span edges, const int 
verts_num)
+{
+  Array> map(verts_num);
+  for (const int64_t i : edges.index_range()) {
+map[edges[i].v1].append(int(i));
+map[edges[i].v2].append(int(i));
+  }
+  return map;
+}
+
+Array> build_vert_to_corner_map(const Span loops, const int 
verts_num)
+{
+  Array> map(verts_num);
+  for (const int64_t i : loops.index_range()) {
+map[loops[i].v].append(int(i));
+  }
+  return map;
+}
+
+}  // namespace blender::mesh_topology
+
 /** \} */
 
 /*  */
diff --git a/source/blender/render/intern/texture_margin.cc 
b/source/blender/render/intern/texture_margin.cc
index 201908234fe..a69449d9386 100644
--- a/source/blender/render/intern/texture_margin.cc
+++ b/source/blender/render/intern/texture_margin.cc
@@ -14,6 +14,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_customdata.h"
 #include "BKE_mesh.h"

[Bf-blender-cvs] [69251411bc7] universal-scene-description: USD Export: Added triangulate options

2022-09-28 Thread Michael Kowalski
Commit: 69251411bc7e897e571a944d6ed016f3b7d76081
Author: Michael Kowalski
Date:   Wed Sep 28 14:36:41 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB69251411bc7e897e571a944d6ed016f3b7d76081

USD Export: Added triangulate options

===

M   source/blender/editors/io/io_usd.c
M   source/blender/io/usd/intern/usd_writer_mesh.cc
M   source/blender/io/usd/usd.h

===

diff --git a/source/blender/editors/io/io_usd.c 
b/source/blender/editors/io/io_usd.c
index 044d5dfad44..abc94836d9c 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -320,6 +320,11 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
 
   const bool usdz_is_arkit = RNA_boolean_get(op->ptr, "usdz_is_arkit");
 
+  const bool triangulate_meshes = RNA_boolean_get(op->ptr, 
"triangulate_meshes");
+
+  const int quad_method = RNA_enum_get(op->ptr, "quad_method");
+  const int ngon_method = RNA_enum_get(op->ptr, "ngon_method");
+
   const bool export_blender_metadata = RNA_boolean_get(op->ptr, 
"export_blender_metadata");
 
   struct USDExportParams params = {RNA_int_get(op->ptr, "start"),
@@ -382,7 +387,10 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
usdz_downscale_size,
usdz_downscale_custom_size,
usdz_is_arkit,
-   export_blender_metadata};
+   export_blender_metadata,
+   triangulate_meshes,
+   quad_method,
+   ngon_method};
 
   /* Take some defaults from the scene, if not specified explicitly. */
   Scene *scene = CTX_data_scene(C);
@@ -471,6 +479,13 @@ static void wm_usd_export_draw(bContext *C, wmOperator *op)
 uiItemR(box, ptr, "export_face_maps", 0, NULL, ICON_NONE);
 uiItemR(box, ptr, "export_uvmaps", 0, NULL, ICON_NONE);
 uiItemR(box, ptr, "export_normals", 0, NULL, ICON_NONE);
+
+uiItemR(box, ptr, "triangulate_meshes", 0, NULL, ICON_NONE);
+
+uiLayout *sub = uiLayoutColumn(box, false);
+uiLayoutSetActive(sub, RNA_boolean_get(ptr, "triangulate_meshes"));
+uiItemR(sub, ptr, "quad_method", 0, IFACE_("Method Quads"), ICON_NONE);
+uiItemR(sub, ptr, "ngon_method", 0, IFACE_("Polygons"), ICON_NONE);
   }
 
   box = uiLayoutBox(layout);
@@ -533,7 +548,6 @@ static void wm_usd_export_draw(bContext *C, wmOperator *op)
   uiItemR(box, ptr, "overwrite_textures", 0, NULL, ICON_NONE);
 }
 
-//!TODO: add custom size int
 uiItemR(box, ptr, "usdz_downscale_size", 0, NULL, ICON_NONE);
 if (RNA_enum_get(ptr, "usdz_downscale_size") == USD_TEXTURE_SIZE_CUSTOM) {
   uiItemR(box, ptr, "usdz_downscale_custom_size", 0, NULL, ICON_NONE);
@@ -548,7 +562,6 @@ static void wm_usd_export_draw(bContext *C, wmOperator *op)
   uiItemL(box, IFACE_("Experimental:"), ICON_NONE);
   uiItemR(box, ptr, "use_instancing", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "fix_skel_root", 0, NULL, ICON_NONE);
-
 }
 
 static bool wm_usd_export_check(bContext *UNUSED(C), wmOperator *op)
@@ -976,6 +989,26 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
   true,
   "Export Blender Metadata",
   "Write Blender-specific information to the Stage's 
customLayerData");
+
+  RNA_def_boolean(ot->srna,
+  "triangulate_meshes",
+  false,
+  "Triangulate Meshes",
+  "Triangulate meshes during export");
+
+  RNA_def_enum(ot->srna,
+   "quad_method",
+   rna_enum_modifier_triangulate_quad_method_items,
+   MOD_TRIANGULATE_QUAD_SHORTEDGE,
+   "Quad Method",
+   "Method for splitting the quads into triangles");
+
+  RNA_def_enum(ot->srna,
+   "ngon_method",
+   rna_enum_modifier_triangulate_ngon_method_items,
+   MOD_TRIANGULATE_NGON_BEAUTY,
+   "N-gon Method",
+   "Method for splitting the n-gons into triangles");
 }
 
 /* == USD Import == */
diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc 
b/source/blender/io/usd/intern/usd_writer_mesh.cc
index 8b2d76d92f5..cdf38d65697 100644
--- a/source/blender/io/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/io/usd/intern/usd_writer_mesh.cc
@@ -21,6 +21,9 @@
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 
+#include "bmesh.h"
+#include "bmesh_tools.h"
+
 #include "DEG_depsgraph.h"
 
 #include "DNA_layer_types.h"
@@ -130,6 +133,29 @@ void USDGenericMeshWriter::do_write(HierarchyContext 
)
 return;
   }
 
+  if (usd_export_context_.export_params.triangulate_meshes) {
+const bool tag_only = false;
+const int quad_method = 

[Bf-blender-cvs] [878dea4e0fc] master: GPencil: Avoid infinite loop in Fill debug mode

2022-09-28 Thread Antonio Vazquez
Commit: 878dea4e0fcca68ba3ad93edeae22114e1252f9e
Author: Antonio Vazquez
Date:   Wed Sep 28 20:29:41 2022 +0200
Branches: master
https://developer.blender.org/rB878dea4e0fcca68ba3ad93edeae22114e1252f9e

GPencil: Avoid infinite loop in Fill debug mode

If the internal flag is set to debug and the Ctrl key is used
the program keeps running endless.

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 4fd96369b4f..aec0af6cd9f 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2712,6 +2712,9 @@ static bool gpencil_do_frame_fill(tGPDfill *tgpf, const 
bool is_inverted)
 gpencil_invert_image(tgpf);
 while (gpencil_find_and_mark_empty_areas(tgpf)) {
   gpencil_boundaryfill_area(tgpf);
+  if (FILL_DEBUG) {
+break;
+  }
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6e9320d2371] master: GPencil: Disable Fill visual aids if use Inverted

2022-09-28 Thread Antonio Vazquez
Commit: 6e9320d23719f81460498b03da61634f6d20b367
Author: Antonio Vazquez
Date:   Wed Sep 28 20:23:49 2022 +0200
Branches: master
https://developer.blender.org/rB6e9320d23719f81460498b03da61634f6d20b367

GPencil: Disable Fill visual aids if use Inverted

When the inverted mode is used, the visual aids must
not be displayed.

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 5d2c4dda617..4fd96369b4f 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2793,8 +2793,9 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
(!is_brush_inv && (event->modifier & KM_CTRL) != 0);
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(tgpf->gpd);
   const bool extend_lines = (tgpf->fill_extend_fac > 0.0f);
-  const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES);
-  const bool help_lines = ((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || 
(show_extend));
+  const bool show_extend = ((tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES) && 
!is_inverted);
+  const bool help_lines = (((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || 
show_extend) &&
+   !is_inverted);
   int estate = OPERATOR_RUNNING_MODAL;
 
   switch (event->type) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [36096fe4803] master: GPencil: Change property text for Fill Visual Aids

2022-09-28 Thread Antonio Vazquez
Commit: 36096fe4803afe004630bf54b81bfebc3f62621b
Author: Antonio Vazquez
Date:   Wed Sep 28 19:42:03 2022 +0200
Branches: master
https://developer.blender.org/rB36096fe4803afe004630bf54b81bfebc3f62621b

GPencil: Change property text for Fill Visual Aids

===

M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index aa2d94f9082..66dcbab3a35 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1927,7 +1927,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
   prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", 
GP_BRUSH_FILL_SHOW_EXTENDLINES);
   RNA_def_property_boolean_default(prop, true);
-  RNA_def_property_ui_text(prop, "Show Extend Lines", "Show help lines for 
stroke extension");
+  RNA_def_property_ui_text(prop, "Visual Aids", "Show help lines for stroke 
extension");
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 
   prop = RNA_def_property(srna, "use_collide_strokes", PROP_BOOLEAN, 
PROP_NONE);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [19955ef88ef] master: GPencil: Extend Fill lines when visual aids are disabled

2022-09-28 Thread Antonio Vazquez
Commit: 19955ef88ef8be8fc47d4d0d840c197fdc719259
Author: Antonio Vazquez
Date:   Wed Sep 28 20:07:20 2022 +0200
Branches: master
https://developer.blender.org/rB19955ef88ef8be8fc47d4d0d840c197fdc719259

GPencil: Extend Fill lines when visual aids are disabled

When the visual aids are disabled, but the extend factor
is > 0, the lines must be extended, but not displayed.

Also, some variables renamed to clarify.

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index b505d5c27a4..5d2c4dda617 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2792,8 +2792,9 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
   const bool is_inverted = (is_brush_inv && (event->modifier & KM_CTRL) == 0) 
||
(!is_brush_inv && (event->modifier & KM_CTRL) != 0);
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(tgpf->gpd);
-  const bool do_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES);
-  const bool help_lines = ((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || 
(do_extend));
+  const bool extend_lines = (tgpf->fill_extend_fac > 0.0f);
+  const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES);
+  const bool help_lines = ((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || 
(show_extend));
   int estate = OPERATOR_RUNNING_MODAL;
 
   switch (event->type) {
@@ -2862,7 +2863,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
   int step = ((float)i / (float)total) * 100.0f;
   WM_cursor_time(win, step);
 
-  if (do_extend) {
+  if (extend_lines) {
 gpencil_update_extend(tgpf);
   }
 
@@ -2893,7 +2894,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
 loop_limit++;
   }
 
-  if (do_extend) {
+  if (extend_lines) {
 gpencil_delete_temp_stroke_extension(tgpf, true);
   }
 
@@ -2922,13 +2923,13 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
   estate = OPERATOR_CANCELLED;
 }
   }
-  else if (do_extend) {
+  else if (extend_lines) {
 gpencil_update_extend(tgpf);
   }
   tgpf->oldkey = event->type;
   break;
 case EVT_SKEY:
-  if ((do_extend) && (event->val == KM_PRESS)) {
+  if ((show_extend) && (event->val == KM_PRESS)) {
 /* Clean temp strokes. */
 stroke_array_free(tgpf);
 
@@ -2944,7 +2945,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
   }
   break;
 case EVT_DKEY:
-  if ((do_extend) && (event->val == KM_PRESS)) {
+  if ((show_extend) && (event->val == KM_PRESS)) {
 tgpf->flag ^= GP_BRUSH_FILL_STROKE_COLLIDE;
 /* Clean temp strokes. */
 stroke_array_free(tgpf);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ad789c74df4] master: GPencil: Fix unreported memory leak in Fill inverse

2022-09-28 Thread Antonio Vazquez
Commit: ad789c74df49f71597252c234e37dce39d34b1ec
Author: Antonio Vazquez
Date:   Wed Sep 28 19:36:15 2022 +0200
Branches: master
https://developer.blender.org/rBad789c74df49f71597252c234e37dce39d34b1ec

GPencil: Fix unreported memory leak in Fill inverse

There was a memory leak when use inverted fill.

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index c99d003faf3..b505d5c27a4 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2681,9 +2681,12 @@ static bool gpencil_find_and_mark_empty_areas(tGPDfill 
*tgpf)
 get_pixel(ibuf, i, rgba);
 if (rgba[3] == 0.0f) {
   set_pixel(ibuf, i, blue_col);
+  BKE_image_release_ibuf(tgpf->ima, ibuf, NULL);
   return true;
 }
   }
+
+  BKE_image_release_ibuf(tgpf->ima, ibuf, NULL);
   return false;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c55d38f00b8] master: Geometry Nodes: viewport preview

2022-09-28 Thread Jacques Lucke
Commit: c55d38f00b8c0e6ae8bda9cc66614afe28fb3fc9
Author: Jacques Lucke
Date:   Wed Sep 28 17:54:59 2022 +0200
Branches: master
https://developer.blender.org/rBc55d38f00b8c0e6ae8bda9cc66614afe28fb3fc9

Geometry Nodes: viewport preview

This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.

**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
  makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
  is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
  its active or not.

**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
  When pinned, the spreadsheet still references the viewer node even
  when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
  the active viewer.

**Attribute**
* When a field is linked to the second input of the viewer node it is
  displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
  automatically. This does not work in all cases. It falls back to the
  face corner domain on meshes and the point domain on curves. When
  necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
  that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.

**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
  setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
  by disabling the "Viewer Node" option in the "View" menu.

**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
  is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
  field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
  attribute.
* The ground truth for the active viewer node is stored in the workspace
  now. Node editors, spreadsheets and viewports retrieve the active
  viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
  the viewed geometry of the corresponding object is part of the iterator
  instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
  to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
  existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
  "preferred domain" for every field input. If there is not exactly one
  preferred domain, the fallback is used.

Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
  added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
  the values might have to be normalized or some should be drawn as arrays.
  For now, we encourage users to build node groups that generate appropriate
  viewer-geometry. We might include some of that functionality in future 
versions.
  Support for displaying attribute values as text in the viewport is planned as 
well.
* There seems to be an issue with the attribute overlay for pointclouds on
  nvidia gpus, to be investigated.

Differential Revision: https://developer.blender.org/D15954

===

M   release/scripts/startup/bl_operators/spreadsheet.py
M   release/scripts/startup/bl_ui/space_spreadsheet.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/CMakeLists.txt
M   source/blender/blenkernel/BKE_duplilist.h
M   source/blender/blenkernel/BKE_geometry_fields.hh
A   source/blender/blenkernel/BKE_viewer_path.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/geometry_fields.cc
M   source/blender/blenkernel/intern/node.cc
M   source/blender/blenkernel/intern/object_dupli.cc
M   source/blender/blenkernel/intern/screen.c
A   source/blender/blenkernel/intern/viewer_path.cc
M   source/blender/blenkernel/intern/workspace.cc
M   source/blender/blenloader/intern/readfile.cc
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/versioning_300.cc
M   source/blender/depsgraph/DEG_depsgraph_query.h
M   

[Bf-blender-cvs] [8c95ab235fa] master: GPencil: Fix unreported bug for fill closing strokes

2022-09-28 Thread Antonio Vazquez
Commit: 8c95ab235fad748ba6f18b04a6d5cd17df9f0108
Author: Antonio Vazquez
Date:   Wed Sep 28 17:38:23 2022 +0200
Branches: master
https://developer.blender.org/rB8c95ab235fad748ba6f18b04a6d5cd17df9f0108

GPencil: Fix unreported bug for fill closing strokes

The extend lines were included in render by error
when the only collide option was ON.

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index b99274d66e5..60665898ffe 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -874,22 +874,22 @@ static void gpencil_update_extend(tGPDfill *tgpf)
 
 static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, bGPDstroke *gps)
 {
-  if (tgpf->is_render) {
-return true;
-  }
-
   const bool show_help = (tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) != 0;
   const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES) != 0;
   const bool is_extend = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_TAG);
   const bool is_extend_help = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_HELP);
   const bool is_line_mode = (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND);
   const bool only_collide = (tgpf->flag & GP_BRUSH_FILL_COLLIDE_ONLY) != 0;
-  const bool is_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
+  const bool stroke_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
 
-  if (is_line_mode && only_collide && tgpf->is_render && !is_collide) {
+  if (is_extend && is_line_mode && only_collide && tgpf->is_render && 
!stroke_collide) {
 return false;
   }
 
+  if (tgpf->is_render) {
+return true;
+  }
+
   if ((!show_help) && (show_extend)) {
 if (!is_extend && !is_extend_help) {
   return false;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2312915b962] master: Cleanup: Rename variables

2022-09-28 Thread Antonio Vazquez
Commit: 2312915b9620808d29e9b20529684800638d5a2a
Author: Antonio Vazquez
Date:   Wed Sep 28 17:41:08 2022 +0200
Branches: master
https://developer.blender.org/rB2312915b9620808d29e9b20529684800638d5a2a

Cleanup: Rename variables

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 60665898ffe..c99d003faf3 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -874,15 +874,16 @@ static void gpencil_update_extend(tGPDfill *tgpf)
 
 static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, bGPDstroke *gps)
 {
+  const bool is_line_mode = (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND);
   const bool show_help = (tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) != 0;
   const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES) != 0;
-  const bool is_extend = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_TAG);
-  const bool is_extend_help = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_HELP);
-  const bool is_line_mode = (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND);
-  const bool only_collide = (tgpf->flag & GP_BRUSH_FILL_COLLIDE_ONLY) != 0;
+  const bool is_extend_stroke = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_TAG);
+  const bool is_help_stroke = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & 
GP_STROKE_HELP);
+  const bool only_collide_strokes = (tgpf->flag & GP_BRUSH_FILL_COLLIDE_ONLY) 
!= 0;
   const bool stroke_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
 
-  if (is_extend && is_line_mode && only_collide && tgpf->is_render && 
!stroke_collide) {
+  if (is_line_mode && is_extend_stroke && only_collide_strokes && 
tgpf->is_render &&
+  !stroke_collide) {
 return false;
   }
 
@@ -891,13 +892,13 @@ static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, 
bGPDstroke *gps)
   }
 
   if ((!show_help) && (show_extend)) {
-if (!is_extend && !is_extend_help) {
+if (!is_extend_stroke && !is_help_stroke) {
   return false;
 }
   }
 
   if ((show_help) && (!show_extend)) {
-if (is_extend || is_extend_help) {
+if (is_extend_stroke || is_help_stroke) {
   return false;
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1f493125e30] master: MSVC: promote C4033 to an error

2022-09-28 Thread Ray Molenkamp
Commit: 1f493125e30d29f3bc0a295d667c770de2a0f2f5
Author: Ray Molenkamp
Date:   Wed Sep 28 08:32:56 2022 -0600
Branches: master
https://developer.blender.org/rB1f493125e30d29f3bc0a295d667c770de2a0f2f5

MSVC: promote C4033 to an error

C4033 'function' must return a value

is a MSVC level-1 warning, clang and GCC
treat this as an error however, this
change promotes it to an error as well
for MSVC to mimic the GCC behaviour.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8adf6c396f..68eb07e34f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1632,6 +1632,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
 "/we4013"  # 'function' undefined; assuming extern returning int
 "/we4133"  # incompatible pointer types
 "/we4431"  # missing type specifier - int assumed
+"/we4033"  # 'function' must return a value
   )
 
   string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0d1a7d1c1be] gpencil-new-data-proposal: Merge branch 'master' into gpencil-new-data-proposal

2022-09-28 Thread Antonio Vazquez
Commit: 0d1a7d1c1bea6ec2c18c893d263e2c458a302d30
Author: Antonio Vazquez
Date:   Wed Sep 28 16:30:51 2022 +0200
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB0d1a7d1c1bea6ec2c18c893d263e2c458a302d30

Merge branch 'master' into gpencil-new-data-proposal

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3f55121a185] master: GPencil: Fix compiler warning

2022-09-28 Thread Antonio Vazquez
Commit: 3f55121a185ab7259b319be98fcbb787f4ab842b
Author: Antonio Vazquez
Date:   Wed Sep 28 16:10:39 2022 +0200
Branches: master
https://developer.blender.org/rB3f55121a185ab7259b319be98fcbb787f4ab842b

GPencil: Fix compiler warning

===

M   source/blender/editors/gpencil/gpencil_fill.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index ba187080bab..b99274d66e5 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -887,7 +887,7 @@ static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, 
bGPDstroke *gps)
   const bool is_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
 
   if (is_line_mode && only_collide && tgpf->is_render && !is_collide) {
-return;
+return false;
   }
 
   if ((!show_help) && (show_extend)) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bb4e09ddc56] master: Fix compiler warnings with clang

2022-09-28 Thread Brecht Van Lommel
Commit: bb4e09ddc565b96684e280323cf4afcc2d39986f
Author: Brecht Van Lommel
Date:   Wed Sep 28 15:49:26 2022 +0200
Branches: master
https://developer.blender.org/rBbb4e09ddc565b96684e280323cf4afcc2d39986f

Fix compiler warnings with clang

This attribute only works on functions in clang, not function pointers.

===

M   source/blender/blenlib/BLI_compiler_attrs.h

===

diff --git a/source/blender/blenlib/BLI_compiler_attrs.h 
b/source/blender/blenlib/BLI_compiler_attrs.h
index 9ee626296cb..f0566e0b3e2 100644
--- a/source/blender/blenlib/BLI_compiler_attrs.h
+++ b/source/blender/blenlib/BLI_compiler_attrs.h
@@ -46,7 +46,7 @@
 #endif
 
 /* the function return value points to memory (2 args for 'size * tot') */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
 #  define ATTR_ALLOC_SIZE(args...) __attribute__((alloc_size(args)))
 #else
 #  define ATTR_ALLOC_SIZE(...)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fe19de5fcca] master: GPencil: Fill Tool - Check if extensions collide with real strokes

2022-09-28 Thread Antonio Vazquez
Commit: fe19de5fccac1a26bfe87bc41386791e5ee049f2
Author: Antonio Vazquez
Date:   Wed Sep 28 14:32:56 2022 +0200
Branches: master
https://developer.blender.org/rBfe19de5fccac1a26bfe87bc41386791e5ee049f2

GPencil: Fill Tool - Check if extensions collide with real strokes

This commit is an improvement in the previous fill tool
changes in order to improve how the extended strokes
are managed.

* Now, the algorithm checks if the extend cross a standard stroke, not only 
extend strokes.

* Option to enable or disable the stroke cross checking
because this can be slow in very complex scenes.

* Added `D` key to toggle stroke cross option.

* Option to use only collide strokes to be used as fill limit.

If the option to use only collide strokes is enabled, the
open extensions are in different color.

* Status text now shows mode and the actual extend factor.

This commits also contains a refactor of the loops
to use arrays as much as possible.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D16052

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_fill.c
M   source/blender/makesdna/DNA_brush_enums.h
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 95185c2a2f5..12e05840cfa 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1893,6 +1893,12 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_gap_closure(View3DPanel, Panel):
 row = col.row(align=True)
 row.prop(gp_settings, "show_fill_extend", text="Visual Aids")
 
+if gp_settings.fill_extend_mode == 'EXTEND':
+row = col.row(align=True)
+row.prop(gp_settings, "use_collide_strokes")
+row = col.row(align=True)
+row.prop(gp_settings, "use_collide_only")
+
 
 # Grease Pencil stroke sculpting tools
 class GreasePencilSculptPanel:
diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 79ce68f5aa1..ba187080bab 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -87,6 +87,8 @@ typedef struct tStroke {
   bGPDframe *gpf;
   /** Referenced stroke. */
   bGPDstroke *gps;
+  /** Array of 2D points */
+  float (*points2d)[2];
   /** Extreme Stroke A. */
   bGPDstroke *gps_ext_a;
   /** Extreme Stroke B. */
@@ -199,6 +201,7 @@ typedef struct tGPDfill {
 
 bool skip_layer_check(short fill_layer_mode, int gpl_active_index, int 
gpl_index);
 static void gpencil_draw_boundary_lines(const struct bContext *UNUSED(C), 
struct tGPDfill *tgpf);
+static void gpencil_fill_status_indicators(struct tGPDfill *tgpf);
 
 /* Free temp stroke array. */
 static void stroke_array_free(tGPDfill *tgpf)
@@ -206,6 +209,7 @@ static void stroke_array_free(tGPDfill *tgpf)
   if (tgpf->stroke_array) {
 for (int i = 0; i < tgpf->stroke_array_num; i++) {
   tStroke *stroke = tgpf->stroke_array[i];
+  MEM_SAFE_FREE(stroke->points2d);
   MEM_freeN(stroke);
 }
 MEM_SAFE_FREE(tgpf->stroke_array);
@@ -392,6 +396,9 @@ static void gpencil_load_array_strokes(tGPDfill *tgpf)
   continue;
 }
 
+float diff_mat[4][4];
+BKE_gpencil_layer_transform_matrix_get(tgpf->depsgraph, tgpf->ob, gpl, 
diff_mat);
+
 LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
   /* Check if stroke can be drawn. */
   if ((gps->points == NULL) || (gps->totpoints < 2)) {
@@ -407,13 +414,26 @@ static void gpencil_load_array_strokes(tGPDfill *tgpf)
 continue;
   }
 
-  tStroke *stroke = MEM_callocN(sizeof(tStroke), "temp stroke data");
+  tStroke *stroke = MEM_callocN(sizeof(tStroke), __func__);
   stroke->gpl = gpl;
   stroke->gpf = gpf;
   stroke->gps = gps;
 
   /* Create the extension strokes only for Lines. */
   if (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND) {
+/* Convert all points to 2D to speed up collision checks and avoid 
convert in each
+ * iteration. */
+stroke->points2d = (float(*)[2])MEM_mallocN(sizeof(*stroke->points2d) 
* gps->totpoints,
+"GP Stroke temp 2d 
points");
+
+for (int i = 0; i < gps->totpoints; i++) {
+  bGPDspoint *pt = >points[i];
+  bGPDspoint pt2;
+  gpencil_point_to_parent_space(pt, diff_mat, );
+  gpencil_point_to_xy_fl(
+  >gsc, gps, , >points2d[i][0], 
>points2d[i][1]);
+}
+
 /* Extend start. */
 bGPDspoint *pt1 = >points[0];
 stroke->gps_ext_a = BKE_gpencil_stroke_new(gps->mat_nr, 2, 
gps->thickness);
@@ -459,6 +479,21 @@ static void 

[Bf-blender-cvs] [e191cf89b28] master: Fix macOS cmake warning about missing OpenAL, after Python module changes

2022-09-28 Thread Brecht Van Lommel
Commit: e191cf89b280343d0bb04e76ddac7fd67a034205
Author: Brecht Van Lommel
Date:   Wed Sep 28 14:38:11 2022 +0200
Branches: master
https://developer.blender.org/rBe191cf89b280343d0bb04e76ddac7fd67a034205

Fix macOS cmake warning about missing OpenAL, after Python module changes

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 27fcaf823e8..2d1803ec376 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -36,10 +36,6 @@ endmacro()
 # 
 # Find system provided libraries.
 
-# Avoid searching for headers since this would otherwise override our lib
-# directory as well as PYTHON_ROOT_DIR.
-set(CMAKE_FIND_FRAMEWORK NEVER)
-
 # Find system ZLIB, not the pre-compiled one supplied with OpenCollada.
 set(ZLIB_ROOT /usr)
 find_package(ZLIB REQUIRED)
@@ -79,6 +75,10 @@ if(NOT EXISTS "${LIBDIR}/")
   message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
 endif()
 
+# Avoid searching for headers since this would otherwise override our lib
+# directory as well as PYTHON_ROOT_DIR.
+set(CMAKE_FIND_FRAMEWORK NEVER)
+
 # Optionally use system Python if PYTHON_ROOT_DIR is specified.
 if(WITH_PYTHON AND (WITH_PYTHON_MODULE AND PYTHON_ROOT_DIR))
   find_package(PythonLibsUnix REQUIRED)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [050b6498d30] master: Bump submodule versions

2022-09-28 Thread Sebastian Parborg
Commit: 050b6498d308f1d01096888e80b8aa5f99f1fee7
Author: Sebastian Parborg
Date:   Wed Sep 28 13:45:22 2022 +0200
Branches: master
https://developer.blender.org/rB050b6498d308f1d01096888e80b8aa5f99f1fee7

Bump submodule versions

===

M   release/datafiles/locale
M   release/scripts/addons
M   release/scripts/addons_contrib
M   source/tools

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 1b891478f44..7be7aff5a18 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 1b891478f44dd047c3a92fda3ebd17fae1c3acd3
+Subproject commit 7be7aff5a18c550465b3f7634539ed4168af7c51
diff --git a/release/scripts/addons b/release/scripts/addons
index 67f1fbca148..726d08c9036 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 67f1fbca1482d9d9362a4001332e785c3fd5d230
+Subproject commit 726d08c9036b939f46b59bceb72a61e3102600cc
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 95107484d07..c43c0b2bcf0 16
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 95107484d076bc965239942e857c83433bfa86d7
+Subproject commit c43c0b2bcf08c34d933c3b56f096c9a23c8eff68
diff --git a/source/tools b/source/tools
index 2a541f164a2..2ab59df2c98 16
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit 2a541f164a222ef7bcd036d37687738acee8d946
+Subproject commit 2ab59df2c987d383a7ed9dbcd4f3897bbba7c12b

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5270ac5ed87] master: Fix GC tracking error for instances of mathutils types

2022-09-28 Thread Campbell Barton
Commit: 5270ac5ed87fb5f9b5605fdc332f16ea0f7ee59d
Author: Campbell Barton
Date:   Wed Sep 28 16:09:12 2022 +1000
Branches: master
https://developer.blender.org/rB5270ac5ed87fb5f9b5605fdc332f16ea0f7ee59d

Fix GC tracking error for instances of mathutils types

Mathutils types were always GC tracked even when it wasn't intended.
Not having to track objects speeds up Python execution.

In an isolated benchmark created to stress test the GC
creating 4-million vectors (re-assigning them 100 times), this gives
an overall ~2.5x speedup, see: P3221.

Details:

Since [0] (which added support for sub-classed mathutils types)
tp_alloc was called which defaults to PyType_GenericAlloc which always
GC tracked the resulting object when Py_TPFLAGS_HAVE_GC was set.

Avoid using PyType_GenericAlloc unless the type is sub-classed,
in that case the object is un-tracked.

Add asserts that the tracked state is as expected before tracking &
un-tracking, to ensure changes to object creation don't cause objects
to be tracked unintentionally.

Also assign the PyTypeObject.tp_is_gc callback so types optionally GC
track objects only do so when an object is referenced.

[0]: fbd936494495d0de54eef24a97957e000306785f

===

M   source/blender/python/generic/idprop_py_api.c
M   source/blender/python/gpu/gpu_py_batch.c
M   source/blender/python/gpu/gpu_py_buffer.c
M   source/blender/python/intern/bpy_props.c
M   source/blender/python/intern/bpy_rna.c
M   source/blender/python/intern/bpy_rna_data.c
M   source/blender/python/mathutils/mathutils.c
M   source/blender/python/mathutils/mathutils.h
M   source/blender/python/mathutils/mathutils_Color.c
M   source/blender/python/mathutils/mathutils_Euler.c
M   source/blender/python/mathutils/mathutils_Matrix.c
M   source/blender/python/mathutils/mathutils_Quaternion.c
M   source/blender/python/mathutils/mathutils_Vector.c

===

diff --git a/source/blender/python/generic/idprop_py_api.c 
b/source/blender/python/generic/idprop_py_api.c
index 333ab9487d1..3978f7f37cc 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -909,6 +909,11 @@ static int BPy_IDGroup_Iter_clear(BPy_IDGroup_Iter *self)
   return 0;
 }
 
+static int BPy_IDGroup_Iter_is_gc(BPy_IDGroup_Iter *self)
+{
+  return (self->group != NULL);
+}
+
 static bool BPy_Group_Iter_same_size_or_raise_error(BPy_IDGroup_Iter *self)
 {
   if (self->len_init == self->group->prop->len) {
@@ -1000,6 +1005,7 @@ static void IDGroup_Iter_init_type(void)
   SHARED_MEMBER_SET(tp_flags, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC);
   SHARED_MEMBER_SET(tp_traverse, (traverseproc)BPy_IDGroup_Iter_traverse);
   SHARED_MEMBER_SET(tp_clear, (inquiry)BPy_IDGroup_Iter_clear);
+  SHARED_MEMBER_SET(tp_is_gc, (inquiry)BPy_IDGroup_Iter_is_gc);
   SHARED_MEMBER_SET(tp_iter, PyObject_SelfIter);
 
 #undef SHARED_MEMBER_SET
@@ -1015,6 +1021,7 @@ static PyObject *IDGroup_Iter_New_WithType(BPy_IDProperty 
*group,
   iter->group = group;
   if (group != NULL) {
 Py_INCREF(group);
+BLI_assert(!PyObject_GC_IsTracked((PyObject *)iter));
 PyObject_GC_Track(iter);
 iter->cur = (reversed ? group->prop->data.group.last : 
group->prop->data.group.first);
 iter->len_init = group->prop->len;
@@ -1086,6 +1093,11 @@ static int BPy_IDGroup_View_clear(BPy_IDGroup_View *self)
   return 0;
 }
 
+static int BPy_IDGroup_View_is_gc(BPy_IDGroup_View *self)
+{
+  return (self->group != NULL);
+}
+
 /* View Specific API's (Key/Value/Items). */
 
 static PyObject *BPy_Group_ViewKeys_iter(BPy_IDGroup_View *self)
@@ -1233,6 +1245,7 @@ static void IDGroup_View_init_type(void)
   SHARED_MEMBER_SET(tp_flags, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC);
   SHARED_MEMBER_SET(tp_traverse, (traverseproc)BPy_IDGroup_View_traverse);
   SHARED_MEMBER_SET(tp_clear, (inquiry)BPy_IDGroup_View_clear);
+  SHARED_MEMBER_SET(tp_is_gc, (inquiry)BPy_IDGroup_View_is_gc);
   SHARED_MEMBER_SET(tp_methods, BPy_IDGroup_View_methods);
 
 #undef SHARED_MEMBER_SET
@@ -2087,6 +2100,7 @@ static BPy_IDGroup_View 
*IDGroup_View_New_WithType(BPy_IDProperty *group, PyType
   iter->group = group;
   if (group != NULL) {
 Py_INCREF(group);
+BLI_assert(!PyObject_GC_IsTracked((PyObject *)iter));
 PyObject_GC_Track(iter);
   }
   return iter;
diff --git a/source/blender/python/gpu/gpu_py_batch.c 
b/source/blender/python/gpu/gpu_py_batch.c
index 879e1c0ce8b..a36b1dfd1b5 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -111,6 +111,7 @@ static PyObject *pygpu_batch__tp_new(PyTypeObject 
*UNUSED(type), PyObject *args,
 Py_INCREF(py_indexbuf);
   }
 
+  BLI_assert(!PyObject_GC_IsTracked((PyObject *)ret));
   PyObject_GC_Track(ret);
 #endif
 
@@ -273,6 +274,11 @@ static int pygpu_batch__tp_clear(BPyGPUBatch *self)
   return 

[Bf-blender-cvs] [ada2b9f6e43] master: Fix T101341: make nodegroups active input/output non-animatable

2022-09-28 Thread Philipp Oeser
Commit: ada2b9f6e43e687acba8b7b86394d3cc20eed291
Author: Philipp Oeser
Date:   Tue Sep 27 09:42:57 2022 +0200
Branches: master
https://developer.blender.org/rBada2b9f6e43e687acba8b7b86394d3cc20eed291

Fix T101341: make nodegroups active input/output non-animatable

Active UI list index is usually not animatable.
Here specifically, the active list index is oly used for operators acting
on a specific (active) socket.

Note other props here were already made non-animatable in
rB1d3b92bdeabc.

Maniphest Tasks: T101341

Differential Revision: https://developer.blender.org/D16077

===

M   source/blender/makesrna/intern/rna_nodetree.c

===

diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index bdf68dea67b..c9f63e7c315 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -12663,6 +12663,7 @@ static void rna_def_nodetree(BlenderRNA *brna)
   RNA_def_property_int_funcs(
   prop, "rna_NodeTree_active_input_get", "rna_NodeTree_active_input_set", 
NULL);
   RNA_def_property_ui_text(prop, "Active Input", "Index of the active input");
+  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_update(prop, NC_NODE, NULL);
 
   prop = RNA_def_property(srna, "outputs", PROP_COLLECTION, PROP_NONE);
@@ -12676,6 +12677,7 @@ static void rna_def_nodetree(BlenderRNA *brna)
   RNA_def_property_int_funcs(
   prop, "rna_NodeTree_active_output_get", 
"rna_NodeTree_active_output_set", NULL);
   RNA_def_property_ui_text(prop, "Active Output", "Index of the active 
output");
+  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_update(prop, NC_NODE, NULL);
 
   /* exposed as a function for runtime interface type properties */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs