[Bf-blender-cvs] [ae085e301c2] master: Spreadsheet: Dataset region for spreadsheet editor

2021-06-24 Thread Fabian Schempp
Commit: ae085e301c2aac0d6956609bfe93a90a19f0e235
Author: Fabian Schempp
Date:   Fri Jun 25 07:57:24 2021 +0200
Branches: master
https://developer.blender.org/rBae085e301c2aac0d6956609bfe93a90a19f0e235

Spreadsheet: Dataset region for spreadsheet editor

This patch adds a left aligned sidebar to the spreadsheet editor. This
Sidebar can be used to navigate the geometry component types and
attribute domains. It also provides a quick overview of domain sizes.
It replaces the two dropdowns in the regions header.
Next step will be to add the domain cycling shortcut
using the CTRL + mouse wheel.

Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin),
Hans Goudey (HooglyBoogly).

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

===

M   release/datafiles/userdef/userdef_default_theme.c
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M   release/scripts/startup/bl_ui/space_spreadsheet.py
M   source/blender/blenkernel/BKE_attribute.h
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenlib/BLI_string.h
M   source/blender/blenlib/intern/string.c
M   source/blender/blenlib/tests/BLI_string_test.cc
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/blenloader/intern/versioning_userdef.c
M   source/blender/editors/include/ED_spreadsheet.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_handlers.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_query.c
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/space_spreadsheet/CMakeLists.txt
M   source/blender/editors/space_spreadsheet/space_spreadsheet.cc
M   source/blender/editors/space_spreadsheet/spreadsheet_context.cc
M   
source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
A   source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc
A   source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh
A   source/blender/editors/space_spreadsheet/spreadsheet_dataset_layout.cc
A   source/blender/editors/space_spreadsheet/spreadsheet_dataset_layout.hh
M   source/blender/editors/space_spreadsheet/spreadsheet_intern.hh
M   source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/datafiles/userdef/userdef_default_theme.c 
b/release/datafiles/userdef/userdef_default_theme.c
index 48e675492f9..441a92127ea 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -1041,6 +1041,11 @@ const bTheme U_theme_default = {
 .active_object = RGBA(0xffaf29ff),
 .edited_object = RGBA(0x00806266),
 .row_alternate = RGBA(0xff07),
+.list = RGBA(0x424242ff),
+.list_title = RGBA(0xc3c3c3ff),
+.list_text = RGBA(0xc3c3c3ff),
+.list_text_hi = RGBA(0xff),
+.hilite = RGBA(0x80808080),
   },
   .tarm = {
 {
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index bd14b2c532c..7f1039a975b 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -187,7 +187,7 @@ def _template_items_context_panel(menu, key_args_primary):
 ]
 
 
-def _template_space_region_type_toggle(*, toolbar_key=None, sidebar_key=None):
+def _template_space_region_type_toggle(*, toolbar_key=None, sidebar_key=None, 
channels_key=None):
 items = []
 if toolbar_key is not None:
 items.append(
@@ -199,6 +199,12 @@ def _template_space_region_type_toggle(*, 
toolbar_key=None, sidebar_key=None):
 ("wm.context_toggle", sidebar_key,
  {"properties": [("data_path", 'space_data.show_region_ui')]}),
 )
+if channels_key is not None:
+items.append(
+("wm.context_toggle", channels_key,
+ {"properties": [("data_path", 
'space_data.show_region_channels')]}),
+)
+
 return items
 
 
@@ -3021,6 +3027,7 @@ def km_spreadsheet_generic(_params):
 items.extend([
 *_template_space_region_type_toggle(
 sidebar_key={"type": 'N', "value": 'PRESS'},
+channels_key={"type": 'T', "value": 'PRESS'},
 ),
 ])
 
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 

[Bf-blender-cvs] [f20930b39ae] soc-2021-curves: Cleanup: Refactoring and commenting methods

2021-06-24 Thread dilithjay
Commit: f20930b39ae53571c08ef40660b89e1bf9b0d943
Author: dilithjay
Date:   Fri Jun 25 11:04:52 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rBf20930b39ae53571c08ef40660b89e1bf9b0d943

Cleanup: Refactoring and commenting methods

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index cdd960ad170..180bd37e877 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -168,6 +168,37 @@ static void 
free_up_selected_handles_for_movement(BezTriple *bezt)
   }
 }
 
+static void move_selected_bezt_to_mouse(BezTriple *bezt, ViewContext *vc, 
wmEvent *event)
+{
+  /* Get mouse location in 3D space. */
+  float location[3];
+  mouse_location_to_worldspace(event->mval, bezt->vec[1], vc, location);
+
+  /* Move entire BezTriple if center point is dragged. */
+  if (bezt->f2) {
+move_bezt_to_location(bezt, location);
+  }
+  /* Move handle separately if only a handle is dragged. */
+  else {
+free_up_selected_handles_for_movement(bezt);
+if (bezt->f1) {
+  copy_v3_v3(bezt->vec[0], location);
+}
+else {
+  copy_v3_v3(bezt->vec[2], location);
+}
+  }
+}
+
+static void move_bp_to_mouse(BPoint *bp, const wmEvent *event, const 
ViewContext *vc)
+{
+  /* Get mouse location in 3D space. */
+  float location[3];
+  mouse_location_to_worldspace(event->mval, bp->vec, vc, location);
+
+  copy_v3_v3(bp->vec, location);
+}
+
 /* Delete given BezTriple from given Nurb. */
 static void delete_bezt_from_nurb(BezTriple *bezt, Nurb *nu)
 {
@@ -451,6 +482,7 @@ static void calculate_new_bezier_point(const float 
*point_prev,
   interp_v3_v3v3(new_right_handle, center_point, handle_next, parameter);
 }
 
+/* Update the nearest point data for all nurbs. */
 static void update_data_for_all_nurbs(ListBase *nurbs, ViewContext *vc, void 
*op_data)
 {
   struct TempBeztData *data = op_data;
@@ -475,13 +507,14 @@ static void update_data_for_all_nurbs(ListBase *nurbs, 
ViewContext *vc, void *op
 update_data_if_nearest_point_in_segment(bezt, bezt + 1, nu, i, vc, 
screen_co, data);
   }
 
-  if (nu->flagu & CU_NURB_CYCLIC) {
+  if (nu->flagu & CU_NURB_CYCLIC && bezt) {
 update_data_if_nearest_point_in_segment(bezt + 1, nu->bezt, nu, i, vc, 
screen_co, data);
   }
 }
   }
 }
 
