[Bf-blender-cvs] [ac68dd8a4b5] refactor-mesh-hide-generic: Merge branch 'master' into refactor-mesh-hide-generic

2022-07-30 Thread Hans Goudey
Commit: ac68dd8a4b5e59b5500dbd1896b48458b080049e
Author: Hans Goudey
Date:   Sat Jul 30 22:44:03 2022 -0500
Branches: refactor-mesh-hide-generic
https://developer.blender.org/rBac68dd8a4b5e59b5500dbd1896b48458b080049e

Merge branch 'master' into refactor-mesh-hide-generic

===



===

diff --cc source/blender/blenkernel/intern/pbvh.c
index 0b2d0e51582,0ec7a79f890..7ac74103bf1
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@@ -3152,9 -3137,8 +3142,9 @@@ void pbvh_vertex_iter_init(PBVH *pbvh, 
}
  
vi->mask = NULL;
-   if (pbvh->type == PBVH_FACES) {
+   if (pbvh->header.type == PBVH_FACES) {
  vi->vert_normals = pbvh->vert_normals;
 +vi->hide_vert = pbvh->hide_vert;
  
  vi->vmask = CustomData_get_layer(pbvh->vdata, CD_PAINT_MASK);
}
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index 9bc38234a19,2366089cefb..20cc48f3d83
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -338,36 -341,34 +341,38 @@@ int SCULPT_active_face_set_get(SculptSe
return SCULPT_FACE_SET_NONE;
  }
  
- void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible)
+ void SCULPT_vertex_visible_set(SculptSession *ss, PBVHVertRef vertex, bool 
visible)
  {
switch (BKE_pbvh_type(ss->pbvh)) {
 -case PBVH_FACES:
 -  SET_FLAG_FROM_TEST(ss->mvert[vertex.i].flag, !visible, ME_HIDE);
 +case PBVH_FACES: {
 +  bool *hide_vert = BKE_pbvh_get_vert_hide_for_write(ss->pbvh);
-   hide_vert[index] = visible;
-   BKE_pbvh_vert_mark_update(ss->pbvh, index);
++  hide_vert[vertex.i] = visible;
+   BKE_pbvh_vert_mark_update(ss->pbvh, vertex);
break;
 +}
- case PBVH_BMESH:
-   BM_elem_flag_set(BM_vert_at_index(ss->bm, index), BM_ELEM_HIDDEN, 
!visible);
+ case PBVH_BMESH: {
+   BMVert *v = (BMVert *)vertex.i;
+   BM_elem_flag_set(v, BM_ELEM_HIDDEN, !visible);
break;
+ }
  case PBVH_GRIDS:
break;
}
  }
  
