[Bf-blender-cvs] [575ade22d4d] master: Commit D14179: Revamp Vertex Paint With C++

2022-04-20 Thread Joseph Eagar
Commit: 575ade22d4de472ccf9e7d2dc1ffca37416c58f6
Author: Joseph Eagar
Date:   Wed Apr 20 22:03:45 2022 -0700
Branches: master
https://developer.blender.org/rB575ade22d4de472ccf9e7d2dc1ffca37416c58f6

Commit D14179: Revamp Vertex Paint With C++

- Verrtex paint mode has been refactored into C++ templates.
  It now works with both byte and float colors and point
  & corner attribute domains.
- There is a new API for mixing colors (also based
  on C++ templates).  Unlike the existing APIs byte
  and float colors are interpolated identically.
  Interpolation does happen in a squared rgb space,
  this may be changed in the future.
- Vertex paint now uses the sculpt undo system.

Reviewed By: Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D14179
Ref D14179

===

M   release/datafiles/locale
M   release/scripts/addons
M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenlib/BLI_color.hh
A   source/blender/blenlib/BLI_color_mix.hh
M   source/blender/blenlib/CMakeLists.txt
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/draw/engines/workbench/workbench_engine.c
M   source/blender/editors/mesh/mesh_data.c
M   source/blender/editors/sculpt_paint/CMakeLists.txt
M   source/blender/editors/sculpt_paint/paint_intern.h
R064source/blender/editors/sculpt_paint/paint_vertex.c  
source/blender/editors/sculpt_paint/paint_vertex.cc
M   source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
M   source/blender/editors/sculpt_paint/paint_vertex_color_utils.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_intern.h
M   source/tools

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 63699f96834..716dc02ec30 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 63699f968344db7dc853d2c5972325beea44900c
+Subproject commit 716dc02ec30c0810513f7b4adc4ae865ae50c4e6
diff --git a/release/scripts/addons b/release/scripts/addons
index baa581415c7..787ea78f7fa 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit baa581415c7ed23d7c45ef873631748135672683
+Subproject commit 787ea78f7fa6f0373d80ba1247768402df93f8ad
diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 4ae37095411..10043941948 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -615,9 +615,6 @@ typedef struct SculptSession {
   union {
 struct {
   struct SculptVertexPaintGeomMap gmap;
-
-  /* For non-airbrush painting to re-apply from the original (MLoop 
aligned). */
-  unsigned int *previous_color;
 } vpaint;
 
 struct {
diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index fe8b002302c..472e2c7ada8 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1341,8 +1341,6 @@ void BKE_sculptsession_free_vwpaint_data(struct 
SculptSession *ss)
   struct SculptVertexPaintGeomMap *gmap = NULL;
   if (ss->mode_type == OB_MODE_VERTEX_PAINT) {
 gmap = >mode.vpaint.gmap;
-
-MEM_SAFE_FREE(ss->mode.vpaint.previous_color);
   }
   else if (ss->mode_type == OB_MODE_WEIGHT_PAINT) {
 gmap = >mode.wpaint.gmap;
diff --git a/source/blender/blenlib/BLI_color.hh 
b/source/blender/blenlib/BLI_color.hh
index 0754221eb65..98fd7d0f15d 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -345,5 +345,7 @@ BLI_color_convert_to_theme4b(const 
ColorSceneLinear4f _l
 
 using ColorGeometry4f = ColorSceneLinear4f;
 using ColorGeometry4b = ColorSceneLinearByteEncoded4b;
+using ColorPaint4f = ColorSceneLinear4f;
+using ColorPaint4b = ColorSceneLinearByteEncoded4b;
 
 }  // namespace blender
diff --git a/source/blender/blenlib/BLI_color_mix.hh 
b/source/blender/blenlib/BLI_color_mix.hh
new file mode 100644
index 000..8398f2c3326
--- /dev/null
+++ b/source/blender/blenlib/BLI_color_mix.hh
@@ -0,0 +1,1053 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
+
+/** \file
+ * \ingroup blenlib
+ *
+ * Contains color mixing utilities.
+ * 
+ */
+
+#include "BLI_color.hh"
+#include "BLI_math_base.h"
+#include "BLI_math_color.h"
+#include "BLI_sys_types.h"
+
+#include "IMB_colormanagement.h"
+#include "IMB_imbuf.h"
+
+#include 
+
+namespace blender::color {
+
+struct ByteTraits {
+  using ValueType = uchar;
+  using BlendType = int;
+
+  inline static const uchar range = 255; /* Zero-based maximum value. */
+  inline static const float frange = 255.0f; /* Convienent floating-point 
version of range. */
+  inline static 

[Bf-blender-cvs] [c6ed879f9aa] master: Text Editor: add Python 3.10 soft keywords to `builtinfunc` list

2022-04-20 Thread Jon Denning
Commit: c6ed879f9aa7cd863f146cc7104f16cfe8a73e8a
Author: Jon Denning
Date:   Thu Apr 21 12:30:14 2022 +1000
Branches: master
https://developer.blender.org/rBc6ed879f9aa7cd863f146cc7104f16cfe8a73e8a

Text Editor: add Python 3.10 soft keywords to `builtinfunc` list

Python 3.10 has added "soft keywords" [0] to their list of identifiers.
This patch adds these soft keywords to the list of builtin functions
that the text editor searches for when highlighting Python code.

The only soft keywords that Python 3.10 current has are: `match`,
`case`, and `_`, but more will likely be added in future versions.

Currently, the `_` soft keyword is ignored from highlighting. It is a
wildcard matching pattern when used with `case` (similar to `default`
for `switch`es in C/C++), but `_` is far more often used in other
contexts where highlighting the `_` might seem strange. For example,
ignoring elements when unpacking tuples (`_, g, _, a = color`).

This patch also updates the commented Python code for creating the list
of keywords, for convenience.

Before:

{F13012878}

After:

{F13012880}

Example from PEP-636 [1]

Note: These soft keywords are only reserved under specific contexts.
However, in order for the text editor to know when the keywords are used
in the appropriate contexts, the text editor would need a full-blown
Python grammar [2] parser. So, for now, these keywords are simply added
in along with the other keywords in order to highlight them in the text
editor.

[0]: https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
[1]: https://peps.python.org/pep-0636/#matching-specific-values
[2]: https://docs.python.org/3/reference/grammar.html

Ref D14707

===

M   source/blender/editors/space_text/text_format_py.c

===

diff --git a/source/blender/editors/space_text/text_format_py.c 
b/source/blender/editors/space_text/text_format_py.c
index 4048e181fde..6658ac5a83c 100644
--- a/source/blender/editors/space_text/text_format_py.c
+++ b/source/blender/editors/space_text/text_format_py.c
@@ -33,24 +33,33 @@ static int txtfmt_py_find_builtinfunc(const char *string)
   int i, len;
   /* list is from...
* ", ".join(['"%s"' % kw
-   *for kw in  __import__("keyword").kwlist
-   *if kw not in {"False", "None", "True", "def", "class"}])
+   *for kw in sorted(__import__("keyword").kwlist + 
__import__("keyword").softkwlist)
+   *if kw not in {"False", "None", "True", "def", "class", "_"}])
*
* ... and for this code:
-   * print("\n".join(['else if (STR_LITERAL_STARTSWITH(string, "%s", len)) i = 
len;' % kw
-   *  for kw in  __import__("keyword").kwlist
-   *  if kw not in {"False", "None", "True", "def", "class"}]))
+   * import keyword
+   * ignore = {"False", "None", "True", "def", "class", "_"}
+   * keywords = sorted(set(keyword.kwlist + keyword.softkwlist) - ignore)
+   * longest = max(len(kw) for kw in keywords)
+   * first  = 'if(STR_LITERAL_STARTSWITH(string, "%s",%s len)) { i = 
len;'
+   * middle = '} else if (STR_LITERAL_STARTSWITH(string, "%s",%s len)) { i = 
len;'
+   * last   = '} else %s   { i = 
0;'
+   * print("\n".join([(first if i==0 else middle) % (kw, ' '*(longest - 
len(kw)))
+   * for (i, kw) in enumerate(keywords)]) + "\n" +
+   *   last % (' '*(longest-2)) + "\n" +
+   *   "}")
*/
 
   /* Keep aligned args for readability. */
   /* clang-format off */
 
-  if(STR_LITERAL_STARTSWITH(string, "assert",   len)) { i = len;
+  if(STR_LITERAL_STARTSWITH(string, "and",  len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "as",   len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "assert",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "async",len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "await",len)) { i = len;
-  } else if (STR_LITERAL_STARTSWITH(string, "and",  len)) { i = len;
-  } else if (STR_LITERAL_STARTSWITH(string, "as",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "break",len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "case", len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "continue", len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "del",  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "elif", len)) { i = len;
@@ -65,6 +74,7 @@ static int txtfmt_py_find_builtinfunc(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "in",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "is",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "lambda",   len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "match",len)) { i = len;
   } else if 

[Bf-blender-cvs] [5fc488559ca] master: Cleanup: explicitly disable autopep8 for rna_manual_reference

2022-04-20 Thread Campbell Barton
Commit: 5fc488559ca4af16beb9955d614cacc6d4cc5163
Author: Campbell Barton
Date:   Thu Apr 21 10:59:32 2022 +1000
Branches: master
https://developer.blender.org/rB5fc488559ca4af16beb9955d614cacc6d4cc5163

Cleanup: explicitly disable autopep8 for rna_manual_reference

Currently the "exclude" option for autopep8 isn't as reliable as it
should be since passing in absolute paths to autopep8 causes
the paths not to match. See: D14686 for details.

So explicitly disable autopep8 in this generated file (the generator
has already been updated).

Also use spaces for indentation otherwise autopep8 re-indents them.
This seems like a bug in autopep8 since it's changing lines with
autopep8 disabled. Use a workaround instead of looking into a fix since
it's simpler for all our Python files to use spaces instead of tabs and
there isn't much benefit mixing indentation for scripts.

===

M   release/scripts/modules/rna_manual_reference.py

===

diff --git a/release/scripts/modules/rna_manual_reference.py 
b/release/scripts/modules/rna_manual_reference.py
index 6d0ff66d478..9896bd3e281 100644
--- a/release/scripts/modules/rna_manual_reference.py
+++ b/release/scripts/modules/rna_manual_reference.py
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Do not edit this file. This file is auto generated from 
rna_manual_reference_updater.py
 
+# autopep8: off
 import bpy
 
 manual_version = '%d.%d' % bpy.app.version[:2]
@@ -37,2842 +38,2844 @@ if LANG is not None:
 url_manual_prefix = url_manual_prefix.replace("manual/en", "manual/" + 
LANG)
 
 url_manual_mapping = (
-   
("bpy.types.movietrackingsettings.refine_intrinsics_tangential_distortion*", 
"movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-tangential-distortion"),
-   
("bpy.types.spacesequesequencertimelineoverlaynceeditor.show_strip_offset*", 
"editors/video_sequencer/sequencer/display.html#bpy-types-spacesequesequencertimelineoverlaynceeditor-show-strip-offset"),
-   
("bpy.types.movietrackingsettings.refine_intrinsics_radial_distortion*", 
"movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-radial-distortion"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_max_trappedair*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-max-trappedair"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_min_trappedair*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-min-trappedair"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_max_wavecrest*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-max-wavecrest"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_min_wavecrest*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-min-wavecrest"),
-   ("bpy.types.lineartgpencilmodifier.use_offset_towards_custom_camera*", 
"grease_pencil/modifiers/generate/line_art.html#bpy-types-lineartgpencilmodifier-use-offset-towards-custom-camera"),
-   ("bpy.types.movietrackingsettings.refine_intrinsics_principal_point*", 
"movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-principal-point"),
-   ("bpy.types.cyclesobjectsettings.shadow_terminator_geometry_offset*", 
"render/cycles/object_settings/object_data.html#bpy-types-cyclesobjectsettings-shadow-terminator-geometry-offset"),
-   ("bpy.types.sequencertoolsettings.use_snap_current_frame_to_strips*", 
"video_editing/edit/montage/editing.html#bpy-types-sequencertoolsettings-use-snap-current-frame-to-strips"),
-   ("bpy.types.cycleslightsettings.use_multiple_importance_sampling*", 
"render/cycles/light_settings.html#bpy-types-cycleslightsettings-use-multiple-importance-sampling"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_max_energy*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-max-energy"),
-   ("bpy.types.fluiddomainsettings.sndparticle_potential_min_energy*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-min-energy"),
-   ("bpy.types.lineartgpencilmodifier.use_overlap_edge_type_support*", 
"grease_pencil/modifiers/generate/line_art.html#bpy-types-lineartgpencilmodifier-use-overlap-edge-type-support"),
-   ("bpy.types.movietrackingsettings.refine_intrinsics_focal_length*", 
"movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-focal-length"),
-   ("bpy.types.rigidbodyconstraint.rigidbodyconstraint.use_breaking*", 

[Bf-blender-cvs] [b719fa267ac] master: Fix typo in previous commit

2022-04-20 Thread Richard Antalik
Commit: b719fa267ac9bb8a00cc3b1f32ff0294333b17ae
Author: Richard Antalik
Date:   Thu Apr 21 02:26:54 2022 +0200
Branches: master
https://developer.blender.org/rBb719fa267ac9bb8a00cc3b1f32ff0294333b17ae

Fix typo in previous commit

===

M   source/blender/editors/space_sequencer/sequencer_select.c

===

diff --git a/source/blender/editors/space_sequencer/sequencer_select.c 
b/source/blender/editors/space_sequencer/sequencer_select.c
index cd9c334b705..95707f83d85 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -1921,7 +1921,7 @@ static bool select_grouped_effect(SeqCollection *strips,
   Sequence *seq;
   SEQ_ITERATOR_FOREACH (seq, strips) {
 if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) &&
-SEQ_relation_is_effect_of_strip(seq, actseq) {
+SEQ_relation_is_effect_of_strip(seq, actseq)) {
   effects[seq->type] = 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] [e16ff4132e3] master: VSE: Add frame selected operator for preview

2022-04-20 Thread ok what
Commit: e16ff4132e35cab6a757105741b8563679bda0bd
Author: ok what
Date:   Thu Apr 21 00:38:39 2022 +0200
Branches: master
https://developer.blender.org/rBe16ff4132e35cab6a757105741b8563679bda0bd

VSE: Add frame selected operator for preview

This operator moves the view to show the selected visible strips.

Reviewed By: ISS

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

===

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_sequencer.py
M   source/blender/editors/space_sequencer/sequencer_view.c
M   source/blender/editors/transform/transform_gizmo_2d.c
M   source/blender/sequencer/SEQ_transform.h
M   source/blender/sequencer/intern/strip_transform.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 9b47a7b35b5..78620c41d1e 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -2960,6 +2960,7 @@ def km_sequencerpreview(params):
 ("sequencer.select_box", {"type": 'B', "value": 'PRESS'}, None),
 
 # View.
+("sequencer.view_selected", {"type": 'NUMPAD_PERIOD', "value": 
'PRESS'}, None),
 ("sequencer.view_all_preview", {"type": 'HOME', "value": 'PRESS'}, 
None),
 ("sequencer.view_all_preview", {"type": 'NDOF_BUTTON_FIT', "value": 
'PRESS'}, None),
 ("sequencer.view_ghost_border", {"type": 'O', "value": 'PRESS'}, None),
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 e1977bf7df2..7faa418d74e 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -1866,6 +1866,7 @@ def km_sequencerpreview(params):
 ("wm.search_menu", {"type": 'TAB', "value": 'PRESS'}, None),
 ("sequencer.view_all_preview", {"type": 'A', "value": 'PRESS'}, None),
 ("sequencer.view_all_preview", {"type": 'NDOF_BUTTON_FIT', "value": 
'PRESS'}, None),
+("sequencer.view_selected", {"type": 'F', "value": 'PRESS'}, None),
 ("sequencer.view_ghost_border", {"type": 'O', "value": 'PRESS'}, None),
 ("sequencer.view_zoom_ratio", {"type": 'NUMPAD_1', "value": 'PRESS'},
  {"properties": [("ratio", 1.0)]}),
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index bbf9548a973..00ace072bda 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -429,9 +429,14 @@ class SEQUENCER_MT_view(Menu):
 
 layout.separator()
 
+layout.operator_context = 'INVOKE_REGION_WIN'
+if st.view_type == 'PREVIEW':
+# See above (T32595)
+layout.operator_context = 'INVOKE_REGION_PREVIEW'
+layout.operator("sequencer.view_selected", text="Frame Selected")
+
 if is_sequencer_view:
 layout.operator_context = 'INVOKE_REGION_WIN'
-layout.operator("sequencer.view_selected", text="Frame Selected")
 layout.operator("sequencer.view_all")
 layout.operator("view2d.zoom_border", text="Zoom")
 
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c 
b/source/blender/editors/space_sequencer/sequencer_view.c
index 4d245b9ddaa..c407dad623d 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -22,9 +22,11 @@
 
 #include "RNA_define.h"
 
+#include "SEQ_iterator.h"
 #include "SEQ_select.h"
 #include "SEQ_sequencer.h"
 #include "SEQ_time.h"
+#include "SEQ_transform.h"
 
 /* For menu, popup, icons, etc. */
 #include "ED_anim_api.h"
@@ -260,14 +262,30 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
 /** \name Frame Selected Operator
  * \{ */
 
-static int sequencer_view_selected_exec(bContext *C, wmOperator *op)
+static void seq_view_collection_rect_preview(Scene *scene, SeqCollection 
*strips, rctf *rect)
+{
+  float min[2], max[2];
+  SEQ_image_transform_bounding_box_from_collection(scene, strips, true, min, 
max);
+
+  rect->xmin = min[0];
+  rect->xmax = max[0];
+  rect->ymin = min[1];
+  rect->ymax = max[1];
+
+  float minsize = min_ff(BLI_rctf_size_x(rect), BLI_rctf_size_y(rect));
+
+  /* If the size of the strip is smaller than a pixel, add padding to prevent 
division by zero. */
+  if (minsize < 1.0f) {
+BLI_rctf_pad(rect, 20.0f, 20.0f);
+  }
+
+  /* Add padding. */
+  BLI_rctf_scale(rect, 1.1f);
+}
+
+static void 

[Bf-blender-cvs] [0c3d2461b78] master: Cleanup: VSE effect relationship checking

2022-04-20 Thread Richard Antalik
Commit: 0c3d2461b78839df9f6d5f358bd8bbf48881edde
Author: Richard Antalik
Date:   Thu Apr 21 01:57:55 2022 +0200
Branches: master
https://developer.blender.org/rB0c3d2461b78839df9f6d5f358bd8bbf48881edde

Cleanup: VSE effect relationship checking

Use `SEQ_relation_is_effect_of_strip` for checking effect-input
relationship where this is applicable.

===

M   source/blender/editors/space_sequencer/sequencer_select.c
M   source/blender/editors/transform/transform_snap_sequencer.c
M   source/blender/sequencer/intern/iterator.c
M   source/blender/sequencer/intern/strip_edit.c
M   source/blender/sequencer/intern/strip_relations.c

===

diff --git a/source/blender/editors/space_sequencer/sequencer_select.c 
b/source/blender/editors/space_sequencer/sequencer_select.c
index 8e5931b127a..cd9c334b705 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -27,6 +27,7 @@
 
 #include "SEQ_channels.h"
 #include "SEQ_iterator.h"
+#include "SEQ_relations.h"
 #include "SEQ_select.h"
 #include "SEQ_sequencer.h"
 #include "SEQ_time.h"
@@ -1920,7 +1921,7 @@ static bool select_grouped_effect(SeqCollection *strips,
   Sequence *seq;
   SEQ_ITERATOR_FOREACH (seq, strips) {
 if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) &&
-ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) {
+SEQ_relation_is_effect_of_strip(seq, actseq) {
   effects[seq->type] = true;
 }
   }
diff --git a/source/blender/editors/transform/transform_snap_sequencer.c 
b/source/blender/editors/transform/transform_snap_sequencer.c
index cf229c9e9ec..7715388bf52 100644
--- a/source/blender/editors/transform/transform_snap_sequencer.c
+++ b/source/blender/editors/transform/transform_snap_sequencer.c
@@ -21,6 +21,7 @@
 #include "SEQ_channels.h"
 #include "SEQ_effects.h"
 #include "SEQ_iterator.h"
+#include "SEQ_relations.h"
 #include "SEQ_render.h"
 #include "SEQ_sequencer.h"
 
@@ -102,8 +103,7 @@ static void query_strip_effects_fn(Sequence *seq_reference,
 
   /* Find all strips connected to `seq_reference`. */
   LISTBASE_FOREACH (Sequence *, seq_test, seqbase) {
-if (seq_test->seq1 == seq_reference || seq_test->seq2 == seq_reference ||
-seq_test->seq3 == seq_reference) {
+if (SEQ_relation_is_effect_of_strip(seq_test, seq_reference)) {
   query_strip_effects_fn(seq_test, seqbase, collection);
 }
   }
diff --git a/source/blender/sequencer/intern/iterator.c 
b/source/blender/sequencer/intern/iterator.c
index a4d8cf79d1f..2710edd6e80 100644
--- a/source/blender/sequencer/intern/iterator.c
+++ b/source/blender/sequencer/intern/iterator.c
@@ -20,6 +20,7 @@
 #include "BKE_scene.h"
 
 #include "SEQ_iterator.h"
+#include "SEQ_relations.h"
 #include "SEQ_render.h"
 #include "SEQ_time.h"
 #include "render.h"
@@ -241,15 +242,6 @@ static void 
collection_filter_channel_up_to_incl(SeqCollection *collection, cons
   }
 }
 
-static bool seq_is_effect_of(const Sequence *seq_effect, const Sequence 
*possibly_input)
-{
-  if (seq_effect->seq1 == possibly_input || seq_effect->seq2 == possibly_input 
||
-  seq_effect->seq3 == possibly_input) {
-return true;
-  }
-  return false;
-}
-
 /* Check if seq must be rendered. This depends on whole stack in some cases, 
not only seq itself.
  * Order of applying these conditions is important. */
 static bool must_render_strip(const Sequence *seq, SeqCollection 
*strips_at_timeline_frame)
@@ -262,7 +254,8 @@ static bool must_render_strip(const Sequence *seq, 
SeqCollection *strips_at_time
   return false;
 }
 
-if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 && seq_is_effect_of(seq_iter, 
seq)) {
+if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 &&
+SEQ_relation_is_effect_of_strip(seq_iter, seq)) {
   /* Strips in same channel or higher than its effect are rendered. */
   if (seq->machine >= seq_iter->machine) {
 return true;
diff --git a/source/blender/sequencer/intern/strip_edit.c 
b/source/blender/sequencer/intern/strip_edit.c
index 7aa81f5ae8a..6c7bb71cb75 100644
--- a/source/blender/sequencer/intern/strip_edit.c
+++ b/source/blender/sequencer/intern/strip_edit.c
@@ -154,8 +154,7 @@ static void sequencer_flag_users_for_removal(Scene *scene, 
ListBase *seqbase, Se
 }
 
 /* Remove effects, that use seq. */
-if ((user_seq->seq1 && user_seq->seq1 == seq) || (user_seq->seq2 && 
user_seq->seq2 == seq) ||
-(user_seq->seq3 && user_seq->seq3 == seq)) {
+if (SEQ_relation_is_effect_of_strip(user_seq, seq)) {
   user_seq->flag |= SEQ_FLAG_DELETE;
   /* Strips can be used as mask even if not in same seqbase. */
   sequencer_flag_users_for_removal(scene, >ed->seqbase, user_seq);
diff --git a/source/blender/sequencer/intern/strip_relations.c 

[Bf-blender-cvs] [3cef9ebaf81] master: Fix T97356: Crash when adding adjustment layer strip

2022-04-20 Thread Richard Antalik
Commit: 3cef9ebaf81053d80228f3ad43fa91e0ca75c542
Author: Richard Antalik
Date:   Thu Apr 21 00:05:57 2022 +0200
Branches: master
https://developer.blender.org/rB3cef9ebaf81053d80228f3ad43fa91e0ca75c542

Fix T97356: Crash when adding adjustment layer strip

Crash was caused by incorrectly assuming, that rendered strip is meta
when editing code in bulk, but this wasn't true and strip had no
channels initialized, which caused crash on NULL dereference.

Correct approach is to find list of channels where on same level as
rendered strip, similar to how `SEQ_get_seqbase_by_seq` function works
for list of strips.

===

M   source/blender/sequencer/SEQ_channels.h
M   source/blender/sequencer/intern/channels.c
M   source/blender/sequencer/intern/effects.c

===

diff --git a/source/blender/sequencer/SEQ_channels.h 
b/source/blender/sequencer/SEQ_channels.h
index 1d87875fb26..9436d5dfa32 100644
--- a/source/blender/sequencer/SEQ_channels.h
+++ b/source/blender/sequencer/SEQ_channels.h
@@ -15,6 +15,7 @@ struct Editing;
 struct ListBase;
 struct Scene;
 struct SeqTimelineChannel;
+struct Sequence;
 
 struct ListBase *SEQ_channels_displayed_get(struct Editing *ed);
 void SEQ_channels_displayed_set(struct Editing *ed, struct ListBase *channels);
@@ -28,6 +29,7 @@ char *SEQ_channel_name_get(struct ListBase *channels, const 
int channel_index);
 bool SEQ_channel_is_locked(const struct SeqTimelineChannel *channel);
 bool SEQ_channel_is_muted(const struct SeqTimelineChannel *channel);
 int SEQ_channel_index_get(const struct SeqTimelineChannel *channel);
+ListBase *SEQ_get_channels_by_seq(struct ListBase *seqbase, const struct 
Sequence *seq);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/sequencer/intern/channels.c 
b/source/blender/sequencer/intern/channels.c
index e8e82af03f5..21e3461c7d0 100644
--- a/source/blender/sequencer/intern/channels.c
+++ b/source/blender/sequencer/intern/channels.c
@@ -81,3 +81,19 @@ bool SEQ_channel_is_muted(const SeqTimelineChannel *channel)
 {
   return (channel->flag & SEQ_CHANNEL_MUTE) != 0;
 }
+
+ListBase *SEQ_get_channels_by_seq(ListBase *seqbase, const Sequence *seq)
+{
+  ListBase *lb = NULL;
+
+  LISTBASE_FOREACH (Sequence *, iseq, seqbase) {
+if (seq == iseq) {
+  return seqbase;
+}
+if ((lb = SEQ_get_channels_by_seq(>seqbase, seq))) {
+  return lb;
+}
+  }
+
+  return NULL;
+}
diff --git a/source/blender/sequencer/intern/effects.c 
b/source/blender/sequencer/intern/effects.c
index 0192f4f625c..f4fc79a6572 100644
--- a/source/blender/sequencer/intern/effects.c
+++ b/source/blender/sequencer/intern/effects.c
@@ -44,6 +44,7 @@
 
 #include "RE_pipeline.h"
 
+#include "SEQ_channels.h"
 #include "SEQ_effects.h"
 #include "SEQ_proxy.h"
 #include "SEQ_relations.h"
@@ -2421,8 +2422,6 @@ static ImBuf *do_multicam(const SeqRenderData *context,
 {
   ImBuf *out;
   Editing *ed;
-  ListBase *seqbasep;
-  ListBase *channels = >channels;
 
   if (seq->multicam_source == 0 || seq->multicam_source >= seq->machine) {
 return NULL;
@@ -2432,7 +2431,8 @@ static ImBuf *do_multicam(const SeqRenderData *context,
   if (!ed) {
 return NULL;
   }
-  seqbasep = SEQ_get_seqbase_by_seq(>seqbase, seq);
+  ListBase *seqbasep = SEQ_get_seqbase_by_seq(>seqbase, seq);
+  ListBase *channels = SEQ_get_channels_by_seq(>seqbase, seq);
   if (!seqbasep) {
 return NULL;
   }
@@ -2463,13 +2463,12 @@ static int early_out_adjustment(Sequence *UNUSED(seq), 
float UNUSED(fac))
 static ImBuf *do_adjustment_impl(const SeqRenderData *context, Sequence *seq, 
float timeline_frame)
 {
   Editing *ed;
-  ListBase *seqbasep;
-  ListBase *channels = >channels;
   ImBuf *i = NULL;
 
   ed = context->scene->ed;
 
-  seqbasep = SEQ_get_seqbase_by_seq(>seqbase, seq);
+  ListBase *seqbasep = SEQ_get_seqbase_by_seq(>seqbase, seq);
+  ListBase *channels = SEQ_get_channels_by_seq(>seqbase, seq);
 
   /* Clamp timeline_frame to strip range so it behaves as if it had "still 
frame" offset (last
* frame is static after end of strip). This is how most strips behave. This 
way transition

___
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] [502f3debf9a] master: Fix T70844: Incorrect snappping of strips when effects attached

2022-04-20 Thread Shrey Aggarwal
Commit: 502f3debf9a683280d12a5fa19bf4b3a2e2731bf
Author: Shrey Aggarwal
Date:   Thu Apr 21 00:44:57 2022 +0200
Branches: master
https://developer.blender.org/rB502f3debf9a683280d12a5fa19bf4b3a2e2731bf

Fix T70844: Incorrect snappping of strips when effects attached

Sometimes, when moving strip with 2 input effect attached and causing
strip overlap, this overlap is resolved incorrectly - too big offset
is applied. This is because effects are not taken into consideration
when "shuffeling" to resolve overlap.

To fix usual cases (transitions), overlap between strip and it's effect
is considered to be impossible.

There are edge cases, but these would be much more complicated to
implement and could have negative impact on performance.

Reviewed By: ISS

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

===

M   source/blender/sequencer/SEQ_relations.h
M   source/blender/sequencer/intern/strip_relations.c
M   source/blender/sequencer/intern/strip_transform.c

===

diff --git a/source/blender/sequencer/SEQ_relations.h 
b/source/blender/sequencer/SEQ_relations.h
index 735b5659ca9..917f549f16d 100644
--- a/source/blender/sequencer/SEQ_relations.h
+++ b/source/blender/sequencer/SEQ_relations.h
@@ -18,6 +18,10 @@ struct ReportList;
 struct Scene;
 struct Sequence;
 
+/**
+ * Check if one sequence is input to the other.
+ */
+bool SEQ_relation_is_effect_of_strip(const struct Sequence *effect, const 
struct Sequence *input);
 /**
  * Function to free imbuf and anim data on changes.
  */
@@ -64,6 +68,7 @@ void SEQ_cache_iterate(
 struct Sequence *SEQ_find_metastrip_by_sequence(ListBase *seqbase /* = 
ed->seqbase */,
 struct Sequence *meta /* = 
NULL */,
 struct Sequence *seq);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/sequencer/intern/strip_relations.c 
b/source/blender/sequencer/intern/strip_relations.c
index a65a331c650..ff6d9481f42 100644
--- a/source/blender/sequencer/intern/strip_relations.c
+++ b/source/blender/sequencer/intern/strip_relations.c
@@ -34,6 +34,11 @@
 #include "image_cache.h"
 #include "utils.h"
 
+bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence 
*input)
+{
+  return ELEM(input, effect->seq1, effect->seq2);
+}
+
 /* check whether sequence cur depends on seq */
 static bool seq_relations_check_depend(Sequence *seq, Sequence *cur)
 {
diff --git a/source/blender/sequencer/intern/strip_transform.c 
b/source/blender/sequencer/intern/strip_transform.c
index e614dfa9b82..2c9ab0a3335 100644
--- a/source/blender/sequencer/intern/strip_transform.c
+++ b/source/blender/sequencer/intern/strip_transform.c
@@ -297,6 +297,9 @@ static int shuffle_seq_time_offset_test(SeqCollection 
*strips_to_shuffle,
   if (!SEQ_transform_test_overlap_seq_seq(seq, seq_other)) {
 continue;
   }
+  if (SEQ_relation_is_effect_of_strip(seq_other, seq)) {
+continue;
+  }
   if (UNLIKELY(SEQ_collection_has_strip(seq_other, strips_to_shuffle))) {
 CLOG_WARN(,
   "Strip overlaps with itself or another strip, that is to be 
shuffled. "

___
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] [2bd9cbe4053] master: Fix T97254: VSE channel mute does mute sound

2022-04-20 Thread Richard Antalik
Commit: 2bd9cbe40532143bcc520d2ec55e5ff4f4eceebb
Author: Richard Antalik
Date:   Thu Apr 21 00:33:26 2022 +0200
Branches: master
https://developer.blender.org/rB2bd9cbe40532143bcc520d2ec55e5ff4f4eceebb

Fix T97254: VSE channel mute does mute sound

Add missing RNA update function

===

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

===

diff --git a/source/blender/makesrna/intern/rna_sequencer.c 
b/source/blender/makesrna/intern/rna_sequencer.c
index a27e699ef3d..3fd87a16d28 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -2169,11 +2169,12 @@ static void rna_def_channel(BlenderRNA *brna)
   prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_CHANNEL_LOCK);
   RNA_def_property_ui_text(prop, "Lock channel", "");
+  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
 
   prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_CHANNEL_MUTE);
   RNA_def_property_ui_text(prop, "Mute channel", "");
-  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
+  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, 
"rna_Sequence_sound_update");
 }
 
 static void rna_def_editor(BlenderRNA *brna)

___
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] [d2dee8f482b] sculpt-dev: Sculpt-dev: fix crash in paint brush

2022-04-20 Thread Joseph Eagar
Commit: d2dee8f482bda04ab90af33dd0c223c91b61b720
Author: Joseph Eagar
Date:   Wed Apr 20 13:28:55 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rBd2dee8f482bda04ab90af33dd0c223c91b61b720

Sculpt-dev: fix crash in paint brush

===

M   release/scripts/startup/bl_ui/properties_data_mesh.py
M   source/blender/blenkernel/intern/attribute.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py 
b/release/scripts/startup/bl_ui/properties_data_mesh.py
index a04db145710..1bfd82cc790 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -12,12 +12,16 @@ class MESH_MT_vertex_group_context_menu(Menu):
 def draw(self, _context):
 layout = self.layout
 
-layout.operator("object.vertex_group_sort",
+layout.operator(
+"object.vertex_group_sort",
 icon='SORTALPHA',
-text="Sort by Name",).sort_type = 'NAME'
-layout.operator("object.vertex_group_sort",
+text="Sort by Name",
+).sort_type = 'NAME'
+layout.operator(
+"object.vertex_group_sort",
 icon='BONE_DATA',
-text="Sort by Bone Hierarchy",).sort_type = 'BONE_HIERARCHY'
+text="Sort by Bone Hierarchy",
+).sort_type = 'BONE_HIERARCHY'
 layout.separator()
 layout.operator("object.vertex_group_copy", icon='DUPLICATE')
 layout.operator("object.vertex_group_copy_to_selected")
@@ -25,9 +29,11 @@ class MESH_MT_vertex_group_context_menu(Menu):
 layout.operator("object.vertex_group_mirror", 
icon='ARROW_LEFTRIGHT').use_topology = False
 layout.operator("object.vertex_group_mirror", text="Mirror Vertex 
Group (Topology)").use_topology = True
 layout.separator()
-layout.operator("object.vertex_group_remove_from",
+layout.operator(
+"object.vertex_group_remove_from",
 icon='X',
-text="Remove from All Groups",).use_all_groups = True
+text="Remove from All Groups",
+).use_all_groups = True
 layout.operator("object.vertex_group_remove_from", text="Clear Active 
Group").use_all_verts = True
 layout.operator("object.vertex_group_remove", text="Delete All 
Unlocked Groups").all_unlocked = True
 layout.operator("object.vertex_group_remove", text="Delete All 
Groups").all = True
@@ -119,8 +125,7 @@ class MESH_UL_shape_keys(UIList):
 
 class MESH_UL_uvmaps(UIList):
 def draw_item(self, _context, layout, _data, item, icon, _active_data, 
_active_propname, _index):
-# assert(isinstance(item, (bpy.types.MeshTexturePolyLayer,
-# bpy.types.MeshLoopColorLayer)))
+# assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, 
bpy.types.MeshLoopColorLayer)))
 if self.layout_type in {'DEFAULT', 'COMPACT'}:
 layout.prop(item, "name", text="", emboss=False, icon='GROUP_UVS')
 icon = 'RESTRICT_RENDER_OFF' if item.active_render else 
'RESTRICT_RENDER_ON'
@@ -239,7 +244,11 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
 col.operator("object.vertex_group_move", icon='TRIA_UP', 
text="").direction = 'UP'
 col.operator("object.vertex_group_move", icon='TRIA_DOWN', 
text="").direction = 'DOWN'
 
-if (ob.vertex_groups and (ob.mode == 'EDIT' or (ob.mode == 
'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex))):
+if (
+ob.vertex_groups and
+(ob.mode == 'EDIT' or
+ (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and 
ob.data.use_paint_mask_vertex))
+):
 row = layout.row()
 
 sub = row.row(align=True)
@@ -410,7 +419,6 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
 col.operator("mesh.uv_texture_add", icon='ADD', text="")
 col.operator("mesh.uv_texture_remove", icon='REMOVE', text="")
 
-
 class DATA_PT_remesh(MeshButtonsPanel, Panel):
 bl_label = "Remesh"
 bl_options = {'DEFAULT_CLOSED'}
@@ -463,8 +471,6 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel):
 else:
 col.operator("mesh.customdata_custom_splitnormals_add", icon='ADD')
 
-col.operator("mesh.customdata_ids_clear", icon='X')
-
 col = layout.column(heading="Store")
 
 col.enabled = obj is not None and obj.mode != 'EDIT'
@@ -488,20 +494,6 @@ class MESH_UL_attributes(UIList):
 'CORNER': "Face Corner",
 }
 
-def filter_items(self, context, data, property):
-attrs = getattr(data, property)
-ret = []
-idxs = []
-idx = 0
-
-for item in attrs:
-ret.append(self.bitflag_filter_item if not item.temporary else 0)
-idxs.append(idx)
-
-idx += 1
-
-return 

[Bf-blender-cvs] [8d2da45f98b] master: Revert "Fix Cycles HIP assuming warp size 32"

2022-04-20 Thread Brecht Van Lommel
Commit: 8d2da45f98bc326d718b05172ff42300a4ab3988
Author: Brecht Van Lommel
Date:   Wed Apr 20 18:07:37 2022 +0200
Branches: master
https://developer.blender.org/rB8d2da45f98bc326d718b05172ff42300a4ab3988

Revert "Fix Cycles HIP assuming warp size 32"

This reverts commit 390b9f1305059f5d8c7f944d44fc3e5821a3eb82. It seems to
break things on Linux for unknown reasons, so leave it out for now. A solution
to this will be required for Vega cards though.

===

M   intern/cycles/kernel/device/hip/compat.h

===

diff --git a/intern/cycles/kernel/device/hip/compat.h 
b/intern/cycles/kernel/device/hip/compat.h
index 9c93d87fd87..667352ed12e 100644
--- a/intern/cycles/kernel/device/hip/compat.h
+++ b/intern/cycles/kernel/device/hip/compat.h
@@ -62,7 +62,7 @@ typedef unsigned long long uint64_t;
 #define ccl_gpu_block_idx_x (blockIdx.x)
 #define ccl_gpu_grid_dim_x (gridDim.x)
 #define ccl_gpu_warp_size (warpSize)
-#define ccl_gpu_thread_mask(thread_warp) uint64_t(0x >> (64 - 
thread_warp))
+#define ccl_gpu_thread_mask(thread_warp) uint(0x >> (ccl_gpu_warp_size 
- thread_warp))
 
 #define ccl_gpu_global_id_x() (ccl_gpu_block_idx_x * ccl_gpu_block_dim_x + 
ccl_gpu_thread_idx_x)
 #define ccl_gpu_global_size_x() (ccl_gpu_grid_dim_x * ccl_gpu_block_dim_x)

___
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] [3a6813ea651] master: LibOverride: Make 'custom bone shape' and 'bbone custom handle' non-overridable.

2022-04-20 Thread Bastien Montagne
Commit: 3a6813ea651256cc2a056f82911feabdac554ea8
Author: Bastien Montagne
Date:   Wed Apr 20 17:01:01 2022 +0200
Branches: master
https://developer.blender.org/rB3a6813ea651256cc2a056f82911feabdac554ea8

LibOverride: Make 'custom bone shape' and 'bbone custom handle' non-overridable.

There is not much point in having those editable in overrides, and since
those are pointers, their value always differs from ref linked ID vs.
local override one, generating 'noise' in Outliner's override property
view.

===

M   source/blender/makesrna/intern/rna_armature.c
M   source/blender/makesrna/intern/rna_pose.c

===

diff --git a/source/blender/makesrna/intern/rna_armature.c 
b/source/blender/makesrna/intern/rna_armature.c
index 8d022338d7a..df92601dd0c 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -1047,6 +1047,7 @@ static void rna_def_bone_common(StructRNA *srna, int 
editbone)
 RNA_def_property_update(prop, 0, "rna_Bone_bbone_handle_update");
   }
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
+  RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
   RNA_def_property_ui_text(
   prop, "B-Bone Start Handle", "Bone that serves as the start handle for 
the B-Bone curve");
 
@@ -1091,6 +1092,7 @@ static void rna_def_bone_common(StructRNA *srna, int 
editbone)
 RNA_def_property_update(prop, 0, "rna_Bone_bbone_handle_update");
   }
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
+  RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
   RNA_def_property_ui_text(
   prop, "B-Bone End Handle", "Bone that serves as the end handle for the 
B-Bone curve");
 
diff --git a/source/blender/makesrna/intern/rna_pose.c 
b/source/blender/makesrna/intern/rna_pose.c
index 2390fdd72f0..a80e9573657 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -1360,7 +1360,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
   RNA_def_property_pointer_sdna(prop, NULL, "custom_tx");
   RNA_def_property_struct_type(prop, "PoseBone");
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
-  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+  RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
   RNA_def_property_ui_text(prop,
"Custom Shape Transform",
"Bone that defines the display transform of this 
custom shape");

___
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] [56d1d19c88e] master: UI: Add option to create color attribute directly from canvas selector.

2022-04-20 Thread Jung Jaeyun
Commit: 56d1d19c88e0fceea197c44d78f93fb26d8f9824
Author: Jung Jaeyun
Date:   Wed Apr 20 16:54:46 2022 +0200
Branches: master
https://developer.blender.org/rB56d1d19c88e0fceea197c44d78f93fb26d8f9824

UI: Add option to create color attribute directly from canvas selector.

Added + and - buttons to create and delete color attributes from canvas 
selector.

{T97345}

{F13006374}

Reviewed By: jbakker, Ethan1080

Maniphest Tasks: T97345

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

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 10dfd182836..570d7c12e30 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -526,7 +526,10 @@ class SelectPaintSlotHelper:
 
 case 'COLOR_ATTRIBUTE':
 mesh = ob.data
-layout.template_list(
+
+row = layout.row()
+col = row.column()
+col.template_list(
 "MESH_UL_color_attributes_selector",
 "color_attributes",
 mesh,
@@ -536,6 +539,10 @@ class SelectPaintSlotHelper:
 rows=3,
 )
 
+col = row.column(align=True)
+col.operator("geometry.color_attribute_add", icon='ADD', 
text="")
+col.operator("geometry.color_attribute_remove", icon='REMOVE', 
text="")
+
 if settings.missing_uvs:
 layout.separator()
 split = layout.split()

___
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] [604c33e6943] master: Build: updates for Blender to build against new 3.2 libraries

2022-04-20 Thread Brecht Van Lommel
Commit: 604c33e694375828b0f322010e8e4ac17b4b02f3
Author: Brecht Van Lommel
Date:   Tue Apr 19 18:09:05 2022 +0200
Branches: master
https://developer.blender.org/rB604c33e694375828b0f322010e8e4ac17b4b02f3

Build: updates for Blender to build against new 3.2 libraries

Building against the existing 3.1 libraries should continue to work, until
the precompiled libraries are committed for all platforms.

* Enable WebP by default.
* Update Windows for new library file names.
* Automatically clear outdated CMake cache variables when upgrading to new
  libraries.
* Fix static library linking order issues on Linux for OpenEXR and OpenVDB.

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206

===

M   CMakeLists.txt
M   build_files/cmake/Modules/FindOpenEXR.cmake
M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_lite.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/platform/platform_apple.cmake
A   build_files/cmake/platform/platform_old_libs_update.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   extern/mantaflow/CMakeLists.txt
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc39429742e..2cc9466c2ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -284,7 +284,7 @@ option(WITH_IMAGE_TIFF  "Enable LibTIFF Support" ON)
 option(WITH_IMAGE_DDS   "Enable DDS Image Support" ON)
 option(WITH_IMAGE_CINEON"Enable CINEON and DPX Image Support" ON)
 option(WITH_IMAGE_HDR   "Enable HDR Image Support" ON)
-option(WITH_IMAGE_WEBP  "Enable WebP Image Support" OFF)
+option(WITH_IMAGE_WEBP  "Enable WebP Image Support" ON)
 
 # Audio/Video format support
 option(WITH_CODEC_AVI   "Enable Blenders own AVI file support 
(raw/jpeg)" ON)
@@ -302,7 +302,7 @@ option(WITH_USD "Enable Universal Scene 
Description (USD) Suppor
 option(WITH_OPENCOLLADA   "Enable OpenCollada Support 
(http://www.opencollada.org)" ON)
 
 # Sound output
-option(WITH_SDL   "Enable SDL for sound and joystick support" ON)
+option(WITH_SDL   "Enable SDL for sound" ON)
 option(WITH_OPENAL"Enable OpenAL Support (http://www.openal.org)" ON)
 if(APPLE)
   option(WITH_COREAUDIO"Enable CoreAudio for audio support on macOS" ON)
diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake 
b/build_files/cmake/Modules/FindOpenEXR.cmake
index f772ef4e1ff..9107b562711 100644
--- a/build_files/cmake/Modules/FindOpenEXR.cmake
+++ b/build_files/cmake/Modules/FindOpenEXR.cmake
@@ -85,9 +85,9 @@ STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" 
_openexr_libs_ver ${OPENE
 IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
   SET(_openexr_FIND_COMPONENTS
 Iex
-IlmThread
 OpenEXR
 OpenEXRCore
+IlmThread
   )
 ELSE()
   SET(_openexr_FIND_COMPONENTS
diff --git a/build_files/cmake/config/blender_full.cmake 
b/build_files/cmake/config/blender_full.cmake
index 9faa0118ae2..e09577ac802 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -30,6 +30,7 @@ set(WITH_IMAGE_HDR   ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR   ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG  ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF  ON  CACHE BOOL "" FORCE)
+set(WITH_IMAGE_WEBP  ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_NDOF  ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_IME   ON  CACHE BOOL "" FORCE)
 set(WITH_INTERNATIONAL   ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_lite.cmake 
b/build_files/cmake/config/blender_lite.cmake
index 2d895f55c31..2f6057ee9c0 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -34,6 +34,7 @@ set(WITH_IMAGE_HDR   OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR   OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG  OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF  OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_WEBP  OFF CACHE BOOL "" FORCE)
 set(WITH_INPUT_NDOF  OFF CACHE BOOL "" FORCE)
 set(WITH_INTERNATIONAL   OFF CACHE BOOL "" FORCE)
 set(WITH_JACKOFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_release.cmake 
b/build_files/cmake/config/blender_release.cmake
index 4e96975bd90..8ece5eec39e 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -31,6 +31,7 @@ set(WITH_IMAGE_HDR   ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR   ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG  ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF  ON  CACHE BOOL "" FORCE)

[Bf-blender-cvs] [b9c37608a9e] master: Build: upgrade many library dependencies to new versions for Blender 3.2

2022-04-20 Thread Ray Molenkamp
Commit: b9c37608a9e959a896f5358d4ab3d3d001a70833
Author: Ray Molenkamp
Date:   Tue Apr 19 18:08:51 2022 +0200
Branches: master
https://developer.blender.org/rBb9c37608a9e959a896f5358d4ab3d3d001a70833

Build: upgrade many library dependencies to new versions for Blender 3.2

This only updates the build system, precompiled libraries for the various
platforms will be committed over the coming week.

New:
fmt 8.0.0
level_zero v1.7.15
pystring v1.1.3
robinmap v0.6.2
webp 1.2.2

Updated:
alembic 1.8.3
blosc 1.21.1
boost 1.78.0
embree 3.13.3
ffmpeg 5.0
fftw 3.3.10
flac 1.3.4
imath 3.1.4
ispc v1.17.0
jpeg 2.1.3
ogg 1.3.5
oidn 1.4.3
openal 1.21.1
opencolorio 2.1.1
openexr 3.1.4
openimageio v2.3.13.0
openjpeg 2.4.0
opensubdiv v3_4_4
openvdb 9.0.0
osl 1.11.17.0
sdl 2.0.20
tbb 2020_u3
tiff 4.3.0
usd 22.03
vorbis 1.3.7
vpx 1.11.0
x264 35fe20d1b
zlib 1.2.12

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206

===

M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/alembic.cmake
M   build_files/build_environment/cmake/blosc.cmake
M   build_files/build_environment/cmake/boost.cmake
A   build_files/build_environment/cmake/boost_build_options.cmake
M   build_files/build_environment/cmake/download.cmake
M   build_files/build_environment/cmake/embree.cmake
A   build_files/build_environment/cmake/fmt.cmake
M   build_files/build_environment/cmake/harvest.cmake
A   build_files/build_environment/cmake/imath.cmake
M   build_files/build_environment/cmake/jpeg.cmake
A   build_files/build_environment/cmake/level-zero.cmake
D   build_files/build_environment/cmake/nanovdb.cmake
M   build_files/build_environment/cmake/opencolorio.cmake
M   build_files/build_environment/cmake/openexr.cmake
M   build_files/build_environment/cmake/openimagedenoise.cmake
M   build_files/build_environment/cmake/openimageio.cmake
M   build_files/build_environment/cmake/openjpeg.cmake
M   build_files/build_environment/cmake/opensubdiv.cmake
M   build_files/build_environment/cmake/openvdb.cmake
M   build_files/build_environment/cmake/options.cmake
M   build_files/build_environment/cmake/osl.cmake
A   build_files/build_environment/cmake/pystring.cmake
A   build_files/build_environment/cmake/robinmap.cmake
M   build_files/build_environment/cmake/tiff.cmake
M   build_files/build_environment/cmake/usd.cmake
M   build_files/build_environment/cmake/versions.cmake
M   build_files/build_environment/cmake/webp.cmake
A   build_files/build_environment/patches/cmakelists_pystring.txt
M   build_files/build_environment/patches/embree.diff
M   build_files/build_environment/patches/ispc.diff
A   build_files/build_environment/patches/level-zero.diff
M   build_files/build_environment/patches/openvdb.diff
M   build_files/build_environment/patches/osl.diff
M   build_files/build_environment/patches/usd.diff
M   build_files/build_environment/windows/build_deps.cmd

===

diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index 40e5c35f990..8f4738d1f1c 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -29,8 +29,9 @@ cmake_minimum_required(VERSION 3.5)
 
 include(ExternalProject)
 include(cmake/check_software.cmake)
-include(cmake/options.cmake)
 include(cmake/versions.cmake)
+include(cmake/options.cmake)
+include(cmake/boost_build_options.cmake)
 include(cmake/download.cmake)
 
 if(ENABLE_MINGW64)
@@ -46,6 +47,7 @@ include(cmake/png.cmake)
 include(cmake/jpeg.cmake)
 include(cmake/blosc.cmake)
 include(cmake/pthreads.cmake)
+include(cmake/imath.cmake)
 include(cmake/openexr.cmake)
 include(cmake/brotli.cmake)
 include(cmake/freetype.cmake)
@@ -75,7 +77,6 @@ endif()
 include(cmake/osl.cmake)
 include(cmake/tbb.cmake)
 include(cmake/openvdb.cmake)
-include(cmake/nanovdb.cmake)
 include(cmake/python.cmake)
 option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from 
source" OFF)
 if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
@@ -94,12 +95,15 @@ include(cmake/pugixml.cmake)
 include(cmake/ispc.cmake)
 include(cmake/openimagedenoise.cmake)
 include(cmake/embree.cmake)
+include(cmake/fmt.cmake)
+include(cmake/robinmap.cmake)
 if(NOT APPLE)
   include(cmake/xr_openxr.cmake)
 endif()
 
 # OpenColorIO and dependencies.
 include(cmake/expat.cmake)
+include(cmake/pystring.cmake)
 include(cmake/yamlcpp.cmake)
 include(cmake/opencolorio.cmake)
 
@@ -107,8 +111,9 @@ if(BLENDER_PLATFORM_ARM)
   include(cmake/sse2neon.cmake)
 endif()
 
-if(WITH_WEBP)
-  include(cmake/webp.cmake)
+include(cmake/webp.cmake)
+if(NOT APPLE)
+  include(cmake/level-zero.cmake)
 endif()
 
 if(NOT WIN32 OR ENABLE_MINGW64)
diff --git 

[Bf-blender-cvs] [58511c4175f] lineart-object-load: LineArt: Face mark filtering for new object loading code.

2022-04-20 Thread YimingWu
Commit: 58511c4175f6a505d53034809010db60e335401c
Author: YimingWu
Date:   Thu Apr 7 09:07:55 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rB58511c4175f6a505d53034809010db60e335401c

LineArt: Face mark filtering for new object loading code.

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M   source/blender/makesdna/DNA_lineart_types.h

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index afcde2c3a7f..3419fa4e224 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1498,6 +1498,8 @@ typedef struct EdgeFeatData {
   float crease_threshold;
   float **poly_normals;
   bool use_auto_smooth;
+  bool use_freestyle_face;
+  int freestyle_face_index;
 } EdgeFeatData;
 
 typedef struct EdgeFeatReduceData {
@@ -1520,127 +1522,151 @@ static void 
lineart_identify_mlooptri_feature_edges(void *__restrict userdata,
   EdgeFeatData *e_feat_data = (EdgeFeatData *)userdata;
   EdgeFacePair *e_f_pair = _feat_data->edge_pair_arr[i];
   EdgeFeatReduceData *reduce_data = (EdgeFeatReduceData *)tls->userdata_chunk;
-  /* Mesh boundary */
-  if (e_f_pair->f2 == -1) {
-e_f_pair->eflag = LRT_EDGE_FLAG_CONTOUR;
-reduce_data->feat_edges += 1;
+  Mesh *me = e_feat_data->me;
+  const MLoopTri *mlooptri = e_feat_data->mlooptri;
+
+  uint16_t edge_flag_result = 0;
+
+  FreestyleEdge *fel, *fer;
+  bool face_mark_filtered = false;
+  bool enable_face_mark = (e_feat_data->use_freestyle_face && 
e_feat_data->rb->filter_face_mark);
+  bool only_contour = false;
+  if (enable_face_mark) {
+int index = e_feat_data->freestyle_face_index;
+if (index > -1) {
+  fel = &((FreestyleEdge 
*)me->pdata.layers[index].data)[mlooptri[e_f_pair->f1].poly];
+}
+if (e_f_pair->f2 != -1) {
+  fer = &((FreestyleEdge 
*)me->pdata.layers[index].data)[mlooptri[e_f_pair->f2].poly];
+}
+else {
+  /* Handles mesh boundary case */
+  fer = fel;
+}
+if (e_feat_data->rb->filter_face_mark_boundaries ^ 
e_feat_data->rb->filter_face_mark_invert) {
+  if ((fel->flag & FREESTYLE_FACE_MARK) || (fer->flag & 
FREESTYLE_FACE_MARK)) {
+face_mark_filtered = true;
+  }
+}
+else {
+  if ((fel->flag & FREESTYLE_FACE_MARK) && (fer->flag & 
FREESTYLE_FACE_MARK) && (fer != fel)) {
+face_mark_filtered = true;
+  }
+}
+if (e_feat_data->rb->filter_face_mark_invert) {
+  face_mark_filtered = !face_mark_filtered;
+}
+if (!face_mark_filtered) {
+  e_f_pair->eflag = LRT_EDGE_FLAG_INHIBIT;
+  if (e_feat_data->rb->filter_face_mark_keep_contour) {
+only_contour = true;
+  }
+}
+  }
+
+  if (enable_face_mark && !face_mark_filtered && !only_contour) {
 return;
   }
+  else {
 
-  LineartTriangle *tri1, *tri2;
-  LineartVert *vert;
-  LineartRenderBuffer *rb = e_feat_data->rb;
+/* Mesh boundary */
+if (e_f_pair->f2 == -1) {
+  e_f_pair->eflag = LRT_EDGE_FLAG_CONTOUR;
+  reduce_data->feat_edges += 1;
+  return;
+}
 
-  /* The mesh should already be triangulated now, so we can assume each face 
is a triangle. */
-  tri1 = lineart_triangle_from_index(rb, e_feat_data->tri_array, e_f_pair->f1);
-  tri2 = lineart_triangle_from_index(rb, e_feat_data->tri_array, e_f_pair->f2);
+LineartTriangle *tri1, *tri2;
+LineartVert *vert;
+LineartRenderBuffer *rb = e_feat_data->rb;
 
-  vert = _feat_data->v_array[e_f_pair->v1];
+/* The mesh should already be triangulated now, so we can assume each face 
is a triangle. */
+tri1 = lineart_triangle_from_index(rb, e_feat_data->tri_array, 
e_f_pair->f1);
+tri2 = lineart_triangle_from_index(rb, e_feat_data->tri_array, 
e_f_pair->f2);
 
-  double vv[3];
-  double *view_vector = vv;
-  double dot_1 = 0, dot_2 = 0;
-  double result;
+vert = _feat_data->v_array[e_f_pair->v1];
 
-  if (rb->cam_is_persp) {
-sub_v3_v3v3_db(view_vector, vert->gloc, rb->camera_pos);
-  }
-  else {
-view_vector = rb->view_vector;
-  }
+double vv[3];
+double *view_vector = vv;
+double dot_1 = 0, dot_2 = 0;
+double result;
 
-  dot_1 = dot_v3v3_db(view_vector, tri1->gn);
-  dot_2 = dot_v3v3_db(view_vector, tri2->gn);
-  uint16_t edge_flag_result = 0;
+if (rb->cam_is_persp) {
+  sub_v3_v3v3_db(view_vector, vert->gloc, rb->camera_pos);
+}
+else {
+  view_vector = rb->view_vector;
+}
 
-  if ((result = dot_1 * dot_2) <= 0 && (dot_1 + dot_2)) {
-edge_flag_result |= LRT_EDGE_FLAG_CONTOUR;
-  }
+dot_1 = dot_v3v3_db(view_vector, tri1->gn);
+dot_2 = dot_v3v3_db(view_vector, tri2->gn);
 
-  Mesh *me = e_feat_data->me;
-  const MLoopTri *mlooptri = e_feat_data->mlooptri;
+if ((result = 

[Bf-blender-cvs] [ce689964a4b] lineart-object-load: LineArt: Index calculation based adjacent lookup WIP

2022-04-20 Thread YimingWu
Commit: ce689964a4b3d3604b252bcfb3cf50297be3ff23
Author: YimingWu
Date:   Wed Apr 20 10:53:21 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rBce689964a4b3d3604b252bcfb3cf50297be3ff23

LineArt: Index calculation based adjacent lookup WIP

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index acc36062152..dd08fc6493f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1429,6 +1429,41 @@ static void 
lineart_main_discard_out_of_frame_edges(LineartRenderBuffer *rb)
   }
 }
 
+/**
+ * Transform a single vert to it's viewing position.
+ */
+static void lineart_vert_transform(
+BMVert *v, int index, LineartVert *RvBuf, double (*mv_mat)[4], double 
(*mvp_mat)[4])
+{
+  double co[4];
+  LineartVert *vt = [index];
+  copy_v3db_v3fl(co, v->co);
+  mul_v3_m4v3_db(vt->gloc, mv_mat, co);
+  mul_v4_m4v3_db(vt->fbcoord, mvp_mat, co);
+}
+
+static void lineart_vert_transform_me(
+MVert *v, int index, LineartVert *RvBuf, double (*mv_mat)[4], double 
(*mvp_mat)[4])
+{
+  double co[4];
+  LineartVert *vt = [index];
+  copy_v3db_v3fl(co, v->co);
+  mul_v3_m4v3_db(vt->gloc, mv_mat, co);
+  mul_v4_m4v3_db(vt->fbcoord, mvp_mat, co);
+}
+
+typedef struct LineartAdjacentItem {
+  unsigned int v1;
+  unsigned int v2;
+  unsigned int e;
+} LineartAdjacentItem;
+
+typedef struct LineartEdgeNeighbor {
+  int e;
+  short flags;
+  int v1, v2;
+} LineartEdgeNeighbor;
+
 typedef struct VertData {
   MVert *mvert;
   LineartVert *v_arr;
@@ -1657,6 +1692,146 @@ static uint16_t lineart_identify_medge_feature_edges(
   return edge_flag_result;
 }
 
+__attribute__((optimize("O0"))) static uint16_t 
lineart_identify_feature_line_me(
+LineartRenderBuffer *rb,
+int eindex,
+LineartTriangle *rt_array,
+LineartVert *rv_array,
+float crease_threshold,
+bool use_auto_smooth,
+bool use_freestyle_edge,
+bool use_freestyle_face,
+Mesh *me,
+LineartEdgeNeighbor *en,
+float (*normals)[3])
+{
+
+  MPoly *ll = NULL, *lr = NULL;
+
+  int t1i = -1, t1e = -1, t2i = -1;
+  if (en[eindex].e >= 0) {
+t1i = en[eindex].e / 3;
+t1e = en[eindex].e;
+  }
+  if (t1e >= 0 && en[t1e].e >= 0) {
+t2i = en[t1e].e / 3;
+  }
+
+  if (t1i >= 0) {
+ll = >mpoly[me->runtime.looptris.array[t1i].poly];
+  }
+  if (t2i >= 0) {
+lr = >mpoly[me->runtime.looptris.array[t2i].poly];
+  }
+
+  if (t1i < 0 && t2i < 0) {
+if (!rb->use_loose_as_contour) {
+  if (use_freestyle_face && rb->filter_face_mark) {
+if (rb->filter_face_mark_invert) {
+  return LRT_EDGE_FLAG_LOOSE;
+}
+return 0;
+  }
+  return LRT_EDGE_FLAG_LOOSE;
+}
+  }
+
+  FreestyleEdge *fel, *fer;
+  bool face_mark_filtered = false;
+  bool only_contour = false;
+
+  uint16_t edge_flag_result = 0;
+
+  /* Mesh boundary */
+  if (!ll || !lr) {
+return (edge_flag_result | LRT_EDGE_FLAG_CONTOUR);
+  }
+
+  LineartTriangle *tri1, *tri2;
+  LineartVert *l;
+
+  /* The mesh should already be triangulated now, so we can assume each face 
is a triangle. */
+  tri1 = lineart_triangle_from_index(rb, rt_array, t1i);
+  tri2 = lineart_triangle_from_index(rb, rt_array, t2i);
+
+  l = _array[en[eindex].v1];
+
+  double vv[3];
+  double *view_vector = vv;
+  double dot_1 = 0, dot_2 = 0;
+  double result;
+  bool material_back_face = ((tri1->flags | tri2->flags) & 
LRT_TRIANGLE_MAT_BACK_FACE_CULLING);
+
+  if (rb->use_contour || rb->use_back_face_culling || material_back_face) {
+
+if (rb->cam_is_persp) {
+  sub_v3_v3v3_db(view_vector, rb->camera_pos, l->gloc);
+}
+else {
+  view_vector = rb->view_vector;
+}
+
+dot_1 = dot_v3v3_db(view_vector, tri1->gn);
+dot_2 = dot_v3v3_db(view_vector, tri2->gn);
+
+if (rb->use_contour && (result = dot_1 * dot_2) <= 0 && (fabs(dot_1) + 
fabs(dot_2))) {
+  edge_flag_result |= LRT_EDGE_FLAG_CONTOUR;
+}
+
+/* Because the ray points towards the camera, so backface is when dot 
value being negative.*/
+if (rb->use_back_face_culling) {
+  if (dot_1 < 0) {
+tri1->flags |= LRT_CULL_DISCARD;
+  }
+  if (dot_2 < 0) {
+tri2->flags |= LRT_CULL_DISCARD;
+  }
+}
+if (material_back_face) {
+  if (tri1->flags & LRT_TRIANGLE_MAT_BACK_FACE_CULLING && dot_1 < 0) {
+tri1->flags |= LRT_CULL_DISCARD;
+  }
+  if (tri2->flags & LRT_TRIANGLE_MAT_BACK_FACE_CULLING && dot_2 < 0) {
+tri2->flags |= LRT_CULL_DISCARD;
+  }
+}
+  }
+
+  /* For when face mark filtering decided that we discard the face but 
keep_contour option is on.
+   * so we still have correct full contour 

[Bf-blender-cvs] [516ec45d10b] lineart-object-load: LineArt: Object loading fixes for master

2022-04-20 Thread YimingWu
Commit: 516ec45d10b867d54e614fc5c6952ead3a342d27
Author: YimingWu
Date:   Tue Apr 12 19:50:46 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rB516ec45d10b867d54e614fc5c6952ead3a342d27

LineArt: Object loading fixes for master

===

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_cpu.c
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 1058f861be3..0e7df2a136d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -387,7 +387,6 @@ static void options_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
 
   uiLayout *col = uiLayoutColumn(layout, true);
 
-  uiItemR(col, ptr, "use_remove_doubles", 0, NULL, ICON_NONE);
   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);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index a168873740a..830066ac0fb 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -140,7 +140,7 @@ typedef struct LineartEdge {
   char min_occ;
 
   /** Also for line type determination on chaining. */
-  unsigned char flags;
+  short flags;
   unsigned char intersection_mask;
 
   /**
@@ -179,7 +179,7 @@ typedef struct LineartEdgeChainItem {
   /** For restoring position to 3d space. */
   float gpos[3];
   float normal[3];
-  unsigned char line_type;
+  short line_type;
   char occlusion;
   unsigned char material_mask_bits;
   unsigned char intersection_mask;
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 3419fa4e224..acc36062152 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1429,19 +1429,6 @@ static void 
lineart_main_discard_out_of_frame_edges(LineartRenderBuffer *rb)
   }
 }
 
-/**
- * Transform a single vert to it's viewing position.
- */
-static void lineart_vert_transform(
-BMVert *v, int index, LineartVert *RvBuf, double (*mv_mat)[4], double 
(*mvp_mat)[4])
-{
-  double co[4];
-  LineartVert *vt = [index];
-  copy_v3db_v3fl(co, v->co);
-  mul_v3_m4v3_db(vt->gloc, mv_mat, co);
-  mul_v4_m4v3_db(vt->fbcoord, mvp_mat, co);
-}
-
 typedef struct VertData {
   MVert *mvert;
   LineartVert *v_arr;
@@ -1670,170 +1657,6 @@ static uint16_t lineart_identify_medge_feature_edges(
   return edge_flag_result;
 }
 
-static uint16_t lineart_identify_feature_line(LineartRenderBuffer *rb,
-  BMEdge *e,
-  LineartTriangle *rt_array,
-  LineartVert *rv_array,
-  float crease_threshold,
-  bool use_auto_smooth,
-  bool use_freestyle_edge,
-  bool use_freestyle_face,
-  BMesh *bm_if_freestyle)
-{
-  BMLoop *ll, *lr = NULL;
-
-  ll = e->l;
-  if (ll) {
-lr = e->l->radial_next;
-  }
-
-  if (!ll && !lr) {
-return LRT_EDGE_FLAG_LOOSE;
-  }
-
-  FreestyleEdge *fel, *fer;
-  bool face_mark_filtered = false;
-  uint16_t edge_flag_result = 0;
-  bool only_contour = false;
-
-  if (use_freestyle_face && rb->filter_face_mark) {
-fel = CustomData_bmesh_get(_if_freestyle->pdata, ll->f->head.data, 
CD_FREESTYLE_FACE);
-if (ll != lr && lr) {
-  fer = CustomData_bmesh_get(_if_freestyle->pdata, lr->f->head.data, 
CD_FREESTYLE_FACE);
-}
-else {
-  /* Handles mesh boundary case */
-  fer = fel;
-}
-if (rb->filter_face_mark_boundaries ^ rb->filter_face_mark_invert) {
-  if ((fel->flag & FREESTYLE_FACE_MARK) || (fer->flag & 
FREESTYLE_FACE_MARK)) {
-face_mark_filtered = true;
-  }
-}
-else {
-  if ((fel->flag & FREESTYLE_FACE_MARK) && (fer->flag & 
FREESTYLE_FACE_MARK) && (fer != fel)) {
-face_mark_filtered = true;
-  }
-}
-if (rb->filter_face_mark_invert) {
-  face_mark_filtered = !face_mark_filtered;
-}
-if 

[Bf-blender-cvs] [fe2df4c771a] lineart-object-load: LineArt: Object loading wip

2022-04-20 Thread YimingWu
Commit: fe2df4c771af415ea049497590b7d1a9699abccf
Author: YimingWu
Date:   Mon Mar 28 13:34:17 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rBfe2df4c771af415ea049497590b7d1a9699abccf

LineArt: Object loading wip

===

M   source/blender/blenlib/intern/BLI_mempool.c
M   source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/blenlib/intern/BLI_mempool.c 
b/source/blender/blenlib/intern/BLI_mempool.c
index f70b5ddd766..bc97b71c78e 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -355,32 +355,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr)
 {
   BLI_freenode *newhead = addr;
 
-#ifndef NDEBUG
-  {
-BLI_mempool_chunk *chunk;
-bool found = false;
-for (chunk = pool->chunks; chunk; chunk = chunk->next) {
-  if (ARRAY_HAS_ITEM((char *)addr, (char *)CHUNK_DATA(chunk), 
pool->csize)) {
-found = true;
-break;
-  }
-}
-if (!found) {
-  BLI_assert_msg(0, "Attempt to free data which is not in pool.\n");
-}
-  }
-
-  /* Enable for debugging. */
-  if (UNLIKELY(mempool_debug_memset)) {
-memset(addr, 255, pool->esize);
-  }
-#endif
-
   if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
-#ifndef NDEBUG
-/* This will detect double free's. */
-BLI_assert(newhead->freeword != FREEWORD);
-#endif
 newhead->freeword = FREEWORD;
   }
 
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 5d952991cf7..a168873740a 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -14,6 +14,14 @@
 
 #include 
 
+typedef struct EdgeFacePair {
+  int v1;
+  int v2;
+  int f1;
+  int f2;
+  uint16_t eflag;
+} EdgeFacePair;
+
 typedef struct LineartStaticMemPoolNode {
   Link item;
   size_t size;
@@ -396,7 +404,7 @@ typedef struct LineartObjectInfo {
 
 typedef struct LineartObjectLoadTaskInfo {
   struct LineartRenderBuffer *rb;
-  struct Depsgraph *dg;
+  int thread_id;
   /* LinkNode styled list */
   LineartObjectInfo *pending;
   /* Used to spread the load across several threads. This can not overflow. */
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 08737c19eef..981dd5105c4 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -8,6 +8,7 @@
 #include "MOD_gpencil_lineart.h"
 #include "MOD_lineart.h"
 
+#include "BLI_edgehash.h"
 #include "BLI_linklist.h"
 #include "BLI_listbase.h"
 #include "BLI_math.h"
@@ -28,6 +29,8 @@
 #include "BKE_lib_id.h"
 #include "BKE_material.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_object.h"
 #include "BKE_pointcache.h"
 #include "BKE_scene.h"
@@ -1439,6 +1442,39 @@ static void lineart_vert_transform(
   mul_v4_m4v3_db(vt->fbcoord, mvp_mat, co);
 }
 
+typedef struct VertData {
+  MVert *mvert;
+  LineartVert *v_arr;
+  double (*model_view)[4];
+  double (*model_view_proj)[4];
+} VertData;
+
+static void lineart_mvert_transform_task(void *__restrict userdata,
+ const int i,
+ const TaskParallelTLS *__restrict 
UNUSED(tls))
+{
+  VertData *vert_task_data = (VertData *)userdata;
+  MVert *m_v = _task_data->mvert[i];
+  double co[4];
+  LineartVert *v = _task_data->v_arr[i];
+  copy_v3db_v3fl(co, m_v->co);
+  mul_v3_m4v3_db(v->gloc, vert_task_data->model_view, co);
+  mul_v4_m4v3_db(v->fbcoord, vert_task_data->model_view_proj, co);
+  v->index = i;
+}
+
+static int lineart_edge_type_duplication_count(char eflag)
+{
+  int count = 0;
+  /* See eLineartEdgeFlag for details. */
+  for (int i = 0; i < 6; i++) {
+if (eflag & (1 << i)) {
+  count++;
+}
+  }
+  return count;
+}
+
 /**
  * Because we have a variable size for #LineartTriangle, we need an access 
helper.
  * See #LineartTriangleThread for more info.
@@ -1452,6 +1488,161 @@ static LineartTriangle 
*lineart_triangle_from_index(LineartRenderBuffer *rb,
   return (LineartTriangle *)b;
 }
 
+typedef struct EdgeFeatData {
+  LineartRenderBuffer *rb;
+  Mesh *me;
+  const MLoopTri *mlooptri;
+  EdgeFacePair *edge_pair_arr;
+  LineartTriangle *tri_array;
+  LineartVert *v_array;
+  float crease_threshold;
+  bool use_auto_smooth;
+} EdgeFeatData;
+
+typedef struct EdgeFeatReduceData {
+  int feat_edges;
+} EdgeFeatReduceData;
+
+static void feat_data_sum_reduce(const void *__restrict UNUSED(userdata),
+ void *__restrict 

[Bf-blender-cvs] [f49948bf488] lineart-object-load: LineArt: Working fix for new object loading

2022-04-20 Thread YimingWu
Commit: f49948bf488139214246e782f980ef7f2c7ea6f3
Author: YimingWu
Date:   Tue Apr 5 22:59:13 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rBf49948bf488139214246e782f980ef7f2c7ea6f3

LineArt: Working fix for new object loading

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index e54d12a650a..afcde2c3a7f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2252,6 +2252,12 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
 
   int allocate_la_e = edge_reduce.feat_edges;
 
+  if (!edge_pair_arr) {
+edge_pair_alloc_len = 256;
+edge_pair_arr = MEM_mallocN(sizeof(EdgeFacePair) * edge_pair_alloc_len,
+"lineart edge_pair arr");
+  }
+
   /* Check for edge marks that would create feature edges. */
   for (int i = 0; i < me->totedge; i++) {
 MEdge *medge = >medge[i];
@@ -2261,7 +2267,7 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
 if (eflag) {
   int min_edges_to_add = 0;
   void **eval;
-  if (!BLI_edgehash_ensure_p(edge_hash, medge->v1, medge->v2, )) {
+  if (edge_hash == NULL || !BLI_edgehash_ensure_p(edge_hash, medge->v1, 
medge->v2, )) {
 int pair_idx = edge_pair_arr_len++;
 /* Edge has not been added before, create a new pair. */
 EdgeFacePair *pair = _pair_arr[pair_idx];
@@ -2271,7 +2277,9 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
 pair->f1 = -1;
 pair->f2 = -1;
 pair->eflag = eflag;
-*eval = POINTER_FROM_INT(pair_idx);
+if (edge_hash) {
+  *eval = POINTER_FROM_INT(pair_idx);
+}
 min_edges_to_add = 1;
 
 if (edge_pair_arr_len == edge_pair_alloc_len) {
@@ -2301,7 +2309,9 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
 }
   }
 
-  BLI_edgehash_free(edge_hash, NULL);
+  if (edge_hash) {
+BLI_edgehash_free(edge_hash, NULL);
+  }
 
   la_edge_arr = lineart_mem_acquire_thread(_buf->render_data_pool,
sizeof(LineartEdge) * 
allocate_la_e);

___
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] [3a055e8f41d] lineart-object-load: LineArt: Crease by sharp

2022-04-20 Thread YimingWu
Commit: 3a055e8f41d18442be21a231c33f517adefc24a6
Author: YimingWu
Date:   Sun Apr 3 16:46:10 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rB3a055e8f41d18442be21a231c33f517adefc24a6

LineArt: Crease by sharp

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index c263f69ff00..0241f8f3d96 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1561,20 +1561,20 @@ static void 
lineart_identify_mlooptri_feature_edges(void *__restrict userdata,
   const MLoopTri *mlooptri = e_feat_data->mlooptri;
 
   if (rb->use_crease) {
-// if (rb->sharp_as_crease && !BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
-//  edge_flag_result |= LRT_EDGE_FLAG_CREASE;
-//}
-// else {
-bool do_crease = true;
-if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
-(me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
-(me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
-  do_crease = false;
-}
-if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
e_feat_data->crease_threshold)) {
+if (e_f_pair->eflag & BM_ELEM_TAG) {
   edge_flag_result |= LRT_EDGE_FLAG_CREASE;
 }
-//}
+else {
+  bool do_crease = true;
+  if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
+  (me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
+  (me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
+do_crease = false;
+  }
+  if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
e_feat_data->crease_threshold)) {
+edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+  }
+}
   }
 
   int mat1 = me->mpoly[mlooptri[e_f_pair->f1].poly].mat_nr;
@@ -1608,6 +1608,10 @@ static uint16_t 
lineart_identify_medge_feature_edges(LineartRenderBuffer *rb,
   bool face_mark_filtered = false;
   uint16_t edge_flag_result = 0;
 
+  if (rb->use_crease && rb->sharp_as_crease && medge->flag & ME_SHARP) {
+edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+  }
+
   // if (use_freestyle_face && rb->filter_face_mark) {
   //   fel = CustomData_bmesh_get(_if_freestyle->pdata, ll->f->head.data, 
CD_FREESTYLE_FACE);
   //   if (ll != lr && lr) {

___
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] [50840bb2a3a] lineart-object-load: LineArt: Crease in new object loading working correctly.

2022-04-20 Thread YimingWu
Commit: 50840bb2a3a08cf0572681c22c030f375bf0d80a
Author: YimingWu
Date:   Sun Apr 3 18:03:36 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rB50840bb2a3a08cf0572681c22c030f375bf0d80a

LineArt: Crease in new object loading working correctly.

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 0241f8f3d96..e54d12a650a 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1561,19 +1561,14 @@ static void 
lineart_identify_mlooptri_feature_edges(void *__restrict userdata,
   const MLoopTri *mlooptri = e_feat_data->mlooptri;
 
   if (rb->use_crease) {
-if (e_f_pair->eflag & BM_ELEM_TAG) {
-  edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+bool do_crease = true;
+if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
+(me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
+(me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
+  do_crease = false;
 }
-else {
-  bool do_crease = true;
-  if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
-  (me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
-  (me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
-do_crease = false;
-  }
-  if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
e_feat_data->crease_threshold)) {
-edge_flag_result |= LRT_EDGE_FLAG_CREASE;
-  }
+if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
e_feat_data->crease_threshold)) {
+  edge_flag_result |= LRT_EDGE_FLAG_CREASE;
 }
   }
 
@@ -1608,7 +1603,7 @@ static uint16_t 
lineart_identify_medge_feature_edges(LineartRenderBuffer *rb,
   bool face_mark_filtered = false;
   uint16_t edge_flag_result = 0;
 
-  if (rb->use_crease && rb->sharp_as_crease && medge->flag & ME_SHARP) {
+  if (rb->use_crease && rb->sharp_as_crease && (medge->flag & ME_SHARP)) {
 edge_flag_result |= LRT_EDGE_FLAG_CREASE;
   }
 
@@ -2141,7 +2136,7 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
   if (orig_ob->lineart.flags & OBJECT_LRT_OWN_CREASE) {
 use_crease = cosf(M_PI - orig_ob->lineart.crease_threshold);
   }
-  if (ob_info->original_me->flag & ME_AUTOSMOOTH) {
+  else if (ob_info->original_me->flag & ME_AUTOSMOOTH) {
 use_crease = cosf(ob_info->original_me->smoothresh);
 use_auto_smooth = 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] [0d5d5542873] lineart-object-load: LineArt: Crease support for new loading

2022-04-20 Thread YimingWu
Commit: 0d5d55428731c15732e107241de5b0c09d52edcb
Author: YimingWu
Date:   Tue Apr 12 19:09:51 2022 +0800
Branches: lineart-object-load
https://developer.blender.org/rB0d5d55428731c15732e107241de5b0c09d52edcb

LineArt: Crease support for new loading

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 981dd5105c4..c263f69ff00 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1496,6 +1496,7 @@ typedef struct EdgeFeatData {
   LineartTriangle *tri_array;
   LineartVert *v_array;
   float crease_threshold;
+  float **poly_normals;
   bool use_auto_smooth;
 } EdgeFeatData;
 
@@ -1556,25 +1557,26 @@ static void 
lineart_identify_mlooptri_feature_edges(void *__restrict userdata,
 edge_flag_result |= LRT_EDGE_FLAG_CONTOUR;
   }
 
-  // if (rb->use_crease) {
-  //   if (rb->sharp_as_crease && !BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
-  // edge_flag_result |= LRT_EDGE_FLAG_CREASE;
-  //   }
-  //   else {
-  // bool do_crease = true;
-  // if (!rb->force_crease && !use_auto_smooth &&
-  // (BM_elem_flag_test(ll->f, BM_ELEM_SMOOTH) && 
BM_elem_flag_test(lr->f,
-  // BM_ELEM_SMOOTH))) {
-  //   do_crease = false;
-  // }
-  // if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
crease_threshold)) {
-  //   edge_flag_result |= LRT_EDGE_FLAG_CREASE;
-  // }
-  //   }
-  // }
   Mesh *me = e_feat_data->me;
   const MLoopTri *mlooptri = e_feat_data->mlooptri;
 
+  if (rb->use_crease) {
+// if (rb->sharp_as_crease && !BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
+//  edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+//}
+// else {
+bool do_crease = true;
+if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
+(me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
+(me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
+  do_crease = false;
+}
+if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < 
e_feat_data->crease_threshold)) {
+  edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+}
+//}
+  }
+
   int mat1 = me->mpoly[mlooptri[e_f_pair->f1].poly].mat_nr;
   int mat2 = me->mpoly[mlooptri[e_f_pair->f2].poly].mat_nr;
 
@@ -2084,6 +2086,8 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
   const MLoopTri *mlooptri = BKE_mesh_runtime_looptri_ensure(me);
   const int tot_tri = BKE_mesh_runtime_looptri_len(me);
 
+  // float **normals = BKE_mesh_poly_normals_ensure(me);
+
   // TODO
   if (0) {
 MEdge *medge = NULL;
@@ -2239,6 +2243,7 @@ static void 
lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
   edge_feat_data.v_array = la_v_arr;
   edge_feat_data.crease_threshold = use_crease;
   edge_feat_data.use_auto_smooth = use_auto_smooth;
+  // edge_feat_data.poly_normals = normals;
 
   BLI_task_parallel_range(0,
   edge_pair_arr_len,

___
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] [7cb6fb01831] master: Cleanup: Remove redundant types from custom data masks

2022-04-20 Thread Hans Goudey
Commit: 7cb6fb01831e94cace6df1a61070e1e88a316ca4
Author: Hans Goudey
Date:   Wed Apr 20 09:12:40 2022 -0500
Branches: master
https://developer.blender.org/rB7cb6fb01831e94cace6df1a61070e1e88a316ca4

Cleanup: Remove redundant types from custom data masks

Colors and byte colors are already included in `CD_MASK_PROP_ALL`.

===

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

===

diff --git a/source/blender/blenkernel/intern/customdata.cc 
b/source/blender/blenkernel/intern/customdata.cc
index 6b6ee5b04ea..a50351d19c0 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -2052,47 +2052,45 @@ const CustomData_MeshMasks CD_MASK_BAREMESH_ORIGINDEX = 
{
 };
 const CustomData_MeshMasks CD_MASK_MESH = {
 /* vmask */ (CD_MASK_MVERT | CD_MASK_MDEFORMVERT | CD_MASK_MVERT_SKIN | 
CD_MASK_PAINT_MASK |
- CD_MASK_PROP_ALL | CD_MASK_PROP_COLOR | CD_MASK_CREASE),
+ CD_MASK_PROP_ALL | CD_MASK_CREASE),
 /* emask */ (CD_MASK_MEDGE | CD_MASK_FREESTYLE_EDGE | CD_MASK_PROP_ALL),
 /* fmask */ 0,
 /* pmask */
 (CD_MASK_MPOLY | CD_MASK_FACEMAP | CD_MASK_FREESTYLE_FACE | 
CD_MASK_PROP_ALL |
  CD_MASK_SCULPT_FACE_SETS),
 /* lmask */
-(CD_MASK_MLOOP | CD_MASK_MDISPS | CD_MASK_MLOOPUV | 
CD_MASK_PROP_BYTE_COLOR |
- CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
+(CD_MASK_MLOOP | CD_MASK_MDISPS | CD_MASK_MLOOPUV | 
CD_MASK_CUSTOMLOOPNORMAL |
+ CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
 };
 const CustomData_MeshMasks CD_MASK_DERIVEDMESH = {
 /* vmask */ (CD_MASK_ORIGINDEX | CD_MASK_MDEFORMVERT | CD_MASK_SHAPEKEY | 
CD_MASK_MVERT_SKIN |
  CD_MASK_PAINT_MASK | CD_MASK_ORCO | CD_MASK_CLOTH_ORCO | 
CD_MASK_PROP_ALL |
- CD_MASK_PROP_COLOR | CD_MASK_CREASE),
+ CD_MASK_CREASE),
 /* emask */ (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_EDGE | 
CD_MASK_PROP_ALL),
 /* fmask */ (CD_MASK_ORIGINDEX | CD_MASK_ORIGSPACE | CD_MASK_PREVIEW_MCOL 
| CD_MASK_TANGENT),
 /* pmask */
 (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | 
CD_MASK_PROP_ALL |
  CD_MASK_SCULPT_FACE_SETS),
 /* lmask */
-(CD_MASK_MLOOPUV | CD_MASK_PROP_BYTE_COLOR | CD_MASK_CUSTOMLOOPNORMAL |
- CD_MASK_PREVIEW_MLOOPCOL | CD_MASK_ORIGSPACE_MLOOP |
- CD_MASK_PROP_ALL), /* XXX MISSING CD_MASK_MLOOPTANGENT ? */
+(CD_MASK_MLOOPUV | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_PREVIEW_MLOOPCOL |
+ CD_MASK_ORIGSPACE_MLOOP | CD_MASK_PROP_ALL), /* XXX MISSING 
CD_MASK_MLOOPTANGENT ? */
 };
 const CustomData_MeshMasks CD_MASK_BMESH = {
 /* vmask */ (CD_MASK_MDEFORMVERT | CD_MASK_BWEIGHT | CD_MASK_MVERT_SKIN | 
CD_MASK_SHAPEKEY |
- CD_MASK_SHAPE_KEYINDEX | CD_MASK_PAINT_MASK | 
CD_MASK_PROP_ALL |
- CD_MASK_PROP_COLOR | CD_MASK_CREASE),
+ CD_MASK_SHAPE_KEYINDEX | CD_MASK_PAINT_MASK | 
CD_MASK_PROP_ALL | CD_MASK_CREASE),
 /* emask */ (CD_MASK_BWEIGHT | CD_MASK_CREASE | CD_MASK_FREESTYLE_EDGE | 
CD_MASK_PROP_ALL),
 /* fmask */ 0,
 /* pmask */
 (CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL | 
CD_MASK_SCULPT_FACE_SETS),
 /* lmask */
-(CD_MASK_MDISPS | CD_MASK_MLOOPUV | CD_MASK_PROP_BYTE_COLOR | 
CD_MASK_CUSTOMLOOPNORMAL |
- CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
+(CD_MASK_MDISPS | CD_MASK_MLOOPUV | CD_MASK_CUSTOMLOOPNORMAL | 
CD_MASK_GRID_PAINT_MASK |
+ CD_MASK_PROP_ALL),
 };
 const CustomData_MeshMasks CD_MASK_EVERYTHING = {
 /* vmask */ (CD_MASK_MVERT | CD_MASK_BM_ELEM_PYPTR | CD_MASK_ORIGINDEX | 
CD_MASK_MDEFORMVERT |
  CD_MASK_BWEIGHT | CD_MASK_MVERT_SKIN | CD_MASK_ORCO | 
CD_MASK_CLOTH_ORCO |
  CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | 
CD_MASK_PAINT_MASK |
- CD_MASK_PROP_ALL | CD_MASK_PROP_COLOR | CD_MASK_CREASE),
+ CD_MASK_PROP_ALL | CD_MASK_CREASE),
 /* emask */
 (CD_MASK_MEDGE | CD_MASK_BM_ELEM_PYPTR | CD_MASK_ORIGINDEX | 
CD_MASK_BWEIGHT | CD_MASK_CREASE |
  CD_MASK_FREESTYLE_EDGE | CD_MASK_PROP_ALL),
@@ -2105,9 +2103,8 @@ const CustomData_MeshMasks CD_MASK_EVERYTHING = {
  CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL | CD_MASK_SCULPT_FACE_SETS),
 /* lmask */
 (CD_MASK_MLOOP | CD_MASK_BM_ELEM_PYPTR | CD_MASK_MDISPS | CD_MASK_NORMAL | 
CD_MASK_MLOOPUV |
- CD_MASK_PROP_BYTE_COLOR | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_MLOOPTANGENT 
|
- CD_MASK_PREVIEW_MLOOPCOL | CD_MASK_ORIGSPACE_MLOOP | 
CD_MASK_GRID_PAINT_MASK |
- CD_MASK_PROP_ALL),
+ CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_MLOOPTANGENT | 
CD_MASK_PREVIEW_MLOOPCOL |
+ CD_MASK_ORIGSPACE_MLOOP | CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
 };
 
 static const LayerTypeInfo *layerType_getInfo(int type)


[Bf-blender-cvs] [03ec505fa54] master: Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLOR

2022-04-20 Thread Hans Goudey
Commit: 03ec505fa549840936d7425269073dc82fd29b10
Author: Hans Goudey
Date:   Wed Apr 20 09:10:10 2022 -0500
Branches: master
https://developer.blender.org/rB03ec505fa549840936d7425269073dc82fd29b10

Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLOR

The "PROP" in the name reflects its generic status, and removing
"LOOP" makes sense because it is no longer associated with just
mesh face corners. In general the goal is to remove extra semantic
meaning from the custom data types.

===

M   source/blender/blenkernel/intern/DerivedMesh.cc
M   source/blender/blenkernel/intern/attribute.c
M   source/blender/blenkernel/intern/attribute_access.cc
M   source/blender/blenkernel/intern/customdata.cc
M   source/blender/blenkernel/intern/data_transfer.c
M   source/blender/blenkernel/intern/dynamicpaint.c
M   source/blender/blenkernel/intern/geometry_component_mesh.cc
M   source/blender/blenkernel/intern/mesh.cc
M   source/blender/blenkernel/intern/mesh_evaluate.cc
M   source/blender/blenkernel/intern/mesh_tessellate.c
M   source/blender/blenkernel/intern/mesh_validate.cc
M   source/blender/blenkernel/intern/object_update.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/blenkernel/intern/pbvh.cc
M   source/blender/blenloader/intern/versioning_260.c
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/bmesh/operators/bmo_join_triangles.c
M   source/blender/draw/engines/workbench/workbench_engine.c
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_cache_impl_particles.c
M   source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
M   source/blender/editors/geometry/geometry_attributes.cc
M   source/blender/editors/mesh/editmesh_utils.c
M   source/blender/editors/mesh/mesh_data.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/object/object_data_transfer.c
M   source/blender/editors/sculpt_paint/paint_vertex.c
M   source/blender/editors/sculpt_paint/sculpt_ops.c
M   source/blender/editors/space_node/node_geometry_attribute_search.cc
M   source/blender/editors/space_view3d/view3d_draw.c
M   
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M   source/blender/gpu/intern/gpu_buffers.c
M   source/blender/gpu/intern/gpu_node_graph.c
M   source/blender/io/alembic/exporter/abc_writer_mesh.cc
M   source/blender/io/alembic/intern/abc_customdata.cc
M   source/blender/io/alembic/intern/abc_reader_mesh.cc
M   source/blender/io/collada/GeometryExporter.cpp
M   source/blender/io/collada/MeshImporter.cpp
M   source/blender/io/usd/intern/usd_reader_mesh.cc
M   source/blender/makesdna/DNA_customdata_types.h
M   source/blender/makesdna/DNA_mesh_types.h
M   source/blender/makesrna/intern/rna_attribute.c
M   source/blender/makesrna/intern/rna_mesh.c
M   source/blender/makesrna/intern/rna_modifier.c
M   source/blender/makesrna/intern/rna_particle.c
M   source/blender/modifiers/intern/MOD_dynamicpaint.c
M   source/blender/modifiers/intern/MOD_ocean.c
M   source/blender/modifiers/intern/MOD_particleinstance.c
M   source/blender/python/bmesh/bmesh_py_types_customdata.c
M   source/blender/render/intern/texture_pointdensity.c

===

diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc 
b/source/blender/blenkernel/intern/DerivedMesh.cc
index 33f0c331e46..4b4507a425f 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.cc
+++ b/source/blender/blenkernel/intern/DerivedMesh.cc
@@ -1745,13 +1745,13 @@ static void object_get_datamask(const Depsgraph 
*depsgraph,
 
 /* check if we need tfaces & mcols due to face select or texture paint */
 if ((ob->mode & OB_MODE_TEXTURE_PAINT) || editing) {
-  r_mask->lmask |= CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL;
+  r_mask->lmask |= CD_MASK_MLOOPUV | CD_MASK_PROP_BYTE_COLOR;
   r_mask->fmask |= CD_MASK_MTFACE;
 }
 
 /* check if we need mcols due to vertex paint or weightpaint */
 if (ob->mode & OB_MODE_VERTEX_PAINT) {
-  r_mask->lmask |= CD_MASK_MLOOPCOL;
+  r_mask->lmask |= CD_MASK_PROP_BYTE_COLOR;
 }
 
 if (ob->mode & OB_MODE_WEIGHT_PAINT) {
diff --git a/source/blender/blenkernel/intern/attribute.c 
b/source/blender/blenkernel/intern/attribute.c
index 307868ce6d9..9b8ae4b3804 100644
--- a/source/blender/blenkernel/intern/attribute.c
+++ b/source/blender/blenkernel/intern/attribute.c
@@ -622,10 +622,10 @@ CustomDataLayer *BKE_id_attributes_color_find(const ID 
*id, const char *name)
 layer = BKE_id_attribute_find(id, name, CD_PROP_COLOR, ATTR_DOMAIN_CORNER);
   }
   if (layer == NULL) {
-layer = BKE_id_attribute_find(id, name, CD_MLOOPCOL, 

[Bf-blender-cvs] [245fb6472cd] temp-T97352-3d-texturing-seam-bleeding: Use partial updates.

2022-04-20 Thread Jeroen Bakker
Commit: 245fb6472cdae14b48fae329efb1f45871359dbd
Author: Jeroen Bakker
Date:   Wed Apr 20 14:35:45 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB245fb6472cdae14b48fae329efb1f45871359dbd

Use partial updates.

===

M   source/blender/blenkernel/BKE_pbvh_pixels.hh
M   source/blender/blenkernel/intern/pbvh_pixels_seams.cc

===

diff --git a/source/blender/blenkernel/BKE_pbvh_pixels.hh 
b/source/blender/blenkernel/BKE_pbvh_pixels.hh
index f2ba99df720..63e110775e9 100644
--- a/source/blender/blenkernel/BKE_pbvh_pixels.hh
+++ b/source/blender/blenkernel/BKE_pbvh_pixels.hh
@@ -138,13 +138,16 @@ struct SeamFix {
 };
 
 struct UDIMSeamFixes {
-  ushort src_tile_number;
-  ushort dst_tile_number;
+  uint16_t src_tile_number;
+  uint16_t dst_tile_number;
   Vector pixels;
+  /* Region of the dst image buffer for partial update. Should cover all 
`pixels.dst_pixels`. */
+  rcti dst_partial_region;
 
   UDIMSeamFixes(uint16_t src_tile_number, uint16_t dst_tile_number)
   : src_tile_number(src_tile_number), dst_tile_number(dst_tile_number)
   {
+BLI_rcti_init_minmax(_partial_region);
   }
 };
 
@@ -155,7 +158,6 @@ struct NodeData {
 
   Vector tiles;
   Triangles triangles;
-  /* TODO: This should be ordered between source and destination UDIM tiles. */
   Vector seams;
 
   NodeData()
diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index b35663dd283..5b973c5092c 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -234,6 +234,7 @@ static void add_seam_fix(PBVHNode ,
 {
   NodeData _data = BKE_pbvh_pixels_node_data_get(node);
   UDIMSeamFixes _fixes = node_data.ensure_seam_fixes(src_tile_number, 
dst_tile_number);
+  BLI_rcti_do_minmax_v(_fixes.dst_partial_region, dst_pixel);
   seam_fixes.pixels.append(SeamFix{src_pixel, dst_pixel});
 }
 
@@ -522,9 +523,16 @@ void BKE_pbvh_pixels_fix_seams(PBVHNode *node, Image 
*image, ImageUser *image_us
   }
 }
 
-/* TODO: should be narrowed to the part of the image that needs to be 
updated. Requires
- * access to the image tile. can be stored in the UDIMSeamFixes struct.  */
-BKE_image_partial_update_mark_full_update(image);
+/* Mark dst_image_buffer region dirty covering each dst_pixel. */
+LISTBASE_FOREACH (ImageTile *, image_tile, >tiles) {
+  if (image_tile->tile_number != fixes.dst_tile_number) {
+continue;
+  }
+
+  BKE_image_partial_update_mark_region(
+  image, image_tile, dst_image_buffer, _partial_region);
+  break;
+}
 BKE_image_release_ibuf(image, src_image_buffer, nullptr);
 BKE_image_release_ibuf(image, dst_image_buffer, nullptr);
   }

___
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] [b577f11a5e4] temp-T97352-3d-texturing-seam-bleeding: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

2022-04-20 Thread Jeroen Bakker
Commit: b577f11a5e492170d54ed011b442d551b835307f
Author: Jeroen Bakker
Date:   Wed Apr 20 13:47:05 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBb577f11a5e492170d54ed011b442d551b835307f

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

===



===



___
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] [3a2fb294b86] temp-T97352-3d-texturing-seam-bleeding: Move detemination of cd offset closer to where it is used.

2022-04-20 Thread Jeroen Bakker
Commit: 3a2fb294b86f6a04ce73e4ccb7ea36c6a47d8bcf
Author: Jeroen Bakker
Date:   Wed Apr 20 13:52:26 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB3a2fb294b86f6a04ce73e4ccb7ea36c6a47d8bcf

Move detemination of cd offset closer to where it is used.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc 
b/source/blender/blenkernel/intern/pbvh_pixels.cc
index 51155db4353..6f32451e71f 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -287,7 +287,6 @@ static void update_pixels(PBVH *pbvh, Mesh *mesh, Image 
*image, ImageUser *image
   if (ldata_uv == nullptr) {
 return;
   }
-  int cd_loop_uv_offset = CustomData_get_offset(>ldata, CD_MLOOPUV);
 
   for (PBVHNode *node : nodes_to_update) {
 NodeData *node_data = static_cast(node->pixels.node_data);
@@ -307,6 +306,8 @@ static void update_pixels(PBVH *pbvh, Mesh *mesh, Image 
*image, ImageUser *image
   if (USE_WATERTIGHT_CHECK) {
 apply_watertight_check(pbvh, image, image_user);
   }
+
+  int cd_loop_uv_offset = CustomData_get_offset(>ldata, CD_MLOOPUV);
   BKE_pbvh_pixels_rebuild_seams(pbvh, mesh, image, image_user, 
cd_loop_uv_offset);
 
   /* Clear the UpdatePixels flag. */

___
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] [0385e2f1f90] master: PBVH: Pass Mesh to extract internals.

2022-04-20 Thread Jeroen Bakker
Commit: 0385e2f1f90ff10c75773cc22125292a82cddaa6
Author: Jeroen Bakker
Date:   Wed Apr 20 13:42:51 2022 +0200
Branches: master
https://developer.blender.org/rB0385e2f1f90ff10c75773cc22125292a82cddaa6

PBVH: Pass Mesh to extract internals.

More mesh data is required when extracting the UV seams. This is an
API change for to support this future enhancement.

===

M   source/blender/blenkernel/BKE_pbvh.h
M   source/blender/blenkernel/intern/pbvh_pixels.cc
M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/blenkernel/BKE_pbvh.h 
b/source/blender/blenkernel/BKE_pbvh.h
index bb918fcfdcb..978e52d8003 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -143,8 +143,7 @@ void BKE_pbvh_build_bmesh(PBVH *pbvh,
   int cd_face_node_offset);
 
 void BKE_pbvh_build_pixels(PBVH *pbvh,
-   const struct MLoop *mloop,
-   struct CustomData *ldata,
+   struct Mesh *mesh,
struct Image *image,
struct ImageUser *image_user);
 void BKE_pbvh_free(PBVH *pbvh);
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc 
b/source/blender/blenkernel/intern/pbvh_pixels.cc
index 1c1e9254157..5623cac44ac 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -275,11 +275,7 @@ static void apply_watertight_check(PBVH *pbvh, Image 
*image, ImageUser *image_us
   BKE_image_partial_update_mark_full_update(image);
 }
 
-static void update_pixels(PBVH *pbvh,
-  const struct MLoop *mloop,
-  struct CustomData *ldata,
-  struct Image *image,
-  struct ImageUser *image_user)
+static void update_pixels(PBVH *pbvh, Mesh *mesh, Image *image, ImageUser 
*image_user)
 {
   Vector nodes_to_update;
 
@@ -287,14 +283,14 @@ static void update_pixels(PBVH *pbvh,
 return;
   }
 
-  MLoopUV *ldata_uv = static_cast(CustomData_get_layer(ldata, 
CD_MLOOPUV));
+  MLoopUV *ldata_uv = static_cast(CustomData_get_layer(>ldata, CD_MLOOPUV));
   if (ldata_uv == nullptr) {
 return;
   }
 
   for (PBVHNode *node : nodes_to_update) {
 NodeData *node_data = static_cast(node->pixels.node_data);
-init_triangles(pbvh, node, node_data, mloop);
+init_triangles(pbvh, node, node_data, mesh->mloop);
   }
 
   EncodePixelsUserData user_data;
@@ -377,13 +373,9 @@ void BKE_pbvh_pixels_mark_image_dirty(PBVHNode , 
Image , ImageUser 
 extern "C" {
 using namespace blender::bke::pbvh::pixels;
 
-void BKE_pbvh_build_pixels(PBVH *pbvh,
-   const struct MLoop *mloop,
-   struct CustomData *ldata,
-   struct Image *image,
-   struct ImageUser *image_user)
+void BKE_pbvh_build_pixels(PBVH *pbvh, Mesh *mesh, Image *image, ImageUser 
*image_user)
 {
-  update_pixels(pbvh, mloop, ldata, image, image_user);
+  update_pixels(pbvh, mesh, image, image_user);
 }
 
 void pbvh_pixels_free(PBVHNode *node)
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 8807032bf69..d576d529ce5 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2780,7 +2780,7 @@ static void sculpt_pbvh_update_pixels(PaintModeSettings 
*paint_mode_settings,
 return;
   }
 
-  BKE_pbvh_build_pixels(ss->pbvh, mesh->mloop, >ldata, image, 
image_user);
+  BKE_pbvh_build_pixels(ss->pbvh, mesh, image, image_user);
 }
 
 /** \} */

___
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] [998d5415683] temp-T97352-3d-texturing-seam-bleeding: connected edges.

2022-04-20 Thread Jeroen Bakker
Commit: 998d541568354c7de2ab38d76ce7f5e9d8f145a7
Author: Jeroen Bakker
Date:   Wed Apr 20 13:23:47 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB998d541568354c7de2ab38d76ce7f5e9d8f145a7

connected edges.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index d70bdd0767b..b35663dd283 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -184,14 +184,14 @@ Bitmaps create_tile_bitmap(const PBVH , Image 
, ImageUser _user
 
 int2 find_source_pixel(Bitmap , float2 near_image_coord)
 {
-  // TODO: Should we take lambda into account?
+  // TODO: We should take lambda into account.
   const int SEARCH_RADIUS = 2;
   float min_distance = FLT_MAX;
   int2 result(0, 0);
   int2 image_coord(int(near_image_coord.x), int(near_image_coord.y));
   for (int v = image_coord.y - SEARCH_RADIUS; v <= image_coord.y + 
SEARCH_RADIUS; v++) {
 for (int u = image_coord.x - SEARCH_RADIUS; u <= image_coord.x + 
SEARCH_RADIUS; u++) {
-  if (u < 0 || u > bitmap.resolution.x || v < 0 || v > 
bitmap.resolution.y) {
+  if (u < 0 || u >= bitmap.resolution.x || v < 0 || v >= 
bitmap.resolution.y) {
 /** Pixel not part of this tile. */
 continue;
   }
@@ -237,12 +237,23 @@ static void add_seam_fix(PBVHNode ,
   seam_fixes.pixels.append(SeamFix{src_pixel, dst_pixel});
 }
 
-static void fix_unconnected_seam(
-PBVH , Bitmap , const rcti , const MLoopUV _1, 
const MLoopUV _2)
+/*  */
+
+/** \name Build fixes for connected edges.
+ * \{ */
+
+static void build_fixes(PBVH ,
+Bitmap ,
+const rcti ,
+const MLoopUV _a_1,
+const MLoopUV _a_2,
+const MLoopUV _b_1,
+const MLoopUV _b_2,
+const float scale_factor)
 {
   for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
 for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
-  if (u < 0 || u > bitmap.resolution[0] || v < 0 || v > 
bitmap.resolution[1]) {
+  if (u < 0 || u >= bitmap.resolution[0] || v < 0 || v >= 
bitmap.resolution[1]) {
 /** Pixel not part of this tile. */
 continue;
   }
@@ -252,23 +263,39 @@ static void fix_unconnected_seam(
 /* Skip this pixel as it already has a solution. */
 continue;
   }
-
+  float2 uv_coord(u, v);
   // What is the distance to the edge.
-  float2 uv(float(u) / bitmap.resolution[0], float(v) / 
bitmap.resolution[1]);
+  float2 uv(uv_coord.x / bitmap.resolution.x, uv_coord.y / 
bitmap.resolution.y);
   float2 closest_point;
   // TODO: Should we use lambda to reduce artifacts?
-  closest_to_line_v2(closest_point, uv, luv_1.uv, luv_2.uv);
-
-  /* Calculate the distance in pixel space. */
-  float2 uv_coord(u, v);
+  const float lambda = closest_to_line_v2(closest_point, uv, luv_a_1.uv, 
luv_a_2.uv);
   float2 closest_coord(closest_point.x * bitmap.resolution.x,
closest_point.y * bitmap.resolution.y);
-  float distance_to_edge = len_v2v2(uv_coord, closest_coord);
+
+  /* Distance to the edge in pixel space. */
+  float distance_to_edge = len_v2v2(closest_coord, uv_coord);
   if (distance_to_edge > 2.5f) {
 continue;
   }
 
-  int2 source_pixel = find_source_pixel(bitmap, closest_coord);
+  /*
+   * Project the point over onto the connected UV space. Taking into 
account the scale
+   * difference.
+   */
+  float2 other_closest_point;
+  interp_v2_v2v2(other_closest_point, luv_b_2.uv, luv_b_1.uv, lambda);
+  float2 direction_b;
+  sub_v2_v2v2(direction_b, luv_b_2.uv, luv_b_1.uv);
+  float2 perpedicular_b(direction_b.y, -direction_b.x);
+  normalize_v2(perpedicular_b);
+  perpedicular_b.x /= bitmap.resolution.x;
+  perpedicular_b.y /= bitmap.resolution.y;
+  float2 projected_coord = other_closest_point +
+   perpedicular_b * distance_to_edge * 
scale_factor;
+  projected_coord.x *= bitmap.resolution.x;
+  projected_coord.y *= bitmap.resolution.y;
+
+  int2 source_pixel = find_source_pixel(bitmap, projected_coord);
   int2 destination_pixel(u, v);
 
   PixelInfo src_pixel_info = bitmap.get_pixel_info(source_pixel);
@@ -288,40 +315,29 @@ static void fix_unconnected_seam(
   }
 }
 
-void BKE_pbvh_pixels_rebuild_seams(
-PBVH *pbvh, Mesh *mesh, Image *image, ImageUser *image_user, int 
cd_loop_uv_offset)
+static void build_fixes(PBVH ,
+   

[Bf-blender-cvs] [c89e73209aa] temp-T97352-3d-texturing-seam-bleeding: Fix crash painting on byte textures.

2022-04-20 Thread Jeroen Bakker
Commit: c89e73209aa175d18aeb9eee8db7d67a6e6467c0
Author: Jeroen Bakker
Date:   Wed Apr 20 10:42:59 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBc89e73209aa175d18aeb9eee8db7d67a6e6467c0

Fix crash painting on byte textures.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index 247c6a6c38b..d70bdd0767b 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -395,15 +395,19 @@ void BKE_pbvh_pixels_fix_seams(PBVHNode *node, Image 
*image, ImageUser *image_us
   continue;
 }
 
-for (SeamFix  : fixes.pixels) {
-  int src_offset = fix.src_pixel.y * src_image_buffer->x + fix.src_pixel.x;
-  int dst_offset = fix.dst_pixel.y * dst_image_buffer->x + fix.dst_pixel.x;
-  if (src_image_buffer->rect_float != nullptr && 
dst_image_buffer->rect_float != nullptr) {
+if (src_image_buffer->rect_float != nullptr && 
dst_image_buffer->rect_float != nullptr) {
+  for (SeamFix  : fixes.pixels) {
+int src_offset = fix.src_pixel.y * src_image_buffer->x + 
fix.src_pixel.x;
+int dst_offset = fix.dst_pixel.y * dst_image_buffer->x + 
fix.dst_pixel.x;
 copy_v4_v4(_image_buffer->rect_float[dst_offset * 4],
_image_buffer->rect_float[src_offset * 4]);
   }
-  else if (src_image_buffer->rect != nullptr && dst_image_buffer->rect != 
nullptr) {
-dst_image_buffer->rect_float[dst_offset] = 
src_image_buffer->rect_float[src_offset];
+}
+else if (src_image_buffer->rect != nullptr && dst_image_buffer->rect != 
nullptr) {
+  for (SeamFix  : fixes.pixels) {
+int src_offset = fix.src_pixel.y * src_image_buffer->x + 
fix.src_pixel.x;
+int dst_offset = fix.dst_pixel.y * dst_image_buffer->x + 
fix.dst_pixel.x;
+dst_image_buffer->rect[dst_offset] = 
src_image_buffer->rect[src_offset];
   }
 }

___
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] [86d9ec6df76] temp-T97352-3d-texturing-seam-bleeding: Make connected fixes with more priority.

2022-04-20 Thread Jeroen Bakker
Commit: 86d9ec6df76b47816870bc2ab2e03f1c0d1f5918
Author: Jeroen Bakker
Date:   Wed Apr 20 10:38:14 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB86d9ec6df76b47816870bc2ab2e03f1c0d1f5918

Make connected fixes with more priority.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index b1a8857cf74..247c6a6c38b 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -17,7 +17,7 @@
 
 #include "pbvh_intern.h"
 
-using BMLoopPair = std::pair;
+using BMLoopConnection = std::pair;
 
 namespace blender::bke::pbvh::pixels {
 
@@ -27,10 +27,11 @@ namespace blender::bke::pbvh::pixels {
  *
  * TODO better name would be to find loops that need uv seam fixes.
  */
-Vector find_connected_loops(BMesh *bm, int cd_loop_uv_offset)
+void find_connected_loops(BMesh *bm,
+  const int cd_loop_uv_offset,
+  Vector _connected,
+  Vector _unconnected)
 {
-  Vector pairs;
-
   BMEdge *e;
   BMIter eiter;
   BMLoop *l;
@@ -51,16 +52,17 @@ Vector find_connected_loops(BMesh *bm, int 
cd_loop_uv_offset)
   // This is an edge which is connected in 3d space, but not connected 
in uv space so fixes
   // are needed.
 
-  pairs.append(BMLoopPair(l_first, l));
+  r_connected.append(BMLoopConnection(l_first, l));
+  r_connected.append(BMLoopConnection(l, l_first));
   break;
 }
   }
 }
 if (!connection_found) {
-  pairs.append(BMLoopPair(l_first, nullptr));
+  BLI_assert(!first);
+  r_unconnected.append(l_first);
 }
   }
-  return pairs;
 }
 
 struct PixelInfo {
@@ -304,12 +306,14 @@ void BKE_pbvh_pixels_rebuild_seams(
 
   // find seams.
   // for each edge
-  Vector pairs = find_connected_loops(bm, cd_loop_uv_offset);
+  Vector connected;
+  Vector unconnected;
+  find_connected_loops(bm, cd_loop_uv_offset, connected, unconnected);
 
   // Make a bitmap per tile indicating pixels that have already been assigned 
to a PBVHNode.
   Bitmaps bitmaps = create_tile_bitmap(*pbvh, *image, *image_user);
 
-  for (BMLoopPair  : pairs) {
+  for (BMLoopConnection  : connected) {
 // determine bounding rect in uv space + margin of 1;
 rctf uvbounds;
 BLI_rctf_init_minmax();
@@ -335,13 +339,38 @@ void BKE_pbvh_pixels_rebuild_seams(
 bitmap.resolution[1] +
 MARGIN;
 
-  if (pair.second != nullptr) {
-// TODO..
-continue;
-  }
-  else {
-fix_unconnected_seam(*pbvh, bitmap, uvbounds_i, *luv_1, *luv_2);
-  }
+  fix_unconnected_seam(*pbvh, bitmap, uvbounds_i, *luv_1, *luv_2);
+}
+  }
+
+  for (const BMLoop *unconnected_loop : unconnected) {
+// determine bounding rect in uv space + margin of 1;
+rctf uvbounds;
+BLI_rctf_init_minmax();
+MLoopUV *luv_1 = static_cast(
+BM_ELEM_CD_GET_VOID_P(unconnected_loop, cd_loop_uv_offset));
+MLoopUV *luv_2 = static_cast(
+BM_ELEM_CD_GET_VOID_P(unconnected_loop->next, cd_loop_uv_offset));
+BLI_rctf_do_minmax_v(, luv_1->uv);
+BLI_rctf_do_minmax_v(, luv_2->uv);
+
+for (Bitmap  : bitmaps.bitmaps) {
+  rcti uvbounds_i;
+  const int MARGIN = 1;
+  uvbounds_i.xmin = (uvbounds.xmin - 
bitmap.image_tile.get_tile_x_offset()) *
+bitmap.resolution[0] -
+MARGIN;
+  uvbounds_i.ymin = (uvbounds.ymin - 
bitmap.image_tile.get_tile_y_offset()) *
+bitmap.resolution[1] -
+MARGIN;
+  uvbounds_i.xmax = (uvbounds.xmax - 
bitmap.image_tile.get_tile_x_offset()) *
+bitmap.resolution[0] +
+MARGIN;
+  uvbounds_i.ymax = (uvbounds.ymax - 
bitmap.image_tile.get_tile_y_offset()) *
+bitmap.resolution[1] +
+MARGIN;
+
+  fix_unconnected_seam(*pbvh, bitmap, uvbounds_i, *luv_1, *luv_2);
 }
   }

___
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] [94fd38b8b9c] cycles_oneapi: Cleanup: Spelling

2022-04-20 Thread Sergey Sharybin
Commit: 94fd38b8b9cf542962919fc8353c9eb5e6b685e0
Author: Sergey Sharybin
Date:   Wed Apr 20 10:42:02 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB94fd38b8b9cf542962919fc8353c9eb5e6b685e0

Cleanup: Spelling

===

M   intern/cycles/device/oneapi/queue.cpp
M   intern/cycles/kernel/device/oneapi/dll_interface_template.h
M   intern/cycles/kernel/device/oneapi/kernel.cpp

===

diff --git a/intern/cycles/device/oneapi/queue.cpp 
b/intern/cycles/device/oneapi/queue.cpp
index 628ff2c90ac..a34ff1be21f 100644
--- a/intern/cycles/device/oneapi/queue.cpp
+++ b/intern/cycles/device/oneapi/queue.cpp
@@ -128,7 +128,7 @@ int OneapiDeviceQueue::num_concurrent_states(const size_t 
state_size) const
 }
   }
   else {
-// iGPU path - no really nead to allocate a lot of integrator states, 
because it is shared GPU
+// iGPU path - no really need to allocate a lot of integrator states, 
because it is shared GPU
 // memory
 num_states = 1024 * 512;
   }
@@ -179,9 +179,9 @@ bool OneapiDeviceQueue::enqueue(DeviceKernel kernel,
   size_t kernel_work_size = (size_t)signed_kernel_work_size;
 
   size_t kernel_local_size =
-  (oneapi_dll_.oneapi_kernel_prefered_local_size)(kernel_context_->queue,
-  (::DeviceKernel)kernel,
-  kernel_work_size);
+  (oneapi_dll_.oneapi_kernel_preferred_local_size)(kernel_context_->queue,
+   (::DeviceKernel)kernel,
+   kernel_work_size);
   size_t uniformed_kernel_work_size = round_up(kernel_work_size, 
kernel_local_size);
 
   assert(kernel_context_);
diff --git a/intern/cycles/kernel/device/oneapi/dll_interface_template.h 
b/intern/cycles/kernel/device/oneapi/dll_interface_template.h
index 18d66407974..815f4fbe1a3 100644
--- a/intern/cycles/kernel/device/oneapi/dll_interface_template.h
+++ b/intern/cycles/kernel/device/oneapi/dll_interface_template.h
@@ -37,7 +37,7 @@ DLL_INTERFACE_CALL(oneapi_set_global_memory,
const char *memory_name,
void *memory_device_pointer)
 
-DLL_INTERFACE_CALL(oneapi_kernel_prefered_local_size,
+DLL_INTERFACE_CALL(oneapi_kernel_preferred_local_size,
size_t,
SyclQueue *queue,
const DeviceKernel kernel,
diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp 
b/intern/cycles/kernel/device/oneapi/kernel.cpp
index b046ca26f6a..a80e04edc87 100644
--- a/intern/cycles/kernel/device/oneapi/kernel.cpp
+++ b/intern/cycles/kernel/device/oneapi/kernel.cpp
@@ -256,17 +256,17 @@ void oneapi_set_global_memory(SyclQueue *queue_,
 #  undef KERNEL_TEX
 }
 
-size_t oneapi_kernel_prefered_local_size(SyclQueue *queue_,
- const DeviceKernel kernel,
- const size_t kernel_global_size)
+size_t oneapi_kernel_preferred_local_size(SyclQueue *queue_,
+  const DeviceKernel kernel,
+  const size_t kernel_global_size)
 {
   assert(queue_);
   sycl::queue *queue = reinterpret_cast(queue_);
   (void)kernel_global_size;
-  const static size_t prefered_work_group_size_intersect_shading = 32;
-  const static size_t prefered_work_group_size_technical = 1024;
+  const static size_t preferred_work_group_size_intersect_shading = 32;
+  const static size_t preferred_work_group_size_technical = 1024;
 
-  size_t prefered_work_group_size = 0;
+  size_t preferred_work_group_size = 0;
   switch (kernel) {
 case DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA:
 case DEVICE_KERNEL_INTEGRATOR_INIT_FROM_BAKE:
@@ -280,7 +280,7 @@ size_t oneapi_kernel_prefered_local_size(SyclQueue *queue_,
 case DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE:
 case DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME:
 case DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW:
-  prefered_work_group_size = prefered_work_group_size_intersect_shading;
+  preferred_work_group_size = preferred_work_group_size_intersect_shading;
   break;
 
 case DEVICE_KERNEL_INTEGRATOR_QUEUED_PATHS_ARRAY:
@@ -295,16 +295,16 @@ size_t oneapi_kernel_prefered_local_size(SyclQueue 
*queue_,
 case DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_STATES:
 case DEVICE_KERNEL_INTEGRATOR_RESET:
 case DEVICE_KERNEL_INTEGRATOR_SHADOW_CATCHER_COUNT_POSSIBLE_SPLITS:
-  prefered_work_group_size = prefered_work_group_size_technical;
+  preferred_work_group_size = preferred_work_group_size_technical;
   break;
 
 default:
-  prefered_work_group_size = 512;
+  preferred_work_group_size = 512;
   }
 
   const size_t limit_work_group_size =
   queue->get_device().get_info();
-  return 

[Bf-blender-cvs] [3b6c5bdfaa7] cycles_oneapi: Cleanup: Remove dead code

2022-04-20 Thread Sergey Sharybin
Commit: 3b6c5bdfaa7181a35867887da5074e4825a02a1e
Author: Sergey Sharybin
Date:   Wed Apr 20 10:37:38 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB3b6c5bdfaa7181a35867887da5074e4825a02a1e

Cleanup: Remove dead code

===

M   intern/cycles/device/oneapi/device_impl.h

===

diff --git a/intern/cycles/device/oneapi/device_impl.h 
b/intern/cycles/device/oneapi/device_impl.h
index 3f055cf7fee..501a262230e 100644
--- a/intern/cycles/device/oneapi/device_impl.h
+++ b/intern/cycles/device/oneapi/device_impl.h
@@ -30,9 +30,6 @@ class OneapiDevice : public Device {
  public:
   virtual BVHLayoutMask get_bvh_layout_mask() const override;
 
-  // No need to override
-  // void set_error(const string ) override;
-
   OneapiDevice(const DeviceInfo ,
OneAPIDLLInterface _dll_object,
Stats ,

___
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] [6f40a18ecc2] blender-v2.83-release: Version bump: 2.83.21-rc

2022-04-20 Thread Philipp Oeser
Commit: 6f40a18ecc215839ac71063731931f4450e705b8
Author: Philipp Oeser
Date:   Wed Apr 20 12:22:19 2022 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB6f40a18ecc215839ac71063731931f4450e705b8

Version bump: 2.83.21-rc

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 0d2ec0f8bef..619b09038b9 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -30,9 +30,9 @@
 /* Blender major and minor version. */
 #define BLENDER_VERSION 283
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 20
+#define BLENDER_VERSION_PATCH 21
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE rc
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
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] [354c22b28c3] blender-v2.93-release: Version bump: 2.93.10-rc

2022-04-20 Thread Philipp Oeser
Commit: 354c22b28c319726c8a89fd198d141072b2f8c21
Author: Philipp Oeser
Date:   Wed Apr 20 12:08:38 2022 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB354c22b28c319726c8a89fd198d141072b2f8c21

Version bump: 2.93.10-rc

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 8b9db7c6469..d9173a1b04c 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -33,9 +33,9 @@ extern "C" {
 /* Blender major and minor version. */
 #define BLENDER_VERSION 293
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 9
+#define BLENDER_VERSION_PATCH 10
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE rc
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
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] [5b8a3ccd374] master: Fix T94775: Buggy liboverride default apply code for items insertion in RNA collections.

2022-04-20 Thread Bastien Montagne
Commit: 5b8a3ccd374913d9f81db9e01f64fd51f1296582
Author: Bastien Montagne
Date:   Wed Apr 20 11:05:54 2022 +0200
Branches: master
https://developer.blender.org/rB5b8a3ccd374913d9f81db9e01f64fd51f1296582

Fix T94775: Buggy liboverride default apply code for items insertion in RNA 
collections.

For some reason, the rework of liboverride handling of Collection items
insertion (rB33c5e7bcd5e5) completely missed to update accordingly the
default liboverride apply code...

Many thanks to Wayde Moss (@GuiltyGhost) for the investigation and
proposed solution.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_rna.c 
b/source/blender/makesrna/intern/rna_rna.c
index bd864006b8c..a7d673d3fe1 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -2601,10 +2601,11 @@ bool rna_property_override_apply_default(Main *bmain,
 int item_index_src, item_index_ref;
 if (RNA_property_collection_lookup_string_index(
 ptr_src, prop_src, opop->subitem_local_name, 
_ptr_src, _index_src) &&
-RNA_property_collection_lookup_int(
-ptr_src, prop_src, item_index_src + 1, _ptr_src) &&
-RNA_property_collection_lookup_string_index(
-ptr_dst, prop_dst, opop->subitem_local_name, 
_ptr_ref, _index_ref)) {
+RNA_property_collection_lookup_string_index(ptr_dst,
+prop_dst,
+
opop->subitem_reference_name,
+_ptr_ref,
+_index_ref)) {
   is_valid = true;
   item_index_dst = item_index_ref + 1;
 }
@@ -2612,10 +2613,10 @@ bool rna_property_override_apply_default(Main *bmain,
   if (!is_valid && opop->subitem_local_index >= 0) {
 /* Find from index. */
 if (RNA_property_collection_lookup_int(
-ptr_src, prop_src, opop->subitem_local_index + 1, 
_ptr_src) &&
+ptr_src, prop_src, opop->subitem_local_index, 
_ptr_src) &&
 RNA_property_collection_lookup_int(
-ptr_dst, prop_dst, opop->subitem_local_index, 
_ptr_ref)) {
-  item_index_dst = opop->subitem_local_index + 1;
+ptr_dst, prop_dst, opop->subitem_reference_index, 
_ptr_ref)) {
+  item_index_dst = opop->subitem_reference_index + 1;
   is_valid = 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] [97dbcf97461] master: Fix (unreported) huge liboverride slow-down due to non-disabled UV layer props.

2022-04-20 Thread Bastien Montagne
Commit: 97dbcf97461fbf37c6befb9c78ea07979300ec8b
Author: Bastien Montagne
Date:   Wed Apr 20 10:09:03 2022 +0200
Branches: master
https://developer.blender.org/rB97dbcf97461fbf37c6befb9c78ea07979300ec8b

Fix (unreported) huge liboverride slow-down due to non-disabled UV layer props.

Was revealed by yesterday's fix (rB6f56bd4083f9).

===

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

===

diff --git a/source/blender/makesrna/intern/rna_mesh.c 
b/source/blender/makesrna/intern/rna_mesh.c
index 52af96e355d..7e2b6d9c8ef 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -3182,6 +3182,7 @@ static void rna_def_mesh(BlenderRNA *brna)
   RNA_def_property_pointer_funcs(
   prop, "rna_Mesh_uv_layer_clone_get", "rna_Mesh_uv_layer_clone_set", 
NULL, NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE);
   RNA_def_property_ui_text(
   prop, "Clone UV Loop Layer", "UV loop layer to be used as cloning 
source");
 
@@ -3197,6 +3198,7 @@ static void rna_def_mesh(BlenderRNA *brna)
   RNA_def_property_pointer_funcs(
   prop, "rna_Mesh_uv_layer_stencil_get", "rna_Mesh_uv_layer_stencil_set", 
NULL, NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE);
   RNA_def_property_ui_text(prop, "Mask UV Loop Layer", "UV loop layer to mask 
the painted area");
 
   prop = RNA_def_property(srna, "uv_layer_stencil_index", PROP_INT, 
PROP_UNSIGNED);

___
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] [31a2feceb8d] master: Cleanup: remove unused curves toolsetting

2022-04-20 Thread Jacques Lucke
Commit: 31a2feceb8dc3709187d54e1f9600b0997c39242
Author: Jacques Lucke
Date:   Wed Apr 20 09:51:14 2022 +0200
Branches: master
https://developer.blender.org/rB31a2feceb8dc3709187d54e1f9600b0997c39242

Cleanup: remove unused curves toolsetting

===

M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_sculpt_paint.c

===

diff --git a/source/blender/makesdna/DNA_scene_types.h 
b/source/blender/makesdna/DNA_scene_types.h
index d6c1040110f..9a9aef16306 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1021,16 +1021,10 @@ typedef enum CurvesSculptFlag {
 
 typedef struct CurvesSculpt {
   Paint paint;
-  /** Minimum distance between newly added curves on a surface. */
-  float distance;
-
   /** CurvesSculptFlag. */
   uint32_t flag;
-
   /** Length of newly added curves when it is not interpolated from other 
curves. */
   float curve_length;
-
-  char _pad[4];
 } CurvesSculpt;
 
 typedef struct UvSculpt {
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c 
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 5c83a400cff..f416b024738 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1571,13 +1571,6 @@ static void rna_def_curves_sculpt(BlenderRNA *brna)
   RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
   RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
 
-  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
-  RNA_def_property_range(prop, 0.0f, FLT_MAX);
-  RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 6);
-  RNA_def_property_ui_text(
-  prop, "Distance", "Radius around curves roots in which no new curves can 
be added");
-  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-
   prop = RNA_def_property(srna, "interpolate_length", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", 
CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH);
   RNA_def_property_ui_text(

___
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] [4b281ecd742] temp-T97352-3d-texturing-seam-bleeding: Fix unconnected seams.

2022-04-20 Thread Jeroen Bakker
Commit: 4b281ecd7428d2a955966a1702c8ec6f5aa64f61
Author: Jeroen Bakker
Date:   Wed Apr 20 09:20:47 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB4b281ecd7428d2a955966a1702c8ec6f5aa64f61

Fix unconnected seams.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index 8d44cb33358..b1a8857cf74 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -180,12 +180,39 @@ Bitmaps create_tile_bitmap(const PBVH , Image 
, ImageUser _user
   return result;
 }
 
-int2 find_source_pixel()
+int2 find_source_pixel(Bitmap , float2 near_image_coord)
 {
-  return int2(50, 50);
+  // TODO: Should we take lambda into account?
+  const int SEARCH_RADIUS = 2;
+  float min_distance = FLT_MAX;
+  int2 result(0, 0);
+  int2 image_coord(int(near_image_coord.x), int(near_image_coord.y));
+  for (int v = image_coord.y - SEARCH_RADIUS; v <= image_coord.y + 
SEARCH_RADIUS; v++) {
+for (int u = image_coord.x - SEARCH_RADIUS; u <= image_coord.x + 
SEARCH_RADIUS; u++) {
+  if (u < 0 || u > bitmap.resolution.x || v < 0 || v > 
bitmap.resolution.y) {
+/** Pixel not part of this tile. */
+continue;
+  }
+
+  int2 uv(u, v);
+  const PixelInfo _info = bitmap.get_pixel_info(uv);
+  if (!pixel_info.is_extracted()) {
+continue;
+  }
+
+  float distance = len_v2v2_int(uv, image_coord);
+  if (distance < min_distance) {
+result = uv;
+min_distance = distance;
+  }
+}
+  }
+
+  return result;
 }
 
-static void BKE_pbvh_pixels_clear_seams(PBVH *pbvh)
+/** Clears all existing seam fixes in the given PBVH. */
+static void pbvh_pixels_clear_seams(PBVH *pbvh)
 {
   for (int n = 0; n < pbvh->totnode; n++) {
 PBVHNode  = pbvh->nodes[n];
@@ -208,6 +235,57 @@ static void add_seam_fix(PBVHNode ,
   seam_fixes.pixels.append(SeamFix{src_pixel, dst_pixel});
 }
 
+static void fix_unconnected_seam(
+PBVH , Bitmap , const rcti , const MLoopUV _1, 
const MLoopUV _2)
+{
+  for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
+for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
+  if (u < 0 || u > bitmap.resolution[0] || v < 0 || v > 
bitmap.resolution[1]) {
+/** Pixel not part of this tile. */
+continue;
+  }
+  int pixel_offset = v * bitmap.resolution[0] + u;
+  PixelInfo _info = bitmap.bitmap[pixel_offset];
+  if (pixel_info.is_extracted() || pixel_info.is_seam_fix()) {
+/* Skip this pixel as it already has a solution. */
+continue;
+  }
+
+  // What is the distance to the edge.
+  float2 uv(float(u) / bitmap.resolution[0], float(v) / 
bitmap.resolution[1]);
+  float2 closest_point;
+  // TODO: Should we use lambda to reduce artifacts?
+  closest_to_line_v2(closest_point, uv, luv_1.uv, luv_2.uv);
+
+  /* Calculate the distance in pixel space. */
+  float2 uv_coord(u, v);
+  float2 closest_coord(closest_point.x * bitmap.resolution.x,
+   closest_point.y * bitmap.resolution.y);
+  float distance_to_edge = len_v2v2(uv_coord, closest_coord);
+  if (distance_to_edge > 2.5f) {
+continue;
+  }
+
+  int2 source_pixel = find_source_pixel(bitmap, closest_coord);
+  int2 destination_pixel(u, v);
+
+  PixelInfo src_pixel_info = bitmap.get_pixel_info(source_pixel);
+  if (!src_pixel_info.is_extracted()) {
+continue;
+  }
+  int src_node = src_pixel_info.get_node_index();
+
+  PBVHNode  = pbvh.nodes[src_node];
+  add_seam_fix(node,
+   bitmap.image_tile.get_tile_number(),
+   source_pixel,
+   bitmap.image_tile.get_tile_number(),
+   destination_pixel);
+  bitmap.mark_seam_fix(destination_pixel);
+}
+  }
+}
+
 void BKE_pbvh_pixels_rebuild_seams(
 PBVH *pbvh, Mesh *mesh, Image *image, ImageUser *image_user, int 
cd_loop_uv_offset)
 {
@@ -222,12 +300,11 @@ void BKE_pbvh_pixels_rebuild_seams(
   from_mesh_params.calc_vert_normal = false;
   BM_mesh_bm_from_me(bm, mesh, _mesh_params);
 
-  BKE_pbvh_pixels_clear_seams(pbvh);
+  pbvh_pixels_clear_seams(pbvh);
 
   // find seams.
   // for each edge
   Vector pairs = find_connected_loops(bm, cd_loop_uv_offset);
-  printf("found %lld pairs\n", pairs.size());
 
   // Make a bitmap per tile indicating pixels that have already been assigned 
to a PBVHNode.
   Bitmaps bitmaps = create_tile_bitmap(*pbvh, *image, *image_user);
@@ -263,50 +340,7 @@ void BKE_pbvh_pixels_rebuild_seams(
 continue;
   }
   else {
-
-for (int v = uvbounds_i.ymin; v <= uvbounds_i.ymax; v++) {
-  for (int 

[Bf-blender-cvs] [5c5d5b27a0a] temp-T97352-3d-texturing-seam-bleeding: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

2022-04-20 Thread Jeroen Bakker
Commit: 5c5d5b27a0a1ce19d0ac44ada776f7d245177c7f
Author: Jeroen Bakker
Date:   Wed Apr 20 07:46:25 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB5c5d5b27a0a1ce19d0ac44ada776f7d245177c7f

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

===



===



___
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] [65a1fcdaf76] master: Cleanup: run autopep8 on tests/performance/benchmark

2022-04-20 Thread Campbell Barton
Commit: 65a1fcdaf76f47bc51b4d2143470bbbec03b7f12
Author: Campbell Barton
Date:   Wed Apr 20 17:04:48 2022 +1000
Branches: master
https://developer.blender.org/rB65a1fcdaf76f47bc51b4d2143470bbbec03b7f12

Cleanup: run autopep8 on tests/performance/benchmark

This file was skipped by source/tools/utils/autopep8_clean.py
since it doesn't have a .py extension, running the autopep8 tool
recursively detects Python scripts without extensions.

===

M   tests/performance/benchmark

===

diff --git a/tests/performance/benchmark b/tests/performance/benchmark
index 80556674dcc..4ca46a111e1 100755
--- a/tests/performance/benchmark
+++ b/tests/performance/benchmark
@@ -11,24 +11,30 @@ import sys
 import time
 from typing import List
 
+
 def find_blender_git_dir() -> pathlib.Path:
 # Find .git directory of the repository we are in.
 cwd = pathlib.Path.cwd()
 
 for path in [cwd] + list(cwd.parents):
 if (path / '.git').exists():
-  return path
+return path
 
 return None
 
+
 def get_tests_base_dir(blender_git_dir: pathlib.Path) -> pathlib.Path:
 # Benchmarks dir is next to the Blender source folder.
 return blender_git_dir.parent / 'benchmark'
 
+
 def use_revision_columns(config: api.TestConfig) -> bool:
-return config.benchmark_type == "comparison" and \
-   len(config.queue.entries) > 0 and \
-   not config.queue.has_multiple_revisions_to_build
+return (
+config.benchmark_type == "comparison" and
+len(config.queue.entries) > 0 and
+not config.queue.has_multiple_revisions_to_build
+)
+
 
 def print_header(config: api.TestConfig) -> None:
 # Print header with revision columns headers.
@@ -42,6 +48,7 @@ def print_header(config: api.TestConfig) -> None:
 header += f"{revision_name: <20} "
 print(header)
 
+
 def print_row(config: api.TestConfig, entries: List, end='\n') -> None:
 # Print one or more test entries on a row.
 row = ""
@@ -79,10 +86,13 @@ def print_row(config: api.TestConfig, entries: List, 
end='\n') -> None:
 
 def match_entry(entry: api.TestEntry, args: argparse.Namespace):
 # Filter tests by name and category.
-return fnmatch.fnmatch(entry.test, args.test) or \
-   fnmatch.fnmatch(entry.category, args.test) or \
-   entry.test.find(args.test) != -1 or \
-   entry.category.find(args.test) != -1
+return (
+fnmatch.fnmatch(entry.test, args.test) or
+fnmatch.fnmatch(entry.category, args.test) or
+entry.test.find(args.test) != -1 or
+entry.category.find(args.test) != -1
+)
+
 
 def run_entry(env: api.TestEnvironment,
   config: api.TestConfig,
@@ -159,6 +169,7 @@ def run_entry(env: api.TestEnvironment,
 
 return True
 
+
 def cmd_init(env: api.TestEnvironment, argv: List):
 # Initialize benchmarks folder.
 parser = argparse.ArgumentParser()
@@ -168,6 +179,7 @@ def cmd_init(env: api.TestEnvironment, argv: List):
 env.init(args.build)
 env.unset_log_file()
 
+
 def cmd_list(env: api.TestEnvironment, argv: List) -> None:
 # List devices, tests and configurations.
 print('DEVICES')
@@ -188,6 +200,7 @@ def cmd_list(env: api.TestEnvironment, argv: List) -> None:
 for config_name in configs:
 print(config_name)
 
+
 def cmd_status(env: api.TestEnvironment, argv: List):
 # Print status of tests in configurations.
 parser = argparse.ArgumentParser()
@@ -210,6 +223,7 @@ def cmd_status(env: api.TestEnvironment, argv: List):
 if match_entry(row[0], args):
 print_row(config, row)
 
+
 def cmd_reset(env: api.TestEnvironment, argv: List):
 # Reset tests to re-run them.
 parser = argparse.ArgumentParser()
@@ -232,6 +246,7 @@ def cmd_reset(env: api.TestEnvironment, argv: List):
 if args.test == '*':
 shutil.rmtree(config.logs_dir)
 
+
 def cmd_run(env: api.TestEnvironment, argv: List, update_only: bool):
 # Run tests.
 parser = argparse.ArgumentParser()
@@ -271,6 +286,7 @@ def cmd_run(env: api.TestEnvironment, argv: List, 
update_only: bool):
 
 print("\nfile://" + str(html_filepath))
 
+
 def cmd_graph(argv: List):
 # Create graph from a given JSON results file.
 parser = argparse.ArgumentParser()
@@ -291,6 +307,7 @@ def cmd_graph(argv: List):
 graph = api.TestGraph(json_files)
 graph.write(pathlib.Path(args.output))
 
+
 def main():
 usage = ('benchmark  []\n'
  '\n'
@@ -317,8 +334,8 @@ def main():
 argv = sys.argv[2:]
 blender_git_dir = find_blender_git_dir()
 if blender_git_dir == None:
-  sys.stderr.write('Error: no blender git repository found from current 
working directory\n')
-  sys.exit(1)
+sys.stderr.write('Error: no blender git repository found from current 
working directory\n')
+   

[Bf-blender-cvs] [67a4908bfc9] master: Cleanup: re-run autopep8 with E401 enabled

2022-04-20 Thread Campbell Barton
Commit: 67a4908bfc922439fa889521f1f1b24c09324b4a
Author: Campbell Barton
Date:   Wed Apr 20 16:26:49 2022 +1000
Branches: master
https://developer.blender.org/rB67a4908bfc922439fa889521f1f1b24c09324b4a

Cleanup: re-run autopep8 with E401 enabled

Put imports on their own line which was almost always the case already.

===

M   doc/blender_file_format/BlendFileDnaExporter_25.py

===

diff --git a/doc/blender_file_format/BlendFileDnaExporter_25.py 
b/doc/blender_file_format/BlendFileDnaExporter_25.py
index f85d496b9b5..91a313b789f 100755
--- a/doc/blender_file_format/BlendFileDnaExporter_25.py
+++ b/doc/blender_file_format/BlendFileDnaExporter_25.py
@@ -378,7 +378,8 @@ def usage():
 
 def main():
 
-import os, os.path
+import os
+import os.path
 
 try:
 bpy = __import__('bpy')

___
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] [3adef61942a] master: Cleanup: run autopep8 on release/scripts/presets

2022-04-20 Thread Campbell Barton
Commit: 3adef61942a662892f7ffa86756fceb179fbed1d
Author: Campbell Barton
Date:   Wed Apr 20 16:21:04 2022 +1000
Branches: master
https://developer.blender.org/rB3adef61942a662892f7ffa86756fceb179fbed1d

Cleanup: run autopep8 on release/scripts/presets

===

M   release/scripts/presets/keyconfig/Blender.py
M   release/scripts/presets/keyconfig/Industry_Compatible.py
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py

===

diff --git a/release/scripts/presets/keyconfig/Blender.py 
b/release/scripts/presets/keyconfig/Blender.py
index 7ce9a5650bd..2e77f233ca4 100644
--- a/release/scripts/presets/keyconfig/Blender.py
+++ b/release/scripts/presets/keyconfig/Blender.py
@@ -319,6 +319,7 @@ class Prefs(bpy.types.KeyConfigPreferences):
 col.label(text="File Browser")
 col.row().prop(self, "use_file_single_click")
 
+
 blender_default = bpy.utils.execfile(os.path.join(DIRNAME, "keymap_data", 
"blender_default.py"))
 
 
diff --git a/release/scripts/presets/keyconfig/Industry_Compatible.py 
b/release/scripts/presets/keyconfig/Industry_Compatible.py
index 2a3eb2a0f9d..4e17555fef9 100644
--- a/release/scripts/presets/keyconfig/Industry_Compatible.py
+++ b/release/scripts/presets/keyconfig/Industry_Compatible.py
@@ -10,6 +10,7 @@ import bpy
 DIRNAME, FILENAME = os.path.split(__file__)
 IDNAME = os.path.splitext(FILENAME)[0]
 
+
 def update_fn(_self, _context):
 load()
 
@@ -33,5 +34,6 @@ def load():
 
 keyconfig_init_from_data(kc, keyconfig_data)
 
+
 if __name__ == "__main__":
 load()
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 6408873f13e..9b47a7b35b5 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -19,6 +19,7 @@ __all__ = (
 # 
--
 # Configurable Parameters
 
+
 class Params:
 __slots__ = (
 "apple",
@@ -604,18 +605,18 @@ def km_window(params):
  {"type": k, "value": 'PRESS', "shift": True},
  {"properties": [("space_type", t)]})
 for k, t in (
-('F1', 'FILE_BROWSER'),
-('F2', 'CLIP_EDITOR'),
-('F3', 'NODE_EDITOR'),
-('F4', 'CONSOLE'),
-('F5', 'VIEW_3D'),
-('F6', 'GRAPH_EDITOR'),
-('F7', 'PROPERTIES'),
-('F8', 'SEQUENCE_EDITOR'),
-('F9', 'OUTLINER'),
-('F10', 'IMAGE_EDITOR'),
-('F11', 'TEXT_EDITOR'),
-('F12', 'DOPESHEET_EDITOR'),
+('F1', 'FILE_BROWSER'),
+('F2', 'CLIP_EDITOR'),
+('F3', 'NODE_EDITOR'),
+('F4', 'CONSOLE'),
+('F5', 'VIEW_3D'),
+('F6', 'GRAPH_EDITOR'),
+('F7', 'PROPERTIES'),
+('F8', 'SEQUENCE_EDITOR'),
+('F9', 'OUTLINER'),
+('F10', 'IMAGE_EDITOR'),
+('F11', 'TEXT_EDITOR'),
+('F12', 'DOPESHEET_EDITOR'),
 )
 ),
 
@@ -7168,7 +7169,7 @@ def km_3d_view_tool_edit_curve_pen(params):
 ("curve.pen", {"type": params.tool_mouse, "value": 'PRESS', 
"ctrl": True},
  {"properties": [("insert_point", True), ("delete_point", True)]}),
 ("curve.pen", {"type": params.tool_mouse, "value": 'DOUBLE_CLICK'},
- {"properties": [("toggle_vector", True), ("cycle_handle_type", 
True),]}),
+ {"properties": [("toggle_vector", True), ("cycle_handle_type", 
True), ]}),
 ]},
 )
 
@@ -7433,7 +7434,8 @@ def km_3d_view_tool_paint_gpencil_line(params):
 ("gpencil.primitive_line", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"alt": True},
  {"properties": [("wait_for_input", False)]}),
 # Lasso select
-("gpencil.select_lasso", {"type": params.action_mouse, "value": 
'CLICK_DRAG', "ctrl": True, "alt": True}, None),
+("gpencil.select_lasso", {"type": params.action_mouse,
+ "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
 ]},
 )
 
@@ -7448,7 +7450,8 @@ def km_3d_view_tool_paint_gpencil_polyline(params):
 ("gpencil.primitive_polyline", {"type": 'LEFTMOUSE', "value": 
'PRESS', "shift": True},
  {"properties": [("wait_for_input", False)]}),
 # Lasso select
-("gpencil.select_lasso", {"type": params.action_mouse, "value": 
'CLICK_DRAG', "ctrl": True, "alt": True}, None),
+

[Bf-blender-cvs] [28e068b55cf] master: Cleanup: run autopep8 on release/scripts/freestyle

2022-04-20 Thread Campbell Barton
Commit: 28e068b55cfc5b3d0af87235079978e3708178e7
Author: Campbell Barton
Date:   Wed Apr 20 16:14:24 2022 +1000
Branches: master
https://developer.blender.org/rB28e068b55cfc5b3d0af87235079978e3708178e7

Cleanup: run autopep8 on release/scripts/freestyle

===

M   release/scripts/freestyle/modules/freestyle/functions.py
M   release/scripts/freestyle/modules/freestyle/shaders.py
M   release/scripts/freestyle/styles/backbone_stretcher.py
M   release/scripts/freestyle/styles/split_at_highest_2d_curvatures.py

===

diff --git a/release/scripts/freestyle/modules/freestyle/functions.py 
b/release/scripts/freestyle/modules/freestyle/functions.py
index e9fa53c8b7e..4a4a2f036e1 100644
--- a/release/scripts/freestyle/modules/freestyle/functions.py
+++ b/release/scripts/freestyle/modules/freestyle/functions.py
@@ -91,7 +91,7 @@ __all__ = (
 "pyViewMapGradientNormF0D",
 "pyViewMapGradientNormF1D",
 "pyViewMapGradientVectorF0D",
-)
+)
 
 
 # module members
@@ -147,7 +147,7 @@ from _freestyle import (
 VertexOrientation3DF0D,
 ZDiscontinuityF0D,
 ZDiscontinuityF1D,
-)
+)
 
 # constructs for function definition in Python
 from freestyle.types import (
@@ -157,7 +157,7 @@ from freestyle.types import (
 UnaryFunction0DMaterial,
 UnaryFunction0DVec2f,
 UnaryFunction1DDouble,
-)
+)
 from freestyle.utils import ContextFunctions as CF
 from freestyle.utils import integrate
 
@@ -176,6 +176,7 @@ class CurveMaterialF0D(UnaryFunction0DMaterial):
 Notes: expects instances of CurvePoint to be iterated over
can return None if no fedge can be found
 """
+
 def __call__(self, inter):
 fe = inter.object.fedge
 if fe is None:
@@ -203,6 +204,7 @@ class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
 
 class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
 """Estimates the anisotropy of density."""
+
 def __init__(self, level):
 UnaryFunction0DDouble.__init__(self)
 self.IsoDensity = ReadCompleteViewMapPixelF0D(level)
@@ -233,6 +235,7 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
:arg level: the level at which to compute the gradient
:type level: int
 """
+
 def __init__(self, level):
 UnaryFunction0DVec2f.__init__(self)
 self._l = level
@@ -241,9 +244,9 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
 def __call__(self, iter):
 p = iter.object.point_2d
 gx = CF.read_complete_view_map_pixel(self._l, int(p.x + self._step), 
int(p.y)) - \
- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
+CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
 gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y + 
self._step)) - \
- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
+CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
 return Vector((gx, gy))
 
 
@@ -256,9 +259,9 @@ class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
 def __call__(self, iter):
 p = iter.object.point_2d
 gx = CF.read_complete_view_map_pixel(self._l, int(p.x + self._step), 
int(p.y)) - \
- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
+CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
 gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y + 
self._step)) - \
- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
+CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
 return Vector((gx, gy)).length
 
 # -- Functions for 1D elements (curves) -- #
@@ -286,7 +289,10 @@ class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
 self._sampling = sampling
 
 def __call__(self, inter):
-v = integrate(self._func, inter.points_begin(self._sampling), 
inter.points_end(self._sampling), self._integration)
+v = integrate(
+self._func, inter.points_begin(
+self._sampling), inter.points_end(
+self._sampling), self._integration)
 return v
 
 
@@ -298,5 +304,8 @@ class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
 self._sampling = sampling
 
 def __call__(self, inter):
-v = integrate(self._func, inter.points_begin(self._sampling), 
inter.points_end(self._sampling), self._integration)
+v = integrate(
+self._func, inter.points_begin(
+self._sampling), inter.points_end(
+self._sampling), self._integration)
 return v
diff --git a/release/scripts/freestyle/modules/freestyle/shaders.py 
b/release/scripts/freestyle/modules/freestyle/shaders.py
index 494722bad39..d2b10206b9f 100644
--- a/release/scripts/freestyle/modules/freestyle/shaders.py
+++ 

[Bf-blender-cvs] [41b8e0316a1] master: Cleanup: use autopep8 on release/lts

2022-04-20 Thread Campbell Barton
Commit: 41b8e0316a16c6bb5c38321f8e2dbbfc6f9c09fb
Author: Campbell Barton
Date:   Wed Apr 20 16:17:51 2022 +1000
Branches: master
https://developer.blender.org/rB41b8e0316a16c6bb5c38321f8e2dbbfc6f9c09fb

Cleanup: use autopep8 on release/lts

===

M   release/lts/create_download_urls.py
M   release/lts/create_release_notes.py

===

diff --git a/release/lts/create_download_urls.py 
b/release/lts/create_download_urls.py
index b3e08fe36d0..753e05c98b4 100755
--- a/release/lts/create_download_urls.py
+++ b/release/lts/create_download_urls.py
@@ -18,6 +18,7 @@ class Version:
 Version class that extracts the major, minor and build from
 a version string
 """
+
 def __init__(self, version: str):
 self.version = version
 v = version.split(".")
@@ -28,6 +29,7 @@ class Version:
 def __str__(self) -> str:
 return self.version
 
+
 def get_download_file_names(version: Version):
 yield f"blender-{version}-linux-x64.tar.xz"
 yield f"blender-{version}-macos-x64.dmg"
diff --git a/release/lts/create_release_notes.py 
b/release/lts/create_release_notes.py
index 1e94936217c..a51721057bb 100755
--- a/release/lts/create_release_notes.py
+++ b/release/lts/create_release_notes.py
@@ -30,8 +30,9 @@ class ReleaseLogLine:
 backend.
 * url: (str) url of the ticket task or commit.
 """
+
 def __init__(self, line: str):
-self.line=line
+self.line = line
 items = line.split("|")
 self.task_id = None
 self.commit_id = None
@@ -54,10 +55,10 @@ class ReleaseLogLine:
 self.title = ""
 self.url = f"https://developer.blender.org/{self.ref};
 
-def __format_as_html(self)-> str:
+def __format_as_html(self) -> str:
 return f"  {self.title} [{self.ref}]"
 
-def __format_as_text(self) ->str:
+def __format_as_text(self) -> str:
 return f"* {self.title} [{self.ref}]"
 
 def __format_as_steam(self) -> str:
@@ -110,7 +111,7 @@ def extract_release_notes(version: str, task_id: int):
 description = task["description"]
 lines = description.split("\n")
 start_index = lines.index(f"## Blender {version} ##")
-lines = lines[start_index+1:]
+lines = lines[start_index + 1:]
 for line in lines:
 if not line.strip():
 continue
@@ -125,7 +126,7 @@ def extract_release_notes(version: str, task_id: int):
 log_line.title = format_title(issue_task.title)
 yield log_line
 elif log_line.commit_id:
-commits = 
phab.diffusion.commit.search(constraints={"identifiers":[log_line.commit_id]})
+commits = phab.diffusion.commit.search(constraints={"identifiers": 
[log_line.commit_id]})
 commit = commits.data[0]
 commit_message = commit['fields']['message']
 commit_title = commit_message.split("\n")[0]

___
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] [8898251584b] master: Cleanup: run autopep8 on intern/cycles/

2022-04-20 Thread Campbell Barton
Commit: 8898251584ba99881985933c13dfb5e529393641
Author: Campbell Barton
Date:   Wed Apr 20 16:07:03 2022 +1000
Branches: master
https://developer.blender.org/rB8898251584ba99881985933c13dfb5e529393641

Cleanup: run autopep8 on intern/cycles/

Disable autopep8 for the block that yields passes in list_render_passes,
for better readability.

===

M   intern/cycles/app/io_export_cycles_xml.py
M   intern/cycles/blender/addon/camera.py
M   intern/cycles/blender/addon/engine.py
M   intern/cycles/blender/addon/operators.py
M   intern/cycles/blender/addon/presets.py
M   intern/cycles/blender/addon/properties.py
M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/addon/version_update.py

===

diff --git a/intern/cycles/app/io_export_cycles_xml.py 
b/intern/cycles/app/io_export_cycles_xml.py
index 0009995653e..ceb30f8fb56 100644
--- a/intern/cycles/app/io_export_cycles_xml.py
+++ b/intern/cycles/app/io_export_cycles_xml.py
@@ -10,6 +10,7 @@ import bpy
 from bpy_extras.io_utils import ExportHelper
 from bpy.props import PointerProperty, StringProperty
 
+
 def strip(root):
 root.text = None
 root.tail = None
@@ -17,6 +18,7 @@ def strip(root):
 for elem in root:
 strip(elem)
 
+
 def write(node, fname):
 strip(node)
 
@@ -26,25 +28,31 @@ def write(node, fname):
 f = open(fname, "w")
 f.write(s)
 
+
 class CyclesXMLSettings(bpy.types.PropertyGroup):
 @classmethod
 def register(cls):
 bpy.types.Scene.cycles_xml = PointerProperty(
-type=cls,
-name="Cycles XML export Settings",
-description="Cycles XML export 
settings")
+type=cls,
+name="Cycles XML export Settings",
+description="Cycles XML export settings",
+)
 cls.filepath = StringProperty(
-name='Filepath',
-description='Filepath for the .xml file',
-maxlen=256,
-default='',
-subtype='FILE_PATH')
+name='Filepath',
+description='Filepath for the .xml file',
+maxlen=256,
+default='',
+subtype='FILE_PATH',
+)
 
 @classmethod
 def unregister(cls):
 del bpy.types.Scene.cycles_xml
 
-# User Interface Drawing Code
+
+# User Interface Drawing Code.
+
+
 class RenderButtonsPanel():
 bl_space_type = 'PROPERTIES'
 bl_region_type = 'WINDOW'
@@ -114,22 +122,31 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
 uvs += str(uvf.uv1[0]) + " " + str(uvf.uv1[1]) + " "
 uvs += str(uvf.uv2[0]) + " " + str(uvf.uv2[1]) + " "
 uvs += str(uvf.uv3[0]) + " " + str(uvf.uv3[1]) + " "
-if vcount==4:
+if vcount == 4:
 uvs += " " + str(uvf.uv4[0]) + " " + str(uvf.uv4[1]) + " "
 
-
-node = etree.Element('mesh', attrib={'nverts': nverts.strip(), 
'verts': verts.strip(), 'P': P, 'UV' : uvs.strip()})
+node = etree.Element(
+'mesh',
+attrib={
+'nverts': nverts.strip(),
+'verts': verts.strip(),
+'P': P,
+'UV': uvs.strip(),
+})
 
 # write to file
 write(node, filepath)
 
 return {'FINISHED'}
 
+
 def register():
 bpy.utils.register_module(__name__)
 
+
 def unregister():
 bpy.utils.unregister_module(__name__)
 
+
 if __name__ == "__main__":
 register()
diff --git a/intern/cycles/blender/addon/camera.py 
b/intern/cycles/blender/addon/camera.py
index 9841e031201..0e78112699e 100644
--- a/intern/cycles/blender/addon/camera.py
+++ b/intern/cycles/blender/addon/camera.py
@@ -4,11 +4,14 @@
 # 
 
 # Fit to match default projective camera with focal_length 50 and sensor_width 
36.
-default_fisheye_polynomial = [-1.1735143712967577e-05,
-  -0.019988736953434998,
-  -3.3525322965709175e-06,
-  3.099275275886036e-06,
-  -2.6064646454854524e-08]
+default_fisheye_polynomial = [
+-1.1735143712967577e-05,
+-0.019988736953434998,
+-3.3525322965709175e-06,
+3.099275275886036e-06,
+-2.6064646454854524e-08,
+]
+
 
 # Utilities to generate lens polynomials to match built-in camera types, only 
here
 # for reference at the moment, not used by the code.
@@ -51,7 +54,9 @@ def fisheye_lens_polynomial_from_equidistant(fov=180, 
sensor_width=36, sensor_he
 return [0, -np.radians(fov) / sensor_width, 0, 0, 0]
 
 
-def fisheye_lens_polynomial_from_distorted_projective_polynomial(k1, k2, k3, 
focal_length=50, sensor_width=36, sensor_height=None):
+def