+/* Insert a bezt to a nurb at the location specified by op_data. */
 static void add_bezt_to_nurb(Nurb *nu, void *op_data, Curve *cu)
 {
   EditNurb *editnurb = cu->editnurb;
@@ -497,6 +530,7 @@ static void add_bezt_to_nurb(Nurb *nu, void *op_data, Curve 
*cu)
   /* Duplicate control point after the cut. */
   memcpy(new_bezt, new_bezt - 1, sizeof(BezTriple));
   copy_v3_v3(new_bezt->vec[1], data->cut_loc);
+  new_bezt->h1 = new_bezt->h2 = HD_ALIGN;
 
   if (index < nu->pntsu) {
 /* Copy all control points after the cut to the new memory. */
@@ -529,6 +563,64 @@ static void add_bezt_to_nurb(Nurb *nu, void *op_data, 
Curve *cu)
   new_bezt->f1 = new_bezt->f2 = new_bezt->f3 = 1;
 }
 
+/* Make a cut on the nearest nurb at the closest point. */
+static void make_cut(wmEvent *event, Curve *cu, Nurb **r_nu, ViewContext *vc)
+{
+  struct TempBeztData data = {.bezt_index = 0,
+  .min_dist = 1,
+  .parameter = 0.5f,
+  .has_prev = false,
+  .has_next = false,
+  .mval[0] = event->mval[0],
+  .mval[1] = event->mval[1]};
+
+  ListBase *nurbs = BKE_curve_editNurbs_get(cu);
+
+  update_data_for_all_nurbs(nurbs, vc, );
+
+  float threshold_distance = get_view_zoom(data.cut_loc, vc);
+  /* If the minimum distance found < threshold distance, make cut. */
+  if (data.min_dist < threshold_distance) {
+Nurb *nu = data.nurb;
+if (nu && nu->type == CU_BEZIER) {
+  update_closest_point_in_data(, nu->resolu, vc);
+  add_bezt_to_nurb(nu, , cu);
+  *r_nu = nu;
+}
+  }
+}
+
+/* Add a new control point connected to the selected control point. */
+static void add_point_connected_to_selected_point(Curve *cu, ViewContext *vc, 
wmEvent *event)
+{
+  Nurb *nu = NULL;
+  BezTriple *bezt = NULL;
+  BPoint *bp = NULL;
+
+  float location[3];
+
+  ED_curve_nurb_vert_selected_find(cu, vc->v3d, , , );
+
+  if (bezt) {
+mul_v3_m4v3(location, vc->obedit->obmat, bezt->vec[1]);
+  }
+  else if (bp) {
+mul_v3_m4v3(location, vc->obedit->obmat, bp->vec);
+  }
+  else {
+copy_v3_v3(location, vc->scene->cursor.location);
+  }
+
+  ED_view3d_win_to_3d_int(vc->v3d, vc->region, location, event->mval, 
location);
+  EditNurb *editnurb = cu->editnurb;
+  ed_editcurve_addvert(cu, editnurb, vc->v3d, location);
+  

[Bf-blender-cvs] [841df831e89] master: LineArt: More type & related chaining improvements

2021-06-24 Thread YimingWu
Commit: 841df831e89dfc4011c323203c2efb8265dc1878
Author: YimingWu
Date:   Fri Jun 25 13:15:25 2021 +0800
Branches: master
https://developer.blender.org/rB841df831e89dfc4011c323203c2efb8265dc1878

LineArt: More type & related chaining improvements

This patch includes: Floating edge type support,
Special chaining option for floating edge,
Chaining option for reducing jagged edges when floating
edges are involved.

Reviewed By: Sebastian Parborg (zeddb)

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

===

M   source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M   source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M   source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M   source/blender/gpencil_modifiers/intern/lineart/lineart_intern.h
M   source/blender/makesdna/DNA_gpencil_modifier_types.h
M   source/blender/makesdna/DNA_lineart_types.h
M   source/blender/makesrna/intern/rna_gpencil_modifier.c

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index f0aae7e4498..1f70ecb4595 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -305,6 +305,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel 
*panel)
   uiLayout *col = uiLayoutColumnWithHeading(layout, true, IFACE_("Edge 
Types"));
 
   uiItemR(col, ptr, "use_contour", 0, IFACE_("Contour"), ICON_NONE);
+  uiItemR(col, ptr, "use_floating", 0, IFACE_("Floating"), ICON_NONE);
   uiItemR(col, ptr, "use_material", 0, IFACE_("Material Borders"), ICON_NONE);
   uiItemR(col, ptr, "use_edge_mark", 0, IFACE_("Edge Marks"), ICON_NONE);
   uiItemR(col, ptr, "use_intersection", 0, IFACE_("Intersections"), ICON_NONE);
@@ -312,7 +313,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel 
*panel)
   uiLayout *sub = uiLayoutRowWithHeading(col, false, IFACE_("Crease"));
   uiItemR(sub, ptr, "use_crease", 0, "", ICON_NONE);
   uiLayout *entry = uiLayoutRow(sub, false);
-  uiLayoutSetActive(entry, RNA_boolean_get(ptr, "use_crease") || is_first);
+  uiLayoutSetEnabled(entry, RNA_boolean_get(ptr, "use_crease") || is_first);
   if (use_cache && !is_first) {
 uiItemL(entry, IFACE_("Angle Cached"), ICON_INFO);
   }
@@ -368,6 +369,7 @@ static void options_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
   uiItemR(col, ptr, "use_edge_overlap", 0, IFACE_("Overlapping Edges As 
Contour"), ICON_NONE);
   uiItemR(col, ptr, "use_object_instances", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "use_clip_plane_boundaries", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "allow_overlap_edge_types", 0, NULL, ICON_NONE);
 }
 
 static void style_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -430,7 +432,7 @@ static void transparency_panel_draw(const bContext 
*UNUSED(C), Panel *panel)
 
   uiLayoutSetPropSep(layout, true);
 
-  uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_transparency"));
+  uiLayoutSetEnabled(layout, RNA_boolean_get(ptr, "use_transparency"));
 
   uiLayout *row = uiLayoutRow(layout, true);
   uiLayoutSetPropDecorate(row, false);
@@ -457,6 +459,7 @@ static void chaining_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
   const bool is_baked = RNA_boolean_get(ptr, "is_baked");
   const bool use_cache = RNA_boolean_get(ptr, "use_cache");
   const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, 
ptr->data);
+  const bool is_geom = RNA_boolean_get(ptr, "chain_geometry_space");
 
   uiLayoutSetPropSep(layout, true);
   uiLayoutSetEnabled(layout, !is_baked);
@@ -469,8 +472,16 @@ static void chaining_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
   uiLayout *col = uiLayoutColumnWithHeading(layout, true, IFACE_("Chain"));
   uiItemR(col, ptr, "use_fuzzy_intersections", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "use_fuzzy_all", 0, NULL, ICON_NONE);
-
-  uiItemR(layout, ptr, "chaining_image_threshold", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "chain_floating_edges", 0, IFACE_("Floating Edges"), 
ICON_NONE);
+  uiItemR(col, ptr, "floating_as_contour", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "chain_geometry_space", 0, NULL, ICON_NONE);
+
+  uiItemR(layout,
+  ptr,
+  "chaining_image_threshold",
+  0,
+  is_geom ? IFACE_("Geometry Threshold") : NULL,
+  ICON_NONE);
 
   uiItemR(layout, ptr, "split_angle", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 }
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 72b73b4d174..a7f4231e4aa 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ 

[Bf-blender-cvs] [c8698e66579] temp-geometry-nodes-curve-deform-node: Slightly fix deformation in some cases (mostly edge cases)

2021-06-24 Thread Hans Goudey
Commit: c8698e6657951712aad666381e7e7b06abb600f8
Author: Hans Goudey
Date:   Thu Jun 24 22:18:57 2021 -0500
Branches: temp-geometry-nodes-curve-deform-node
https://developer.blender.org/rBc8698e6657951712aad666381e7e7b06abb600f8

Slightly fix deformation in some cases (mostly edge cases)

===

M   source/blender/nodes/geometry/nodes/node_geo_curve_deform.cc

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_deform.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_deform.cc
index dde7191fb69..dc3cab763d5 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_deform.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_deform.cc
@@ -35,10 +35,10 @@ using blender::bke::GeometryInstanceGroup;
 static bNodeSocketTemplate geo_node_curve_deform_in[] = {
 {SOCK_GEOMETRY, N_("Geometry")},
 {SOCK_GEOMETRY, N_("Curve")},
-{SOCK_STRING, N_("Factor")},
-{SOCK_FLOAT, N_("Factor"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 
PROP_FACTOR},
 {SOCK_BOOLEAN, N_("Use Bounds")},
 {SOCK_BOOLEAN, N_("Stretch")},
+{SOCK_BOOLEAN, N_("Temp Only Bounds")},
+{SOCK_VECTOR, N_("Weird Hack"), 0.5f, 0.5f, 0.5f, 1.0f, -FLT_MAX, FLT_MAX, 
PROP_TRANSLATION},
 {-1, ""},
 };
 
@@ -168,6 +168,7 @@ static float3 deform_position(const SplineDeformInput ,
 struct Bounds {
   float3 min;
   float3 max;
+  float3 size;
   float3 inv_size;
 };
 
@@ -178,15 +179,16 @@ static Bounds position_bounds(const Span 
positions)
   for (const float3  : positions) {
 minmax_v3v3_v3(min, max, position);
   }
-  return {min, max, float3::safe_divide(float3(1), max - min)};
+  const float3 size = max - min;
+  return {min, max, size, float3::safe_divide(float3(1), size)};
 }
 
 static Bounds dummy_parameter_bounds(const GeometryNodeCurveDeformAxis 
deform_axis)
 {
   if (axis_is_negative(deform_axis)) {
-return {float3(-1), float3(0), float3(-1)};
+return {float3(-1), float3(0), float3(-1), float3(-1)};
   }
-  return {float3(0), float3(1), float3(1)};
+  return {float3(0), float3(1), float3(1), float3(1)};
 }
 
 static float process_parameter(const float3 position,
@@ -220,6 +222,15 @@ static void execute_on_component(const GeoNodeExecParams 
,
   const Bounds bounds = position_bounds(positions);
   const Bounds parameter_bounds = input.use_bounds ? bounds : 
dummy_parameter_bounds(deform_axis);
 
+  float3 center_offset(0);
+  if (bounds.size[next_axis] != 0.0f) {
+center_offset[next_axis] = 0.5f;
+  }
+  float3 input_center_offset = params.get_input("Weird Hack");
+  if (!input_center_offset.is_zero()) {
+center_offset = input_center_offset;
+  }
+
   threading::parallel_for(positions.index_range(), 1024, [&](IndexRange range) 
{
 for (const int i : range) {
   const float parameter = process_parameter(
@@ -227,13 +238,17 @@ static void execute_on_component(const GeoNodeExecParams 
,
 
   const Spline::LookupResult lookup = 
input.spline.lookup_evaluated_length(parameter);
 
-  const float3 co = (positions[i] - bounds.min) * bounds.inv_size * 2.0f - 
float3(1);
+  const float3 co = ((positions[i] - bounds.min) * bounds.inv_size - 
center_offset) *
+bounds.size;
   if (is_negative) {
 positions[i] = deform_position(input, lookup, co[next_axis], 
co[other_axis], is_negative);
   }
   else {
 positions[i] = deform_position(input, lookup, co[other_axis], 
co[next_axis], is_negative);
   }
+  if (params.get_input("Temp Only Bounds")) {
+positions[i] = co;
+  }
 }
   });

___
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] [379f116a2ac] temp-geometry-nodes-curve-deform-node: Merge branch 'master' into temp-geometry-nodes-curve-deform-node

2021-06-24 Thread Hans Goudey
Commit: 379f116a2ac929883d29519b41c1e63cffe6e591
Author: Hans Goudey
Date:   Wed Jun 23 22:55:01 2021 -0500
Branches: temp-geometry-nodes-curve-deform-node
https://developer.blender.org/rB379f116a2ac929883d29519b41c1e63cffe6e591

Merge branch 'master' into temp-geometry-nodes-curve-deform-node

===



===

diff --cc release/scripts/startup/nodeitems_builtins.py
index 9db2670d7c0,e7d991622e8..005e282fc0f
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@@ -501,11 -501,13 +501,14 @@@ geometry_node_categories = 
  NodeItem("ShaderNodeCombineRGB"),
  ]),
  GeometryNodeCategory("GEO_CURVE", "Curve", items=[
+ NodeItem("GeometryNodeCurveSubdivide"),
  NodeItem("GeometryNodeCurveToMesh"),
  NodeItem("GeometryNodeCurveResample"),
 +NodeItem("GeometryNodeCurveDeform"),
  NodeItem("GeometryNodeMeshToCurve"),
+ NodeItem("GeometryNodeCurveToPoints"),
  NodeItem("GeometryNodeCurveLength"),
+ NodeItem("GeometryNodeCurveReverse"),
  ]),
  GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[
  NodeItem("GeometryNodeBoundBox"),
diff --cc source/blender/blenkernel/BKE_node.h
index 5fa7d2b2a95,a0f6be6b3e9..87140964ccb
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1434,7 -1434,11 +1434,12 @@@ int ntreeTexExecTree(struct bNodeTree *
  #define GEO_NODE_CURVE_LENGTH 1054
  #define GEO_NODE_SELECT_BY_MATERIAL 1055
  #define GEO_NODE_CONVEX_HULL 1056
- #define GEO_NODE_CURVE_DEFORM 1057
+ #define GEO_NODE_CURVE_TO_POINTS 1057
+ #define GEO_NODE_CURVE_REVERSE 1058
+ #define GEO_NODE_SEPARATE_COMPONENTS 1059
+ #define GEO_NODE_CURVE_SUBDIVIDE 1060
+ #define GEO_NODE_RAYCAST 1061
++#define GEO_NODE_CURVE_DEFORM 1062
  
  /** \} */
  
diff --cc source/blender/blenkernel/BKE_spline.hh
index 60a9b9bb89a,24b5a78e598..8b8de115330
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@@ -170,22 -167,19 +169,22 @@@ class Spline 
};
LookupResult lookup_evaluated_factor(const float factor) const;
LookupResult lookup_evaluated_length(const float length) const;
 +  LookupResult lookup_evaluated_length_cyclic(const float length) const;
  
blender::Array sample_uniform_index_factors(const int samples_size) 
const;
 +  void sample_length_parameters_to_index_factors(blender::MutableSpan 
parameters) const;
 +
LookupResult lookup_data_from_index_factor(const float index_factor) const;
  
-   void sample_based_on_index_factors(const blender::fn::GVArray ,
-  blender::Span index_factors,
-  blender::fn::GMutableSpan dst) const;
+   void sample_with_index_factors(const blender::fn::GVArray ,
+  blender::Span index_factors,
+  blender::fn::GMutableSpan dst) const;
template
-   void sample_based_on_index_factors(const blender::VArray ,
-  blender::Span index_factors,
-  blender::MutableSpan dst) const
+   void sample_with_index_factors(const blender::VArray ,
+  blender::Span index_factors,
+  blender::MutableSpan dst) const
{
- this->sample_based_on_index_factors(
+ this->sample_with_index_factors(
  blender::fn::GVArray_For_VArray(src), index_factors, 
blender::fn::GMutableSpan(dst));
}
template
diff --cc source/blender/blenkernel/intern/node.cc
index a3eb55d8c4a,db18cecb5d3..4e0e784a5b8
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@@ -5055,10 -5053,12 +5053,13 @@@ static void registerGeometryNodes(
register_node_type_geo_bounding_box();
register_node_type_geo_collection_info();
register_node_type_geo_convex_hull();
 +  register_node_type_geo_curve_deform();
register_node_type_geo_curve_length();
register_node_type_geo_curve_to_mesh();
+   register_node_type_geo_curve_to_points();
register_node_type_geo_curve_resample();
+   register_node_type_geo_curve_reverse();
+   register_node_type_geo_curve_subdivide();
register_node_type_geo_delete_geometry();
register_node_type_geo_edge_split();
register_node_type_geo_input_material();
diff --cc source/blender/blenkernel/intern/spline_base.cc
index 8956ba6adae,aa0d95d4d61..584156ea40f
--- a/source/blender/blenkernel/intern/spline_base.cc
+++ b/source/blender/blenkernel/intern/spline_base.cc
@@@ -331,67 -463,20 +475,67 @@@ Array Spline::sample_uniform_ind
return samples;
  }
  
 +#ifdef DEBUG
 +static void assert_sorted_array_in_range(Span data, const float min, 
const float max)
 +{
 +  BLI_assert(data.first() >= min);
 +  for (const int i : 

[Bf-blender-cvs] [b517b9f6467] temp-geometry-nodes-curve-deform-node: Merge branch 'master' into temp-geometry-nodes-curve-deform-node

2021-06-24 Thread Hans Goudey
Commit: b517b9f6467cafcaa3e50574734e6d776eadb5cd
Author: Hans Goudey
Date:   Thu Jun 24 13:25:19 2021 -0500
Branches: temp-geometry-nodes-curve-deform-node
https://developer.blender.org/rBb517b9f6467cafcaa3e50574734e6d776eadb5cd

Merge branch 'master' into temp-geometry-nodes-curve-deform-node

===



===



___
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] [051ce30390e] gsoc-2021-porting-modifiers-to-nodes-solidify: Merge branch 'master' into gsoc-2021-porting-modifiers-to-nodes-solidify

2021-06-24 Thread Fabian Schempp
Commit: 051ce30390e8a29d5d3130bfa49a3fda5d4c33df
Author: Fabian Schempp
Date:   Thu Jun 24 21:16:25 2021 +0200
Branches: gsoc-2021-porting-modifiers-to-nodes-solidify
https://developer.blender.org/rB051ce30390e8a29d5d3130bfa49a3fda5d4c33df

Merge branch 'master' into gsoc-2021-porting-modifiers-to-nodes-solidify

===



===



___
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] [5379633e59f] gsoc-2021-porting-modifiers-to-nodes-solidify: - corrected two comments in corresponding test

2021-06-24 Thread Fabian Schempp
Commit: 5379633e59fa81dde204aee77eea86d71443e069
Author: Fabian Schempp
Date:   Thu Jun 24 23:11:39 2021 +0200
Branches: gsoc-2021-porting-modifiers-to-nodes-solidify
https://developer.blender.org/rB5379633e59fa81dde204aee77eea86d71443e069

- corrected two comments in corresponding test

===

M   source/blender/blenkernel/intern/solidify_nonmanifold.c
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/geometry/nodes/node_geo_solidify.cc

===

diff --git a/source/blender/blenkernel/intern/solidify_nonmanifold.c 
b/source/blender/blenkernel/intern/solidify_nonmanifold.c
index 574ab975081..0b8d3f9b251 100644
--- a/source/blender/blenkernel/intern/solidify_nonmanifold.c
+++ b/source/blender/blenkernel/intern/solidify_nonmanifold.c
@@ -2455,7 +2455,7 @@ Mesh *solidify_nonmanifold(const SolidifyData 
*solidify_data,
   /* Haven't found a good way to generalize this. */
   // if (edge_index != numNewEdges) {
   /*BKE_modifier_set_error(ctx->object,
- md,
+ md,A
  "Internal Error: edges array wrong size: %u instead 
of %u",
  numNewEdges,
  edge_index);*/
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index a161728d721..578f07ed11e 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9548,13 +9548,12 @@ static void def_geo_solidify(StructRNA *srna)
 
   prop = RNA_def_property(srna, "thickness_mode", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_items(prop, 
rna_node_geometry_attribute_input_type_items_float);
-  RNA_def_property_enum_default(prop, 1);
   RNA_def_property_ui_text(prop, "Thickness", "");
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 
   prop = RNA_def_property(srna, "nonmanifold_offset_mode", PROP_ENUM, 
PROP_NONE);
   RNA_def_property_enum_items(prop, nonmanifold_thickness_mode_items);
-  RNA_def_property_ui_text(prop, "Thickness", "");
+  RNA_def_property_ui_text(prop, "Mode", "");
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 
   prop = RNA_def_property(srna, "nonmanifold_boundary_mode", PROP_ENUM, 
PROP_NONE);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_solidify.cc 
b/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
index a95b150f1de..a6f596f6472 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
@@ -38,7 +38,7 @@ static bNodeSocketTemplate geo_node_solidify_in[] = {
 {SOCK_FLOAT, N_("Offset"), -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 
PROP_FACTOR},
 {SOCK_BOOLEAN, N_("Fill"), true},
 {SOCK_BOOLEAN, N_("Rim"), true},
-{SOCK_STRING, N_("Shell Faces")},
+{SOCK_STRING, N_("Fill Faces")},
 {SOCK_STRING, N_("Rim Faces")},
 {-1, ""},
 };
@@ -56,6 +56,7 @@ static void geo_node_solidify_init(bNodeTree *UNUSED(tree), 
bNode *node)
   sizeof(NodeGeometrySolidify), __func__);
 
   node->storage = node_storage;
+  node_storage->thickness_mode = GEO_NODE_ATTRIBUTE_INPUT_FLOAT;
 }
 
 static void geo_node_solidify_layout(uiLayout *layout, bContext *UNUSED(C), 
PointerRNA *ptr)
@@ -147,10 +148,9 @@ static void geo_node_solidify_exec(GeoNodeExecParams 
params)
 
 geometry_set.replace_mesh(output_mesh);
 
-const AttributeDomain result_point_domain = ATTR_DOMAIN_POINT;
 const AttributeDomain result_face_domain = ATTR_DOMAIN_FACE;
 
-const std::string shell_faces_attribute_name = 
params.get_input("Shell Faces");
+const std::string shell_faces_attribute_name = 
params.get_input("Fill Faces");
 const std::string rim_faces_attribute_name = 
params.get_input("Rim Faces");
 
 if (solidify_node_data.flag & MOD_SOLIDIFY_SHELL) {
@@ -194,7 +194,7 @@ void register_node_type_geo_solidify()
   node_type_storage(
   , "NodeGeometrySolidify", node_free_standard_storage, 
node_copy_standard_storage);
   node_type_init(, blender::nodes::geo_node_solidify_init);
-  node_type_size(, 167, 100, 600);
+  node_type_size(, 172, 100, 600);
   node_type_update(, blender::nodes::geo_node_solidify_update);
   ntype.geometry_node_execute = blender::nodes::geo_node_solidify_exec;
   ntype.draw_buttons = blender::nodes::geo_node_solidify_layout;

___
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] [6a39a8d94b5] soc-2021-curves: Cleanup: Moved code out of modal method

2021-06-24 Thread dilithjay
Commit: 6a39a8d94b5da17292778eefc98e604320b2816c
Author: dilithjay
Date:   Thu Jun 24 23:07:48 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB6a39a8d94b5da17292778eefc98e604320b2816c

Cleanup: Moved code out of modal method

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 03f4f9abb6e..f51576634f9 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -68,6 +68,24 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+/* Data structure to keep track of details about the cut location */
+struct TempBeztData {
+  /* Index of the last bez triple before the cut. */
+  int bezt_index;
+  /* Nurb to which the cut belongs to. */
+  Nurb *nurb;
+  /* Minimum distance to curve from mouse location. */
+  float min_dist;
+  /* Ratio at which the new point divides the curve segment. */
+  float parameter;
+  /* Whether the cut has any vertices before/after it. */
+  bool has_prev, has_next;
+  /* Locations of adjacent vertices. */
+  float prev_loc[3], cut_loc[3], next_loc[3];
+  /* Mouse location as floats. */
+  float mval[2];
+} temp_bezt_data;
+
 static void mouse_location_to_worldspace(const int *mouse_loc,
  const float *depth,
  const ViewContext *vc,
@@ -343,23 +361,8 @@ static void 
update_data_if_nearest_point_in_segment(BezTriple *bezt1,
 float screen_co[2],
 void *op_data)
 {
-  struct temp_bezt_data {
-/* Index of the last bez triple before the cut. */
-int bezt_index;
-/* Nurb to which the cut belongs to. */
-Nurb *nurb;
-/* Minimum distance to curve from mouse location. */
-float min_dist;
-/* Ratio at which the new point divides the curve segment. */
-float parameter;
-/* Whether the cut has any vertices before/after it. */
-bool has_prev, has_next;
-/* Locations of adjacent vertices. */
-float prev_loc[3], cut_loc[3], next_loc[3];
-/* Mouse location as floats. */
-float mval[2];
-  } temp_bezt_data;
-  struct temp_bezt_data *data = op_data;
+
+  struct TempBeztData *data = op_data;
 
   float resolu = nu->resolu;
   float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), 
"makeCut_bezier");
@@ -408,6 +411,84 @@ static void 
update_data_if_nearest_point_in_segment(BezTriple *bezt1,
   MEM_freeN(points);
 }
 
+static void update_data_for_all_nurbs(ListBase *nurbs, ViewContext *vc, void 
*op_data)
+{
+  struct TempBeztData *data = op_data;
+
+  for (Nurb *nu = nurbs->first; nu; nu = nu->next) {
+if (nu->type == CU_BEZIER) {
+  float screen_co[2];
+  if (data->nurb == NULL) {
+ED_view3d_project_float_object(
+vc->region, nu->bezt->vec[1], screen_co, V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN);
+
+data->nurb = nu;
+data->bezt_index = 0;
+data->min_dist = len_manhattan_v2v2(screen_co, data->mval);
+copy_v3_v3(data->cut_loc, nu->bezt->vec[1]);
+  }
+  int i;
+
+  BezTriple *bezt;
+  for (i = 0; i < nu->pntsu - 1; i++) {
+bezt = >bezt[i];
+update_data_if_nearest_point_in_segment(bezt, bezt + 1, nu, i, vc, 
screen_co, data);
+  }
+
+  if (nu->flagu & CU_NURB_CYCLIC) {
+update_data_if_nearest_point_in_segment(bezt + 1, nu->bezt, nu, i, vc, 
screen_co, data);
+  }
+}
+  }
+}
+
+static void add_bezt_to_nurb(Nurb *nu, void *op_data, Curve *cu)
+{
+  EditNurb *editnurb = cu->editnurb;
+  struct TempBeztData *data = op_data;
+
+  BezTriple *bezt1 = (BezTriple *)MEM_mallocN((nu->pntsu + 1) * 
sizeof(BezTriple),
+  "new_bezt_nurb");
+  int index = data->bezt_index + 1;
+  /* Copy all control points before the cut to the new memory. */
+  memcpy(bezt1, nu->bezt, index * sizeof(BezTriple));
+  BezTriple *new_bezt = bezt1 + index;
+
+  /* Duplicate control point after the cut. */
+  memcpy(new_bezt, new_bezt - 1, sizeof(BezTriple));
+  copy_v3_v3(new_bezt->vec[1], data->cut_loc);
+
+  if (index < nu->pntsu) {
+/* Copy all control points after the cut to the new memory. */
+memcpy(bezt1 + index + 1, nu->bezt + index, (nu->pntsu - index) * 
sizeof(BezTriple));
+  }
+
+  nu->pntsu += 1;
+  cu->actvert = CU_ACT_NONE;
+
+  BezTriple *next_bezt;
+  if ((nu->flagu & CU_NURB_CYCLIC) && (index == nu->pntsu - 1)) {
+next_bezt = bezt1;
+  }
+  else {
+next_bezt = new_bezt + 1;
+  }
+
+  calculate_new_bezier_point((new_bezt - 1)->vec[1],
+ (new_bezt - 1)->vec[2],
+ new_bezt->vec[0],
+ 

[Bf-blender-cvs] [2bd457b4219] soc-2021-curves: Reverted to cut/delete on press due to bad feel

2021-06-24 Thread dilithjay
Commit: 2bd457b42198a591eac53c0cd1f3c78572be989d
Author: dilithjay
Date:   Thu Jun 24 23:38:46 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB2bd457b42198a591eac53c0cd1f3c78572be989d

Reverted to cut/delete on press due to bad feel

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index f51576634f9..0065badcca3 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -616,43 +616,6 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   }
   else if (ELEM(event->type, LEFTMOUSE)) {
 if (event->val == KM_PRESS) {
-  retval = ED_curve_editnurb_select_pick(C, event->mval, extend, deselect, 
toggle);
-  RNA_boolean_set(op->ptr, "new", !retval);
-
-  /* Check if point underneath mouse. Get point if any. */
-  if (!cut_or_delete && !retval) {
-
-/* Create new point under the mouse cursor. Set handle types as vector.
-If an end point of a spline is selected, set the new point as the
-new end point of the spline. */
-float location[3];
-
-ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
-
-if (bezt) {
-  mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
-}
-else if (bp) {
-  mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
-}
-else {
-  copy_v3_v3(location, vc.scene->cursor.location);
-}
-
-ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, 
location);
-EditNurb *editnurb = cu->editnurb;
-ed_editcurve_addvert(cu, editnurb, vc.v3d, location);
-ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
-if (bezt) {
-  bezt->h1 = HD_VECT;
-  bezt->h2 = HD_VECT;
-}
-  }
-}
-if (event->val == KM_RELEASE) {
-  if (dragging) {
-RNA_boolean_set(op->ptr, "dragging", false);
-  }
   bool found_point = false;
 
   if (cut_or_delete) {
@@ -726,6 +689,46 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   BKE_nurb_handles_calc(nu);
 }
   }
+  else {
+retval = ED_curve_editnurb_select_pick(C, event->mval, extend, 
deselect, toggle);
+RNA_boolean_set(op->ptr, "new", !retval);
+
+/* Check if point underneath mouse. Get point if any. */
+if (!retval) {
+
+  /* Create new point under the mouse cursor. Set handle types as 
vector.
+  If an end point of a spline is selected, set the new point as the
+  new end point of the spline. */
+  float location[3];
+
+  ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
+
+  if (bezt) {
+mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
+  }
+  else if (bp) {
+mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
+  }
+  else {
+copy_v3_v3(location, vc.scene->cursor.location);
+  }
+
+  ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, 
location);
+  EditNurb *editnurb = cu->editnurb;
+  ed_editcurve_addvert(cu, editnurb, vc.v3d, location);
+  ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
+  if (bezt) {
+bezt->h1 = HD_VECT;
+bezt->h2 = HD_VECT;
+  }
+}
+  }
+}
+if (event->val == KM_RELEASE) {
+  if (dragging) {
+RNA_boolean_set(op->ptr, "dragging", false);
+  }
+
   RNA_boolean_set(op->ptr, "new", false);
   ret = OPERATOR_FINISHED;
 }

___
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] [202b2650bc6] soc-2021-curves: Cleanup: Refactoring and commenting methods

2021-06-24 Thread dilithjay
Commit: 202b2650bc6c86f826a751da364db80b9cde769a
Author: dilithjay
Date:   Thu Jun 24 23:58:12 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB202b2650bc6c86f826a751da364db80b9cde769a

Cleanup: Refactoring and commenting methods

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 0065badcca3..cdd960ad170 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -84,8 +84,9 @@ struct TempBeztData {
   float prev_loc[3], cut_loc[3], next_loc[3];
   /* Mouse location as floats. */
   float mval[2];
-} temp_bezt_data;
+} TempBeztData;
 
+/* Convert mouse location to worldspace coordinates. */
 static void mouse_location_to_worldspace(const int *mouse_loc,
  const float *depth,
  const ViewContext *vc,
@@ -95,6 +96,7 @@ static void mouse_location_to_worldspace(const int *mouse_loc,
   ED_view3d_win_to_3d_int(vc->v3d, vc->region, r_location, mouse_loc, 
r_location);
 }
 
+/* Move the handle of BezTriple to mouse based on the previously added point. 
*/
 static void move_bezt_handles_to_mouse(BezTriple *bezt,
const bool is_end_point,
const wmEvent *event,
@@ -114,7 +116,7 @@ static void move_bezt_handles_to_mouse(BezTriple *bezt,
 /* Set handle 2 location. */
 copy_v3_v3(bezt->vec[2], location);
 
-/* Set handle 1 location if handle not of type FREE */
+/* Set handle 1 location if handle not of type FREE. */
 if (bezt->h2 != HD_FREE) {
   mul_v3_fl(location, -1);
   madd_v3_v3v3fl(bezt->vec[0], location, bezt->vec[1], 2);
@@ -125,7 +127,7 @@ static void move_bezt_handles_to_mouse(BezTriple *bezt,
 /* Set handle 1 location. */
 copy_v3_v3(bezt->vec[0], location);
 
-/* Set handle 2 location if handle not of type FREE */
+/* Set handle 2 location if handle not of type FREE. */
 if (bezt->h1 != HD_FREE) {
   mul_v3_fl(location, -1);
   madd_v3_v3v3fl(bezt->vec[2], location, bezt->vec[1], 2);
@@ -133,6 +135,7 @@ static void move_bezt_handles_to_mouse(BezTriple *bezt,
   }
 }
 
+/* Move entire control point to given worldspace location. */
 static void move_bezt_to_location(BezTriple *bezt, const float location[3])
 {
   float change[3];
@@ -142,6 +145,7 @@ static void move_bezt_to_location(BezTriple *bezt, const 
float location[3])
   add_v3_v3(bezt->vec[2], change);
 }
 
+/* Alter handle types to allow free movement. */
 static void free_up_selected_handles_for_movement(BezTriple *bezt)
 {
   if (bezt->f1) {
@@ -164,6 +168,7 @@ static void free_up_selected_handles_for_movement(BezTriple 
*bezt)
   }
 }
 
+/* Delete given BezTriple from given Nurb. */
 static void delete_bezt_from_nurb(BezTriple *bezt, Nurb *nu)
 {
   BLI_assert(nu->type == CU_BEZIER);
@@ -177,6 +182,7 @@ static void delete_bezt_from_nurb(BezTriple *bezt, Nurb *nu)
   nu->bezt = bezt1;
 }
 
+/* Delete given BPoint from given Nurb. */
 static void delete_bp_from_nurb(BPoint *bp, Nurb *nu)
 {
   BLI_assert(nu->type == CU_NURBS);
@@ -190,6 +196,7 @@ static void delete_bp_from_nurb(BPoint *bp, Nurb *nu)
   nu->bp = bp1;
 }
 
+/* Get a measure of how zoomed in the current view is. */
 static float get_view_zoom(const float *depth, const ViewContext *vc)
 {
   int p1[2] = {0, 0};
@@ -200,6 +207,7 @@ static float get_view_zoom(const float *depth, const 
ViewContext *vc)
   return 10 / len_v2v2(p1_3d, p2_3d);
 }
 
+/* Get the closest point on an edge to a given point based on perpendicular 
distance. */
 static bool get_closest_point_on_edge(float *point,
   const float pos[2],
   const float pos1[3],
@@ -243,6 +251,7 @@ static bool get_closest_point_on_edge(float *point,
   return false;
 }
 
+/* Get closest control point in all nurbs in given ListBase to a given point. 
*/
 static void *get_closest_cp_to_point_in_nurbs(ListBase *nurbs,
   Nurb **r_nu,
   BezTriple **r_bezt,
@@ -312,47 +321,7 @@ static void *get_closest_cp_to_point_in_nurbs(ListBase 
*nurbs,
   }
 }
 
-static void select_and_get_point(ViewContext *vc,
- Nurb **nu,
- BezTriple **bezt,
- BPoint **bp,
- const int point[2],
- const bool is_start)
-{
-  short hand;
-  BezTriple *bezt1 = NULL;
-  BPoint *bp1 = NULL;
-  Base *basact1 = NULL;
-  Nurb *nu1 = NULL;
-  Curve *cu = vc->obedit->data;
-  copy_v2_v2_int(vc->mval, point);
-  if (is_start) {

[Bf-blender-cvs] [0374114aca6] soc-2021-vse-strip-thumbnails: Cache limit : Set a limit of 1000 thumbs that can be cached giving around 160MB of memory for thumbs. Once the limit is reached, all cache

2021-06-24 Thread Aditya Y Jeppu
Commit: 0374114aca64580642819efbef7253b7c1dbfd59
Author: Aditya Y Jeppu
Date:   Thu Jun 24 23:56:16 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rB0374114aca64580642819efbef7253b7c1dbfd59

Cache limit : Set a limit of 1000 thumbs that can be cached giving around
160MB of memory for thumbs. Once the limit is reached, all cached thumbs
before and after the current view x limits are removed.

===

M   source/blender/editors/space_sequencer/sequencer_draw.c
M   source/blender/sequencer/SEQ_render.h
M   source/blender/sequencer/intern/image_cache.c
M   source/blender/sequencer/intern/image_cache.h
M   source/blender/sequencer/intern/render.c

===

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c 
b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7baf98f64d9..d652acd02fc 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1116,7 +1116,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
   context.is_proxy_render = false;
   context.is_thumb = true;
 
-  ibuf = SEQ_render_thumbnail(, seq, seq->startdisp);
+  ibuf = SEQ_render_thumbnail(, seq, seq->startdisp, v2d);
 
   /*Calculate thumb dimensions */
   float thumb_h = (SEQ_STRIP_OFSTOP - SEQ_STRIP_OFSBOTTOM) - (20 * U.dpi_fac * 
pixely);
@@ -1166,7 +1166,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
 }
 
 /* Get the image */
-ibuf = SEQ_render_thumbnail(, seq, x1 + (int)(cut_off));
+ibuf = SEQ_render_thumbnail(, seq, x1 + (int)(cut_off), v2d);
 
 if (ibuf) {
   ED_draw_imbuf_ctx_clipping(C, ibuf, x1, y1, true, x1 + cut_off, y1, x2, 
y2, zoom_x, zoom_y);
diff --git a/source/blender/sequencer/SEQ_render.h 
b/source/blender/sequencer/SEQ_render.h
index 20472650d20..e3346d35aa4 100644
--- a/source/blender/sequencer/SEQ_render.h
+++ b/source/blender/sequencer/SEQ_render.h
@@ -70,7 +70,8 @@ struct ImBuf *SEQ_render_give_ibuf_direct(const SeqRenderData 
*context,
   struct Sequence *seq);
 struct ImBuf *SEQ_render_thumbnail(SeqRenderData *context,
struct Sequence *seq,
-   float timeline_frame);
+   float timeline_frame,
+   View2D *v2d);
 void SEQ_render_init_colorspace(struct Sequence *seq);
 void SEQ_render_new_render_data(struct Main *bmain,
 struct Depsgraph *depsgraph,
diff --git a/source/blender/sequencer/intern/image_cache.c 
b/source/blender/sequencer/intern/image_cache.c
index 3393b034dc0..06c081c1ba1 100644
--- a/source/blender/sequencer/intern/image_cache.c
+++ b/source/blender/sequencer/intern/image_cache.c
@@ -148,6 +148,7 @@ typedef struct SeqCache {
   struct BLI_mempool *items_pool;
   struct SeqCacheKey *last_key;
   SeqDiskCache *disk_cache;
+  int count;
 } SeqCache;
 
 typedef struct SeqCacheItem {
@@ -1151,6 +1152,7 @@ static void seq_cache_create(Main *bmain, Scene *scene)
 cache->hash = BLI_ghash_new(seq_cache_hashhash, seq_cache_hashcmp, 
"SeqCache hash");
 cache->last_key = NULL;
 cache->bmain = bmain;
+cache->count = 0;
 BLI_mutex_init(>iterator_mutex);
 scene->ed->cache = cache;
 
@@ -1268,6 +1270,7 @@ void SEQ_cache_cleanup(Scene *scene)
 BLI_ghash_remove(cache->hash, key, seq_cache_keyfree, seq_cache_valfree);
   }
   cache->last_key = NULL;
+  cache->count = 0;
   seq_cache_unlock(scene);
 }
 
@@ -1336,6 +1339,36 @@ void seq_cache_cleanup_sequence(Scene *scene,
   seq_cache_unlock(scene);
 }
 
+void seq_cache_thumbnail_cleanup(Scene *scene, Sequence *seq, Sequence 
*seq_changed)
+{
+  SeqCache *cache = seq_cache_get_from_scene(scene);
+  if (!cache) {
+return;
+  }
+
+  int range_start = seq_changed->startdisp;
+  int range_end = seq_changed->enddisp;
+
+  int invalidate_composite = SEQ_CACHE_STORE_THUMBNAIL;
+
+  GHashIterator gh_iter;
+  BLI_ghashIterator_init(_iter, cache->hash);
+  while (!BLI_ghashIterator_done(_iter)) {
+SeqCacheKey *key = BLI_ghashIterator_getKey(_iter);
+BLI_ghashIterator_step(_iter);
+
+if ((key->type & invalidate_composite) && key->timeline_frame >= 
range_start &&
+key->timeline_frame <= range_end) {
+  if (key->link_next || key->link_prev) {
+seq_cache_relink_keys(key->link_next, key->link_prev);
+  }
+  cache->count--;
+  BLI_ghash_remove(cache->hash, key, seq_cache_keyfree, seq_cache_valfree);
+}
+  }
+  cache->last_key = NULL;
+}
+
 struct ImBuf *seq_cache_get(const SeqRenderData *context,
 Sequence *seq,
 float timeline_frame,
@@ -1427,6 +1460,65 @@ bool seq_cache_put_if_possible(
   return false;
 }
 
+void seq_cache_thumbnail_put(const 

[Bf-blender-cvs] [7697a045418] cycles-x: Merge branch 'master' into cycles-x

2021-06-24 Thread Brecht Van Lommel
Commit: 7697a045418191d3ac71afaa8707509c6331b1a8
Author: Brecht Van Lommel
Date:   Thu Jun 24 19:47:57 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB7697a045418191d3ac71afaa8707509c6331b1a8

Merge branch 'master' into cycles-x

===



===

diff --cc intern/cycles/kernel/geom/geom_triangle.h
index 66dfaa7e4e7,ebc5abc017a..b82354b2572
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@@ -20,12 -20,10 +20,12 @@@
   * ray intersection we use a precomputed triangle storage to accelerate
   * intersection at the cost of more memory usage */
  
 +#pragma once
 +
  CCL_NAMESPACE_BEGIN
  
- /* normal on triangle  */
+ /* Normal on triangle. */
 -ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
 +ccl_device_inline float3 triangle_normal(const KernelGlobals *kg, ShaderData 
*sd)
  {
/* load triangle vertices */
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim);
@@@ -42,15 -40,9 +42,15 @@@
}
  }
  
- /* point and normal on triangle  */
+ /* Point and normal on triangle. */
 -ccl_device_inline void triangle_point_normal(
 -KernelGlobals *kg, int object, int prim, float u, float v, float3 *P, 
float3 *Ng, int *shader)
 +ccl_device_inline void triangle_point_normal(const KernelGlobals *kg,
 + int object,
 + int prim,
 + float u,
 + float v,
 + float3 *P,
 + float3 *Ng,
 + int *shader)
  {
/* load triangle vertices */
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim);

___
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] [b129a0b3974] master: GHOST: remove unused EGL context includes in Win32 and Cocoa

2021-06-24 Thread Christian Rauch
Commit: b129a0b39742e142ff223692288129fbc146e825
Author: Christian Rauch
Date:   Wed Jun 23 00:15:59 2021 +0100
Branches: master
https://developer.blender.org/rBb129a0b39742e142ff223692288129fbc146e825

GHOST: remove unused EGL context includes in Win32 and Cocoa

===

M   intern/ghost/intern/GHOST_SystemCocoa.mm
M   intern/ghost/intern/GHOST_SystemWin32.cpp
M   intern/ghost/intern/GHOST_WindowCocoa.mm
M   intern/ghost/intern/GHOST_WindowWin32.cpp

===

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm 
b/intern/ghost/intern/GHOST_SystemCocoa.mm
index f0cc8946215..e0e4438a8b2 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -32,11 +32,7 @@
 #include "GHOST_WindowCocoa.h"
 #include "GHOST_WindowManager.h"
 
-#if defined(WITH_GL_EGL)
-#  include "GHOST_ContextEGL.h"
-#else
-#  include "GHOST_ContextCGL.h"
-#endif
+#include "GHOST_ContextCGL.h"
 
 #ifdef WITH_INPUT_NDOF
 #  include "GHOST_NDOFManagerCocoa.h"
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp 
b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 2eecea2ef5d..e9fd771e866 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -50,11 +50,7 @@
 #include "GHOST_WindowManager.h"
 #include "GHOST_WindowWin32.h"
 
-#if defined(WITH_GL_EGL)
-#  include "GHOST_ContextEGL.h"
-#else
-#  include "GHOST_ContextWGL.h"
-#endif
+#include "GHOST_ContextWGL.h"
 
 #ifdef WITH_INPUT_NDOF
 #  include "GHOST_NDOFManagerWin32.h"
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm 
b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 1776b0d5ce0..d082fa99ad8 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -22,11 +22,7 @@
 #include "GHOST_Debug.h"
 #include "GHOST_SystemCocoa.h"
 
-#if defined(WITH_GL_EGL)
-#  include "GHOST_ContextEGL.h"
-#else
-#  include "GHOST_ContextCGL.h"
-#endif
+#include "GHOST_ContextCGL.h"
 
 #include 
 #include 
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp 
b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 33c79daf11d..0a647c446e7 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -30,11 +30,8 @@
 #include "utf_winfunc.h"
 #include "utfconv.h"
 
-#if defined(WITH_GL_EGL)
-#  include "GHOST_ContextEGL.h"
-#else
-#  include "GHOST_ContextWGL.h"
-#endif
+#include "GHOST_ContextWGL.h"
+
 #ifdef WIN32_COMPOSITING
 #  include 
 #endif

___
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] [3d7021b4ec2] master: GHOST/XR: support Wayland via XrGraphicsBindingOpenGLWaylandKHR

2021-06-24 Thread Christian Rauch
Commit: 3d7021b4ec23d79fef361364c35965d9af0f4e5b
Author: Christian Rauch
Date:   Wed Jun 23 00:09:18 2021 +0100
Branches: master
https://developer.blender.org/rB3d7021b4ec23d79fef361364c35965d9af0f4e5b

GHOST/XR: support Wayland via XrGraphicsBindingOpenGLWaylandKHR

===

M   intern/ghost/CMakeLists.txt
M   intern/ghost/intern/GHOST_IXrGraphicsBinding.h
M   intern/ghost/intern/GHOST_XrContext.cpp
M   intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

===

diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 1815a46591a..77ec307e604 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -484,10 +484,15 @@ if(WITH_XR_OPENXR)
 )
   elseif(UNIX AND NOT APPLE)
 list(APPEND XR_PLATFORM_DEFINES -DXR_OS_LINUX)
-if (WITH_GL_EGL)
-  list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL)
-else()
-  list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB)
+if (WITH_GHOST_WAYLAND)
+  list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_WAYLAND)
+endif()
+if (WITH_GHOST_X11)
+  if (WITH_GL_EGL)
+list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL)
+  else()
+list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB)
+  endif()
 endif()
   endif()
 
diff --git a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h 
b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
index 5508d34e96c..a7339158dc4 100644
--- a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
+++ b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
@@ -39,6 +39,9 @@ class GHOST_IXrGraphicsBinding {
 #elif defined(WIN32)
 XrGraphicsBindingOpenGLWin32KHR wgl;
 XrGraphicsBindingD3D11KHR d3d11;
+#endif
+#if defined(WITH_GHOST_WAYLAND)
+XrGraphicsBindingOpenGLWaylandKHR wl;
 #endif
   } oxr_binding;
 
diff --git a/intern/ghost/intern/GHOST_XrContext.cpp 
b/intern/ghost/intern/GHOST_XrContext.cpp
index f057e679d56..2906a6b241e 100644
--- a/intern/ghost/intern/GHOST_XrContext.cpp
+++ b/intern/ghost/intern/GHOST_XrContext.cpp
@@ -420,7 +420,7 @@ void GHOST_XrContext::getExtensionsToEnable(
 r_ext_names.push_back(gpu_binding);
   }
 
-#if defined(WITH_GL_EGL)
+#if defined(WITH_GHOST_X11) && defined(WITH_GL_EGL)
   assert(openxr_extension_is_available(m_oxr->extensions, 
XR_MNDX_EGL_ENABLE_EXTENSION_NAME));
   r_ext_names.push_back(XR_MNDX_EGL_ENABLE_EXTENSION_NAME);
 #endif
diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp 
b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
index aeaa6e6b9e0..dd0205ea867 100644
--- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
+++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
@@ -24,6 +24,12 @@
 
 #if defined(WITH_GL_EGL)
 #  include "GHOST_ContextEGL.h"
+#  if defined(WITH_GHOST_X11)
+#include "GHOST_SystemX11.h"
+#  endif
+#  if defined(WITH_GHOST_WAYLAND)
+#include "GHOST_SystemWayland.h"
+#  endif
 #elif defined(WITH_GHOST_X11)
 #  include "GHOST_ContextGLX.h"
 #elif defined(WIN32)
@@ -113,11 +119,13 @@ class GHOST_XrGraphicsBindingOpenGL : public 
GHOST_IXrGraphicsBinding {
 #  if defined(WITH_GL_EGL)
 GHOST_ContextEGL _egl = static_cast(ghost_ctx);
 
-oxr_binding.egl.type = XR_TYPE_GRAPHICS_BINDING_EGL_MNDX;
-oxr_binding.egl.getProcAddress = eglGetProcAddress;
-oxr_binding.egl.display = ctx_egl.getDisplay();
-oxr_binding.egl.config = ctx_egl.getConfig();
-oxr_binding.egl.context = ctx_egl.getContext();
+if (dynamic_cast(ctx_egl.m_system)) {
+  oxr_binding.egl.type = XR_TYPE_GRAPHICS_BINDING_EGL_MNDX;
+  oxr_binding.egl.getProcAddress = eglGetProcAddress;
+  oxr_binding.egl.display = ctx_egl.getDisplay();
+  oxr_binding.egl.config = ctx_egl.getConfig();
+  oxr_binding.egl.context = ctx_egl.getContext();
+}
 #  else
 GHOST_ContextGLX _glx = static_cast(ghost_ctx);
 XVisualInfo *visual_info = glXGetVisualFromFBConfig(ctx_glx.m_display, 
ctx_glx.m_fbconfig);
@@ -139,6 +147,14 @@ class GHOST_XrGraphicsBindingOpenGL : public 
GHOST_IXrGraphicsBinding {
 oxr_binding.wgl.hGLRC = ctx_wgl.m_hGLRC;
 #endif
 
+#if defined(WITH_GHOST_WAYLAND)
+GHOST_ContextEGL _wl_egl = static_cast(ghost_ctx);
+if (dynamic_cast(ctx_wl_egl.m_system)) {
+  oxr_binding.wl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR;
+  oxr_binding.wl.display = (struct wl_display *)ctx_wl_egl.m_nativeDisplay;
+}
+#endif
+
 /* Generate a frame-buffer to use for blitting into the texture. */
 glGenFramebuffers(1, _fbo);
   }

___
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] [5f27a5fff7f] master: GHOST/EGL: store pointer to GHOST_System for downcast tests

2021-06-24 Thread Christian Rauch
Commit: 5f27a5fff7f24d57c39e4b79feeeb4c408c89139
Author: Christian Rauch
Date:   Wed Jun 23 00:01:04 2021 +0100
Branches: master
https://developer.blender.org/rB5f27a5fff7f24d57c39e4b79feeeb4c408c89139

GHOST/EGL: store pointer to GHOST_System for downcast tests

===

M   intern/ghost/intern/GHOST_ContextEGL.cpp
M   intern/ghost/intern/GHOST_ContextEGL.h
M   intern/ghost/intern/GHOST_SystemWayland.cpp
M   intern/ghost/intern/GHOST_SystemX11.cpp
M   intern/ghost/intern/GHOST_WindowWayland.cpp
M   intern/ghost/intern/GHOST_WindowX11.cpp

===

diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp 
b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 770ead5962e..0fee200ea1a 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -202,7 +202,8 @@ template T _api(EGLenum api, T , T , 
T )
   }
 }
 
-GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
+GHOST_ContextEGL::GHOST_ContextEGL(const GHOST_System *const system,
+   bool stereoVisual,
EGLNativeWindowType nativeWindow,
EGLNativeDisplayType nativeDisplay,
EGLint contextProfileMask,
@@ -212,6 +213,7 @@ GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
EGLint contextResetNotificationStrategy,
EGLenum api)
 : GHOST_Context(stereoVisual),
+  m_system(system),
   m_nativeDisplay(nativeDisplay),
   m_nativeWindow(nativeWindow),
   m_contextProfileMask(contextProfileMask),
diff --git a/intern/ghost/intern/GHOST_ContextEGL.h 
b/intern/ghost/intern/GHOST_ContextEGL.h
index 170647177c2..00c8e33ebdf 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.h
+++ b/intern/ghost/intern/GHOST_ContextEGL.h
@@ -24,6 +24,7 @@
 #pragma once
 
 #include "GHOST_Context.h"
+#include "GHOST_System.h"
 
 #include 
 
@@ -43,7 +44,8 @@ class GHOST_ContextEGL : public GHOST_Context {
   /**
* Constructor.
*/
-  GHOST_ContextEGL(bool stereoVisual,
+  GHOST_ContextEGL(const GHOST_System *const system,
+   bool stereoVisual,
EGLNativeWindowType nativeWindow,
EGLNativeDisplayType nativeDisplay,
EGLint contextProfileMask,
@@ -112,6 +114,8 @@ class GHOST_ContextEGL : public GHOST_Context {
  private:
   bool initContextEGLEW();
 
+  const GHOST_System *const m_system;
+
   EGLNativeDisplayType m_nativeDisplay;
   EGLNativeWindowType m_nativeWindow;
 
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp 
b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 16a6c93417e..f54a022f249 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1593,7 +1593,8 @@ GHOST_IContext 
*GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
   GHOST_Context *context;
 
   for (int minor = 6; minor >= 0; --minor) {
-context = new GHOST_ContextEGL(false,
+context = new GHOST_ContextEGL(this,
+   false,
EGLNativeWindowType(os_egl_window),
EGLNativeDisplayType(d->display),
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
@@ -1609,7 +1610,8 @@ GHOST_IContext 
*GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
   delete context;
   }
 
-  context = new GHOST_ContextEGL(false,
+  context = new GHOST_ContextEGL(this,
+ false,
  EGLNativeWindowType(os_egl_window),
  EGLNativeDisplayType(d->display),
  EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp 
b/intern/ghost/intern/GHOST_SystemX11.cpp
index ee312e2fc40..2a1dd890ac2 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -441,7 +441,8 @@ GHOST_IContext 
*GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSetti
 
   for (int minor = 5; minor >= 0; --minor) {
 #if defined(WITH_GL_EGL)
-context = new GHOST_ContextEGL(false,
+context = new GHOST_ContextEGL(this,
+   false,
EGLNativeWindowType(nullptr),
EGLNativeDisplayType(m_display),
profile_mask,
@@ -471,7 +472,8 @@ GHOST_IContext 
*GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSetti
   }
 
 #if defined(WITH_GL_EGL)
-  context = new GHOST_ContextEGL(false,
+  context = new GHOST_ContextEGL(this,
+ false,
  EGLNativeWindowType(nullptr),

[Bf-blender-cvs] [b801db11811] master: GHOST/Wayland: auto-select highest supported OpenGL version

2021-06-24 Thread Christian Rauch
Commit: b801db11811ddd5c9639ff8e701cf5462dde4139
Author: Christian Rauch
Date:   Tue Jun 22 22:46:28 2021 +0100
Branches: master
https://developer.blender.org/rBb801db11811ddd5c9639ff8e701cf5462dde4139

GHOST/Wayland: auto-select highest supported OpenGL version

===

M   intern/ghost/intern/GHOST_SystemWayland.cpp
M   intern/ghost/intern/GHOST_WindowWayland.cpp

===

diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp 
b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 83b9b2ba36b..16a6c93417e 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1590,15 +1590,34 @@ GHOST_IContext 
*GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
   d->os_surfaces.push_back(os_surface);
   d->os_egl_windows.push_back(os_egl_window);
 
-  GHOST_Context *context = new GHOST_ContextEGL(false,
-
EGLNativeWindowType(os_egl_window),
-
EGLNativeDisplayType(d->display),
-
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
-3,
-3,
-GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-EGL_OPENGL_API);
+  GHOST_Context *context;
+
+  for (int minor = 6; minor >= 0; --minor) {
+context = new GHOST_ContextEGL(false,
+   EGLNativeWindowType(os_egl_window),
+   EGLNativeDisplayType(d->display),
+   EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+   4,
+   minor,
+   GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+   
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+   EGL_OPENGL_API);
+
+if (context->initializeDrawingContext())
+  return context;
+else
+  delete context;
+  }
+
+  context = new GHOST_ContextEGL(false,
+ EGLNativeWindowType(os_egl_window),
+ EGLNativeDisplayType(d->display),
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+ 3,
+ 3,
+ GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+ GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+ EGL_OPENGL_API);
 
   if (context->initializeDrawingContext()) {
 return context;
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp 
b/intern/ghost/intern/GHOST_WindowWayland.cpp
index cbac2d6eaa1..1b9c29fc2c9 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -532,6 +532,22 @@ GHOST_Context 
*GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
   context = new GHOST_ContextNone(m_wantStereoVisual);
   break;
 case GHOST_kDrawingContextTypeOpenGL:
+  for (int minor = 6; minor >= 0; --minor) {
+context = new GHOST_ContextEGL(m_wantStereoVisual,
+   EGLNativeWindowType(w->egl_window),
+   
EGLNativeDisplayType(m_system->display()),
+   EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+   4,
+   minor,
+   GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+   
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+   EGL_OPENGL_API);
+
+if (context->initializeDrawingContext())
+  return context;
+else
+  delete context;
+  }
   context = new GHOST_ContextEGL(m_wantStereoVisual,
  EGLNativeWindowType(w->egl_window),
  EGLNativeDisplayType(m_system->display()),
@@ -541,7 +557,6 @@ GHOST_Context 
*GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
  GHOST_OPENGL_EGL_CONTEXT_FLAGS,
  
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
  EGL_OPENGL_API);
-  break;
   }
 
   return (context->initializeDrawingContext() == GHOST_kSuccess) ? context : 
nullptr;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:

[Bf-blender-cvs] [b5840f9b5ba] master: Cleanup: compiler warnings with clang

2021-06-24 Thread Brecht Van Lommel
Commit: b5840f9b5ba912f016db01dfcd5b28f32195c147
Author: Brecht Van Lommel
Date:   Thu Jun 24 19:17:51 2021 +0200
Branches: master
https://developer.blender.org/rBb5840f9b5ba912f016db01dfcd5b28f32195c147

Cleanup: compiler warnings with clang

* Mark either all or no class methods with override
* Don't use zero sized array since it has a different size in C and C++.
  Using a little more memory here is not significant.
* Don't use deprecated mechanism to mark private GSet members in clang
  just like we don't for MSVC, it warns even for simple zero initialization.

===

M   intern/ghost/intern/GHOST_System.h
M   source/blender/blenkernel/BKE_spline.hh
M   source/blender/blenlib/BLI_ghash.h
M   source/blender/editors/space_outliner/tree/tree_element_overrides.cc
M   source/blender/editors/space_outliner/tree/tree_element_overrides.hh
M   source/blender/editors/transform/transform_convert_sequencer.c
M   source/blender/gpu/GPU_viewport.h

===

diff --git a/intern/ghost/intern/GHOST_System.h 
b/intern/ghost/intern/GHOST_System.h
index 9915520691f..279f90b9641 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -239,7 +239,7 @@ class GHOST_System : public GHOST_ISystem {
* Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
* \param api: Enum indicating which API to use.
*/
-  virtual void setTabletAPI(GHOST_TTabletAPI api) override;
+  virtual void setTabletAPI(GHOST_TTabletAPI api);
   GHOST_TTabletAPI getTabletAPI(void);
 
 #ifdef WITH_INPUT_NDOF
diff --git a/source/blender/blenkernel/BKE_spline.hh 
b/source/blender/blenkernel/BKE_spline.hh
index 24b5a78e598..0de9270bde1 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -328,7 +328,8 @@ class BezierSpline final : public Spline {
   };
   InterpolationData interpolation_data_from_index_factor(const float 
index_factor) const;
 
-  virtual blender::fn::GVArrayPtr interpolate_to_evaluated(const 
blender::fn::GVArray ) const;
+  virtual blender::fn::GVArrayPtr interpolate_to_evaluated(
+  const blender::fn::GVArray ) const override;
 
   void evaluate_segment(const int index,
 const int next_index,
diff --git a/source/blender/blenlib/BLI_ghash.h 
b/source/blender/blenlib/BLI_ghash.h
index bc517f81955..b53b8a433d2 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -234,7 +234,7 @@ void *BLI_gset_pop_key(GSet *gs, const void *key) 
ATTR_WARN_UNUSED_RESULT;
 /* so we can cast but compiler sees as different */
 typedef struct GSetIterator {
   GHashIterator _ghi
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
   __attribute__((deprecated))
 #endif
   ;
diff --git 
a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc 
b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
index c5d254242c6..731beb3956e 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
@@ -94,9 +94,7 @@ void TreeElementOverridesBase::expand(SpaceOutliner 
_outliner) const
 
 TreeElementOverridesProperty::TreeElementOverridesProperty(TreeElement 
_te,

TreeElementOverridesData _data)
-: AbstractTreeElement(legacy_te),
-  id_(override_data.id),
-  override_prop_(override_data.override_property)
+: AbstractTreeElement(legacy_te), 
override_prop_(override_data.override_property)
 {
   BLI_assert(legacy_te.store_elem->type == TSE_LIBRARY_OVERRIDE);
 
diff --git 
a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh 
b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
index c3caab8e268..0067db6ea56 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
@@ -40,7 +40,6 @@ class TreeElementOverridesBase final : public 
AbstractTreeElement {
 };
 
 class TreeElementOverridesProperty final : public AbstractTreeElement {
-  ID _;
   IDOverrideLibraryProperty _prop_;
 
  public:
diff --git a/source/blender/editors/transform/transform_convert_sequencer.c 
b/source/blender/editors/transform/transform_convert_sequencer.c
index 6a23b10b079..2cb0e3c8589 100644
--- a/source/blender/editors/transform/transform_convert_sequencer.c
+++ b/source/blender/editors/transform/transform_convert_sequencer.c
@@ -465,7 +465,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer 
*tc, TransCustomData *c
 
   SeqCollection *transformed_strips = 
seq_transform_collection_from_transdata(tc);
 
-  if ((t->state == TRANS_CANCEL)) {
+  if (t->state == TRANS_CANCEL) {
 seq_transform_cancel(t, 

[Bf-blender-cvs] [15868b1ff4a] master: Fix wrong default value for RenderEngine.bl_use_image_save

2021-06-24 Thread Thomas Lachmann
Commit: 15868b1ff4ad07ca5f7274b6c54f2f43a4ded955
Author: Thomas Lachmann
Date:   Thu Jun 24 19:01:44 2021 +0200
Branches: master
https://developer.blender.org/rB15868b1ff4ad07ca5f7274b6c54f2f43a4ded955

Fix wrong default value for RenderEngine.bl_use_image_save

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

===

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

===

diff --git a/source/blender/makesrna/intern/rna_render.c 
b/source/blender/makesrna/intern/rna_render.c
index 6715941ae2a..4fe61df9387 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -858,6 +858,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "bl_use_image_save", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", 
RE_USE_NO_IMAGE_SAVE);
+  RNA_def_property_boolean_default(prop, true);
   RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
   RNA_def_property_ui_text(
   prop,

___
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] [beb6399ae59] master: Fix T89129: file dialog displays in-progress Safari downloads as a folder

2021-06-24 Thread Leon Zandman
Commit: beb6399ae5971fdbbf8aa6eb8832200afabeb97d
Author: Leon Zandman
Date:   Thu Jun 24 19:03:51 2021 +0200
Branches: master
https://developer.blender.org/rBbeb6399ae5971fdbbf8aa6eb8832200afabeb97d

Fix T89129: file dialog displays in-progress Safari downloads as a folder

In-progress Safari download files/packages are now recognized as bundles
and therefore not treated as directories.

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

===

M   source/blender/editors/space_file/filelist.c
M   source/blender/makesdna/DNA_space_types.h

===

diff --git a/source/blender/editors/space_file/filelist.c 
b/source/blender/editors/space_file/filelist.c
index 148799067bc..40a7be0423e 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1191,7 +1191,7 @@ static int filelist_geticon_ex(const FileDirEntry *file,
 if (FILENAME_IS_PARENT(file->relpath)) {
   return is_main ? ICON_FILE_PARENT : ICON_NONE;
 }
-if (typeflag & FILE_TYPE_APPLICATIONBUNDLE) {
+if (typeflag & FILE_TYPE_BUNDLE) {
   return ICON_UGLYPACKAGE;
 }
 if (typeflag & FILE_TYPE_BLENDER) {
@@ -2519,9 +2519,16 @@ int ED_path_extension_type(const char *path)
   if (file_is_blend_backup(path)) {
 return FILE_TYPE_BLENDER_BACKUP;
   }
-  if (BLI_path_extension_check(path, ".app")) {
-return FILE_TYPE_APPLICATIONBUNDLE;
+#ifdef __APPLE__
+  if (BLI_path_extension_check_n(path,
+ /* Application bundle */
+ ".app",
+ /* Safari in-progress/paused download */
+ ".download",
+ NULL)) {
+return FILE_TYPE_BUNDLE;
   }
+#endif
   if (BLI_path_extension_check(path, ".py")) {
 return FILE_TYPE_PYSCRIPT;
   }
@@ -2815,7 +2822,7 @@ static int filelist_readjob_list_dir(const char *root,
   entry->attributes = BLI_file_attributes(full_path);
   if (S_ISDIR(files[i].s.st_mode)
 #ifdef __APPLE__
-  && !(ED_path_extension_type(full_path) & FILE_TYPE_APPLICATIONBUNDLE)
+  && !(ED_path_extension_type(full_path) & FILE_TYPE_BUNDLE)
 #endif
   ) {
 entry->typeflag = FILE_TYPE_DIR;
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index 7804ece9769..2b9a4f7ba1d 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1019,7 +1019,7 @@ typedef enum eFileSel_File_Types {
   FILE_TYPE_COLLADA = (1 << 13),
   /** from filter_glob operator property */
   FILE_TYPE_OPERATOR = (1 << 14),
-  FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
+  FILE_TYPE_BUNDLE = (1 << 15),
   FILE_TYPE_ALEMBIC = (1 << 16),
   /** For all kinds of recognized import/export formats. No need for 
specialized types. */
   FILE_TYPE_OBJECT_IO = (1 << 17),

___
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] [7b524d9b710] master: Cleanup: move and simplify some draw_cache macros

2021-06-24 Thread Germano Cavalcante
Commit: 7b524d9b710f18dc4539a97de7fad7a760565757
Author: Germano Cavalcante
Date:   Thu Jun 24 10:53:22 2021 -0300
Branches: master
https://developer.blender.org/rB7b524d9b710f18dc4539a97de7fad7a760565757

Cleanup: move and simplify some draw_cache macros

===

M   source/blender/draw/intern/draw_cache_extract.h
M   source/blender/draw/intern/draw_cache_extract_mesh_private.h
M   source/blender/draw/intern/draw_cache_impl_mesh.c

===

diff --git a/source/blender/draw/intern/draw_cache_extract.h 
b/source/blender/draw/intern/draw_cache_extract.h
index 848253a7e43..be61b0a9baf 100644
--- a/source/blender/draw/intern/draw_cache_extract.h
+++ b/source/blender/draw/intern/draw_cache_extract.h
@@ -263,8 +263,7 @@ typedef struct MeshBatchCache {
 #define MBC_IBO_LEN (sizeof(((MeshBufferCache){0}).ibo) / sizeof(void *))
 
 #define MBC_BATCH_INDEX(batch_name) \
-  ((offsetof(MeshBatchCache, batch_name) - offsetof(MeshBatchCache, 
batch.surface)) / \
-   sizeof(void *))
+  ((offsetof(MeshBatchCache, batch_name) - offsetof(MeshBatchCache, batch)) / 
sizeof(void *))
 
 typedef enum DRWBatchFlag {
   MBC_SURFACE = (1u << MBC_BATCH_INDEX(batch.surface)),
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh_private.h 
b/source/blender/draw/intern/draw_cache_extract_mesh_private.h
index a258967564b..1b4521335ec 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh_private.h
+++ b/source/blender/draw/intern/draw_cache_extract_mesh_private.h
@@ -40,66 +40,6 @@ extern "C" {
 
 #define MIN_RANGE_LEN 1024
 
-/* -- */
-/** \name Dependencies between buffer and batch
- * \{ */
-#ifndef NDEBUG
-#  define _MDEF_type(name) static DRWBatchFlag MDEP_assert_##name = 0, 
MDEP_##name
-#else
-#  define _MDEF_type(name) static const DRWBatchFlag MDEP_##name
-#endif
-
-/* clang-format off */
-
-#define _MDEPS_CREATE1(b) (1u << MBC_BATCH_INDEX(b))
-#define _MDEPS_CREATE2(b1, b2) _MDEPS_CREATE1(b1) | _MDEPS_CREATE1(b2)
-#define _MDEPS_CREATE3(b1, b2, b3) _MDEPS_CREATE2(b1, b2) | _MDEPS_CREATE1(b3)
-#define _MDEPS_CREATE4(b1, b2, b3, b4) _MDEPS_CREATE3(b1, b2, b3) | 
_MDEPS_CREATE1(b4)
-#define _MDEPS_CREATE5(b1, b2, b3, b4, b5) _MDEPS_CREATE4(b1, b2, b3, b4) | 
_MDEPS_CREATE1(b5)
-#define _MDEPS_CREATE6(b1, b2, b3, b4, b5, b6) _MDEPS_CREATE5(b1, b2, b3, b4, 
b5) | _MDEPS_CREATE1(b6)
-#define _MDEPS_CREATE7(b1, b2, b3, b4, b5, b6, b7) _MDEPS_CREATE6(b1, b2, b3, 
b4, b5, b6) | _MDEPS_CREATE1(b7)
-#define _MDEPS_CREATE8(b1, b2, b3, b4, b5, b6, b7, b8) _MDEPS_CREATE7(b1, b2, 
b3, b4, b5, b6, b7) | _MDEPS_CREATE1(b8)
-#define _MDEPS_CREATE9(b1, b2, b3, b4, b5, b6, b7, b8, b9) _MDEPS_CREATE8(b1, 
b2, b3, b4, b5, b6, b7, b8) | _MDEPS_CREATE1(b9)
-#define _MDEPS_CREATE10(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10) 
_MDEPS_CREATE9(b1, b2, b3, b4, b5, b6, b7, b8, b9) | _MDEPS_CREATE1(b10)
-#define _MDEPS_CREATE19(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, 
b13, b14, b15, b16, b17, b18, b19) _MDEPS_CREATE10(b1, b2, b3, b4, b5, b6, b7, 
b8, b9, b10) | _MDEPS_CREATE9(b11, b12, b13, b14, b15, b16, b17, b18, b19)
-
-#define MDEPS_CREATE(name, ...) _MDEF_type(name) = 
VA_NARGS_CALL_OVERLOAD(_MDEPS_CREATE, __VA_ARGS__)
-
-#define _MDEPS_CREATE_MAP1(a) MDEP_##a
-#define _MDEPS_CREATE_MAP2(a, b) MDEP_##a | MDEP_##b
-#define _MDEPS_CREATE_MAP3(a, b, c) _MDEPS_CREATE_MAP2(a, b) | MDEP_##c
-#define _MDEPS_CREATE_MAP4(a, b, c, d) _MDEPS_CREATE_MAP3(a, b, c) | MDEP_##d
-#define _MDEPS_CREATE_MAP5(a, b, c, d, e) _MDEPS_CREATE_MAP4(a, b, c, d) | 
MDEP_##e
-#define _MDEPS_CREATE_MAP6(a, b, c, d, e, f) _MDEPS_CREATE_MAP5(a, b, c, d, e) 
| MDEP_##f
-#define _MDEPS_CREATE_MAP7(a, b, c, d, e, f, g) _MDEPS_CREATE_MAP6(a, b, c, d, 
e, f) | MDEP_##g
-#define _MDEPS_CREATE_MAP8(a, b, c, d, e, f, g, h) _MDEPS_CREATE_MAP7(a, b, c, 
d, e, f, g) | MDEP_##h
-#define _MDEPS_CREATE_MAP9(a, b, c, d, e, f, g, h, i) _MDEPS_CREATE_MAP8(a, b, 
c, d, e, f, g, h) | MDEP_##i
-#define _MDEPS_CREATE_MAP10(a, b, c, d, e, f, g, h, i, j) 
_MDEPS_CREATE_MAP9(a, b, c, d, e, f, g, h, i) | MDEP_##j
-
-#define MDEPS_CREATE_MAP(...) VA_NARGS_CALL_OVERLOAD(_MDEPS_CREATE_MAP, 
__VA_ARGS__)
-
-#ifndef NDEBUG
-#  define _MDEPS_ASSERT2(b, name) \
-MDEP_assert_##name |= _MDEPS_CREATE1(b); \
-BLI_assert(MDEP_##name & _MDEPS_CREATE1(b))
-#  define _MDEPS_ASSERT3(b, n1, n2) _MDEPS_ASSERT2(b, n1); _MDEPS_ASSERT2(b, 
n2)
-#  define _MDEPS_ASSERT4(b, n1, n2, n3) _MDEPS_ASSERT3(b, n1, n2); 
_MDEPS_ASSERT2(b, n3)
-#  define _MDEPS_ASSERT5(b, n1, n2, n3, n4) _MDEPS_ASSERT4(b, n1, n2, n3); 
_MDEPS_ASSERT2(b, n4)
-#  define _MDEPS_ASSERT6(b, n1, n2, n3, n4, n5) _MDEPS_ASSERT5(b, n1, n2, n3, 
n4); _MDEPS_ASSERT2(b, n5)
-#  define _MDEPS_ASSERT7(b, n1, n2, n3, n4, n5, n6) _MDEPS_ASSERT6(b, n1, n2, 
n3, n4, n5); _MDEPS_ASSERT2(b, n6)
-#  define _MDEPS_ASSERT8(b, n1, n2, n3, n4, n5, 

[Bf-blender-cvs] [a13314a03f9] master: Fix T89390: crash when join geometry node has only muted inputs

2021-06-24 Thread Jacques Lucke
Commit: a13314a03f929d30d6db174541abb10daa501117
Author: Jacques Lucke
Date:   Thu Jun 24 15:45:43 2021 +0200
Branches: master
https://developer.blender.org/rBa13314a03f929d30d6db174541abb10daa501117

Fix T89390: crash when join geometry node has only muted inputs

===

M   source/blender/modifiers/intern/MOD_nodes_evaluator.cc
M   source/blender/nodes/NOD_node_tree_ref.hh
M   source/blender/nodes/intern/node_tree_ref.cc

===

diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc 
b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index e8677c7ce1a..980607db839 100644
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@ -1456,9 +1456,11 @@ Vector 
NodeParamsProvider::extract_multi_input(StringRef identi
 
   Vector ret_values;
   socket.foreach_origin_socket([&](DSocket origin) {
-for (const MultiInputValueItem  : multi_value.items) {
-  if (item.origin == origin) {
+for (MultiInputValueItem  : multi_value.items) {
+  if (item.origin == origin && item.value != nullptr) {
 ret_values.append({*input_state.type, item.value});
+/* Make sure we do not use the same value again if two values have the 
same origin. */
+item.value = nullptr;
 return;
   }
 }
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh 
b/source/blender/nodes/NOD_node_tree_ref.hh
index b028fc28bbc..4f2565cbbaf 100644
--- a/source/blender/nodes/NOD_node_tree_ref.hh
+++ b/source/blender/nodes/NOD_node_tree_ref.hh
@@ -146,7 +146,7 @@ class InputSocketRef final : public SocketRef {
   void foreach_logical_origin(FunctionRef 
origin_fn,
   FunctionRef skipped_fn,
   bool only_follow_first_input_link,
-  Vector _sockets) 
const;
+  Vector 
_sockets_stack) const;
 };
 
 class OutputSocketRef final : public SocketRef {
@@ -159,7 +159,7 @@ class OutputSocketRef final : public SocketRef {
  private:
   void foreach_logical_target(FunctionRef 
target_fn,
   FunctionRef skipped_fn,
-  Vector 
_sockets) const;
+  Vector 
_sockets_stack) const;
 };
 
 class NodeRef : NonCopyable, NonMovable {
diff --git a/source/blender/nodes/intern/node_tree_ref.cc 
b/source/blender/nodes/intern/node_tree_ref.cc
index 6709eb52798..bed4d60382d 100644
--- a/source/blender/nodes/intern/node_tree_ref.cc
+++ b/source/blender/nodes/intern/node_tree_ref.cc
@@ -176,12 +176,12 @@ void NodeTreeRef::create_linked_socket_caches()
 /* Find logically linked sockets. */
 Vector logically_linked_sockets;
 Vector logically_linked_skipped_sockets;
-Vector handled_sockets;
+Vector seen_sockets_stack;
 socket->foreach_logical_origin(
 [&](const OutputSocketRef ) { 
logically_linked_sockets.append(); },
 [&](const SocketRef ) { 
logically_linked_skipped_sockets.append(); },
 false,
-handled_sockets);
+seen_sockets_stack);
 if (logically_linked_sockets == directly_linked_sockets) {
   socket->logically_linked_sockets_ = socket->directly_linked_sockets_;
 }
@@ -222,16 +222,17 @@ void NodeTreeRef::create_linked_socket_caches()
   }
 }
 
-void InputSocketRef::foreach_logical_origin(FunctionRef origin_fn,
-FunctionRef skipped_fn,
-bool only_follow_first_input_link,
-Vector 
_sockets) const
+void InputSocketRef::foreach_logical_origin(
+FunctionRef origin_fn,
+FunctionRef skipped_fn,
+bool only_follow_first_input_link,
+Vector _sockets_stack) const
 {
   /* Protect against loops. */
-  if (handled_sockets.contains(this)) {
+  if (seen_sockets_stack.contains(this)) {
 return;
   }
-  handled_sockets.append(this);
+  seen_sockets_stack.append(this);
 
   Span links_to_check = this->directly_linked_links();
   if (only_follow_first_input_link) {
@@ -251,7 +252,7 @@ void 
InputSocketRef::foreach_logical_origin(FunctionReffrom();
   skipped_fn.call_safe(origin);
   skipped_fn.call_safe(mute_input);
-  mute_input.foreach_logical_origin(origin_fn, skipped_fn, true, 
handled_sockets);
+  mute_input.foreach_logical_origin(origin_fn, skipped_fn, true, 
seen_sockets_stack);
   break;
 }
   }
@@ -268,18 +269,20 @@ void 
InputSocketRef::foreach_logical_origin(FunctionRef target_fn,
 FunctionRef skipped_fn,
-Vector _sockets) const
+Vector _sockets_stack) const
 {
   /* Protect against loops. */
-  if (handled_sockets.contains(this)) {
+  if (seen_sockets_stack.contains(this)) {
 return;
   }
-  handled_sockets.append(this);
+  

[Bf-blender-cvs] [d7155a55462] asset-browser-poselib: Merge branch 'master' into asset-browser-poselib

2021-06-24 Thread Julian Eisel
Commit: d7155a554625ab7fddea1a896e381420158d8a74
Author: Julian Eisel
Date:   Thu Jun 24 15:26:44 2021 +0200
Branches: asset-browser-poselib
https://developer.blender.org/rBd7155a554625ab7fddea1a896e381420158d8a74

Merge branch 'master' into asset-browser-poselib

===



===



___
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] [45cfa58ee82] cycles-x: Enable built-in OptiX curves by default

2021-06-24 Thread Patrick Mours
Commit: 45cfa58ee82a3ccdeaa5d07cb69e0f672b356e08
Author: Patrick Mours
Date:   Thu Jun 24 12:53:43 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB45cfa58ee82a3ccdeaa5d07cb69e0f672b356e08

Enable built-in OptiX curves by default

Starting with OptiX 7.3 curves now behave as expected with Cycles and render 
the same as the
custom intersection implementation, so enable by default.

===

M   intern/cycles/blender/addon/properties.py
M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/blender_python.cpp
M   intern/cycles/device/optix/device_impl.cpp
M   intern/cycles/util/util_debug.cpp
M   intern/cycles/util/util_debug.h

===

diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 6afce0829f8..4997e9e4381 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -708,11 +708,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
 
 debug_use_cuda_adaptive_compile: BoolProperty(name="Adaptive Compile", 
default=False)
 
-debug_use_optix_curves_api: BoolProperty(
-name="Native OptiX Curve Primitive",
-description="Use OptiX curves API for hair instead of custom 
implementation",
-default=False
-)
 debug_use_optix_debug: BoolProperty(
 name="OptiX Module Debug",
 description="Load OptiX module in debug mode: lower logging verbosity 
level, enable validations, and lower optimization level",
diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 4d6418ed84a..8ab8e051ec0 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1779,7 +1779,6 @@ class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, 
Panel):
 
 col = layout.column()
 col.label(text="OptiX Flags:")
-col.prop(cscene, "debug_use_optix_curves_api")
 col.prop(cscene, "debug_use_optix_debug")
 
 col.separator()
diff --git a/intern/cycles/blender/blender_python.cpp 
b/intern/cycles/blender/blender_python.cpp
index fbb6c07bfb6..59826fa3e85 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -90,7 +90,6 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
   /* Synchronize CUDA flags. */
   flags.cuda.adaptive_compile = get_boolean(cscene, 
"debug_use_cuda_adaptive_compile");
   /* Synchronize OptiX flags. */
-  flags.optix.use_curves_api = get_boolean(cscene, 
"debug_use_optix_curves_api");
   flags.optix.use_debug = get_boolean(cscene, "debug_use_optix_debug");
   /* Synchronize OpenCL device type. */
   switch (get_enum(cscene, "debug_opencl_device_type")) {
diff --git a/intern/cycles/device/optix/device_impl.cpp 
b/intern/cycles/device/optix/device_impl.cpp
index 2d2b596b95b..44f7964304d 100644
--- a/intern/cycles/device/optix/device_impl.cpp
+++ b/intern/cycles/device/optix/device_impl.cpp
@@ -232,12 +232,13 @@ bool OptiXDevice::load_kernels(const 
DeviceRequestedFeatures _features
 #  if OPTIX_ABI_VERSION >= 36
   pipeline_options.usesPrimitiveTypeFlags = 
OPTIX_PRIMITIVE_TYPE_FLAGS_TRIANGLE;
   if (requested_features.use_hair) {
-if (DebugFlags().optix.use_curves_api && 
requested_features.use_hair_thick) {
+#if OPTIX_ABI_VERSION >= 47
+if (requested_features.use_hair_thick) {
   pipeline_options.usesPrimitiveTypeFlags |= 
OPTIX_PRIMITIVE_TYPE_FLAGS_ROUND_CUBIC_BSPLINE;
 }
-else {
+else
+#endif
   pipeline_options.usesPrimitiveTypeFlags |= 
OPTIX_PRIMITIVE_TYPE_FLAGS_CUSTOM;
-}
   }
 #  endif
 
@@ -337,8 +338,8 @@ bool OptiXDevice::load_kernels(const 
DeviceRequestedFeatures _features
   group_descs[PG_HITS].hitgroup.entryFunctionNameIS = 
"__intersection__curve_ribbon";
 }
 
-#  if OPTIX_ABI_VERSION >= 36
-if (DebugFlags().optix.use_curves_api && 
requested_features.use_hair_thick) {
+#  if OPTIX_ABI_VERSION >= 47
+if (requested_features.use_hair_thick) {
   OptixBuiltinISOptions builtin_options = {};
   builtin_options.builtinISModuleType = 
OPTIX_PRIMITIVE_TYPE_ROUND_CUBIC_BSPLINE;
   builtin_options.usesMotionBlur = false;
@@ -409,7 +410,7 @@ bool OptiXDevice::load_kernels(const 
DeviceRequestedFeatures _features
   trace_css = std::max(trace_css, stack_size[PG_HITD].cssIS + 
stack_size[PG_HITD].cssAH);
   trace_css = std::max(trace_css, stack_size[PG_HITS].cssIS + 
stack_size[PG_HITS].cssAH);
   trace_css = std::max(trace_css, stack_size[PG_HITL].cssIS + 
stack_size[PG_HITL].cssAH);
-#  if OPTIX_ABI_VERSION >= 36
+#  if OPTIX_ABI_VERSION >= 47
   trace_css = std::max(trace_css,
stack_size[PG_HITD_MOTION].cssIS + 
stack_size[PG_HITD_MOTION].cssAH);
   trace_css = std::max(trace_css,
@@ -439,7 +440,7 @@ bool OptiXDevice::load_kernels(const 
DeviceRequestedFeatures 

[Bf-blender-cvs] [cbdddc56488] master: Workaround for assert from 27da305a404f72a75a37892e1ac080c6531d059b

2021-06-24 Thread Campbell Barton
Commit: cbdddc564887731d9b4fe4432fdf855975e8e939
Author: Campbell Barton
Date:   Thu Jun 24 20:56:16 2021 +1000
Branches: master
https://developer.blender.org/rBcbdddc564887731d9b4fe4432fdf855975e8e939

Workaround for assert from 27da305a404f72a75a37892e1ac080c6531d059b

This worked for existing scenes but adding new objects was asserting
needs further investigation.

===

M   source/blender/depsgraph/intern/node/deg_node_component.h

===

diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h 
b/source/blender/depsgraph/intern/node/deg_node_component.h
index 965022823d3..6e31ef268ed 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -227,7 +227,8 @@ struct ParametersComponentNode : public ComponentNode {
   virtual bool need_tag_cow_before_update() override
   {
 if (ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(owner->id_type)) {
-  BLI_assert(deg_copy_on_write_is_expanded(owner->id_cow));
+  /* Disabled as this is not true for newly added objects, needs 
investigation. */
+  // BLI_assert(deg_copy_on_write_is_expanded(owner->id_cow));
   return false;
 }
 return true;

___
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] [27da305a404] master: Depsgraph: support flushing parameters without a full COW update

2021-06-24 Thread Campbell Barton
Commit: 27da305a404f72a75a37892e1ac080c6531d059b
Author: Campbell Barton
Date:   Thu Jun 24 19:13:52 2021 +1000
Branches: master
https://developer.blender.org/rB27da305a404f72a75a37892e1ac080c6531d059b

Depsgraph: support flushing parameters without a full COW update

Avoid computationally expensive copying operations
when only some settings have been modified.

This is done by adding support for updating parameters
without tagging for copy-on-write.

Currently only mesh data blocks are supported,
other data-blocks can be added individually.

This prepares for changing values such as edit-mesh auto-smooth angle
in edit-mode without duplicating all mesh-data.
The benefit will only be seen when the user interface no longer tags
all ID's for copy on write updates.

ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations
where non edit-mode geometry is modified in edit-mode.
While this isn't something user are likely to do,
Python scripts may change the underlying mesh.

Reviewed By: sergey

Ref D11377

===

M   source/blender/blenkernel/BKE_lib_id.h
M   source/blender/blenkernel/CMakeLists.txt
A   source/blender/blenkernel/intern/lib_id_eval.c
M   source/blender/blenkernel/intern/mesh_validate.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/depsgraph_tag.cc
M   source/blender/depsgraph/intern/node/deg_node_component.h
M   source/blender/editors/mesh/editmesh_tools.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesrna/intern/rna_mesh.c
M   source/blender/makesrna/intern/rna_mesh_api.c
M   source/blender/python/bmesh/bmesh_py_types.c

===

diff --git a/source/blender/blenkernel/BKE_lib_id.h 
b/source/blender/blenkernel/BKE_lib_id.h
index e16507bf3cc..fac5dc8c010 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -315,6 +315,9 @@ void BKE_id_blend_write(struct BlendWriter *writer, struct 
ID *id);
 
 #define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
 
+/* lib_id_eval.c */
+void BKE_id_eval_properties_copy(struct ID *id_cow, struct ID *id);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 0f36887b234..20663f0a790 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -165,6 +165,7 @@ set(SRC
   intern/layer_utils.c
   intern/lib_id.c
   intern/lib_id_delete.c
+  intern/lib_id_eval.c
   intern/lib_override.c
   intern/lib_query.c
   intern/lib_remap.c
diff --git a/source/blender/blenkernel/intern/lib_id_eval.c 
b/source/blender/blenkernel/intern/lib_id_eval.c
new file mode 100644
index 000..140fe403ac3
--- /dev/null
+++ b/source/blender/blenkernel/intern/lib_id_eval.c
@@ -0,0 +1,48 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bke
+ *
+ * Contains management of ID's and libraries
+ * allocate and free of all library data
+ */
+
+#include "DNA_ID.h"
+#include "DNA_mesh_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "BKE_lib_id.h"
+#include "BKE_mesh.h"
+
+/**
+ * Copy relatives parameters, from `id` to `id_cow`.
+ * Use handle the #ID_RECALC_PARAMETERS tag.
+ * \note Keep in sync with #ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW.
+ */
+void BKE_id_eval_properties_copy(ID *id_cow, ID *id)
+{
+  const ID_Type id_type = GS(id->name);
+  BLI_assert((id_cow->tag & LIB_TAG_COPIED_ON_WRITE) && !(id->tag & 
LIB_TAG_COPIED_ON_WRITE));
+  BLI_assert(ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(id_type));
+  if (id_type == ID_ME) {
+BKE_mesh_copy_parameters((Mesh *)id_cow, (const Mesh *)id);
+  }
+  else {
+BLI_assert_unreachable();
+  }
+}
diff --git a/source/blender/blenkernel/intern/mesh_validate.c 
b/source/blender/blenkernel/intern/mesh_validate.c
index df84cf6607f..bfdbf844a26 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -1105,7 +1105,7 @@ bool BKE_mesh_validate(Mesh *me, const bool do_verbose, 
const bool cddata_check_
   

[Bf-blender-cvs] [51568030e9c] master: Depsgraph: remove redundant mesh data duplication in edit-mode

2021-06-24 Thread Campbell Barton
Commit: 51568030e9c833da867c8d80c72b2eca2f591477
Author: Campbell Barton
Date:   Thu Jun 24 19:18:53 2021 +1000
Branches: master
https://developer.blender.org/rB51568030e9c833da867c8d80c72b2eca2f591477

Depsgraph: remove redundant mesh data duplication in edit-mode

This resolves a bottleneck where every update while transforming
copied the entire mesh data-block, which isn't needed as the edit-mesh
is the source of the data being edited.

Testing shows a significant overall speedup when transforming:

- ~1.5x with a subdivided cube 1.5 million vertices.
- ~3.0x with the spring mesh (edit-mode with modifiers disabled,
  duplicated 10x to drop performance).

Reviewed By: sergey

Ref D11337

===

M   source/blender/depsgraph/intern/node/deg_node_component.h

===

diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h 
b/source/blender/depsgraph/intern/node/deg_node_component.h
index a7c69b27654..965022823d3 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -31,6 +31,10 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_object.h"
+
+#include "DNA_object_types.h"
+
 struct ID;
 struct bPoseChannel;
 
@@ -158,6 +162,23 @@ struct ComponentNode : public Node {
 DEG_COMPONENT_NODE_DECLARE; \
   }
 
+/* When updating object data in edit-mode, don't request COW update since this 
will duplicate
+ * all object data which is unnecessary when the edit-mode data is used for 
calculating modifiers.
+ *
+ * TODO: Investigate modes besides edit-mode. */
+#define DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_OBDATA_IN_EDIT_MODE(name) \
+  struct name##ComponentNode : public ComponentNode { \
+DEG_COMPONENT_NODE_DECLARE; \
+virtual bool need_tag_cow_before_update() override \
+{ \
+  if (OB_DATA_SUPPORT_EDITMODE(owner->id_type) && \
+  BKE_object_data_is_in_editmode(owner->id_orig)) { \
+return false; \
+  } \
+  return true; \
+} \
+  }
+
 #define DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(name) \
   struct name##ComponentNode : public ComponentNode { \
 DEG_COMPONENT_NODE_DECLARE; \
@@ -171,7 +192,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Animation);
 DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(BatchCache);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Cache);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(CopyOnWrite);
-DEG_COMPONENT_NODE_DECLARE_GENERIC(Geometry);
+DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_OBDATA_IN_EDIT_MODE(Geometry);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(ImageAnimation);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(LayerCollections);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Particles);

___
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] [67b352f9c53] master: Fix T87486: Can't open file with modifiers to a grease pencil library override

2021-06-24 Thread Bastien Montagne
Commit: 67b352f9c5317c81c8e862a49be656c56e8f0743
Author: Bastien Montagne
Date:   Thu Jun 24 12:10:38 2021 +0200
Branches: master
https://developer.blender.org/rB67b352f9c5317c81c8e862a49be656c56e8f0743

Fix T87486: Can't open file with modifiers to a grease pencil library override

Very stupid typo in override apply code on GP modifiers (typical
copy/paste mistake from original modifiers code).

@jbakker this should be back-ported to 2.93LTS.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index 3d3faf0c56f..a208e520d02 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1882,7 +1882,7 @@ bool 
rna_Object_greasepencil_modifiers_override_apply(Main *bmain,
   GpencilModifierData *mod_dst = ED_object_gpencil_modifier_add(
   NULL, bmain, NULL, ob_dst, mod_src->name, mod_src->type);
 
-  BLI_remlink(_dst->modifiers, mod_dst);
+  BLI_remlink(_dst->greasepencil_modifiers, mod_dst);
   /* This handles NULL anchor as expected by adding at head of list. */
   BLI_insertlinkafter(_dst->greasepencil_modifiers, mod_anchor, mod_dst);

___
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] [8cdb99d51c0] master: Fix linking code after own recent commit.

2021-06-24 Thread Bastien Montagne
Commit: 8cdb99d51c02d5cc60c774c176a43519c046e14c
Author: Bastien Montagne
Date:   Thu Jun 24 10:53:45 2021 +0200
Branches: master
https://developer.blender.org/rB8cdb99d51c02d5cc60c774c176a43519c046e14c

Fix linking code after own recent commit.

More stupid mistake in recent enhanced reports for file load code,
rB82c17082ba0e left some read-after-free situations.

===

M   source/blender/blenkernel/intern/blender_copybuffer.c
M   source/blender/blenkernel/intern/blender_undo.c
M   source/blender/blenloader/BLO_readfile.h
M   source/blender/blenloader/intern/blend_validate.c
M   source/blender/blenloader/intern/readblenentry.c
M   source/blender/blenloader/intern/readfile_tempload.c
M   source/blender/editors/space_file/filelist.c
M   source/blender/imbuf/intern/thumbs_blend.c
M   source/blender/python/intern/bpy_library_load.c
M   source/blender/windowmanager/intern/wm_files.c
M   source/blender/windowmanager/intern/wm_files_link.c

===

diff --git a/source/blender/blenkernel/intern/blender_copybuffer.c 
b/source/blender/blenkernel/intern/blender_copybuffer.c
index c8fedc086b8..9c9f898afef 100644
--- a/source/blender/blenkernel/intern/blender_copybuffer.c
+++ b/source/blender/blenkernel/intern/blender_copybuffer.c
@@ -87,7 +87,8 @@ bool BKE_copybuffer_read(Main *bmain_dst,
  ReportList *reports,
  const uint64_t id_types_mask)
 {
-  BlendHandle *bh = BLO_blendhandle_from_file(libname, 
&(BlendFileReadReport){.reports = reports});
+  BlendFileReadReport bf_reports = {.reports = reports};
+  BlendHandle *bh = BLO_blendhandle_from_file(libname, _reports);
   if (bh == NULL) {
 /* Error reports will have been made by BLO_blendhandle_from_file(). */
 return false;
@@ -133,7 +134,8 @@ int BKE_copybuffer_paste(bContext *C,
   BlendHandle *bh;
   const int id_tag_extra = 0;
 
-  bh = BLO_blendhandle_from_file(libname, &(BlendFileReadReport){.reports = 
reports});
+  BlendFileReadReport bf_reports = {.reports = reports};
+  bh = BLO_blendhandle_from_file(libname, _reports);
 
   if (bh == NULL) {
 /* error reports will have been made by BLO_blendhandle_from_file() */
diff --git a/source/blender/blenkernel/intern/blender_undo.c 
b/source/blender/blenkernel/intern/blender_undo.c
index 6f47cd1336e..411ece21599 100644
--- a/source/blender/blenkernel/intern/blender_undo.c
+++ b/source/blender/blenkernel/intern/blender_undo.c
@@ -78,10 +78,10 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu,
 
   if (UNDO_DISK) {
 const struct BlendFileReadParams params = {0};
-struct BlendFileData *bfd = BKE_blendfile_read(
-mfu->filename, , &(BlendFileReadReport){NULL});
+BlendFileReadReport bf_reports = {.reports = NULL};
+struct BlendFileData *bfd = BKE_blendfile_read(mfu->filename, , 
_reports);
 if (bfd != NULL) {
-  BKE_blendfile_read_setup(C, bfd, , &(BlendFileReadReport){NULL});
+  BKE_blendfile_read_setup(C, bfd, , _reports);
   success = true;
 }
   }
diff --git a/source/blender/blenloader/BLO_readfile.h 
b/source/blender/blenloader/BLO_readfile.h
index c2ac2df1f84..52ef577fceb 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -155,7 +155,9 @@ struct BLODataBlockInfo {
 };
 
 BlendHandle *BLO_blendhandle_from_file(const char *filepath, struct 
BlendFileReadReport *reports);
-BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize);
+BlendHandle *BLO_blendhandle_from_memory(const void *mem,
+ int memsize,
+ struct BlendFileReadReport *reports);
 
 struct LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh,
  int ofblocktype,
@@ -260,6 +262,7 @@ typedef struct TempLibraryContext {
   /** Temporary main used to load data into (currently initialized from 
`real_main`). */
   struct Main *bmain_base;
   struct BlendHandle *blendhandle;
+  struct BlendFileReadReport bf_reports;
   struct LibraryLink_Params liblink_params;
   struct Library *lib;
 
diff --git a/source/blender/blenloader/intern/blend_validate.c 
b/source/blender/blenloader/intern/blend_validate.c
index 0f729304128..5b093223fda 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -83,8 +83,8 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList 
*reports)
 }
 
 BKE_library_filepath_set(bmain, curlib, curlib->filepath);
-BlendHandle *bh = BLO_blendhandle_from_file(curlib->filepath_abs,
-
&(BlendFileReadReport){.reports = reports});
+BlendFileReadReport bf_reports = {.reports = reports};
+BlendHandle *bh = 

[Bf-blender-cvs] [3a8347f8234] master: CMake: link bf_blenkernel from bf_depsgraph

2021-06-24 Thread Campbell Barton
Commit: 3a8347f82348ef2f430cdaa8a2e840ad3dba5a71
Author: Campbell Barton
Date:   Thu Jun 24 19:33:55 2021 +1000
Branches: master
https://developer.blender.org/rB3a8347f82348ef2f430cdaa8a2e840ad3dba5a71

CMake: link bf_blenkernel from bf_depsgraph

Without this tests fail to lknk in D11377. Commit separately as the
depsgraph is using BKE it should link to it.

===

M   source/blender/depsgraph/CMakeLists.txt

===

diff --git a/source/blender/depsgraph/CMakeLists.txt 
b/source/blender/depsgraph/CMakeLists.txt
index 95ae587f4ce..3ad26c6f4db 100644
--- a/source/blender/depsgraph/CMakeLists.txt
+++ b/source/blender/depsgraph/CMakeLists.txt
@@ -158,6 +158,7 @@ set(SRC
 )
 
 set(LIB
+  bf_blenkernel
 )
 
 blender_add_lib(bf_depsgraph "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

___
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] [684cd427253] soc-2021-curves: Cleanup: Minor refactoring

2021-06-24 Thread dilithjay
Commit: 684cd427253885e5b913b2bb24151c97464fafef
Author: dilithjay
Date:   Thu Jun 24 14:21:16 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB684cd427253885e5b913b2bb24151c97464fafef

Cleanup: Minor refactoring

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 742dd17e115..646ec78d943 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -148,6 +148,7 @@ static void free_up_selected_handles_for_movement(BezTriple 
*bezt)
 
 static void delete_bezt_from_nurb(BezTriple *bezt, Nurb *nu)
 {
+  BLI_assert(nu->type == CU_BEZIER);
   int index = BKE_curve_nurb_vert_index_get(nu, bezt);
   nu->pntsu -= 1;
   BezTriple *bezt1 = (BezTriple *)MEM_mallocN(nu->pntsu * sizeof(BezTriple), 
"NewBeztCurve");
@@ -160,6 +161,7 @@ static void delete_bezt_from_nurb(BezTriple *bezt, Nurb *nu)
 
 static void delete_bp_from_nurb(BPoint *bp, Nurb *nu)
 {
+  BLI_assert(nu->type == CU_NURBS);
   int index = BKE_curve_nurb_vert_index_get(nu, bp);
   nu->pntsu -= 1;
   BPoint *bp1 = (BPoint *)MEM_mallocN(nu->pntsu * sizeof(BPoint), 
"NewBpCurve");
@@ -223,55 +225,73 @@ static bool get_closest_point_on_edge(float *point,
   return false;
 }
 
-static BezTriple *get_closest_bezt_to_point(Nurb *nu, const float point[2], 
const ViewContext *vc)
+static void *get_closest_cp_to_point_in_nurbs(ListBase *nurbs,
+  Nurb **r_nu,
+  BezTriple **r_bezt,
+  BPoint **r_bp,
+  const float point[2],
+  const ViewContext *vc)
 {
-  float min_distance = 1;
-
-  BezTriple *closest = NULL;
-  for (int i = 0; i < nu->pntsu; i++) {
-BezTriple *bezt = >bezt[i];
-float bezt_vec[2];
-ED_view3d_project_float_object(
-vc->region, bezt->vec[1], bezt_vec, V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN);
-float distance = len_manhattan_v2v2(bezt_vec, point);
-if (distance < min_distance) {
-  min_distance = distance;
-  closest = bezt;
+  float min_distance_bezt = 1;
+  float min_distance_bp = 1;
+
+  BezTriple *closest_bezt = NULL;
+  BPoint *closest_bp = NULL;
+  Nurb *closest_bezt_nu = NULL;
+  Nurb *closest_bp_nu = NULL;
+
+  for (Nurb *nu = nurbs->first; nu; nu = nu->next) {
+if (nu->type == CU_BEZIER) {
+  for (int i = 0; i < nu->pntsu; i++) {
+BezTriple *bezt = >bezt[i];
+float bezt_vec[2];
+ED_view3d_project_float_object(
+vc->region, bezt->vec[1], bezt_vec, V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN);
+float distance = len_manhattan_v2v2(bezt_vec, point);
+if (distance < min_distance_bezt) {
+  min_distance_bezt = distance;
+  closest_bezt = bezt;
+  closest_bezt_nu = nu;
+}
+  }
 }
-  }
-  if (closest) {
-float threshold_distance = get_view_zoom(closest->vec[1], vc);
-if (min_distance < threshold_distance) {
-  return closest;
+if (nu->type == CU_NURBS) {
+  for (int i = 0; i < nu->pntsu; i++) {
+BPoint *bp = >bp[i];
+float bp_vec[2];
+ED_view3d_project_float_object(
+vc->region, bp->vec, bp_vec, V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN);
+float distance = len_manhattan_v2v2(bp_vec, point);
+if (distance < min_distance_bp) {
+  min_distance_bp = distance;
+  closest_bp = bp;
+  closest_bp_nu = nu;
+}
+  }
 }
   }
-  return NULL;
-}
 
-static BPoint *get_closest_bp_to_point(Nurb *nu, const float point[2], const 
ViewContext *vc)
-{
-  float min_distance = 1;
-  float temp[2];
-  copy_v2_v2(temp, point);
-  BPoint *closest = NULL;
-  for (int i = 0; i < nu->pntsu; i++) {
-BPoint *bp = >bp[i];
-float bp_vec[2];
-ED_view3d_project_float_object(
-vc->region, bp->vec, bp_vec, V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN);
-float distance = len_manhattan_v2v2(bp_vec, point);
-if (distance < min_distance) {
-  min_distance = distance;
-  closest = bp;
-}
+  float threshold_distance;
+  if (closest_bezt) {
+threshold_distance = get_view_zoom(closest_bezt->vec[1], vc);
+  }
+  else if (closest_bp) {
+threshold_distance = get_view_zoom(closest_bp->vec, vc);
   }
-  if (closest) {
-float threshold_distance = get_view_zoom(closest->vec, vc);
-if (min_distance < threshold_distance) {
-  return closest;
+  else {
+return;
+  }
+
+  if (min_distance_bezt < threshold_distance || min_distance_bp < 
threshold_distance) {
+if (min_distance_bp < min_distance_bezt) {
+  *r_bp = closest_bp;
+   

[Bf-blender-cvs] [1714d568d58] soc-2021-curves: Set cut and delete point to work on mouse release

2021-06-24 Thread dilithjay
Commit: 1714d568d588607d5b52b7eddb066329902234e7
Author: dilithjay
Date:   Thu Jun 24 11:54:33 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB1714d568d588607d5b52b7eddb066329902234e7

Set cut and delete point to work on mouse release

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 28e5707de16..742dd17e115 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -513,40 +513,72 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   }
   else if (ELEM(event->type, LEFTMOUSE)) {
 if (event->val == KM_PRESS) {
-  retval = ED_curve_editnurb_select_pick(C, event->mval, extend, deselect, 
toggle);
   RNA_boolean_set(op->ptr, "new", !retval);
   bool cut_or_delete = RNA_boolean_get(op->ptr, "cut_or_delete");
+  retval = ED_curve_editnurb_select_pick(C, event->mval, extend, deselect, 
toggle);
 
   /* Check if point underneath mouse. Get point if any. */
-  if (retval) {
-if (cut_or_delete) {
-  /* Delete retrieved control point. */
-  ListBase *nurbs = BKE_curve_editNurbs_get(cu);
-  float mouse_point[2] = {(float)event->mval[0], 
(float)event->mval[1]};
+  if (!cut_or_delete && !retval) {
 
-  for (nu = nurbs->first; nu; nu = nu->next) {
-if (nu->type == CU_BEZIER) {
-  bezt = get_closest_bezt_to_point(nu, mouse_point, );
-  if (bezt && nu) {
-delete_bezt_from_nurb(bezt, nu);
-  }
-}
-else if (nu->type == CU_NURBS) {
-  bp = get_closest_bp_to_point(nu, mouse_point, );
-  if (bp && nu) {
-delete_bp_from_nurb(bp, nu);
-  }
+/* Create new point under the mouse cursor. Set handle types as vector.
+If an end point of a spline is selected, set the new point as the
+new end point of the spline. */
+float location[3];
+
+ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
+
+if (bezt) {
+  mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
+}
+else if (bp) {
+  mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
+}
+else {
+  copy_v3_v3(location, vc.scene->cursor.location);
+}
+
+ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, 
location);
+EditNurb *editnurb = cu->editnurb;
+ed_editcurve_addvert(cu, editnurb, vc.v3d, location);
+ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
+if (bezt) {
+  bezt->h1 = HD_VECT;
+  bezt->h2 = HD_VECT;
+}
+  }
+}
+if (event->val == KM_RELEASE) {
+  if (dragging) {
+RNA_boolean_set(op->ptr, "dragging", false);
+  }
+  bool cut_or_delete = RNA_boolean_get(op->ptr, "cut_or_delete");
+  bool found_point = false;
+
+  if (cut_or_delete) {
+/* Delete retrieved control point. */
+ListBase *nurbs = BKE_curve_editNurbs_get(cu);
+float mouse_point[2] = {(float)event->mval[0], (float)event->mval[1]};
+
+for (nu = nurbs->first; nu; nu = nu->next) {
+  if (nu->type == CU_BEZIER) {
+bezt = get_closest_bezt_to_point(nu, mouse_point, );
+if (bezt && nu) {
+  found_point = true;
+  delete_bezt_from_nurb(bezt, nu);
 }
   }
-
-  cu->actvert = CU_ACT_NONE;
-  if (nu) {
-BKE_nurb_handles_calc(nu);
+  else if (nu->type == CU_NURBS) {
+bp = get_closest_bp_to_point(nu, mouse_point, );
+if (bp && nu) {
+  found_point = true;
+  delete_bp_from_nurb(bp, nu);
+}
   }
 }
-  }
-  else {
-if (cut_or_delete) {
+
+cu->actvert = CU_ACT_NONE;
+
+if (!found_point) {
   /* If curve segment is nearby, add control point at the snapped point
   between the adjacent control points in the curve data structure. */
   EditNurb *editnurb = cu->editnurb;
@@ -676,39 +708,11 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 }
   }
 }
-else {
-  /* Create new point under the mouse cursor. Set handle types as 
vector.
-  If an end point of a spline is selected, set the new point as the
-  new end point of the spline. */
-  float location[3];
-
-  ED_curve_nurb_vert_selected_find(cu, vc.v3d, , , );
-
-  if (bezt) {
-mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
-  }
-  else if (bp) {
-

[Bf-blender-cvs] [aecb168b454] soc-2021-curves: Fixed bug where pressing shift while moving bezt makes handles free

2021-06-24 Thread dilithjay
Commit: aecb168b45439c7cf84808ba5787c45cf7d99442
Author: dilithjay
Date:   Thu Jun 24 14:41:10 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rBaecb168b45439c7cf84808ba5787c45cf7d99442

Fixed bug where pressing shift while moving bezt makes handles free

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 646ec78d943..03f4f9abb6e 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -463,10 +463,11 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   int ret = OPERATOR_RUNNING_MODAL;
   bool dragging = RNA_boolean_get(op->ptr, "dragging");
   bool cut_or_delete = RNA_boolean_get(op->ptr, "cut_or_delete");
+  bool is_new_point = RNA_boolean_get(op->ptr, "new");
 
   bool picked = false;
   if (event->type == EVT_MODAL_MAP) {
-if (event->val == PEN_MODAL_FREE_MOVE_HANDLE) {
+if (event->val == PEN_MODAL_FREE_MOVE_HANDLE && is_new_point) {
   select_and_get_point(, , , , event->mval, event->prevval 
!= KM_PRESS);
   picked = true;
 
@@ -483,7 +484,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 }
 if (dragging) {
   /* Move handle point with mouse cursor if dragging a new control point. 
*/
-  if (RNA_boolean_get(op->ptr, "new")) {
+  if (is_new_point) {
 if (!picked) {
   select_and_get_point(, , , , event->mval, 
event->prevval != KM_PRESS);
 }
@@ -727,6 +728,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   BKE_nurb_handles_calc(nu);
 }
   }
+  RNA_boolean_set(op->ptr, "new", false);
   ret = OPERATOR_FINISHED;
 }
   }

___
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] [09953ecb32d] soc-2021-curves: Fixed bug where cut doesn't work on cyclic curves

2021-06-24 Thread dilithjay
Commit: 09953ecb32ddd4913f61eabf30172ec541d79a59
Author: dilithjay
Date:   Thu Jun 24 11:04:47 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB09953ecb32ddd4913f61eabf30172ec541d79a59

Fixed bug where cut doesn't work on cyclic curves

===

M   release/datafiles/locale
M   release/scripts/addons
M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 4833954c0ac..78591466c33 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 4833954c0ac85cc407e1d5a153aa11b1d1823ec0
+Subproject commit 78591466c335ab055e11729d8af814ce7ce6edc9
diff --git a/release/scripts/addons b/release/scripts/addons
index f86f25e6221..15bafef9349 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit f86f25e62217264495d05f116ccb09d575fe9841
+Subproject commit 15bafef93491ac0caf7c39c27999847910c1d50d
diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index aefb828b969..28e5707de16 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -315,6 +315,79 @@ static void calculate_new_bezier_point(const float 
*point_prev,
   interp_v3_v3v3(new_right_handle, center_point, handle_next, parameter);
 }
 
+static void update_data_if_nearest_point_in_segment(BezTriple *bezt1,
+BezTriple *bezt2,
+Nurb *nu,
+int index,
+ViewContext *vc,
+float screen_co[2],
+void *op_data)
+{
+  struct temp_bezt_data {
+/* Index of the last bez triple before the cut. */
+int bezt_index;
+/* Nurb to which the cut belongs to. */
+Nurb *nurb;
+/* Minimum distance to curve from mouse location. */
+float min_dist;
+/* Ratio at which the new point divides the curve segment. */
+float parameter;
+/* Whether the cut has any vertices before/after it. */
+bool has_prev, has_next;
+/* Locations of adjacent vertices. */
+float prev_loc[3], cut_loc[3], next_loc[3];
+/* Mouse location as floats. */
+float mval[2];
+  } temp_bezt_data;
+  struct temp_bezt_data *data = op_data;
+
+  float resolu = nu->resolu;
+  float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), 
"makeCut_bezier");
+
+  /* Calculate all points on curve. TODO: Get existing . */
+  for (int j = 0; j < 3; j++) {
+BKE_curve_forward_diff_bezier(bezt1->vec[1][j],
+  bezt1->vec[2][j],
+  bezt2->vec[0][j],
+  bezt2->vec[1][j],
+  points + j,
+  resolu,
+  sizeof(float[3]));
+  }
+
+  /* Calculate angle for middle points */
+  for (int k = 0; k <= resolu; k++) {
+/* Convert point to screen coordinates */
+bool check = ED_view3d_project_float_object(vc->region,
+points + 3 * k,
+screen_co,
+V3D_PROJ_RET_CLIP_BB | 
V3D_PROJ_RET_CLIP_WIN) ==
+ V3D_PROJ_RET_OK;
+
+if (check) {
+  float distance = len_manhattan_v2v2(screen_co, data->mval);
+  if (distance < data->min_dist) {
+data->min_dist = distance;
+data->nurb = nu;
+data->bezt_index = index;
+data->parameter = ((float)k) / resolu;
+
+copy_v3_v3(data->cut_loc, points + 3 * k);
+
+data->has_prev = k > 0;
+data->has_next = k < resolu;
+if (data->has_prev) {
+  copy_v3_v3(data->prev_loc, points + 3 * (k - 1));
+}
+if (data->has_next) {
+  copy_v3_v3(data->next_loc, points + 3 * (k + 1));
+}
+  }
+}
+  }
+  MEM_freeN(points);
+}
+
 enum {
   PEN_MODAL_CANCEL = 1,
   PEN_MODAL_FREE_MOVE_HANDLE,
@@ -519,54 +592,16 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 data.min_dist = len_manhattan_v2v2(screen_co, data.mval);
 copy_v3_v3(data.cut_loc, nu->bezt->vec[1]);
   }
-  for (int i = 0; i < nu->pntsu - 1; i++) {
+  int i;
+  for (i = 0; i < nu->pntsu - 1; i++) {
 bezt = >bezt[i];
-float resolu = nu->resolu;
-float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), 
"makeCut_bezier");
-
-/* Calculate all points on curve. TODO: Get 

[Bf-blender-cvs] [8d0f5155de3] soc-2021-curves: Added support for shape preserving cuts

2021-06-24 Thread dilithjay
Commit: 8d0f5155de3fa149b29bfddab875fbe2e2f021d5
Author: dilithjay
Date:   Tue Jun 22 08:07:55 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB8d0f5155de3fa149b29bfddab875fbe2e2f021d5

Added support for shape preserving cuts

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index f587f7d249a..aefb828b969 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -184,7 +184,8 @@ static bool get_closest_point_on_edge(float *point,
   const float pos[2],
   const float pos1[3],
   const float pos2[3],
-  const ViewContext *vc)
+  const ViewContext *vc,
+  float *factor)
 {
   float pos1_2d[2], pos2_2d[2], vec1[2], vec2[2], vec3[2];
 
@@ -207,11 +208,11 @@ static bool get_closest_point_on_edge(float *point,
   perpendicular line from the mouse to the line.*/
   if ((dot1 > 0) == (dot2 > 0)) {
 float len_vec3_sq = len_squared_v2(vec3);
-float factor = 1 - dot2 / len_vec3_sq;
+*factor = 1 - dot2 / len_vec3_sq;
 
 float pos_dif[3];
 sub_v3_v3v3(pos_dif, pos2, pos1);
-madd_v3_v3v3fl(point, pos1, pos_dif, factor);
+madd_v3_v3v3fl(point, pos1, pos_dif, *factor);
 return true;
   }
   if (len_manhattan_v2(vec1) < len_manhattan_v2(vec2)) {
@@ -298,6 +299,22 @@ static void select_and_get_point(ViewContext *vc,
   *nu = nu1;
 }
 
+static void calculate_new_bezier_point(const float *point_prev,
+   float *handle_prev,
+   float *new_left_handle,
+   float *new_right_handle,
+   float *handle_next,
+   const float *point_next,
+   const float parameter)
+{
+  const float center_point[3];
+  interp_v3_v3v3(center_point, handle_prev, handle_next, parameter);
+  interp_v3_v3v3(handle_prev, point_prev, handle_prev, parameter);
+  interp_v3_v3v3(handle_next, handle_next, point_next, parameter);
+  interp_v3_v3v3(new_left_handle, handle_prev, center_point, parameter);
+  interp_v3_v3v3(new_right_handle, center_point, handle_next, parameter);
+}
+
 enum {
   PEN_MODAL_CANCEL = 1,
   PEN_MODAL_FREE_MOVE_HANDLE,
@@ -469,13 +486,19 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 Nurb *nurb;
 /* Minimum distance to curve from mouse location. */
 float min_dist;
+/* Ratio at which the new point divides the curve segment. */
+float parameter;
 /* Whether the cut has any vertices before/after it. */
 bool has_prev, has_next;
 /* Locations of adjacent vertices. */
 float prev_loc[3], cut_loc[3], next_loc[3];
 /* Mouse location as floats. */
 float mval[2];
-  } data = {.bezt_index = 0, .min_dist = 1, .has_prev = false, 
.has_next = false};
+  } data = {.bezt_index = 0,
+.min_dist = 1,
+.parameter = 0.5f,
+.has_prev = false,
+.has_next = false};
 
   data.mval[0] = event->mval[0];
   data.mval[1] = event->mval[1];
@@ -528,6 +551,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   data.min_dist = distance;
   data.nurb = nu;
   data.bezt_index = i;
+  data.parameter = ((float)k) / resolu;
 
   copy_v3_v3(data.cut_loc, points + 3 * k);
 
@@ -554,13 +578,14 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 if (nu && nu->bezt) {
   bool found_min = false;
   float point[3];
+  float factor;
   if (data.has_prev) {
 found_min = get_closest_point_on_edge(
-point, data.mval, data.cut_loc, data.prev_loc, );
+point, data.mval, data.cut_loc, data.prev_loc, , 
);
   }
   if (!found_min && data.has_next) {
 found_min = get_closest_point_on_edge(
-point, data.mval, data.cut_loc, data.next_loc, );
+point, data.mval, data.next_loc, data.cut_loc, , 
);
   }
   if (found_min) {
 float point_2d[2];
@@ -568,6 +593,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 

[Bf-blender-cvs] [38185ad58d1] cycles-x: Fix Cycles X compaction fails with memory issues on Titan V

2021-06-24 Thread Sergey Sharybin
Commit: 38185ad58d1f66518ccb2c4e1b8d90340f198bf3
Author: Sergey Sharybin
Date:   Thu Jun 24 11:05:58 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB38185ad58d1f66518ccb2c4e1b8d90340f198bf3

Fix Cycles X compaction fails with memory issues on Titan V

This card seems to report more threads available than half of the
maximum available states, which breaks offset logic in the path
compaction.

===

M   intern/cycles/integrator/path_trace_work_gpu.cpp

===

diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp 
b/intern/cycles/integrator/path_trace_work_gpu.cpp
index 5228c3a12a1..7a546c9bb4d 100644
--- a/intern/cycles/integrator/path_trace_work_gpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_gpu.cpp
@@ -50,6 +50,11 @@ PathTraceWorkGPU::PathTraceWorkGPU(Device *device,
   max_active_path_index_(0)
 {
   memset(_state_gpu_, 0, sizeof(integrator_state_gpu_));
+
+  /* Limit number of active paths to the half of the overall state. This is 
due to the logic in the
+   * path compaction which relies on the fact that regeneration does not 
happen sooner than half of
+   * the states are available again. */
+  min_num_active_paths_ = min(min_num_active_paths_, max_num_paths_ / 2);
 }
 
 void PathTraceWorkGPU::alloc_integrator_soa()

___
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] [52f7f641789] cycles-x: Fix possible "run-away" error state in Cycles X

2021-06-24 Thread Sergey Sharybin
Commit: 52f7f641789291658cb596f496dae879381b09ff
Author: Sergey Sharybin
Date:   Thu Jun 24 10:47:34 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB52f7f641789291658cb596f496dae879381b09ff

Fix possible "run-away" error state in Cycles X

If the path tracing kernel encountered an error, it could cause wrong
code paths to trigger in the GPU implementation of the display update.

For example, an error state in the path trace should not mate the display
update to attempt to roll-back from interop update to naive one.

===

M   intern/cycles/integrator/path_trace_work_gpu.cpp

===

diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp 
b/intern/cycles/integrator/path_trace_work_gpu.cpp
index ec77b85e94c..5228c3a12a1 100644
--- a/intern/cycles/integrator/path_trace_work_gpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_gpu.cpp
@@ -629,6 +629,12 @@ void PathTraceWorkGPU::copy_to_gpu_display(GPUDisplay 
*gpu_display,
PassMode pass_mode,
int num_samples)
 {
+  if (device_->have_error()) {
+/* Don't attempt to update GPU display if the device has errors: the error 
state will make
+ * wrong decisions to happen about interop, causing more chained bugs. */
+return;
+  }
+
   if (!interop_use_checked_) {
 Device *device = queue_->device;
 interop_use_ = device->should_use_graphics_interop();

___
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] [dca4955b538] cycles-x: Fix display half-float allocation in Cycles X

2021-06-24 Thread Sergey Sharybin
Commit: dca4955b5381cf1fb11c70a6dee9dbe60ed14e77
Author: Sergey Sharybin
Date:   Thu Jun 24 09:42:54 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBdca4955b5381cf1fb11c70a6dee9dbe60ed14e77

Fix display half-float allocation in Cycles X

The comment and check was stating that allocation will happen for the
final resolution, while the actual allocation was using the currently
effective resolution.

Should fix random memory access issues for the viewport render.

===

M   intern/cycles/integrator/path_trace_work_gpu.cpp

===

diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp 
b/intern/cycles/integrator/path_trace_work_gpu.cpp
index 39eb8b22711..ec77b85e94c 100644
--- a/intern/cycles/integrator/path_trace_work_gpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_gpu.cpp
@@ -657,8 +657,6 @@ void PathTraceWorkGPU::copy_to_gpu_display_naive(GPUDisplay 
*gpu_display,
  PassMode pass_mode,
  int num_samples)
 {
-  const int width = effective_buffer_params_.width;
-  const int height = effective_buffer_params_.height;
   const int final_width = render_buffers_->params.width;
   const int final_height = render_buffers_->params.height;
 
@@ -669,7 +667,7 @@ void PathTraceWorkGPU::copy_to_gpu_display_naive(GPUDisplay 
*gpu_display,
* allocated memory as well. */
   if (gpu_display_rgba_half_.data_width != final_width ||
   gpu_display_rgba_half_.data_height != final_height) {
-gpu_display_rgba_half_.alloc(width, height);
+gpu_display_rgba_half_.alloc(final_width, final_height);
 /* TODO(sergey): There should be a way to make sure device-side memory is 
allocated without
  * transfering zeroes to the device. */
 queue_->zero_to_device(gpu_display_rgba_half_);

___
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] [65701599290] master: Cleanup: update clang-format so PyObject_HEAD indents properly

2021-06-24 Thread Campbell Barton
Commit: 65701599290292a0e57c005f45c7dfa0c177
Author: Campbell Barton
Date:   Thu Jun 24 17:10:22 2021 +1000
Branches: master
https://developer.blender.org/rB65701599290292a0e57c005f45c7dfa0c177

Cleanup: update clang-format so PyObject_HEAD indents properly

===

M   .clang-format
M   source/blender/freestyle/intern/python/BPy_BBox.h
M   source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
M   source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
M   source/blender/freestyle/intern/python/BPy_FrsMaterial.h
M   source/blender/freestyle/intern/python/BPy_FrsNoise.h
M   source/blender/freestyle/intern/python/BPy_Id.h
M   source/blender/freestyle/intern/python/BPy_Interface0D.h
M   source/blender/freestyle/intern/python/BPy_Interface1D.h
M   source/blender/freestyle/intern/python/BPy_Iterator.h
M   source/blender/freestyle/intern/python/BPy_SShape.h
M   source/blender/freestyle/intern/python/BPy_StrokeAttribute.h
M   source/blender/freestyle/intern/python/BPy_StrokeShader.h
M   source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h
M   source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h
M   source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h
M   source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h
M   source/blender/freestyle/intern/python/BPy_ViewMap.h
M   source/blender/freestyle/intern/python/BPy_ViewShape.h
M   source/blender/python/bmesh/bmesh_py_ops_call.h
M   source/blender/python/gpu/gpu_py_framebuffer.c
M   source/blender/python/gpu/gpu_py_framebuffer.h
M   source/blender/python/gpu/gpu_py_matrix.c
M   source/blender/python/gpu/gpu_py_offscreen.c
M   source/blender/python/gpu/gpu_py_offscreen.h
M   source/blender/python/gpu/gpu_py_texture.h
M   source/blender/python/gpu/gpu_py_uniformbuffer.h
M   source/blender/python/intern/bpy_app_translations.c
M   source/blender/python/intern/bpy_interface.c
M   source/blender/python/intern/bpy_interface_run.c
M   source/blender/python/intern/bpy_library_load.c
M   source/blender/python/intern/bpy_props.h
M   source/blender/python/intern/bpy_rna.h
M   source/blender/python/intern/bpy_rna_data.c
M   source/blender/python/mathutils/mathutils_Matrix.c
M   source/blender/python/mathutils/mathutils_bvhtree.c
M   source/blender/python/mathutils/mathutils_kdtree.c

===

diff --git a/.clang-format b/.clang-format
index 9cc3cdeaaf8..bf20a4e4c4a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -265,4 +265,5 @@ ForEachMacros:
   - VECTOR_SET_SLOT_PROBING_BEGIN
 
 StatementMacros:
+  - PyObject_HEAD
   - PyObject_VAR_HEAD
diff --git a/source/blender/freestyle/intern/python/BPy_BBox.h 
b/source/blender/freestyle/intern/python/BPy_BBox.h
index 889dbc62a41..9d81a62bbcc 100644
--- a/source/blender/freestyle/intern/python/BPy_BBox.h
+++ b/source/blender/freestyle/intern/python/BPy_BBox.h
@@ -39,7 +39,8 @@ extern PyTypeObject BBox_Type;
 
 /*---Python BPy_BBox structure definition--*/
 typedef struct {
-  PyObject_HEAD Freestyle::BBox *bb;
+  PyObject_HEAD
+  Freestyle::BBox *bb;
 } BPy_BBox;
 
 /*---Python BPy_BBox visible prototypes---*/
diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h 
b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
index a368d4cd47e..0d494092388 100644
--- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
+++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
@@ -39,7 +39,8 @@ extern PyTypeObject BinaryPredicate0D_Type;
 
 /*---Python BPy_BinaryPredicate0D structure 
definition--*/
 typedef struct {
-  PyObject_HEAD Freestyle::BinaryPredicate0D *bp0D;
+  PyObject_HEAD
+  Freestyle::BinaryPredicate0D *bp0D;
 } BPy_BinaryPredicate0D;
 
 /*---Python BPy_BinaryPredicate0D visible 
prototypes---*/
diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h 
b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
index b34fad9e213..3e5ff76b5f9 100644
--- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
+++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
@@ -39,7 +39,8 @@ extern PyTypeObject BinaryPredicate1D_Type;
 
 /*---Python BPy_BinaryPredicate1D structure 
definition--*/
 typedef struct {
-  PyObject_HEAD Freestyle::BinaryPredicate1D *bp1D;
+  PyObject_HEAD
+  Freestyle::BinaryPredicate1D *bp1D;
 } BPy_BinaryPredicate1D;
 
 /*---Python BPy_BinaryPredicate1D visible 
prototypes---*/
diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.h 
b/source/blender/freestyle/intern/python/BPy_FrsMaterial.h

[Bf-blender-cvs] [4b9ff3cd42b] master: Cleanup: comment blocks, trailing space in comments

2021-06-24 Thread Campbell Barton
Commit: 4b9ff3cd42be427e478743648e9951bf8c189a04
Author: Campbell Barton
Date:   Thu Jun 24 15:56:58 2021 +1000
Branches: master
https://developer.blender.org/rB4b9ff3cd42be427e478743648e9951bf8c189a04

Cleanup: comment blocks, trailing space in comments

===

M   intern/clog/clog.c
M   intern/cycles/bvh/bvh_embree.cpp
M   intern/cycles/bvh/bvh_params.h
M   intern/cycles/device/device_task.h
M   intern/cycles/kernel/bvh/bvh.h
M   intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
M   intern/cycles/kernel/geom/geom_triangle.h
M   intern/cycles/kernel/kernel_globals.h
M   intern/cycles/kernel/kernel_projection.h
M   intern/cycles/kernel/kernel_queues.h
M   intern/cycles/kernel/kernel_types.h
M   intern/cycles/kernel/osl/osl_services.h
M   intern/cycles/kernel/svm/svm_closure.h
M   intern/cycles/render/alembic.cpp
M   intern/cycles/render/osl.h
M   intern/cycles/render/session.cpp
M   intern/cycles/util/util_color.h
M   intern/cycles/util/util_debug.h
M   intern/cycles/util/util_task.h
M   intern/ghost/intern/GHOST_ContextGLX.cpp
M   intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
M   intern/ghost/intern/GHOST_SystemX11.cpp
M   intern/guardedalloc/MEM_guardedalloc.h
M   intern/guardedalloc/test/simpletest/memtest.c
M   intern/libmv/libmv/image/array_nd.h
M   intern/opencolorio/gpu_shader_display_transform.glsl
M   source/blender/blenfont/intern/blf_internal.h
M   source/blender/blenkernel/BKE_action.h
M   source/blender/blenkernel/BKE_animsys.h
M   source/blender/blenkernel/BKE_attribute_math.hh
M   source/blender/blenkernel/BKE_cloth.h
M   source/blender/blenkernel/BKE_constraint.h
M   source/blender/blenkernel/BKE_displist.h
M   source/blender/blenkernel/BKE_fcurve.h
M   source/blender/blenkernel/BKE_multires.h
M   source/blender/blenkernel/BKE_object.h
M   source/blender/blenkernel/BKE_screen.h
M   source/blender/blenkernel/BKE_subsurf.h
M   source/blender/blenkernel/BKE_text.h
M   source/blender/blenkernel/intern/DerivedMesh.cc
M   source/blender/blenkernel/intern/action.c
M   source/blender/blenkernel/intern/anim_data.c
M   source/blender/blenkernel/intern/anim_path.c
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/blenkernel/intern/armature.c
M   source/blender/blenkernel/intern/armature_test.cc
M   source/blender/blenkernel/intern/armature_update.c
M   source/blender/blenkernel/intern/camera.c
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/blenkernel/intern/context.c
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/curve_bevel.c
M   source/blender/blenkernel/intern/displist.cc
M   source/blender/blenkernel/intern/font.c
M   source/blender/blenkernel/intern/geometry_component_mesh.cc
M   source/blender/blenkernel/intern/gpencil_geom.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/ipo.c
M   source/blender/blenkernel/intern/keyconfig.c
M   source/blender/blenkernel/intern/lattice_deform.c
M   source/blender/blenkernel/intern/layer.c
M   source/blender/blenkernel/intern/lib_query.c
M   source/blender/blenkernel/intern/mask.c
M   source/blender/blenkernel/intern/mball_tessellate.c
M   source/blender/blenkernel/intern/mesh_merge.c
M   source/blender/blenkernel/intern/multires.c
M   source/blender/blenkernel/intern/multires_reshape_smooth.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/ocean_spectrum.c
M   source/blender/blenkernel/intern/particle_child.c
M   source/blender/blenkernel/intern/particle_distribute.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenkernel/intern/pbvh_bmesh.c
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/blenkernel/intern/rigidbody.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/shrinkwrap.c
M   source/blender/blenkernel/intern/softbody.c
M   source/blender/blenkernel/intern/subdiv_ccg.c
M   source/blender/blenkernel/intern/subdiv_eval.c
M   source/blender/blenkernel/intern/subdiv_foreach.c
M   source/blender/blenkernel/intern/tracking_stabilize.c
M   source/blender/blenkernel/intern/unit.c
M   source/blender/blenlib/BLI_color.hh
M   source/blender/blenlib/BLI_dlrbTree.h
M   source/blender/blenlib/BLI_fnmatch.h
M   source/blender/blenlib/BLI_hash_md5.h
M   source/blender/blenlib/BLI_math_vector.h
M   source/blender/blenlib/BLI_smallhash.h
M   source/blender/blenlib/BLI_task.h
M   source/blender/blenlib/BLI_utildefines.h
M   source/blender/blenlib/BLI_vector.hh
M   

[Bf-blender-cvs] [1f778dbefca] master: Cleanup: use Blender's code style for doxygen commetns in freestyle

2021-06-24 Thread Campbell Barton
Commit: 1f778dbefcaf825dcad1f70a9cc45e503ad74ed5
Author: Campbell Barton
Date:   Thu Jun 24 15:57:33 2021 +1000
Branches: master
https://developer.blender.org/rB1f778dbefcaf825dcad1f70a9cc45e503ad74ed5

Cleanup: use Blender's code style for doxygen commetns in freestyle

===

M   source/blender/freestyle/intern/application/AppCanvas.h
M   source/blender/freestyle/intern/application/AppView.h
M   source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
M   
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
M   source/blender/freestyle/intern/geometry/FastGrid.h
M   source/blender/freestyle/intern/geometry/FitCurve.h
M   source/blender/freestyle/intern/geometry/GeomCleaner.cpp
M   source/blender/freestyle/intern/geometry/GeomCleaner.h
M   source/blender/freestyle/intern/geometry/GeomUtils.h
M   source/blender/freestyle/intern/geometry/Grid.h
M   source/blender/freestyle/intern/geometry/GridHelpers.h
M   source/blender/freestyle/intern/geometry/HashGrid.h
M   source/blender/freestyle/intern/geometry/Noise.h
M   source/blender/freestyle/intern/geometry/Polygon.h
M   source/blender/freestyle/intern/geometry/SweepLine.h
M   source/blender/freestyle/intern/image/GaussianFilter.h
M   source/blender/freestyle/intern/image/Image.h
M   source/blender/freestyle/intern/image/ImagePyramid.h
M   source/blender/freestyle/intern/scene_graph/DrawingStyle.h
M   source/blender/freestyle/intern/scene_graph/FrsMaterial.h
M   source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
M   source/blender/freestyle/intern/scene_graph/LineRep.h
M   source/blender/freestyle/intern/scene_graph/Node.h
M   source/blender/freestyle/intern/scene_graph/NodeCamera.h
M   source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h
M   source/blender/freestyle/intern/scene_graph/NodeGroup.cpp
M   source/blender/freestyle/intern/scene_graph/NodeGroup.h
M   source/blender/freestyle/intern/scene_graph/NodeLight.h
M   source/blender/freestyle/intern/scene_graph/NodeShape.h
M   source/blender/freestyle/intern/scene_graph/NodeTransform.h
M   source/blender/freestyle/intern/scene_graph/NodeViewLayer.h
M   source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
M   source/blender/freestyle/intern/scene_graph/Rep.h
M   source/blender/freestyle/intern/scene_graph/TriangleRep.h
M   source/blender/freestyle/intern/scene_graph/VertexRep.h
M   source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h
M   source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
M   source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h
M   source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
M   source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
M   source/blender/freestyle/intern/stroke/Canvas.h
M   source/blender/freestyle/intern/stroke/Chain.h
M   source/blender/freestyle/intern/stroke/ChainingIterators.h
M   source/blender/freestyle/intern/stroke/ContextFunctions.h
M   source/blender/freestyle/intern/stroke/Curve.cpp
M   source/blender/freestyle/intern/stroke/Curve.h
M   source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
M   source/blender/freestyle/intern/stroke/CurveIterators.h
M   source/blender/freestyle/intern/stroke/Modifiers.h
M   source/blender/freestyle/intern/stroke/Operators.h
M   source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
M   source/blender/freestyle/intern/stroke/Predicates0D.h
M   source/blender/freestyle/intern/stroke/Predicates1D.h
M   source/blender/freestyle/intern/stroke/Stroke.h
M   source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
M   source/blender/freestyle/intern/stroke/StrokeIterators.h
M   source/blender/freestyle/intern/stroke/StrokeLayer.h
M   source/blender/freestyle/intern/stroke/StrokeRenderer.h
M   source/blender/freestyle/intern/stroke/StrokeRep.h
M   source/blender/freestyle/intern/stroke/StrokeShader.h
M   source/blender/freestyle/intern/stroke/StrokeTesselator.h
M   source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
M   source/blender/freestyle/intern/system/BaseObject.h
M   source/blender/freestyle/intern/system/Id.h
M   source/blender/freestyle/intern/system/ProgressBar.h
M   source/blender/freestyle/intern/view_map/FEdgeXDetector.h
M   source/blender/freestyle/intern/view_map/Functions0D.h
M   source/blender/freestyle/intern/view_map/Functions1D.h
M   source/blender/freestyle/intern/view_map/Interface0D.h
M   source/blender/freestyle/intern/view_map/Interface1D.h
M   source/blender/freestyle/intern/view_map/Silhouette.h
M   source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
M   source/blender/freestyle/intern/view_map/SphericalGrid.h
M