- bool SCULPT_vertex_visible_get(SculptSession *ss, int index)
+ bool SCULPT_vertex_visible_get(SculptSession *ss, PBVHVertRef vertex)
  {
switch (BKE_pbvh_type(ss->pbvh)) {
 -case PBVH_FACES:
 -  return !(ss->mvert[vertex.i].flag & ME_HIDE);
 +case PBVH_FACES: {
 +  const bool *hide_vert = BKE_pbvh_get_vert_hide(ss->pbvh);
-   return hide_vert == NULL || !hide_vert[index];
++  return hide_vert == NULL || !hide_vert[vertex.i];
 +}
  case PBVH_BMESH:
-   return !BM_elem_flag_test(BM_vert_at_index(ss->bm, index), 
BM_ELEM_HIDDEN);
+   return !BM_elem_flag_test((BMVert *)vertex.i, BM_ELEM_HIDDEN);
  case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
-   const int grid_index = index / key->grid_area;
-   const int vertex_index = index - grid_index * key->grid_area;
+   const int grid_index = vertex.i / key->grid_area;
+   const int vertex_index = vertex.i - grid_index * key->grid_area;
BLI_bitmap **grid_hidden = BKE_pbvh_get_grid_visibility(ss->pbvh);
if (grid_hidden && grid_hidden[grid_index]) {
  return !BLI_BITMAP_TEST(grid_hidden[grid_index], vertex_index);
diff --cc source/blender/editors/sculpt_paint/sculpt_undo.c
index a2758937e10,60739dad40f..eca663d21b9
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@@ -312,14 -312,15 +312,14 @@@ static bool sculpt_undo_restore_hidden(
SculptSession *ss = ob->sculpt;
SubdivCCG *subdiv_ccg = ss->subdiv_ccg;
  
 -  if (unode->maxvert) {
 -MVert *mvert = ss->mvert;
 +  bool *hide_vert = BKE_pbvh_get_vert_hide_for_write(ss->pbvh);
  
 +  if (unode->maxvert) {
  for (int i = 0; i < unode->totvert; i++) {
 -  MVert *v = [unode->index[i]];
 -  if ((BLI_BITMAP_TEST(unode->vert_hidden, i) != 0) != ((v->flag & 
ME_HIDE) != 0)) {
 +  if ((BLI_BITMAP_TEST(unode->vert_hidden, i) != 0) != hide_vert[i]) {
  BLI_BITMAP_FLIP(unode->vert_hidden, i);
 -v->flag ^= ME_HIDE;
 +hide_vert[i] = !hide_vert[i];
- BKE_pbvh_vert_mark_update(ss->pbvh, unode->index[i]);
+ BKE_pbvh_vert_mark_update(ss->pbvh, 
BKE_pbvh_make_vref(unode->index[i]));
}
  }
}

___
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] [8ebcb9885ad] refactor-mesh-bevel-weight-generic: Merge branch 'master' into refactor-mesh-bevel-weight-generic

2022-07-30 Thread Hans Goudey
Commit: 8ebcb9885adcbed59efb7c546c8b4879238f35fe
Author: Hans Goudey
Date:   Sat Jul 30 19:45:07 2022 -0500
Branches: refactor-mesh-bevel-weight-generic
https://developer.blender.org/rB8ebcb9885adcbed59efb7c546c8b4879238f35fe

Merge branch 'master' into refactor-mesh-bevel-weight-generic

===



===



___
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] [ca7e09f7fc2] soc-2022-many-lights-sampling: Cycles: light tree adaptive splitting with weighted reservoir

2022-07-30 Thread Jeffrey Liu
Commit: ca7e09f7fc2d2beb4259aef9b48a1d368a72d249
Author: Jeffrey Liu
Date:   Sat Jul 30 18:12:12 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBca7e09f7fc2d2beb4259aef9b48a1d368a72d249

Cycles: light tree adaptive splitting with weighted reservoir

This doesn't change anything on the user side, but finally takes the
splitting threshold into consideration. Good for edge cases where the
importance heuristic is not accurate enough.

Currently implemented using a stack size of 32, and using the weighted
reservoir sampling technique. Right now, weights are uniform from
adaptive splitting, but plans are to actually take an actual light
sample for better weighting.

===

M   intern/cycles/kernel/light/light_tree.h

===

diff --git a/intern/cycles/kernel/light/light_tree.h 
b/intern/cycles/kernel/light/light_tree.h
index 4c39c97060e..8e84d5a6fdb 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -4,6 +4,9 @@
 
 CCL_NAMESPACE_BEGIN
 
+/* to-do: this seems like a relative expensive computation, and we can make it 
a lot cheaper
+ * by using a bounding sphere instead of a bounding box. This will be more 
inaccurate, but it
+ * might be fine when used along with the adaptive splitting. */
 ccl_device float light_tree_bounding_box_angle(const float3 bbox_min,
const float3 bbox_max,
const float3 P,
@@ -77,6 +80,15 @@ ccl_device float light_tree_node_importance(const float3 P,
   return importance;
 }
 
+/* This is uniformly sampling the reservoir for now. */
+ccl_device float light_tree_emitter_reservoir_weight(KernelGlobals kg,
+ const float3 P,
+ const float3 N,
+ int emitter_index)
+{
+  return 1.0f;
+}
+
 ccl_device float light_tree_emitter_importance(KernelGlobals kg,
const float3 P,
const float3 N,
@@ -100,6 +112,40 @@ ccl_device float 
light_tree_emitter_importance(KernelGlobals kg,
   P, N, bbox_min, bbox_max, bcone_axis, kemitter->theta_o, 
kemitter->theta_e, kemitter->energy);
 }
 
+/* to-do: this is using a lot of the same calculations as the cluster 
importance,
+ * so it may be better to compute these once and then hold on to it somewhere. 
*/
+ccl_device float light_tree_should_split(KernelGlobals kg,
+ const float3 P,
+ const ccl_global KernelLightTreeNode 
*knode)
+{
+  const float3 bbox_min = make_float3(
+  knode->bounding_box_min[0], knode->bounding_box_min[1], 
knode->bounding_box_min[2]);
+  const float3 bbox_max = make_float3(
+  knode->bounding_box_max[0], knode->bounding_box_max[1], 
knode->bounding_box_max[2]);
+  const float3 centroid = 0.5f * bbox_min + 0.5f * bbox_max;
+
+  const float radius = len(bbox_max - centroid);
+  const float distance = len(P - centroid);
+
+  if (distance < radius) {
+return true;
+  }
+
+  const float a = distance - radius;
+  const float b = distance + radius;
+
+  const float E_g = 1.0f / (a * b);
+  const float E_e = knode->energy;
+
+  /* This is a simplified version of the expression given in the paper. */
+  const float V_g = (b - a) * (b - a) * E_g * E_g * E_g / 3.0f;
+  const float V_e = knode->energy_variance;
+
+  const float total_variance = V_e * V_g + V_e * E_g * E_g + E_e * E_e * V_g;
+  const float normalized_variance = sqrt(sqrt(1.0f / (1.0f + 
sqrt(total_variance;
+  return (normalized_variance < kernel_data.integrator.splitting_threshold);
+}
+
 ccl_device float light_tree_cluster_importance(KernelGlobals kg,
const float3 P,
const float3 N,
@@ -117,10 +163,51 @@ ccl_device float 
light_tree_cluster_importance(KernelGlobals kg,
   P, N, bbox_min, bbox_max, bcone_axis, knode->theta_o, knode->theta_e, 
knode->energy);
 }
 
+ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
+ float *randu,
+ const float3 P,
+ const float3 N,
+ const ccl_global 
KernelLightTreeNode *knode,
+ float *pdf_factor)
+{
+  /* Right now, sampling is done by incrementing the CDF by the PDF.
+   * However, we first need to calculate the total importance so that we can 
normalize the CDF. */
+  float total_emitter_importance = 0.0f;
+  for (int i = 0; i < knode->num_prims; 

[Bf-blender-cvs] [015dbb494bd] soc-2022-many-lights-sampling: Merge branch 'master' into soc-2022-many-lights-sampling

2022-07-30 Thread Jeffrey Liu
Commit: 015dbb494bd2b1d52dd7ff3d2ea035db3de72331
Author: Jeffrey Liu
Date:   Sat Jul 30 18:15:11 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB015dbb494bd2b1d52dd7ff3d2ea035db3de72331

Merge branch 'master' into soc-2022-many-lights-sampling

===



===



___
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] [3c5620aabd3] master: Cleanup: Move interface_region_tooltip.c and header to C++

2022-07-30 Thread Hans Goudey
Commit: 3c5620aabd33c39caa48192e978d0bf237b5b59b
Author: Hans Goudey
Date:   Sat Jul 30 16:40:41 2022 -0500
Branches: master
https://developer.blender.org/rB3c5620aabd33c39caa48192e978d0bf237b5b59b

Cleanup: Move interface_region_tooltip.c and header to C++

===

M   source/blender/editors/interface/CMakeLists.txt
M   source/blender/editors/interface/interface_region_menu_pie.cc
M   source/blender/editors/interface/interface_region_menu_popup.cc
M   source/blender/editors/interface/interface_region_popover.cc
M   source/blender/editors/interface/interface_region_popup.cc
M   source/blender/editors/interface/interface_region_search.cc
R067source/blender/editors/interface/interface_region_tooltip.c 
source/blender/editors/interface/interface_region_tooltip.cc
M   source/blender/editors/interface/interface_regions.cc
R060source/blender/editors/interface/interface_regions_intern.h 
source/blender/editors/interface/interface_regions_intern.hh

===

diff --git a/source/blender/editors/interface/CMakeLists.txt 
b/source/blender/editors/interface/CMakeLists.txt
index 56a639920a7..c54bcad905f 100644
--- a/source/blender/editors/interface/CMakeLists.txt
+++ b/source/blender/editors/interface/CMakeLists.txt
@@ -57,7 +57,7 @@ set(SRC
   interface_region_popover.cc
   interface_region_popup.cc
   interface_region_search.cc
-  interface_region_tooltip.c
+  interface_region_tooltip.cc
   interface_regions.cc
   interface_style.cc
   interface_template_asset_view.cc
@@ -83,7 +83,7 @@ set(SRC
 
   eyedroppers/eyedropper_intern.h
   interface_intern.h
-  interface_regions_intern.h
+  interface_regions_intern.hh
 )
 
 set(LIB
diff --git a/source/blender/editors/interface/interface_region_menu_pie.cc 
b/source/blender/editors/interface/interface_region_menu_pie.cc
index 8572e938b30..becdfaf4e25 100644
--- a/source/blender/editors/interface/interface_region_menu_pie.cc
+++ b/source/blender/editors/interface/interface_region_menu_pie.cc
@@ -37,7 +37,7 @@
 #include "ED_screen.h"
 
 #include "interface_intern.h"
-#include "interface_regions_intern.h"
+#include "interface_regions_intern.hh"
 
 /*  */
 /** \name Pie Menu
diff --git a/source/blender/editors/interface/interface_region_menu_popup.cc 
b/source/blender/editors/interface/interface_region_menu_popup.cc
index a22f7218203..0647e1a4a70 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.cc
+++ b/source/blender/editors/interface/interface_region_menu_popup.cc
@@ -39,7 +39,7 @@
 #include "ED_screen.h"
 
 #include "interface_intern.h"
-#include "interface_regions_intern.h"
+#include "interface_regions_intern.hh"
 
 /*  */
 /** \name Utility Functions
diff --git a/source/blender/editors/interface/interface_region_popover.cc 
b/source/blender/editors/interface/interface_region_popover.cc
index 2e10261a4f7..c152a9aacd5 100644
--- a/source/blender/editors/interface/interface_region_popover.cc
+++ b/source/blender/editors/interface/interface_region_popover.cc
@@ -46,7 +46,7 @@
 #include "UI_interface.h"
 
 #include "interface_intern.h"
-#include "interface_regions_intern.h"
+#include "interface_regions_intern.hh"
 
 /*  */
 /** \name Popup Menu with Callback or String
diff --git a/source/blender/editors/interface/interface_region_popup.cc 
b/source/blender/editors/interface/interface_region_popup.cc
index 74c228e3338..f6b078c033e 100644
--- a/source/blender/editors/interface/interface_region_popup.cc
+++ b/source/blender/editors/interface/interface_region_popup.cc
@@ -31,7 +31,7 @@
 #include "ED_screen.h"
 
 #include "interface_intern.h"
-#include "interface_regions_intern.h"
+#include "interface_regions_intern.hh"
 
 /*  */
 /** \name Utility Functions
diff --git a/source/blender/editors/interface/interface_region_search.cc 
b/source/blender/editors/interface/interface_region_search.cc
index 81c0c29d09a..f04229609f9 100644
--- a/source/blender/editors/interface/interface_region_search.cc
+++ b/source/blender/editors/interface/interface_region_search.cc
@@ -41,7 +41,7 @@
 
 #include "GPU_state.h"
 #include "interface_intern.h"
-#include "interface_regions_intern.h"
+#include "interface_regions_intern.hh"
 
 #define MENU_BORDER (int)(0.3f * U.widget_unit)
 
diff --git a/source/blender/editors/interface/interface_region_tooltip.c 
b/source/blender/editors/interface/interface_region_tooltip.cc
similarity index 67%
rename from source/blender/editors/interface/interface_region_tooltip.c
rename to source/blender/editors/interface/interface_region_tooltip.cc
index f460a159a5f..e18d23c8a1c 100644
--- 

[Bf-blender-cvs] [e255e5445c7] temp-sculpt-normals-masking: temp-sculpt-normals-masking: Remove unwanted formatting changes

2022-07-30 Thread Joseph Eagar
Commit: e255e5445c71bb93e32038c8cd581770e59147e2
Author: Joseph Eagar
Date:   Sat Jul 30 11:34:38 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rBe255e5445c71bb93e32038c8cd581770e59147e2

temp-sculpt-normals-masking: Remove unwanted formatting changes

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 25c05445415..470b78ae558 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -25,15 +25,14 @@ def kmi_to_string_or_none(kmi):
 
 
 def generate_from_enum_ex(
-_context,
-*,
-idname_prefix,
-icon_prefix,
-type,
-attr,
-cursor="DEFAULT",
-tooldef_keywords={},
-exclude_filter={}
+_context, *,
+idname_prefix,
+icon_prefix,
+type,
+attr,
+cursor='DEFAULT',
+tooldef_keywords={},
+exclude_filter={}
 ):
 tool_defs = []
 for enum in type.bl_rna.properties[attr].enum_items_static:
@@ -79,15 +78,16 @@ class _defs_view3d_generic:
 props = tool.operator_properties("view3d.cursor3d")
 layout.prop(props, "use_depth")
 layout.prop(props, "orientation")
-
 return dict(
 idname="builtin.cursor",
 label="Cursor",
-description=("Set the cursor location, drag to transform"),
+description=(
+"Set the cursor location, drag to transform"
+),
 icon="ops.generic.cursor",
 keymap="3D View Tool: Cursor",
 draw_settings=draw_settings,
-options={"KEYMAP_FALLBACK"},
+options={'KEYMAP_FALLBACK'},
 )
 
 @ToolDef.from_fn
@@ -119,7 +119,6 @@ class _defs_view3d_generic:
 kmi_to_string_or_none(kmi_add),
 kmi_to_string_or_none(kmi_remove),
 )
-
 return dict(
 idname="builtin.measure",
 label="Measure",
@@ -127,11 +126,12 @@ class _defs_view3d_generic:
 icon="ops.view3d.ruler",
 widget="VIEW3D_GGT_ruler",
 keymap="3D View Tool: Measure",
-options={"KEYMAP_FALLBACK"},
+options={'KEYMAP_FALLBACK'},
 )
 
 
 class _defs_annotate:
+
 def draw_settings_common(context, layout, tool):
 gpd = context.annotation_data
 region_type = context.region.type
@@ -141,15 +141,15 @@ class _defs_annotate:
 text = gpd.layers.active_note
 maxw = 25
 if len(text) > maxw:
-text = text[: maxw - 5] + ".." + text[-3:]
+text = text[:maxw - 5] + '..' + text[-3:]
 else:
 text = ""
 
 gpl = context.active_annotation_layer
 if gpl is not None:
 layout.label(text="Annotation:")
-if context.space_data.type in {"VIEW_3D", "SEQUENCE_EDITOR"}:
-if region_type == "TOOL_HEADER":
+if context.space_data.type in {'VIEW_3D', 'SEQUENCE_EDITOR'}:
+if region_type == 'TOOL_HEADER':
 sub = layout.split(align=True, factor=0.5)
 sub.ui_units_x = 6.5
 sub.prop(gpl, "color", text="")
@@ -166,30 +166,21 @@ class _defs_annotate:
 space_type = tool.space_type
 tool_settings = context.tool_settings
 
-if space_type == "VIEW_3D":
+if space_type == 'VIEW_3D':
 row = layout.row(align=True)
-row.prop(
-tool_settings, "annotation_stroke_placement_view3d", 
text="Placement"
-)
-if tool_settings.gpencil_stroke_placement_view3d == "CURSOR":
+row.prop(tool_settings, "annotation_stroke_placement_view3d", 
text="Placement")
+if tool_settings.gpencil_stroke_placement_view3d == 'CURSOR':
 row.prop(tool_settings.gpencil_sculpt, "lockaxis")
-elif tool_settings.gpencil_stroke_placement_view3d in {"SURFACE", 
"STROKE"}:
+elif tool_settings.gpencil_stroke_placement_view3d in {'SURFACE', 
'STROKE'}:
 row.prop(tool_settings, "use_gpencil_stroke_endpoints")
 
-elif space_type in {
-"IMAGE_EDITOR",
-"NODE_EDITOR",
-"SEQUENCE_EDITOR",
-"CLIP_EDITOR",
-}:
+elif space_type in {'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 
'CLIP_EDITOR'}:
 row = layout.row(align=True)
-row.prop(
-tool_settings, "annotation_stroke_placement_view2d", 
text="Placement"
-)
+

[Bf-blender-cvs] [6bfbdc4bff8] temp-sculpt-normals-masking: temp-sculpt-normals-masking: Make occlusion suboption of view normal

2022-07-30 Thread Joseph Eagar
Commit: 6bfbdc4bff8a54d8f9426c3e05d3a44aa09e434d
Author: Joseph Eagar
Date:   Sat Jul 30 11:31:06 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rB6bfbdc4bff8a54d8f9426c3e05d3a44aa09e434d

temp-sculpt-normals-masking: Make occlusion suboption of view normal

===

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/editors/sculpt_paint/sculpt_automasking.cc

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 47c38d116f8..4b5da913fe2 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -947,13 +947,13 @@ def brush_settings_advanced(layout, context, brush, 
popover=False):
 
 col.prop(brush, "use_automasking_start_normal", text="Area Normal")
 col.prop(brush, "use_automasking_view_normal", text="View Normal")
-col.prop(brush, "use_automasking_view_occlusion", text="Occlusion")
 
 sculpt = context.tool_settings.sculpt
 
 if brush.use_automasking_start_normal:
 col.separator()
 
+col.prop(brush, "use_automasking_view_occlusion", text="Occlusion")
 col.prop(sculpt, "automasking_start_normal_limit")
 col.prop(sculpt, "automasking_start_normal_falloff")
 
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index e69d106374a..64add640fd0 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5475,7 +5475,6 @@ class VIEW3D_MT_sculpt_automasking_pie(Menu):
 pie.prop(sculpt, "use_automasking_boundary_edges", text="Mesh 
Boundary")
 pie.prop(sculpt, "use_automasking_start_normal", text="Area Normal")
 pie.prop(sculpt, "use_automasking_view_normal", text="View Normal")
-pie.prop(sculpt, "use_automasking_view_occlusion", text="Occlusion")
 
 
 class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 7b1b02ef905..9358e1f5a05 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -972,8 +972,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 col.prop(sculpt, "use_automasking_boundary_edges", text="Mesh 
Boundary")
 col.prop(sculpt, "use_automasking_start_normal", text="Area Normal")
 col.prop(sculpt, "use_automasking_view_normal", text="View Normal")
-col.prop(sculpt, "use_automasking_view_occlusion", text="Occlusion")
-
+
 if sculpt.use_automasking_start_normal:
 col.separator()
 
@@ -983,6 +982,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 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")
 
diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc 
b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index 004fba98b68..36f0b4bf3c8 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -93,9 +93,6 @@ bool SCULPT_is_automasking_enabled(const Sculpt *sd, const 
SculptSession *ss, co
   if (SCULPT_is_automasking_mode_enabled(sd, br, 
BRUSH_AUTOMASKING_VIEW_NORMAL)) {
 return true;
   }
-  if (SCULPT_is_automasking_mode_enabled(sd, br, 
BRUSH_AUTOMASKING_VIEW_OCCLUSION)) {
-return true;
-  }
   return false;
 }
 
@@ -126,7 +123,7 @@ static float 
sculpt_automasking_normal_calc(AutomaskingCache *automasking,
 {
   float normal_v[3];
 
-  if (automask_data->orig_data.no) {
+  if (automask_data->have_orig_data) {
 copy_v3_v3(normal_v, automask_data->orig_data.no);
   }
   else {
@@ -162,8 +159,7 @@ static bool SCULPT_automasking_needs_factors_cache(const 
Sculpt *sd, const Brush
   if (automasking_flags & (BRUSH_AUTOMASKING_BOUNDARY_EDGES,
BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS,
BRUSH_AUTOMASKING_BRUSH_NORMAL,
-   BRUSH_AUTOMASKING_VIEW_NORMAL,
-   BRUSH_AUTOMASKING_VIEW_OCCLUSION)) {
+   BRUSH_AUTOMASKING_VIEW_NORMAL)) {
 return brush && brush->automasking_boundary_edges_propagation_steps != 1;
   }
   return false;
@@ -250,8 +246,10 @@ float 

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

2022-07-30 Thread Joseph Eagar
Commit: 447425ad991b99b3dcc7fba501c42027b9a80cdd
Author: Joseph Eagar
Date:   Sat Jul 30 11:18:40 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rB447425ad991b99b3dcc7fba501c42027b9a80cdd

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

===



===

diff --cc source/blender/editors/sculpt_paint/sculpt.c
index c28b426051d,2366089cefb..3f978c19e47
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -2361,13 -2397,12 +2397,13 @@@ static float brush_strength(const Sculp
  float SCULPT_brush_strength_factor(SculptSession *ss,
 const Brush *br,
 const float brush_point[3],
-const float len,
+float len,
 const float vno[3],
 const float fno[3],
-const float mask,
-const int vertex_index,
+float mask,
+const PBVHVertRef vertex,
 -   int thread_id)
 +   const int thread_id,
 +   AutomaskingNodeData *automask_data)
  {
StrokeCache *cache = ss->cache;
const Scene *scene = cache->vc->scene;
@@@ -2451,7 -2486,7 +2487,7 @@@
avg *= 1.0f - mask;
  
/* Auto-masking. */
-   avg *= SCULPT_automasking_factor_get(cache->automasking, ss, vertex_index, 
automask_data);
 -  avg *= SCULPT_automasking_factor_get(cache->automasking, ss, vertex);
++  avg *= SCULPT_automasking_factor_get(cache->automasking, ss, vertex, 
automask_data);
  
return avg;
  }
@@@ -3040,9 -3075,8 +3076,9 @@@ static void do_gravity_task_cb_ex(void 
  vd.no,
  vd.fno,
  vd.mask ? *vd.mask : 0.0f,
- vd.index,
+ vd.vertex,
 -thread_id);
 +thread_id,
 +NULL);
  
  mul_v3_v3fl(proxy[vd.i], offset, fade);
  
@@@ -5913,69 -5962,4 +5964,68 @@@ void SCULPT_fake_neighbors_free(Object 
sculpt_pose_fake_neighbors_free(ss);
  }
  
 +void SCULPT_automasking_node_begin(Object *ob,
 +   const SculptSession *ss,
 +   AutomaskingCache *automasking,
 +   AutomaskingNodeData *node_data,
 +   PBVHNode *node)
 +{
 +  if (!automasking) {
 +memset(node_data, 0, sizeof(*node_data));
 +return;
 +  }
 +
 +  node_data->node = node;
 +  node_data->have_orig_data = automasking->settings.flags &
 +  (BRUSH_AUTOMASKING_BRUSH_NORMAL | 
BRUSH_AUTOMASKING_VIEW_NORMAL);
 +
 +  if (node_data->have_orig_data) {
 +SCULPT_orig_vert_data_init(_data->orig_data, ob, node, 
SCULPT_UNDO_COORDS);
 +  }
 +  else {
 +memset(_data->orig_data, 0, sizeof(node_data->orig_data));
 +  }
 +}
 +
 +void SCULPT_automasking_node_update(SculptSession *ss,
 +AutomaskingNodeData *automask_data,
 +PBVHVertexIter *vd)
 +{
 +  if (automask_data->have_orig_data) {
 +SCULPT_orig_vert_data_update(_data->orig_data, vd);
 +  }
 +}
 +
- bool SCULPT_vertex_is_occluded(SculptSession *ss, int vertex, bool original)
++bool SCULPT_vertex_is_occluded(SculptSession *ss, PBVHVertRef vertex, bool 
original)
 +{
 +  float ray_start[3], ray_end[3], ray_normal[3], face_normal[3];
 +  float co[3];
 +
 +  copy_v3_v3(co, SCULPT_vertex_co_get(ss, vertex));
 +  float mouse[2];
 +
 +  ED_view3d_project_float_v2_m4(ss->cache->vc->region, co, mouse, 
ss->cache->projection_mat);
 +
-   int depth = SCULPT_raycast_init(
-   ss->cache->vc, mouse, ray_end, ray_start, ray_normal, original);
++  int depth = SCULPT_raycast_init(ss->cache->vc, mouse, ray_end, ray_start, 
ray_normal, original);
 +
 +  negate_v3(ray_normal);
 +
 +  copy_v3_v3(ray_start, SCULPT_vertex_co_get(ss, vertex));
 +  madd_v3_v3fl(ray_start, ray_normal, 0.002);
 +
 +  SculptRaycastData srd = {0};
 +  srd.original = original;
 +  srd.ss = ss;
 +  srd.hit = false;
 +  srd.ray_start = ray_start;
 +  srd.ray_normal = ray_normal;
 +  srd.depth = depth;
 +  srd.face_normal = face_normal;
 +
 +  isect_ray_tri_watertight_v3_precalc(_precalc, ray_normal);
 +  BKE_pbvh_raycast(ss->pbvh, sculpt_raycast_cb, , ray_start, ray_normal, 
srd.original);
 

[Bf-blender-cvs] [af6f0f17574] master: Fix failing blenlib test from previous commit

2022-07-30 Thread Harley Acheson
Commit: af6f0f17574d52316da7a3ab1dfa14ff4b003743
Author: Harley Acheson
Date:   Sat Jul 30 09:27:32 2022 -0700
Branches: master
https://developer.blender.org/rBaf6f0f17574d52316da7a3ab1dfa14ff4b003743

Fix failing blenlib test from previous commit

Commit 310be2e37cfb did not update UI_MENU_ARROW_SEP used in tests.

===

M   source/blender/blenlib/tests/BLI_string_search_test.cc

===

diff --git a/source/blender/blenlib/tests/BLI_string_search_test.cc 
b/source/blender/blenlib/tests/BLI_string_search_test.cc
index aa6adae8d76..ab1d073ed33 100644
--- a/source/blender/blenlib/tests/BLI_string_search_test.cc
+++ b/source/blender/blenlib/tests/BLI_string_search_test.cc
@@ -9,7 +9,7 @@
 namespace blender::string_search::tests {
 
 /* Right arrow, keep in sync with #UI_MENU_ARROW_SEP in `UI_interface.h`. */
-#define UI_MENU_ARROW_SEP "\xe2\x96\xb6"
+#define UI_MENU_ARROW_SEP "\xe2\x96\xb8"
 
 TEST(string_search, damerau_levenshtein_distance)
 {

___
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] [310be2e37cf] master: UI: UI_MENU_ARROW_SEP Unicode Character

2022-07-30 Thread Harley Acheson
Commit: 310be2e37cfb756da67806c0a0babb9ff472b803
Author: Harley Acheson
Date:   Sat Jul 30 07:54:12 2022 -0700
Branches: master
https://developer.blender.org/rB310be2e37cfb756da67806c0a0babb9ff472b803

UI: UI_MENU_ARROW_SEP Unicode Character

Use a smaller arrow text character as menu item separator.

See D15578 for examples and details.

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

Reviewed by Julian Eisel

===

M   source/blender/blenlib/intern/string_search.cc
M   source/blender/editors/include/UI_interface.h

===

diff --git a/source/blender/blenlib/intern/string_search.cc 
b/source/blender/blenlib/intern/string_search.cc
index 14d85b99739..31ea24eb494 100644
--- a/source/blender/blenlib/intern/string_search.cc
+++ b/source/blender/blenlib/intern/string_search.cc
@@ -11,8 +11,8 @@
 #include "BLI_timeit.hh"
 
 /* Right arrow, keep in sync with #UI_MENU_ARROW_SEP in `UI_interface.h`. */
-#define UI_MENU_ARROW_SEP "\xe2\x96\xb6"
-#define UI_MENU_ARROW_SEP_UNICODE 0x25b6
+#define UI_MENU_ARROW_SEP "\xe2\x96\xb8"
+#define UI_MENU_ARROW_SEP_UNICODE 0x25b8
 
 namespace blender::string_search {
 
diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index afef516b245..163ea7e9493 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -85,7 +85,7 @@ typedef struct uiViewItemHandle uiViewItemHandle;
 
 /* Separator for text in search menus (right pointing arrow).
  * keep in sync with `string_search.cc`. */
-#define UI_MENU_ARROW_SEP "\xe2\x96\xb6"
+#define UI_MENU_ARROW_SEP "\xe2\x96\xb8"
 
 /* names */
 #define UI_MAX_DRAW_STR 400

___
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] [a5814607289] master: UV: Add options for uv select similar in island mode

2022-07-30 Thread Chris Blackbourn
Commit: a5814607289a7e01d4844ee5ef724e6388cf044e
Author: Chris Blackbourn
Date:   Sat Jul 30 23:20:13 2022 +1200
Branches: master
https://developer.blender.org/rBa5814607289a7e01d4844ee5ef724e6388cf044e

UV: Add options for uv select similar in island mode

In island selection mode, add new options for uv select similar:

* Area UV
* Area 3D
* Face (number of faces in island)

See also https://developer.blender.org/T47437
Differential Revision: https://developer.blender.org/D15553

===

M   source/blender/editors/include/ED_uvedit.h
M   source/blender/editors/uvedit/uvedit_islands.c
M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/include/ED_uvedit.h 
b/source/blender/editors/include/ED_uvedit.h
index 80a75da27f8..24d6819536d 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -305,6 +305,29 @@ void ED_uvedit_buttons_register(struct ARegionType *art);
 
 /* uvedit_islands.c */
 
+struct FaceIsland {
+  struct FaceIsland *next;
+  struct FaceIsland *prev;
+  struct BMFace **faces;
+  int faces_len;
+  rctf bounds_rect;
+  /**
+   * \note While this is duplicate information,
+   * it allows islands from multiple meshes to be stored in the same list.
+   */
+  uint cd_loop_uv_offset;
+  float aspect_y;
+};
+
+int bm_mesh_calc_uv_islands(const Scene *scene,
+struct BMesh *bm,
+ListBase *island_list,
+const bool only_selected_faces,
+const bool only_selected_uvs,
+const bool use_seams,
+const float aspect_y,
+const uint cd_loop_uv_offset);
+
 struct UVMapUDIM_Params {
   const struct Image *image;
   /** Copied from #SpaceImage.tile_grid_shape */
diff --git a/source/blender/editors/uvedit/uvedit_islands.c 
b/source/blender/editors/uvedit/uvedit_islands.c
index 9a31fd6469d..2afc60a4b5c 100644
--- a/source/blender/editors/uvedit/uvedit_islands.c
+++ b/source/blender/editors/uvedit/uvedit_islands.c
@@ -309,23 +309,8 @@ static float uv_nearest_grid_tile_distance(const int 
udim_grid[2],
 
 /*  */
 /** \name Calculate UV Islands
- *
- * \note Currently this is a private API/type, it could be made public.
  * \{ */
 
-struct FaceIsland {
-  struct FaceIsland *next, *prev;
-  BMFace **faces;
-  int faces_len;
-  rctf bounds_rect;
-  /**
-   * \note While this is duplicate information,
-   * it allows islands from multiple meshes to be stored in the same list.
-   */
-  uint cd_loop_uv_offset;
-  float aspect_y;
-};
-
 struct SharedUVLoopData {
   uint cd_loop_uv_offset;
   bool use_seams;
@@ -347,14 +332,14 @@ static bool bm_loop_uv_shared_edge_check(const BMLoop 
*l_a, const BMLoop *l_b, v
 /**
  * Calculate islands and add them to \a island_list returning the number of 
items added.
  */
-static int bm_mesh_calc_uv_islands(const Scene *scene,
-   BMesh *bm,
-   ListBase *island_list,
-   const bool only_selected_faces,
-   const bool only_selected_uvs,
-   const bool use_seams,
-   const float aspect_y,
-   const uint cd_loop_uv_offset)
+int bm_mesh_calc_uv_islands(const Scene *scene,
+BMesh *bm,
+ListBase *island_list,
+const bool only_selected_faces,
+const bool only_selected_uvs,
+const bool use_seams,
+const float aspect_y,
+const uint cd_loop_uv_offset)
 {
   int island_added = 0;
   BM_mesh_elem_table_ensure(bm, BM_FACE);
diff --git a/source/blender/editors/uvedit/uvedit_select.c 
b/source/blender/editors/uvedit/uvedit_select.c
index d59dcb4f4ed..b1ed00e2c57 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -81,6 +81,7 @@ static void uv_select_tag_update_for_object(Depsgraph 
*depsgraph,
 typedef enum {
   UV_SSIM_AREA_UV = 1000,
   UV_SSIM_AREA_3D,
+  UV_SSIM_FACE,
   UV_SSIM_LENGTH_UV,
   UV_SSIM_LENGTH_3D,
   UV_SSIM_SIDES,
@@ -4638,6 +4639,33 @@ static float get_uv_face_needle(const eUVSelectSimilar 
type,
   return result;
 }
 
+static float get_uv_island_needle(const eUVSelectSimilar type,
+  const struct FaceIsland *island,
+  const float ob_m3[3][3],
+  const int cd_loop_uv_offset)
+
+{
+  float result = 0.0f;
+  switch (type) {
+case 

[Bf-blender-cvs] [d31886b3fe3] master: Cleanup: braces around statements in OBJ parser

2022-07-30 Thread Aras Pranckevicius
Commit: d31886b3fe3b939fb86079d5fb607e80103078da
Author: Aras Pranckevicius
Date:   Sat Jul 30 13:10:35 2022 +0300
Branches: master
https://developer.blender.org/rBd31886b3fe3b939fb86079d5fb607e80103078da

Cleanup: braces around statements in OBJ parser

===

M   source/blender/io/wavefront_obj/importer/obj_import_string_utils.cc

===

diff --git 
a/source/blender/io/wavefront_obj/importer/obj_import_string_utils.cc 
b/source/blender/io/wavefront_obj/importer/obj_import_string_utils.cc
index 9a457167fca..7e282b164b0 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_string_utils.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_string_utils.cc
@@ -41,12 +41,14 @@ void fixup_line_continuations(char *p, char *end)
   while (true) {
 /* Find next backslash, if any. */
 char *backslash = std::find(p, end, '\\');
-if (backslash == end)
+if (backslash == end) {
   break;
+}
 /* Skip over possible whitespace right after it. */
 p = backslash + 1;
-while (p < end && is_whitespace(*p) && *p != '\n')
+while (p < end && is_whitespace(*p) && *p != '\n') {
   ++p;
+}
 /* If then we have a newline, turn both backslash
  * and the newline into regular spaces. */
 if (p < end && *p == '\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] [5fa8dbeacdf] sculpt-dev: Merge remote-tracking branch 'origin' into sculpt-dev

2022-07-30 Thread Joseph Eagar
Commit: 5fa8dbeacdfa8d7394462abf6b69ccca36d0fd66
Author: Joseph Eagar
Date:   Sat Jul 30 00:18:24 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rB5fa8dbeacdfa8d7394462abf6b69ccca36d0fd66

Merge remote-tracking branch 'origin' into sculpt-dev

===



===

diff --cc intern/CMakeLists.txt
index 6a0c2691361,6387fd016ba..9ec58d273dd
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@@ -68,6 -68,9 +68,13 @@@ if(UNIX AND NOT APPLE
add_subdirectory(libc_compat)
  endif()
  
 +if(WITH_INSTANT_MESHES)
 +  add_subdirectory(instant-meshes)
 +endif()
++
+ if(UNIX AND NOT APPLE)
+   # Important this comes after "ghost" as it uses includes defined by GHOST's 
CMake.
+   if(WITH_GHOST_WAYLAND AND WITH_GHOST_WAYLAND_DYNLOAD)
+ add_subdirectory(wayland_dynload)
+   endif()
+ endif()
diff --cc intern/guardedalloc/intern/mallocn_lockfree_impl.c
index bf23d63ca7a,300e2000a14..3558257a3f0
--- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c
+++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c
@@@ -45,10 -44,8 +45,11 @@@ enum 
  #define PTR_FROM_MEMHEAD(memhead) (memhead + 1)
  #define MEMHEAD_ALIGNED_FROM_PTR(ptr) (((MemHeadAligned *)ptr) - 1)
  #define MEMHEAD_IS_ALIGNED(memhead) ((memhead)->len & 
(size_t)MEMHEAD_ALIGN_FLAG)
+ #define MEMHEAD_LEN(memhead) ((memhead)->len & 
~((size_t)(MEMHEAD_ALIGN_FLAG)))
  
 +#define MEM_POISON_MEMHEAD(vmemh) BLI_asan_poison(MEMHEAD_FROM_PTR(vmemh), 
sizeof(MemHead))
 +#define MEM_UNPOISON_MEMHEAD(vmemh) 
BLI_asan_unpoison(MEMHEAD_FROM_PTR(vmemh), sizeof(MemHead))
 +
  /* Uncomment this to have proper peak counter. */
  #define USE_ATOMIC_MAX
  
@@@ -82,14 -79,8 +83,14 @@@ print_error(const char *str, ...
  
  size_t MEM_lockfree_allocN_len(const void *vmemh)
  {
-   if (vmemh) {
+   if (LIKELY(vmemh)) {
 -return MEMHEAD_LEN(MEMHEAD_FROM_PTR(vmemh));
 +size_t ret;
 +
 +MEM_UNPOISON_MEMHEAD(vmemh);
 +ret = MEMHEAD_FROM_PTR(vmemh)->len & ~((size_t)(MEMHEAD_ALIGN_FLAG));
 +MEM_POISON_MEMHEAD(vmemh);
 +
 +return ret;
}
  
return 0;
diff --cc source/blender/blenkernel/BKE_customdata.h
index 33529a949e2,010fbb27172..02e55bb0c89
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@@ -576,39 -550,11 +576,26 @@@ void CustomData_validate_layer_name(con
   */
  bool CustomData_verify_versions(struct CustomData *data, int index);
  
- /* BMesh specific custom-data stuff.
-  *
-  * Needed to convert to/from different face representation (for versioning). 
*/
+ /* BMesh specific custom-data stuff. */
  
- void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData 
*ldata, int totloop);
- void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData 
*ldata, int total);
  void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct 
CustomData *ldata);
 -void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, char 
htype);
++
 +/**
 + * Update active indices for active/render/clone/stencil custom data layers
 + * based on indices from fdata layers
 + * used by do_versions in `readfile.c` when creating pdata and ldata for 
pre-bmesh
 + * meshes and needed to preserve active/render/clone/stencil flags set in 
pre-bmesh files.
 + */
 +void CustomData_bmesh_do_versions_update_active_layers(struct CustomData 
*fdata,
 +   struct CustomData 
*ldata);
 +
 +void CustomData_bmesh_init_pool_ex(CustomData *data,
 +   int totelem,
 +   const char htype,
 +   const char *memtag);
 +
 +void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const 
char htype);
  
- #ifndef NDEBUG
- /**
-  * Debug check, used to assert when we expect layers to be in/out of sync.
-  *
-  * \param fallback: Use when there are no layers to handle,
-  * since callers may expect success or failure.
-  */
- bool CustomData_from_bmeshpoly_test(CustomData *fdata, CustomData *ldata, 
bool fallback);
- #endif
- 
  /**
   * Validate and fix data of \a layer,
   * if possible (needs relevant callback in layer's type to be defined).
diff --cc source/blender/blenkernel/BKE_paint.h
index 5ec0175d405,8b9deadc960..0fd92636637
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -801,9 -568,9 +807,9 @@@ typedef struct SculptSession 
struct ExpandCache *expand_cache;
  
/* Cursor data and active vertex for tools */
-   PBVHVertRef active_vertex_index;
-   PBVHFaceRef active_face_index;
+   PBVHVertRef active_vertex;
++  PBVHFaceRef active_face;
  
 -  int active_face_index;
int active_grid_index;
  
/* When active, the cursor draws with faded colors, indicating that there 
is an action enabled.
@@@ -826,18 -592,10 +832,18 @@@
struct 

[Bf-blender-cvs] [1a0fab56b4b] master: Merge remote-tracking branch 'origin/blender-v3.3-release'

2022-07-30 Thread Jesse Yurkovich
Commit: 1a0fab56b4bcc641548e82e6a5782acf8deb11fa
Author: Jesse Yurkovich
Date:   Fri Jul 29 23:23:07 2022 -0700
Branches: master
https://developer.blender.org/rB1a0fab56b4bcc641548e82e6a5782acf8deb11fa

Merge remote-tracking branch 'origin/blender-v3.3-release'

===



===



___
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] [8ae14bc1d74] blender-v3.3-release: Fix 100035: Make UDIM detection less aggressive

2022-07-30 Thread Jesse Yurkovich
Commit: 8ae14bc1d74021bb1385c46fb637721b4d3dbb2d
Author: Jesse Yurkovich
Date:   Fri Jul 29 23:17:41 2022 -0700
Branches: blender-v3.3-release
https://developer.blender.org/rB8ae14bc1d74021bb1385c46fb637721b4d3dbb2d

Fix 100035: Make UDIM detection less aggressive

There's been a handful of reports where "obviously" not a UDIM filenames
were detected as such during image open.[1]

This change makes the detection less aggressive by enforcing that the
4-digit sequence be delineated on both sides by one of the following 3
characters ., -, _

This fixes the problem for such filenames as:
"screenshot-1080p.png", "Image-1920x1080.png", "(1999) Photo.png", and
"antiguaChestnut_X_1240Wx814H.png"

[1] T97366 T98918 T99154 T100035

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

===

M   source/blender/blenkernel/intern/image.cc
M   source/blender/blenkernel/intern/image_test.cc

===

diff --git a/source/blender/blenkernel/intern/image.cc 
b/source/blender/blenkernel/intern/image.cc
index c2b8ec95a46..ae5eead2547 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -3410,9 +3410,8 @@ void BKE_image_ensure_tile_token(char *filename)
 
   /* General 4-digit "udim" pattern. As this format is susceptible to ambiguity
* with other digit sequences, we can leverage the supported range of roughly
-   * 1000 through 2000 to provide better detection.
-   */
-  std::regex pattern(R"((^|.*?\D)([12]\d{3})(\D.*))");
+   * 1000 through 2000 to provide better detection. */
+  std::regex pattern(R"((.*[._-])([12]\d{3})([._-].*))");
   if (std::regex_search(path, match, pattern)) {
 BLI_strncpy(filename, match.format("$1$3").c_str(), FILE_MAX);
 return;
diff --git a/source/blender/blenkernel/intern/image_test.cc 
b/source/blender/blenkernel/intern/image_test.cc
index 9c15fc62d21..7004d39c805 100644
--- a/source/blender/blenkernel/intern/image_test.cc
+++ b/source/blender/blenkernel/intern/image_test.cc
@@ -32,8 +32,12 @@ TEST(udim, image_ensure_tile_token)
   verify("test_1002_ao.png", "test__ao.png");
   verify("test.1002.ver0023.png", "test..ver0023.png");
   verify("test.ver0023.1002.png", "test.ver0023..png");
-  verify("1002test.png", "test.png");
-  verify("test1002.png", "test.png");
+  verify("test.1002.1.png", "test..1.png");
+  verify("test.1.1002.png", "test.1..png");
+  verify("test-2022-01-01.1002.png", "test-2022-01-01..png");
+  verify("_11.1002.png", "_11..png");
+  verify("2111_01.1002.png", "2111_01..png");
+  verify("2022_1002_100200.1002.png", "2022_1002_100200..png");
 
   /* UVTILE pattern detection. */
   verify("uv-test.u2_v10.png", "uv-test..png");
@@ -44,8 +48,15 @@ TEST(udim, image_ensure_tile_token)
   verify("u2_v10uv-test.png", "uv-test.png");
   verify("u2_v10u_v-test.png", "u_v-test.png");
 
-  /* Incorrect patterns. */
-  for (const char *incorrect : {"test.123.png",
+  /* Patterns which should not be detected as UDIMs. */
+  for (const char *incorrect : {"1002.png",
+"1002test.png",
+"test1002.png",
+"test(1002).png",
+"(1002)test.png",
+"test-1080p.png",
+"test-1920x1080.png",
+"test.123.png",
 "test.12345.png",
 "test.uv.png",
 "test.u1v.png",

___
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