[Bf-blender-cvs] [03faffa10b9] master: UI: support A-Z accelerator keys for pie menus

2020-04-16 Thread Campbell Barton
Commit: 03faffa10b90d56150188502a3267458f1bfb6d4
Author: Campbell Barton
Date:   Fri Apr 17 15:50:47 2020 +1000
Branches: master
https://developer.blender.org/rB03faffa10b90d56150188502a3267458f1bfb6d4

UI: support A-Z accelerator keys for pie menus

Converting menus to PIE's was removing convenient key accelerators.

===

M   source/blender/editors/interface/interface.c

===

diff --git a/source/blender/editors/interface/interface.c 
b/source/blender/editors/interface/interface.c
index c97f5ee8239..8cccf4e5309 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -979,7 +979,9 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
 UI_BTYPE_BUT_MENU,
 UI_BTYPE_MENU,
 UI_BTYPE_BLOCK,
-UI_BTYPE_PULLDOWN) ||
+UI_BTYPE_PULLDOWN,
+/* For PIE-menus. */
+UI_BTYPE_ROW) ||
   (but->flag & UI_HIDDEN)) {
 /* pass */
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f1f68b3f9ae] master: Fix toggling quad-view loosing 3D view clipping

2020-04-16 Thread Campbell Barton
Commit: f1f68b3f9aed3385bb57be37c31b26f6216f4f4b
Author: Campbell Barton
Date:   Fri Apr 17 15:30:18 2020 +1000
Branches: master
https://developer.blender.org/rBf1f68b3f9aed3385bb57be37c31b26f6216f4f4b

Fix toggling quad-view loosing 3D view clipping

===

M   source/blender/editors/screen/screen_ops.c

===

diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index 452984f2333..b66964d0e7f 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3870,7 +3870,6 @@ static int region_quadview_exec(bContext *C, wmOperator 
*op)
 
   rv3d->viewlock_quad = RV3D_VIEWLOCK_INIT;
   rv3d->viewlock = 0;
-  rv3d->rflag &= ~RV3D_CLIPPING;
 
   /* Accumulate locks, in case they're mixed. */
   for (region_iter = area->regionbase.first; region_iter; region_iter = 
region_iter->next) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [84eb739a0e3] modifier-panels-ui: Fix layout issue in Bevel modifier Limit Method

2020-04-16 Thread William Reynish
Commit: 84eb739a0e3e0acfa5f3739b02d47e350ebfd1ab
Author: William Reynish
Date:   Fri Apr 17 07:13:12 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB84eb739a0e3e0acfa5f3739b02d47e350ebfd1ab

Fix layout issue in Bevel modifier Limit Method

===

M   source/blender/modifiers/intern/MOD_bevel.c

===

diff --git a/source/blender/modifiers/intern/MOD_bevel.c 
b/source/blender/modifiers/intern/MOD_bevel.c
index 42ef7fb824f..992ed6a38ac 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -316,15 +316,18 @@ static void panel_draw(const bContext *C, Panel *panel)
   uiItemS(layout);
 
   uiItemR(layout, , "affect", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
-  col = uiLayoutColumn(layout, true);
+
+  uiItemS(layout);
+
+  col = uiLayoutColumn(layout, false);
   uiItemR(col, , "limit_method", 0, NULL, ICON_NONE);
   int limit_method = RNA_enum_get(, "limit_method");
   if (limit_method == MOD_BEVEL_ANGLE) {
-uiItemR(col, , "angle_limit", 0, "", ICON_NONE);
+uiItemR(col, , "angle_limit", 0, NULL, ICON_NONE);
   }
   else if (limit_method == MOD_BEVEL_VGROUP) {
 row = uiLayoutRow(col, true);
-uiItemPointerR(row, , "vertex_group", _ptr, "vertex_groups", "", 
ICON_NONE);
+uiItemPointerR(row, , "vertex_group", _ptr, "vertex_groups", NULL, 
ICON_NONE);
 sub = uiLayoutRow(row, true);
 uiLayoutSetActive(sub, has_vertex_group);
 uiLayoutSetPropDecorate(sub, false);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [19c7ef3067b] master: UV: minor adjustments to opacity adjustment

2020-04-16 Thread Campbell Barton
Commit: 19c7ef3067b7907101bbaa79d6a671052a4551ed
Author: Campbell Barton
Date:   Fri Apr 17 13:53:15 2020 +1000
Branches: master
https://developer.blender.org/rB19c7ef3067b7907101bbaa79d6a671052a4551ed

UV: minor adjustments to opacity adjustment

- Allow 0.0..1.0 range, as even at 0.0 the selection is still visible.
- Correct versioning code, not to overwrite the value for new files.

===

M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/makesrna/intern/rna_space.c

===

diff --git a/source/blender/blenloader/intern/versioning_290.c 
b/source/blender/blenloader/intern/versioning_290.c
index c6adbb5c7d2..0ce3cf405cd 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -23,6 +23,7 @@
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
+#include "DNA_genfile.h"
 #include "DNA_screen_types.h"
 
 #include "BKE_collection.h"
@@ -49,12 +50,14 @@ void blo_do_versions_290(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
   {
 /* Keep this block, even when empty. */
 
-for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
-  LISTBASE_FOREACH (ScrArea *, area, >areabase) {
-LISTBASE_FOREACH (SpaceLink *, sl, >spacedata) {
-  if (sl->spacetype == SPACE_IMAGE) {
-SpaceImage *sima = (SpaceImage *)sl;
-sima->uv_opacity = 1.0f;
+if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "float", 
"uv_opacity")) {
+  for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
+LISTBASE_FOREACH (ScrArea *, area, >areabase) {
+  LISTBASE_FOREACH (SpaceLink *, sl, >spacedata) {
+if (sl->spacetype == SPACE_IMAGE) {
+  SpaceImage *sima = (SpaceImage *)sl;
+  sima->uv_opacity = 1.0f;
+}
   }
 }
   }
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index f6a7c74484a..c6a94aae450 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2937,7 +2937,7 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
   RNA_def_property_float_sdna(prop, NULL, "uv_opacity");
-  RNA_def_property_range(prop, 0.2f, 1.0f);
+  RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0f0436c15e0] master: Cleanup: comments for ui_draw_menu_item & correct argument name

2020-04-16 Thread Campbell Barton
Commit: 0f0436c15e00df4a04b028ac5781f5255fa66310
Author: Campbell Barton
Date:   Fri Apr 17 11:16:48 2020 +1000
Branches: master
https://developer.blender.org/rB0f0436c15e00df4a04b028ac5781f5255fa66310

Cleanup: comments for ui_draw_menu_item & correct argument name

===

M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_widgets.c

===

diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index 51fe990bd02..593d176849f 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -853,7 +853,7 @@ void ui_draw_menu_item(const struct uiFontStyle *fstyle,
int iconid,
int state,
bool use_sep,
-   int *r_name_width);
+   int *r_xmax);
 void ui_draw_preview_item(
 const struct uiFontStyle *fstyle, rcti *rect, const char *name, int 
iconid, int state);
 
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 53c488bf765..03f2fddc168 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -5292,15 +5292,23 @@ void ui_draw_tooltip_background(const uiStyle 
*UNUSED(style), uiBlock *UNUSED(bl
   wt->draw(>wcol, rect, 0, 0);
 }
 
-/* helper call to draw a menu item without button */
-/* state: UI_ACTIVE or 0 */
+/**
+ * Helper call to draw a menu item without a button.
+ *
+ * \param state: The state of the button,
+ * typically #UI_ACTIVE, #UI_BUT_DISABLED, #UI_BUT_INACTIVE.
+ * \param use_sep: When true, characters after the last #UI_SEP_CHAR are right 
aligned,
+ * use for displaying key shortcuts.
+ * \param r_xmax: The right hand position of the text, this takes into the 
icon,
+ * padding and text clipping when there is not enough room to display the full 
text.
+ */
 void ui_draw_menu_item(const uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
int state,
bool use_sep,
-   int *r_name_width)
+   int *r_xmax)
 {
   uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
   rcti _rect = *rect;
@@ -5363,8 +5371,8 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
  ,
  ,
  );
-if (r_name_width != NULL) {
-  *r_name_width = xofs + info.width;
+if (r_xmax != NULL) {
+  *r_xmax = xofs + info.width;
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ab93e568ebb] master: Cleanup: use colon after doxygen parameters, spelling

2020-04-16 Thread Campbell Barton
Commit: ab93e568ebbfeec0c22ee581c39e2f56d5fb443f
Author: Campbell Barton
Date:   Fri Apr 17 11:11:30 2020 +1000
Branches: master
https://developer.blender.org/rBab93e568ebbfeec0c22ee581c39e2f56d5fb443f

Cleanup: use colon after doxygen parameters, spelling

===

M   source/blender/blenkernel/intern/lib_id.c
M   source/blender/bmesh/tools/bmesh_bevel.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/editors/object/object_modifier.c
M   source/blender/gpu/intern/gpu_viewport.c
M   source/blender/makesrna/intern/rna_access.c

===

diff --git a/source/blender/blenkernel/intern/lib_id.c 
b/source/blender/blenkernel/intern/lib_id.c
index 80f29a55b28..9d7382010fe 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -663,7 +663,7 @@ static void id_swap(Main *bmain, ID *id_a, ID *id_b, const 
bool do_full_id)
  * Does a mere memory swap over the whole IDs data (including type-specific 
memory).
  * \note Most internal ID data itself is not swapped (only IDProperties are).
  *
- * \param bmain May be NULL, in which case there will be no remapping of 
internal pointers to
+ * \param bmain: May be NULL, in which case there will be no remapping of 
internal pointers to
  * itself.
  */
 void BKE_lib_id_swap(Main *bmain, ID *id_a, ID *id_b)
@@ -675,7 +675,7 @@ void BKE_lib_id_swap(Main *bmain, ID *id_a, ID *id_b)
  * Does a mere memory swap over the whole IDs data (including type-specific 
memory).
  * \note All internal ID data itself is also swapped.
  *
- * \param bmain May be NULL, in which case there will be no remapping of 
internal pointers to
+ * \param bmain: May be NULL, in which case there will be no remapping of 
internal pointers to
  * itself.
  */
 void BKE_lib_id_swap_full(Main *bmain, ID *id_a, ID *id_b)
@@ -1248,7 +1248,7 @@ ID *BKE_libblock_find_name(struct Main *bmain, const 
short type, const char *nam
  *
  * \note All other IDs beside given one are assumed already properly sorted in 
the list.
  *
- * \param id_sorting_hint Ignored if NULL. Otherwise, used to check if we can 
insert \a id
+ * \param id_sorting_hint: Ignored if NULL. Otherwise, used to check if we can 
insert \a id
  * immediately before or after that pointer. It must always be into given \a 
lb list.
  */
 void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint)
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c 
b/source/blender/bmesh/tools/bmesh_bevel.c
index bc127243836..d1ddceb00b0 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -997,10 +997,10 @@ static bool point_between_edges(float co[3], BMVert *v, 
BMFace *f, EdgeHalf *e1,
  * record the change in offset_l (or offset_r); later we can tell that a 
change has happened
  * because the offset will differ from its original value in offset_l_spec (or 
offset_r_spec).
  *
- * \param edges_between If this is true, there are edges between e1 and e2 in 
CCW order so they
+ * \param edges_between: If this is true, there are edges between e1 and e2 in 
CCW order so they
  * don't share a common face. We want the meeting point to be on an existing 
face so it
  * should be dropped onto one of the intermediate faces, if possible.
- * \param e_in_plane If we need to drop from the calculated offset lines to 
one of the faces,
+ * \param e_in_plane: If we need to drop from the calculated offset lines to 
one of the faces,
  * we don't want to drop onto the 'in plane' face, so if this is not null skip 
this edge's faces.
  */
 static void offset_meet(EdgeHalf *e1,
@@ -2601,13 +2601,13 @@ static void adjust_miter_inner_coords(BevelParams *bp, 
BevVert *bv, EdgeHalf *em
  * to be a subsequent pass to make the widths as consistent as possible.
  * Doesn't make the actual BMVerts.
  *
- * For a width consistency pass, we just recalculate the coordinates of the 
BoundVerts. If the
+ * For a width consistency pass, we just recalculate the coordinates of the 
#BoundVerts. If the
  * other ends have been (re)built already, then we copy the offsets from there 
to match, else we
  * use the ideal (user-specified) widths.
  *
- * \param construct The first time through, construct will be true and we are 
making the BoundVerts
- * and setting up the BoundVert and EdgeHalf pointers appropriately. Also, if 
construct, decide on
- * the mesh pattern that will be used inside the boundary.
+ * \param construct: The first time through, construct will be true and we are 
making the
+ * #BoundVerts and setting up the #BoundVert and #EdgeHalf pointers 
appropriately.
+ * Also, if construct, decide on the mesh pattern that will be used inside the 
boundary.
  */
 static void build_boundary(BevelParams *bp, BevVert *bv, bool construct)
 {
diff --git 

[Bf-blender-cvs] [cbd6c5735da] master: GNUmakefile: remove style checking targets

2020-04-16 Thread Campbell Barton
Commit: cbd6c5735da1f49a7293e4c2aa68f8ccd0812f7e
Author: Campbell Barton
Date:   Fri Apr 17 12:33:40 2020 +1000
Branches: master
https://developer.blender.org/rBcbd6c5735da1f49a7293e4c2aa68f8ccd0812f7e

GNUmakefile: remove style checking targets

This has been removed since clang-format now enforces code-style.

===

M   GNUmakefile

===

diff --git a/GNUmakefile b/GNUmakefile
index 98bfded4ec7..e3bb3eaff7a 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -71,17 +71,6 @@ Testing Targets
  which are tagged to use the stricter formatting
* test_deprecated:
  Checks for deprecation tags in our code which may need to be removed
-   * test_style_c:
- Checks C/C++ conforms with blenders style guide:
- https://wiki.blender.org/wiki/Source/Code_Style
-   * test_style_c_qtc:
- Same as test_style but outputs QtCreator tasks format
-   * test_style_osl:
- Checks OpenShadingLanguage conforms with blenders style guide:
- https://wiki.blender.org/wiki/Source/Code_Style
-   * test_style_osl_qtc:
- Checks OpenShadingLanguage conforms with blenders style guide:
- https://wiki.blender.org/wiki/Source/Code_Style
 
 Static Source Code Checking
Not associated with building Blender.
@@ -402,45 +391,6 @@ test_cmake: .FORCE
 test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
 
-test_style_c: .FORCE
-   # run our own checks on C/C++ style
-   PYTHONIOENCODING=utf_8 $(PYTHON) \
-   "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
-   "$(BLENDER_DIR)/source/blender" \
-   "$(BLENDER_DIR)/source/creator" \
-   --no-length-check
-
-test_style_c_qtc: .FORCE
-   # run our own checks on C/C++ style
-   USE_QTC_TASK=1 \
-   PYTHONIOENCODING=utf_8 $(PYTHON) \
-   "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
-   "$(BLENDER_DIR)/source/blender" \
-   "$(BLENDER_DIR)/source/creator" \
-   --no-length-check \
-   > \
-   "$(BLENDER_DIR)/test_style.tasks"
-   @echo "written: test_style.tasks"
-
-
-test_style_osl: .FORCE
-   # run our own checks on C/C++ style
-   PYTHONIOENCODING=utf_8 $(PYTHON) \
-   "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
-   "$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
-   "$(BLENDER_DIR)/release/scripts/templates_osl"
-
-
-test_style_osl_qtc: .FORCE
-   # run our own checks on C/C++ style
-   USE_QTC_TASK=1 \
-   PYTHONIOENCODING=utf_8 $(PYTHON) \
-   "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
-   "$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
-   "$(BLENDER_DIR)/release/scripts/templates_osl" \
-   > \
-   "$(BLENDER_DIR)/test_style.tasks"
-   @echo "written: test_style.tasks"
 
 # -
 # Project Files

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0733bd0d644] blender-v2.83-release: UI: Fix bad flow layout

2020-04-16 Thread Aaron Carlisle
Commit: 0733bd0d644a3f1f1d6b74cd6a11c686e06b40a3
Author: Aaron Carlisle
Date:   Thu Apr 16 19:59:48 2020 -0400
Branches: blender-v2.83-release
https://developer.blender.org/rB0733bd0d644a3f1f1d6b74cd6a11c686e06b40a3

UI: Fix bad flow layout

The layout of the new sequencer disk cache were not handled well with 
large preference windows.

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 76e80fdb414..41a6ee5 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -612,33 +612,25 @@ class USERPREF_PT_system_memory(SystemPanel, 
CenterAlignMixIn, Panel):
 
 layout.separator()
 
-flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, 
even_rows=False, align=False)
-
-flow.prop(system, "memory_cache_limit", text="Sequencer Cache Limit")
-flow.prop(system, "scrollback", text="Console Scrollback Lines")
+flow.prop(system, "texture_time_out", text="Texture Time Out")
+flow.prop(system, "texture_collection_rate", text="Garbage Collection 
Rate")
 
 layout.separator()
 
-flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, 
even_rows=False, align=False)
-
-flow.prop(system, "use_sequencer_disk_cache")
-flow.prop(system, "sequencer_disk_cache_dir")
-flow.prop(system, "sequencer_disk_cache_size_limit")
-flow.prop(system, "sequencer_disk_cache_compression")
+flow.prop(system, "vbo_time_out", text="Vbo Time Out")
+flow.prop(system, "vbo_collection_rate", text="Garbage Collection 
Rate")
 
 layout.separator()
 
-flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, 
even_rows=False, align=False)
-
-flow.prop(system, "texture_time_out", text="Texture Time Out")
-flow.prop(system, "texture_collection_rate", text="Garbage Collection 
Rate")
+flow.prop(system, "scrollback", text="Console Scrollback Lines")
 
 layout.separator()
 
-flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, 
even_rows=False, align=False)
-
-flow.prop(system, "vbo_time_out", text="Vbo Time Out")
-flow.prop(system, "vbo_collection_rate", text="Garbage Collection 
Rate")
+flow.prop(system, "memory_cache_limit", text="Sequencer Cache Limit")
+flow.prop(system, "use_sequencer_disk_cache")
+flow.prop(system, "sequencer_disk_cache_dir")
+flow.prop(system, "sequencer_disk_cache_size_limit")
+flow.prop(system, "sequencer_disk_cache_compression")
 
 
 # -

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [55a385620e2] modifier-panels-ui: Cleanup: Consistent code formatting

2020-04-16 Thread Hans Goudey
Commit: 55a385620e29979ea248230f9aa527432a4095db
Author: Hans Goudey
Date:   Thu Apr 16 17:33:34 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB55a385620e29979ea248230f9aa527432a4095db

Cleanup: Consistent code formatting

===

M   source/blender/modifiers/intern/MOD_armature.c
M   source/blender/modifiers/intern/MOD_decimate.c
M   source/blender/modifiers/intern/MOD_displace.c
M   source/blender/modifiers/intern/MOD_hook.c
M   source/blender/modifiers/intern/MOD_mirror.c
M   source/blender/modifiers/intern/MOD_normal_edit.c
M   source/blender/modifiers/intern/MOD_weightvgmix.c

===

diff --git a/source/blender/modifiers/intern/MOD_armature.c 
b/source/blender/modifiers/intern/MOD_armature.c
index 64aa1c8efec..a809dfe5c14 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -253,8 +253,8 @@ static void deformMatrices(ModifierData *md,
 static void panel_draw(const bContext *C, Panel *panel)
 {
   uiLayout *sub, *row, *col;
-
   uiLayout *layout = panel->layout;
+
   PointerRNA ptr;
   PointerRNA ob_ptr;
   modifier_panel_get_property_pointers(C, panel, _ptr, );
diff --git a/source/blender/modifiers/intern/MOD_decimate.c 
b/source/blender/modifiers/intern/MOD_decimate.c
index 2ac0e73a722..ca7530c8a6a 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -229,8 +229,8 @@ static Mesh *applyModifier(ModifierData *md, const 
ModifierEvalContext *ctx, Mes
 static void panel_draw(const bContext *C, Panel *panel)
 {
   uiLayout *sub, *row;
-
   uiLayout *layout = panel->layout;
+
   PointerRNA ptr;
   PointerRNA ob_ptr;
   modifier_panel_get_property_pointers(C, panel, _ptr, );
diff --git a/source/blender/modifiers/intern/MOD_displace.c 
b/source/blender/modifiers/intern/MOD_displace.c
index f0d86b7e3ad..12a7a2ca538 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -428,8 +428,8 @@ static void deformVertsEM(ModifierData *md,
 static void panel_draw(const bContext *C, Panel *panel)
 {
   uiLayout *sub, *row, *col;
-
   uiLayout *layout = panel->layout;
+
   PointerRNA ptr;
   PointerRNA ob_ptr;
   modifier_panel_get_property_pointers(C, panel, _ptr, );
diff --git a/source/blender/modifiers/intern/MOD_hook.c 
b/source/blender/modifiers/intern/MOD_hook.c
index fee8d284658..56e965ce037 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -446,7 +446,8 @@ static void panel_draw(const bContext *C, Panel *panel)
 
 static void falloff_panel_draw(const bContext *C, Panel *panel)
 {
-  uiLayout *row, *layout = panel->layout;
+  uiLayout *row;
+  uiLayout *layout = panel->layout;
 
   PointerRNA ptr;
   modifier_panel_get_property_pointers(C, panel, NULL, );
diff --git a/source/blender/modifiers/intern/MOD_mirror.c 
b/source/blender/modifiers/intern/MOD_mirror.c
index b31af81617c..27cf315dbeb 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -139,9 +139,6 @@ static void panel_draw(const bContext *C, Panel *panel)
   col = uiLayoutColumn(layout, false);
   uiLayoutSetPropSep(col, true);
 
-  /* No decorators for the first few rows. */
-  // uiLayoutSetPropDecorate(col, true);
-
   prop = RNA_struct_find_property(, "use_axis");
   row = uiLayoutRowWithHeading(col, true, IFACE_("Axis"));
   uiItemFullR(row, , prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE);
@@ -161,8 +158,6 @@ static void panel_draw(const bContext *C, Panel *panel)
   uiItemFullR(row, , prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE);
 
   uiItemS(col);
-  /* Now decorators are fine, we don't insert multiple items in a single row 
anymore. */
-  // uiLayoutSetPropDecorate(col, true);
 
   uiItemR(col, , "mirror_object", 0, NULL, ICON_NONE);
 
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c 
b/source/blender/modifiers/intern/MOD_normal_edit.c
index bb01e62ec0a..dd351c5e036 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -726,7 +726,7 @@ static void panel_draw(const bContext *C, Panel *panel)
 
 static void mix_mode_panel_draw(const bContext *C, Panel *panel)
 {
-  /* HANS-TODO: This panel should be open by default. */
+  /* This panel could be open by default. */
   uiLayout *row, *sub;
   uiLayout *layout = panel->layout;
 
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c 
b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 3ca29bcc01a..c4f529e17e3 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -456,14 +456,6 @@ static void panel_draw(const bContext *C, Panel *panel)
   uiItemPointerR(layout, , 

[Bf-blender-cvs] [e46f4a7e454] modifier-panels-ui: Merge branch 'master' into modifier-panels-ui

2020-04-16 Thread Hans Goudey
Commit: e46f4a7e454385f29eff6070afc3c9189ac5f8f4
Author: Hans Goudey
Date:   Thu Apr 16 17:08:11 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rBe46f4a7e454385f29eff6070afc3c9189ac5f8f4

Merge branch 'master' into modifier-panels-ui

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ac943796d4d] modifier-panels-ui: Draw list panels with box widget colors and code

2020-04-16 Thread Hans Goudey
Commit: ac943796d4daad3b3016bdf070798cb51c1edb08
Author: Hans Goudey
Date:   Thu Apr 16 17:04:22 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rBac943796d4daad3b3016bdf070798cb51c1edb08

Draw list panels with box widget colors and code

This solves the transparency and theming issues by reusing the theming
from the box widget. This requires a new drawing function in order to
use box drawing with an opaque inner color, alpha blended with the
region's background color.

===

M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_panel.c
M   source/blender/editors/interface/interface_widgets.c

===

diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index a907da8e47d..6e93dd30f51 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -240,7 +240,6 @@ enum {
 #define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
 
 #define UI_LIST_PANEL_MARGIN (U.widget_unit * 0.15f)
-#define UI_LIST_PANEL_ROUNDNESS (U.widget_unit * 0.3f)
 
 /* but->drawflag - these flags should only affect how the button is drawn. */
 /* Note: currently, these flags _are not passed_ to the widget's state() or 
draw() functions
diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index 6a489b49e20..817fe757e6e 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -841,6 +841,7 @@ struct GPUBatch *ui_batch_roundbox_shadow_get(void);
 
 void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]);
 void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect);
+void ui_draw_box_opaque(rcti *rect, int roundboxalign);
 void ui_draw_popover_back(ARegion *region, struct uiStyle *style, uiBlock 
*block, rcti *rect);
 void ui_draw_pie_center(uiBlock *block);
 const struct uiWidgetColors *ui_tooltip_get_theme(void);
diff --git a/source/blender/editors/interface/interface_panel.c 
b/source/blender/editors/interface/interface_panel.c
index e0e42df9481..aaf60adcd84 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -848,7 +848,16 @@ void ui_draw_aligned_panel(uiStyle *style,
* can't be dragged. This may be changed in future. 
*/
   show_background);
   const int panel_col = is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK;
+
   const bool is_list_panel = (panel->type && panel->type->flag & (PNL_LIST | 
PNL_LIST_SUBPANEL));
+  float list_panel_roundness = 0.0f;
+
+  /* For list panels, use roundness from the theme for box widgets. */
+  if (is_list_panel) {
+bTheme *btheme = UI_GetTheme();
+uiWidgetColors *wcol = >tui.wcol_box;
+list_panel_roundness = wcol->roundness;
+  }
 
   if (panel->type && (panel->type->flag & PNL_NO_HEADER)) {
 if (show_background) {
@@ -884,16 +893,13 @@ void ui_draw_aligned_panel(uiStyle *style,
 
 /* List panels have some roundness and a shaded header color to 
differentiate them. */
 if (is_list_panel) {
-  /* Round all corners if the panel is closed. */
+  int roundbox_corners = (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
   if (is_closed_y) {
-UI_draw_roundbox_corner_set(UI_CNR_ALL);
+roundbox_corners |= (UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT);
   }
-  else {
-UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
-  }
-
-  UI_GetThemeColorShadeAlpha4fv(TH_PANEL_HEADER, -30, 125, color);
-  UI_draw_roundbox_aa(true, minx, headrect.ymin, maxx, y, 
UI_LIST_PANEL_ROUNDNESS, color);
+  /* Increase ymax a bit for even space on the top and bottom of the 
buttons in the header. */
+  rcti box_rect = {minx, maxx, headrect.ymin, y + U.pixelsize};
+  ui_draw_box_opaque(_rect, roundbox_corners);
 }
 else {
   GPU_blend(true);
@@ -992,7 +998,7 @@ void ui_draw_aligned_panel(uiStyle *style,
   }
   else if (is_list_panel) {
 UI_draw_roundbox_corner_set(UI_CNR_ALL);
-radius = UI_LIST_PANEL_ROUNDNESS;
+radius = list_panel_roundness * U.widget_unit;
   }
   else {
 UI_draw_roundbox_corner_set(UI_CNR_NONE);
@@ -1014,12 +1020,25 @@ void ui_draw_aligned_panel(uiStyle *style,
 GPU_blend(true);
 
 if (show_background) {
-  /* Round the bottom corners as long as this isn't a subpanel between 
other subpanels. */
+  /* Draw list panels and their bottom subpanels with rounding. */
   if (is_list_panel && !(is_subpanel && panel->next)) {
-UI_draw_roundbox_corner_set(UI_CNR_BOTTOM_RIGHT | 

[Bf-blender-cvs] [27e39cc5331] master: GPencil: Add always empty frame when add new layer

2020-04-16 Thread Antonio Vazquez
Commit: 27e39cc533125b4589f469f2c9c595796bb95423
Author: Antonio Vazquez
Date:   Thu Apr 16 22:43:41 2020 +0200
Branches: master
https://developer.blender.org/rB27e39cc533125b4589f469f2c9c595796bb95423

GPencil: Add always empty frame when add new layer

The dopesheet needs to have a frame to display the channel, so an empty frame 
is created in the current frame.

See T66505 for details of why an empty channel cannot be displayed.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_data.c 
b/source/blender/editors/gpencil/gpencil_data.c
index 1e49195140c..c05162510d7 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -241,10 +241,8 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op)
 if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
   gpd = (bGPdata *)ob->data;
   bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true);
-  ScrArea *area = CTX_wm_area(C);
-
-  /* In dopesheet add a new frame. */
-  if ((gpl != NULL) && (area->spacetype == SPACE_ACTION)) {
+  /* Add a new frame to make it visible in Dopesheet. */
+  if (gpl != NULL) {
 gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, 
GP_GETFRAME_ADD_NEW);
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [87ef42419d9] modifier-panels-ui: Minor tweaks to decimate modifier layout code

2020-04-16 Thread Julian Eisel
Commit: 87ef42419d96b153a0d5b45711c85c603171531b
Author: Julian Eisel
Date:   Thu Apr 16 21:27:36 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB87ef42419d96b153a0d5b45711c85c603171531b

Minor tweaks to decimate modifier layout code

Should not have any visible impact.

===

M   source/blender/modifiers/intern/MOD_decimate.c

===

diff --git a/source/blender/modifiers/intern/MOD_decimate.c 
b/source/blender/modifiers/intern/MOD_decimate.c
index 3470e2e24b4..2ac0e73a722 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -228,7 +228,7 @@ static Mesh *applyModifier(ModifierData *md, const 
ModifierEvalContext *ctx, Mes
 
 static void panel_draw(const bContext *C, Panel *panel)
 {
-  uiLayout *sub, *row, *col;
+  uiLayout *sub, *row;
 
   uiLayout *layout = panel->layout;
   PointerRNA ptr;
@@ -248,14 +248,12 @@ static void panel_draw(const bContext *C, Panel *panel)
   if (decimate_type == MOD_DECIM_MODE_COLLAPSE) {
 uiItemR(layout, , "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 
-col = uiLayoutColumnWithHeading(layout, false, "Symmetry");
-row = uiLayoutRow(col, true);
+row = uiLayoutRowWithHeading(layout, true, "Symmetry");
 uiLayoutSetPropDecorate(row, false);
 sub = uiLayoutRow(row, true);
 uiItemR(sub, , "use_symmetry", 0, "", ICON_NONE);
 sub = uiLayoutRow(sub, true);
 uiLayoutSetActive(sub, RNA_boolean_get(, "use_symmetry"));
-uiLayoutSetPropSep(sub, false);
 uiItemR(sub, , "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 uiItemDecoratorR(row, , "symmetry_axis", 0);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [86309bd7f89] modifier-panels-ui: Fix Memory Leak in Shader Interface

2020-04-16 Thread Jeroen Bakker
Commit: 86309bd7f89680c170ca2f4e635515785fcc4669
Author: Jeroen Bakker
Date:   Thu Apr 16 16:55:46 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB86309bd7f89680c170ca2f4e635515785fcc4669

Fix Memory Leak in Shader Interface

===

M   source/blender/gpu/intern/gpu_shader_interface.c

===

diff --git a/source/blender/gpu/intern/gpu_shader_interface.c 
b/source/blender/gpu/intern/gpu_shader_interface.c
index db8ec60fa9a..1caa88d18ae 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -257,6 +257,7 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t 
program)
 input->location = glGetAttribLocation(program, name);
 /* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and 
`gl_VertexID`. */
 if (input->location == -1) {
+  MEM_freeN(input);
   continue;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [187c65becb7] modifier-panels-ui: UI: Remove old hacks for dynamic scrollbar hiding

2020-04-16 Thread Julian Eisel
Commit: 187c65becb7c8b035360783814d8edb2ee5b417c
Author: Julian Eisel
Date:   Thu Apr 16 20:42:56 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB187c65becb7c8b035360783814d8edb2ee5b417c

UI: Remove old hacks for dynamic scrollbar hiding

Although we still dynamically hide scrollbars, they don't change the
region size anymore. They are simply drawn on top of the region content.
Because of this, some hacks introduced by fa28e50ac2a7 are no longer
necessary.
Without these hacks, the scrollbar visibility is evaluated much more
often (cheap operation) which should be more reliable and possibly solve
some glitches.

Also replaces integers passed as booleans.

Fixes T75782.

===

M   source/blender/editors/interface/view2d.c
M   source/blender/editors/screen/area.c

===

diff --git a/source/blender/editors/interface/view2d.c 
b/source/blender/editors/interface/view2d.c
index c07166b9ad2..72f6535eadf 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -60,7 +60,7 @@
 
 #include "interface_intern.h"
 
-static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool 
mask_scrollers);
+static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize);
 
 /*  */
 /** \name Internal Utilities
@@ -134,7 +134,7 @@ void UI_view2d_mask_from_win(const View2D *v2d, rcti 
*r_mask)
  *
  * \param mask_scroll: Optionally clamp scrollbars by this region.
  */
-static void view2d_masks(View2D *v2d, bool check_scrollers, const rcti 
*mask_scroll)
+static void view2d_masks(View2D *v2d, const rcti *mask_scroll)
 {
   int scroll;
 
@@ -144,26 +144,24 @@ static void view2d_masks(View2D *v2d, bool 
check_scrollers, const rcti *mask_scr
 mask_scroll = >mask;
   }
 
-  if (check_scrollers) {
-/* check size if hiding flag is set: */
-if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) {
-  if (!(v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES)) {
-if (BLI_rctf_size_x(>tot) > BLI_rctf_size_x(>cur)) {
-  v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR;
-}
-else {
-  v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR;
-}
+  /* check size if hiding flag is set: */
+  if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) {
+if (!(v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES)) {
+  if (BLI_rctf_size_x(>tot) > BLI_rctf_size_x(>cur)) {
+v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR;
+  }
+  else {
+v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR;
   }
 }
-if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) {
-  if (!(v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES)) {
-if (BLI_rctf_size_y(>tot) + 0.01f > BLI_rctf_size_y(>cur)) {
-  v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR;
-}
-else {
-  v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR;
-}
+  }
+  if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) {
+if (!(v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES)) {
+  if (BLI_rctf_size_y(>tot) + 0.01f > BLI_rctf_size_y(>cur)) {
+v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR;
+  }
+  else {
+v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR;
   }
 }
   }
@@ -385,8 +383,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
   v2d->winx = winx;
   v2d->winy = winy;
 
-  /* set masks (always do), but leave scroller scheck to totrect_set */
-  view2d_masks(v2d, 0, NULL);
+  view2d_masks(v2d, NULL);
 
   if (do_init) {
 /* Visible by default. */
@@ -394,13 +391,12 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
   }
 
   /* set 'tot' rect before setting cur? */
-  /* XXX confusing stuff here still -
-   * I made this function not check scroller hide - that happens in 
totrect_set */
+  /* XXX confusing stuff here still */
   if (tot_changed) {
 UI_view2d_totRect_set_resize(v2d, winx, winy, !do_init);
   }
   else {
-ui_view2d_curRect_validate_resize(v2d, !do_init, 0);
+ui_view2d_curRect_validate_resize(v2d, !do_init);
   }
 }
 
@@ -409,7 +405,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
  * 'cur' is not allowed to be: larger than max, smaller than min, or outside 
of 'tot'
  */
 // XXX pre2.5 -> this used to be called  test_view2d()
-static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool 
mask_scrollers)
+static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize)
 {
   float totwidth, totheight, curwidth, curheight, width, height;
   float winx, winy;
@@ -851,12 +847,12 @@ static void ui_view2d_curRect_validate_resize(View2D 
*v2d, bool resize, bool mas
   }
 
   /* set masks */
-  view2d_masks(v2d, mask_scrollers, NULL);
+  view2d_masks(v2d, NULL);
 }
 
 void UI_view2d_curRect_validate(View2D *v2d)
 {
-  

[Bf-blender-cvs] [66eee8ca6e9] modifier-panels-ui: Fix expanded enums using columns within split layout

2020-04-16 Thread Julian Eisel
Commit: 66eee8ca6e9bdfaeb819553d5191b8803a91508e
Author: Julian Eisel
Date:   Thu Apr 16 21:26:11 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB66eee8ca6e9bdfaeb819553d5191b8803a91508e

Fix expanded enums using columns within split layout

===

M   source/blender/editors/interface/interface_layout.c

===

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 32fb77b774d..6129f73dee6 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -,15 +,15 @@ void uiItemFullR(uiLayout *layout,
  * heading itself. */
 ui_layout_heading_label_add(heading_layout, heading_layout, false, false);
   }
-  else if (inside_prop_sep) {
-/* When placing further items in a split row, add them to a column so they 
match the column
- * layout of previous items (e.g. transform vector with lock icon for each 
item). */
-layout = uiLayoutColumn(layout_parent, true);
-layout->space = 0;
-  }
 
   /* array property */
   if (index == RNA_NO_INDEX && is_array) {
+if (inside_prop_sep) {
+  /* Within a split row, add array items to a column so they match the 
column layout of
+   * previous items (e.g. transform vector with lock icon for each item). 
*/
+  layout = uiLayoutColumn(layout, true);
+}
+
 ui_item_array(layout,
   block,
   name,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bc252b3b1a6] modifier-panels-ui: Fix T75675: Unlinking [with setting users to zero] not clearing LIB_TAG_EXTRAUSER_SET flag

2020-04-16 Thread Philipp Oeser
Commit: bc252b3b1a6e8590ac1de26c59132c27857a33f7
Author: Philipp Oeser
Date:   Thu Apr 16 17:09:04 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBbc252b3b1a6e8590ac1de26c59132c27857a33f7

Fix T75675: Unlinking [with setting users to zero] not clearing
LIB_TAG_EXTRAUSER_SET flag

For example in the Image Editor, an assert would be triggered after
unlinking an image [with setting users to zero] and then setting the
image for the Image Editor again.

Whenever we set an Image for Image Editor, the Image ID is flagged
LIB_TAG_EXTRAUSER_SET, when we unlink [with setting users to zero] this
flag was not cleared.

quote @mont29: "a proper fix would be to move this to modern code, and
actually delete the ID..." but that is for later.

Maniphest Tasks: T75675

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

===

M   source/blender/editors/interface/interface_templates.c

===

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 503dd0b580a..442e192e2a4 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -536,6 +536,7 @@ static void template_id_cb(bContext *C, void *arg_litem, 
void *arg_event)
 
   if (id && CTX_wm_window(C)->eventstate->shift) {
 /* only way to force-remove data (on save) */
+id_us_clear_real(id);
 id_fake_user_clear(id);
 id->us = 0;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bdeb0c310b6] modifier-panels-ui: Fix T75680: Nodegroup user count increased when file saved in edit group mode.

2020-04-16 Thread Bastien Montagne
Commit: bdeb0c310b66fd837d3fbbd648febd6d39420eeb
Author: Bastien Montagne
Date:   Thu Apr 16 17:05:58 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBbdeb0c310b66fd837d3fbbd648febd6d39420eeb

Fix T75680: Nodegroup user count increased when file saved in edit group mode.

This editor's code was a bit schizophrenic, some parts considering its
nodetree usages as real refcounted ones, others, as shallow 'user one'
ones...

Editors should not be real ID users anyway, unless there are *very* good
reasons for it, so swich it to fully 'shallow' usage now.

===

M   source/blender/blenkernel/intern/lib_query.c
M   source/blender/editors/space_node/space_node.c

===

diff --git a/source/blender/blenkernel/intern/lib_query.c 
b/source/blender/blenkernel/intern/lib_query.c
index 9c0fa33157c..4ffdcf14fa7 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -492,16 +492,17 @@ static void 
library_foreach_screen_area(LibraryForeachIDData *data, ScrArea *are
 FOREACH_CALLBACK_INVOKE_ID(data, snode->from, IDWALK_CB_NOP);
 
 FOREACH_CALLBACK_INVOKE(
-data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER);
+data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER_ONE);
 
 for (path = snode->treepath.first; path; path = path->next) {
   if (path == snode->treepath.first) {
 /* first nodetree in path is same as snode->nodetree */
-FOREACH_CALLBACK_INVOKE(
-data, path->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED 
: IDWALK_CB_NOP);
+FOREACH_CALLBACK_INVOKE(data,
+path->nodetree,
+is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER_ONE);
   }
   else {
-FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER);
+FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER_ONE);
   }
 
   if (path->nodetree == NULL) {
diff --git a/source/blender/editors/space_node/space_node.c 
b/source/blender/editors/space_node/space_node.c
index d682cab7293..b6ee393b991 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -890,8 +890,7 @@ static void node_id_remap(ScrArea *UNUSED(area), SpaceLink 
*slink, ID *old_id, I
 for (path = snode->treepath.first; path; path = path->next) {
   if ((ID *)path->nodetree == old_id) {
 path->nodetree = (bNodeTree *)new_id;
-id_us_min(old_id);
-id_us_plus(new_id);
+id_us_ensure_real(new_id);
   }
   if (path == snode->treepath.first) {
 /* first nodetree in path is same as snode->nodetree */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1d4411d1fdd] modifier-panels-ui: Fix T73977, T73825: ignore Python user site-packages directory by default

2020-04-16 Thread Brecht Van Lommel
Commit: 1d4411d1fdd5244602c8ed0de4481e781a214890
Author: Brecht Van Lommel
Date:   Thu Apr 16 15:54:34 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB1d4411d1fdd5244602c8ed0de4481e781a214890

Fix T73977, T73825: ignore Python user site-packages directory by default

This goes along with the existing changes to ignore PYTHONPATH by default.
--python-use-system-env now controls both.

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

===

M   source/blender/python/intern/bpy_interface.c
M   source/creator/creator_args.c

===

diff --git a/source/blender/python/intern/bpy_interface.c 
b/source/blender/python/intern/bpy_interface.c
index b09d3187f3c..6da1715b02d 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -279,9 +279,10 @@ void BPY_python_start(int argc, const char **argv)
* While harmless, it's noisy. */
   Py_FrozenFlag = 1;
 
-  /* Only use the systems environment variables when explicitly requested.
+  /* Only use the systems environment variables and site when explicitly 
requested.
* Since an incorrect 'PYTHONPATH' causes difficult to debug errors, see: 
T72807. */
   Py_IgnoreEnvironmentFlag = !py_use_system_env;
+  Py_NoUserSiteDirectory = !py_use_system_env;
 
   Py_Initialize();
 
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 381a43ff521..a13733fd897 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1924,7 +1924,8 @@ static int arg_handle_python_exit_code_set(int argc, 
const char **argv, void *UN
 
 static const char arg_handle_python_use_system_env_set_doc[] =
 "\n\t"
-"Allow Python to use system environment variables such as 'PYTHONPATH'.";
+"Allow Python to use system environment variables such as 'PYTHONPATH' and 
the user "
+"site-packages directory.";
 static int arg_handle_python_use_system_env_set(int UNUSED(argc),
 const char **UNUSED(argv),
 void *UNUSED(data))

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [df7407e4515] modifier-panels-ui: Fix T75730: Crash on read of liboverride data when missing source modifier.

2020-04-16 Thread Bastien Montagne
Commit: df7407e45154fcbc553bf52ddc1f9f25d5c757d5
Author: Bastien Montagne
Date:   Wed Apr 15 17:23:56 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBdf7407e45154fcbc553bf52ddc1f9f25d5c757d5

Fix T75730: Crash on read of liboverride data when missing source modifier.

While this should not happen, we still want to handle those errors
gracefully from user perspective (i.e. assert for devs, no crash for
users).

Actual fix of root cause of the issue will come later.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index 6cdbda559c2..8cc7669ddce 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1633,7 +1633,10 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
   }
   mod_src = mod_src ? mod_src->next : ob_src->modifiers.first;
 
-  BLI_assert(mod_src != NULL);
+  if (mod_src == NULL) {
+BLI_assert(mod_src != NULL);
+return false;
+  }
 
   /* While it would be nicer to use lower-level modifier_new() here, this one 
is lacking
* special-cases handling (particles and other physics modifiers mostly), so 
using the ED version

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [04111faf670] modifier-panels-ui: Fix T75730: Properly remove unused override properties/operations.

2020-04-16 Thread Bastien Montagne
Commit: 04111faf6703679adbb00c71c9d6778cfafa03a3
Author: Bastien Montagne
Date:   Thu Apr 16 16:19:44 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB04111faf6703679adbb00c71c9d6778cfafa03a3

Fix T75730: Properly remove unused override properties/operations.

While code is supposed to handle gracefully invalid override operations,
it is much cleaner to avoid those completely.

===

M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesrna/intern/rna_access_compare_override.c

===

diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 699d1ee23e9..fb49f60d8b5 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -111,6 +111,17 @@ bool BKE_lib_override_library_operations_create(struct 
Main *bmain,
 const bool force_auto);
 void BKE_lib_override_library_main_operations_create(struct Main *bmain, const 
bool force_auto);
 
+void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty 
*override_property,
+ const short tag,
+ const bool do_set);
+void BKE_lib_override_library_properties_tag(struct IDOverrideLibrary 
*override,
+ const short tag,
+ const bool do_set);
+void BKE_lib_override_library_main_tag(struct Main *bmain, const short tag, 
const bool do_set);
+
+void BKE_lib_override_library_id_unused_cleanup(struct ID *local);
+void BKE_lib_override_library_main_unused_cleanup(struct Main *bmain);
+
 void BKE_lib_override_library_update(struct Main *bmain, struct ID *local);
 void BKE_lib_override_library_main_update(struct Main *bmain);
 
diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index e6a792bc58a..795390f1940 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -744,8 +744,8 @@ bool BKE_lib_override_library_operations_create(Main 
*bmain, ID *local, const bo
 
 if (GS(local->name) == ID_OB) {
   /* Our beloved pose's bone cross-data pointers... Usually, depsgraph 
evaluation would ensure
-   * this is valid, but in some cases (like hidden collections etc.) this 
won't be the case, so
-   * we need to take care of this ourselves. */
+   * this is valid, but in some situations (like hidden collections etc.) 
this won't be the
+   * case, so we need to take care of this ourselves. */
   Object *ob_local = (Object *)local;
   if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && 
ob_local->pose != NULL &&
   ob_local->pose->flag & POSE_RECALC) {
@@ -788,6 +788,12 @@ void BKE_lib_override_library_main_operations_create(Main 
*bmain, const bool for
 {
   ID *id;
 
+  /* When force-auto is set, we also remove all unused existing override 
properties & operations.
+   */
+  if (force_auto) {
+BKE_lib_override_library_main_tag(bmain, IDOVERRIDE_LIBRARY_TAG_UNUSED, 
true);
+  }
+
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
 if ((ID_IS_OVERRIDE_LIBRARY(id) && force_auto) ||
 (ID_IS_OVERRIDE_LIBRARY_AUTO(id) && (id->tag & 
LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
@@ -796,6 +802,92 @@ void BKE_lib_override_library_main_operations_create(Main 
*bmain, const bool for
 }
   }
   FOREACH_MAIN_ID_END;
+
+  if (force_auto) {
+BKE_lib_override_library_main_unused_cleanup(bmain);
+  }
+}
+
+/** Set or clear given tag in all operations as unused in that override 
property data. */
+void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty 
*override_property,
+ const short tag,
+ const bool do_set)
+{
+  if (override_property != NULL) {
+if (do_set) {
+  override_property->tag |= tag;
+}
+else {
+  override_property->tag &= ~tag;
+}
+
+LISTBASE_FOREACH (IDOverrideLibraryPropertyOperation *, opop, 
_property->operations) {
+  if (do_set) {
+opop->tag |= tag;
+  }
+  else {
+opop->tag &= ~tag;
+  }
+}
+  }
+}
+
+/** Set or clear given tag in all properties and operations in that override 
data. */
+void BKE_lib_override_library_properties_tag(struct IDOverrideLibrary 
*override,
+ const short tag,
+ const bool do_set)
+{
+  if (override != NULL) {
+LISTBASE_FOREACH (IDOverrideLibraryProperty *, 

[Bf-blender-cvs] [a22a7f78a4e] modifier-panels-ui: Fix T75780: Gpencil Sculpt brushes not working with old files

2020-04-16 Thread Antonio Vazquez
Commit: a22a7f78a4e3b48fd48d736bd292468588d4378a
Author: Antonio Vazquez
Date:   Thu Apr 16 15:53:03 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBa22a7f78a4e3b48fd48d736bd292468588d4378a

Fix T75780: Gpencil Sculpt brushes not working with old files

The patching of brushes was not done.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 7904e51a516..087fef9ee09 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1666,6 +1666,19 @@ void do_versions_after_linking_280(Main *bmain, 
ReportList *UNUSED(reports))
 LISTBASE_FOREACH (Object *, ob, >objects) {
   BKE_fcurves_id_cb(>id, do_version_fcurve_hide_viewport_fix, NULL);
 }
+
+/* Reset all grease pencil brushes. */
+LISTBASE_FOREACH (Scene *, scene, >scenes) {
+  BKE_brush_gpencil_paint_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_sculpt_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_weight_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_vertex_presets(bmain, scene->toolsettings);
+
+  /* Ensure new Paint modes. */
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL);
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_SCULPT_GPENCIL);
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_WEIGHT_GPENCIL);
+}
   }
 
   /**

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [38031a4a24d] modifier-panels-ui: Fix (unreported) crash on use-after-free in liboverride deletion code.

2020-04-16 Thread Bastien Montagne
Commit: 38031a4a24daea1607d6271fc39621a11aa4ef84
Author: Bastien Montagne
Date:   Thu Apr 16 12:24:21 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB38031a4a24daea1607d6271fc39621a11aa4ef84

Fix (unreported) crash on use-after-free in liboverride deletion code.

===

M   source/blender/blenkernel/intern/lib_override.c

===

diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 6a206fc46d9..e6a792bc58a 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -383,10 +383,10 @@ void 
lib_override_library_property_clear(IDOverrideLibraryProperty *op)
 void BKE_lib_override_library_property_delete(IDOverrideLibrary *override,
   IDOverrideLibraryProperty 
*override_property)
 {
-  lib_override_library_property_clear(override_property);
   if (override->runtime != NULL) {
 BLI_ghash_remove(override->runtime, override_property->rna_path, NULL, 
NULL);
   }
+  lib_override_library_property_clear(override_property);
   BLI_freelinkN(>properties, override_property);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [47b85fb664b] modifier-panels-ui: Fix T75785: "Extrude Faces Along Normals" throws error

2020-04-16 Thread Germano Cavalcante
Commit: 47b85fb664bfe1054cab46b54a808755ae23757a
Author: Germano Cavalcante
Date:   Thu Apr 16 10:44:48 2020 -0300
Branches: modifier-panels-ui
https://developer.blender.org/rB47b85fb664bfe1054cab46b54a808755ae23757a

Fix T75785: "Extrude Faces Along Normals" throws error

===

M   release/scripts/startup/bl_operators/view3d.py

===

diff --git a/release/scripts/startup/bl_operators/view3d.py 
b/release/scripts/startup/bl_operators/view3d.py
index 4a6791f1627..88fa06a913f 100644
--- a/release/scripts/startup/bl_operators/view3d.py
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -153,7 +153,7 @@ class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
 return (obj is not None and obj.mode == 'EDIT')
 
 def execute(self, context):
-return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True)
+return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True, 
False)
 
 def invoke(self, context, _event):
 return self.execute(context)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5ede1bea5e0] modifier-panels-ui: UI: Draw real node sockets for node input buttons

2020-04-16 Thread Julian Eisel
Commit: 5ede1bea5e0d2f6215ab182db3c76de9a700d341
Author: Julian Eisel
Date:   Thu Apr 16 15:09:49 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB5ede1bea5e0d2f6215ab182db3c76de9a700d341

UI: Draw real node sockets for node input buttons

For buttons representing node inputs (e.g. in the material properties)
rather than drawing some generic socket icon, the actual sockets are
drawn now. That includes color, shape and the selection outline.

This should make it easier to understand what these buttons relate to.

Screenshots: {F8469252}, {F8469248} (The left alignment will be done in
a follow-up commit.)

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

Reviewed by: Brecht Van Lommel, Clément Foucault, William Reynish

===

M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/space_node/node_draw.c
M   source/blender/editors/space_node/node_templates.c

===

diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index ba7bea8b428..ca688405e19 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2401,6 +2401,7 @@ static void widget_draw_node_link_socket(const 
uiWidgetColors *wcol,
  uiBut *but,
  float alpha)
 {
+  /* Node socket pointer can be passed as custom_data, see 
UI_but_node_link_set(). */
   if (but->custom_data) {
 const float scale = 0.9f / but->block->aspect;
 
@@ -2412,7 +2413,6 @@ static void widget_draw_node_link_socket(const 
uiWidgetColors *wcol,
 UI_widgetbase_draw_cache_flush();
 GPU_blend(false);
 
-/* See UI_but_node_link_set() */
 ED_node_socket_draw(but->custom_data, rect, col, scale);
   }
   else {
diff --git a/source/blender/editors/space_node/node_draw.c 
b/source/blender/editors/space_node/node_draw.c
index 591c6003153..bd8950c5085 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -707,7 +707,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode 
*snode, bNode *node)
 #define MARKER_SHAPE_CIRCLE 0x2
 #define MARKER_SHAPE_INNER_DOT 0x10
 
-static uint node_socket_draw(const bNodeSocket *sock,
+static void node_socket_draw(const bNodeSocket *sock,
  const float color[4],
  const float color_outline[4],
  float size,
@@ -750,8 +750,6 @@ static uint node_socket_draw(const bNodeSocket *sock,
   immAttr1f(size_id, size);
   immAttr4fv(outline_col_id, color_outline);
   immVertex2f(pos_id, locx, locy);
-
-  return flags;
 }
 
 static void node_socket_outline_color_get(bool selected, float 
r_outline_color[4])
diff --git a/source/blender/editors/space_node/node_templates.c 
b/source/blender/editors/space_node/node_templates.c
index 91fe6a97432..da0058585cb 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -695,7 +695,6 @@ void uiTemplateNodeLink(
 
   UI_but_type_set_menu_from_pulldown(but);
   UI_but_node_link_set(but, sock, socket_col);
-  UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT);
 
   but->poin = (char *)but;
   but->func_argN = arg;
@@ -817,10 +816,6 @@ static void ui_node_draw_input(
 }
   }
   else {
-row = uiLayoutRow(split, true);
-
-uiTemplateNodeLink(row, C, ntree, node, input);
-
 /* input not linked, show value */
 if (!(input->flag & SOCK_HIDE_VALUE)) {
   switch (input->type) {
@@ -829,15 +824,25 @@ static void ui_node_draw_input(
 case SOCK_BOOLEAN:
 case SOCK_RGBA:
 case SOCK_STRING:
+  row = uiLayoutRow(split, true);
   uiItemR(row, , "default_value", 0, "", ICON_NONE);
   break;
 case SOCK_VECTOR:
-  uiItemS(row);
+  row = uiLayoutRow(split, false);
   col = uiLayoutColumn(row, false);
   uiItemR(col, , "default_value", 0, "", ICON_NONE);
   break;
+
+default:
+  row = uiLayoutRow(split, false);
+  break;
   }
 }
+else {
+  row = uiLayoutRow(split, false);
+}
+
+uiTemplateNodeLink(row, C, ntree, node, input);
   }
 
   /* clear */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ce8808ec07b] modifier-panels-ui: Cleanup: unused variable warning

2020-04-16 Thread Philipp Oeser
Commit: ce8808ec07bf3f2f164ba40847d2651f02443d19
Author: Philipp Oeser
Date:   Thu Apr 16 14:30:00 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBce8808ec07bf3f2f164ba40847d2651f02443d19

Cleanup: unused variable warning

Not needed since rB1685f5824d91.

===

M   source/blender/blenkernel/intern/anim_sys.c

===

diff --git a/source/blender/blenkernel/intern/anim_sys.c 
b/source/blender/blenkernel/intern/anim_sys.c
index 5825d7e4acd..de8d5af22ae 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2708,7 +2708,6 @@ void BKE_animsys_eval_animdata(Depsgraph *depsgraph, ID 
*id)
   AnimData *adt = BKE_animdata_from_id(id);
   /* XXX: this is only needed for flushing RNA updates,
* which should get handled as part of the dependency graph instead. */
-  Scene *scene = NULL;
   DEG_debug_print_eval_time(depsgraph, __func__, id->name, id, ctime);
   const bool flush_to_original = DEG_is_active(depsgraph);
   BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM, 
flush_to_original);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6b44e0e71ad] modifier-panels-ui: Fix T74964 Stereo 3D anaglyph and interlace not working

2020-04-16 Thread Clément Foucault
Commit: 6b44e0e71adb5d137814ac335dcb820f4e19cd48
Author: Clément Foucault
Date:   Thu Apr 16 15:47:18 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB6b44e0e71adb5d137814ac335dcb820f4e19cd48

Fix T74964 Stereo 3D anaglyph and interlace not working

Caused by framebuffer initialized in the wrong context.

===

M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/gpu/intern/gpu_viewport.c 
b/source/blender/gpu/intern/gpu_viewport.c
index ad74ce02731..ed825db26ac 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -217,18 +217,6 @@ static void gpu_viewport_framebuffer_view_set(GPUViewport 
*viewport, int view)
 
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
 });
 
-  if (((viewport->flag & GPU_VIEWPORT_STEREO) != 0)) {
-GPU_framebuffer_ensure_config(>stereo_comp_fb,
-  {
-  GPU_ATTACHMENT_NONE,
-  GPU_ATTACHMENT_TEXTURE(dtxl->color),
-  
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
-  });
-  }
-  else {
-dfbl->stereo_comp_fb = NULL;
-  }
-
   viewport->active_view = view;
 }
 
@@ -492,9 +480,6 @@ static void gpu_viewport_default_fb_create(GPUViewport 
*viewport)
   ok = ok && GPU_framebuffer_check_valid(dfbl->color_only_fb, NULL);
   ok = ok && GPU_framebuffer_check_valid(dfbl->depth_only_fb, NULL);
   ok = ok && GPU_framebuffer_check_valid(dfbl->overlay_only_fb, NULL);
-  if (((viewport->flag & GPU_VIEWPORT_STEREO) != 0)) {
-ok = ok && GPU_framebuffer_check_valid(dfbl->stereo_comp_fb, NULL);
-  }
 cleanup:
   if (!ok) {
 GPU_viewport_free(viewport);
@@ -625,6 +610,14 @@ void GPU_viewport_stereo_composite(GPUViewport *viewport, 
Stereo3dFormat *stereo
   DefaultTextureList *dtxl = viewport->txl;
   DefaultFramebufferList *dfbl = viewport->fbl;
 
+  /* The composite framebuffer object needs to be created in the window 
context. */
+  GPU_framebuffer_ensure_config(>stereo_comp_fb,
+{
+GPU_ATTACHMENT_NONE,
+GPU_ATTACHMENT_TEXTURE(dtxl->color),
+
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
+});
+
   GPUVertFormat *vert_format = immVertexFormat();
   uint pos = GPU_vertformat_attr_add(vert_format, "pos", GPU_COMP_F32, 2, 
GPU_FETCH_FLOAT);
   GPU_framebuffer_bind(dfbl->stereo_comp_fb);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [16a350cd491] modifier-panels-ui: GPU: Fix Negative Shift

2020-04-16 Thread Jeroen Bakker
Commit: 16a350cd49144b1a5e8d3d4c9abbf95cd3da58da
Author: Jeroen Bakker
Date:   Thu Apr 16 10:39:30 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB16a350cd49144b1a5e8d3d4c9abbf95cd3da58da

GPU: Fix Negative Shift

glAttributes also include `gl_` names. These don't have a location and
should be ignored during shader interface creation. Those internal names
received a location of -1 and therefore the bitmasking was undefined.

Users wouldn't notice this, but ASAN warned developers of this situation.
ASAN could quit making ASAN un-usable as most shaders have this issue.

Reviewed By: Clément Foucault`

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

===

M   source/blender/gpu/intern/gpu_shader_interface.c

===

diff --git a/source/blender/gpu/intern/gpu_shader_interface.c 
b/source/blender/gpu/intern/gpu_shader_interface.c
index cb1cd9a6f6d..db8ec60fa9a 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -254,8 +254,11 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t 
program)
 }
 
 /* TODO: reject DOUBLE gl_types */
-
 input->location = glGetAttribLocation(program, name);
+/* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and 
`gl_VertexID`. */
+if (input->location == -1) {
+  continue;
+}
 
 shaderface->enabled_attr_mask |= (1 << input->location);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cc24695be73] modifier-panels-ui: Cleanup: typo in comment

2020-04-16 Thread Philipp Oeser
Commit: cc24695be7332b2055917ee4c69708e8e5b91af8
Author: Philipp Oeser
Date:   Thu Apr 16 15:22:15 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBcc24695be7332b2055917ee4c69708e8e5b91af8

Cleanup: typo in comment

===

M   source/blender/makesdna/DNA_ID.h

===

diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index dd3964dfc15..aedd25cb41a 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -539,9 +539,9 @@ enum {
   /* RESET_NEVER tag data-block as needing an auto-override execution, if 
enabled. */
   LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH = 1 << 17,
 
-  /* tag data-block has having an extra user. */
+  /* tag data-block as having an extra user. */
   LIB_TAG_EXTRAUSER = 1 << 2,
-  /* tag data-block has having actually increased usercount for the extra 
virtual user. */
+  /* tag data-block as having actually increased usercount for the extra 
virtual user. */
   LIB_TAG_EXTRAUSER_SET = 1 << 7,
 
   /* RESET_AFTER_USE tag newly duplicated/copied IDs.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2909c0e56fd] modifier-panels-ui: GPUImmediate: Use 2 Buffers For (Un)Strict

2020-04-16 Thread Jeroen Bakker
Commit: 2909c0e56fd48df8dea824a652ddfc1e2ccd56af
Author: Jeroen Bakker
Date:   Thu Apr 16 08:43:32 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB2909c0e56fd48df8dea824a652ddfc1e2ccd56af

GPUImmediate: Use 2 Buffers For (Un)Strict

We used to have a single buffer that was shared between strict and
unstrict draw calls. This leads to many recreation events for the draw
buffers. This patch separates the Unstrict draw buffer from the strict
draw buffer.

This improves performance on Windows Intel 10th gen platform.
On a reference platfor before the patch I got 10 FPS, after this patch
it became 34fps. Note that the same test normally on a low end GPU can
get to 60fps so this does not solve all teh bottlenecks yet.

Reviewed By: Clément Foucault

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

===

M   source/blender/gpu/intern/gpu_immediate.c

===

diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index b30fbd66670..72e17dce776 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -43,6 +43,14 @@
 extern void GPU_matrix_bind(const GPUShaderInterface *);
 extern bool GPU_matrix_dirty_get(void);
 
+typedef struct ImmediateDrawBuffer {
+  GLuint vbo_id;
+  GLubyte *buffer_data;
+  uint buffer_offset;
+  uint buffer_size;
+  uint default_size;
+} ImmediateDrawBuffer;
+
 typedef struct {
   /* TODO: organize this struct by frequency of change (run-time) */
 
@@ -50,14 +58,14 @@ typedef struct {
   GPUContext *context;
 
   /* current draw call */
-  GLubyte *buffer_data;
-  uint buffer_offset;
-  uint buffer_bytes_mapped;
-  uint vertex_len;
   bool strict_vertex_len;
+  uint vertex_len;
+  uint buffer_bytes_mapped;
+  ImmediateDrawBuffer *active_buffer;
   GPUPrimType prim_type;
-
   GPUVertFormat vertex_format;
+  ImmediateDrawBuffer draw_buffer;
+  ImmediateDrawBuffer draw_buffer_strict;
 
   /* current vertex */
   uint vertex_idx;
@@ -65,7 +73,6 @@ typedef struct {
   uint16_t
   unassigned_attr_bits; /* which attributes of current vertex have not 
been given values? */
 
-  GLuint vbo_id;
   GLuint vao_id;
 
   GLuint bound_program;
@@ -76,7 +83,6 @@ typedef struct {
 
 /* size of internal buffer */
 #define DEFAULT_INTERNAL_BUFFER_SIZE (4 * 1024 * 1024)
-static uint imm_buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
 
 static bool initialized = false;
 static Immediate imm;
@@ -88,9 +94,16 @@ void immInit(void)
 #endif
   memset(, 0, sizeof(Immediate));
 
-  imm.vbo_id = GPU_buf_alloc();
-  glBindBuffer(GL_ARRAY_BUFFER, imm.vbo_id);
-  glBufferData(GL_ARRAY_BUFFER, imm_buffer_size, NULL, GL_DYNAMIC_DRAW);
+  imm.draw_buffer.vbo_id = GPU_buf_alloc();
+  imm.draw_buffer.buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
+  imm.draw_buffer.default_size = DEFAULT_INTERNAL_BUFFER_SIZE;
+  glBindBuffer(GL_ARRAY_BUFFER, imm.draw_buffer.vbo_id);
+  glBufferData(GL_ARRAY_BUFFER, imm.draw_buffer.buffer_size, NULL, 
GL_DYNAMIC_DRAW);
+  imm.draw_buffer_strict.vbo_id = GPU_buf_alloc();
+  imm.draw_buffer_strict.buffer_size = 0;
+  imm.draw_buffer_strict.default_size = 0;
+  glBindBuffer(GL_ARRAY_BUFFER, imm.draw_buffer_strict.vbo_id);
+  glBufferData(GL_ARRAY_BUFFER, imm.draw_buffer_strict.buffer_size, NULL, 
GL_DYNAMIC_DRAW);
 
   imm.prim_type = GPU_PRIM_NONE;
   imm.strict_vertex_len = true;
@@ -124,7 +137,8 @@ void immDeactivate(void)
 
 void immDestroy(void)
 {
-  GPU_buf_free(imm.vbo_id);
+  GPU_buf_free(imm.draw_buffer.vbo_id);
+  GPU_buf_free(imm.draw_buffer_strict.vbo_id);
   initialized = false;
 }
 
@@ -213,6 +227,7 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
   assert(initialized);
   assert(imm.prim_type == GPU_PRIM_NONE); /* make sure we haven't already 
begun */
   assert(vertex_count_makes_sense_for_primitive(vertex_len, prim_type));
+  assert(imm.active_buffer == NULL);
 #endif
   imm.prim_type = prim_type;
   imm.vertex_len = vertex_len;
@@ -221,54 +236,58 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
 
   /* how many bytes do we need for this draw call? */
   const uint bytes_needed = vertex_buffer_size(_format, vertex_len);
+  ImmediateDrawBuffer *active_buffer = imm.strict_vertex_len ? 
_buffer_strict :
+   
_buffer;
+  imm.active_buffer = active_buffer;
 
-  glBindBuffer(GL_ARRAY_BUFFER, imm.vbo_id);
+  glBindBuffer(GL_ARRAY_BUFFER, active_buffer->vbo_id);
 
   /* does the current buffer have enough room? */
-  const uint available_bytes = imm_buffer_size - imm.buffer_offset;
+  const uint available_bytes = active_buffer->buffer_size - 
active_buffer->buffer_offset;
 
   bool recreate_buffer = false;
-  if (bytes_needed > imm_buffer_size) {
+  if (bytes_needed > active_buffer->buffer_size) {
 /* expand the internal buffer */
-imm_buffer_size = 

[Bf-blender-cvs] [6fe7bb57549] modifier-panels-ui: UI: Move node socket icons to the left of node input buttons

2020-04-16 Thread Julian Eisel
Commit: 6fe7bb57549f26341ccfcb75b904230b8bc2bf46
Author: Julian Eisel
Date:   Thu Apr 16 15:21:06 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB6fe7bb57549f26341ccfcb75b904230b8bc2bf46

UI: Move node socket icons to the left of node input buttons

Node input buttons (e.g. in the material properties) used to draw their
icons on the right of the buttons. However since they represent inputs,
it makes more sense conceptually to have them on the left.
Further, we might want to add the usual decorator buttons (to control
keyframes or display other states) to the material properties as well.
Having two circle icons next to each other would be confusing.

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

Reviewed by: Brecht Van Lommel, William Reynish

===

M   source/blender/editors/space_node/node_templates.c

===

diff --git a/source/blender/editors/space_node/node_templates.c 
b/source/blender/editors/space_node/node_templates.c
index da0058585cb..91fe6a97432 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -695,6 +695,7 @@ void uiTemplateNodeLink(
 
   UI_but_type_set_menu_from_pulldown(but);
   UI_but_node_link_set(but, sock, socket_col);
+  UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT);
 
   but->poin = (char *)but;
   but->func_argN = arg;
@@ -816,6 +817,10 @@ static void ui_node_draw_input(
 }
   }
   else {
+row = uiLayoutRow(split, true);
+
+uiTemplateNodeLink(row, C, ntree, node, input);
+
 /* input not linked, show value */
 if (!(input->flag & SOCK_HIDE_VALUE)) {
   switch (input->type) {
@@ -824,25 +829,15 @@ static void ui_node_draw_input(
 case SOCK_BOOLEAN:
 case SOCK_RGBA:
 case SOCK_STRING:
-  row = uiLayoutRow(split, true);
   uiItemR(row, , "default_value", 0, "", ICON_NONE);
   break;
 case SOCK_VECTOR:
-  row = uiLayoutRow(split, false);
+  uiItemS(row);
   col = uiLayoutColumn(row, false);
   uiItemR(col, , "default_value", 0, "", ICON_NONE);
   break;
-
-default:
-  row = uiLayoutRow(split, false);
-  break;
   }
 }
-else {
-  row = uiLayoutRow(split, false);
-}
-
-uiTemplateNodeLink(row, C, ntree, node, input);
   }
 
   /* clear */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d83b93c1e1b] modifier-panels-ui: Refactor/strengthen a bit invalid operands checks when applying an override operation.

2020-04-16 Thread Bastien Montagne
Commit: d83b93c1e1b50fd53d40a6e666c7a12f79015503
Author: Bastien Montagne
Date:   Wed Apr 15 17:26:34 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBd83b93c1e1b50fd53d40a6e666c7a12f79015503

Refactor/strengthen a bit invalid operands checks when applying an override 
operation.

===

M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/makesrna/intern/rna_access_compare_override.c

===

diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 6f2882f3565..699d1ee23e9 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -48,6 +48,8 @@ struct IDOverrideLibrary;
 struct IDOverrideLibraryProperty;
 struct IDOverrideLibraryPropertyOperation;
 struct Main;
+struct PointerRNA;
+struct PropertyRNA;
 
 void BKE_lib_override_library_enable(const bool do_enable);
 bool BKE_lib_override_library_is_enabled(void);
@@ -92,6 +94,15 @@ void BKE_lib_override_library_property_operation_delete(
 struct IDOverrideLibraryProperty *override_property,
 struct IDOverrideLibraryPropertyOperation *override_property_operation);
 
+bool BKE_lib_override_library_property_operation_operands_validate(
+struct IDOverrideLibraryPropertyOperation *override_property_operation,
+struct PointerRNA *ptr_dst,
+struct PointerRNA *ptr_src,
+struct PointerRNA *ptr_storage,
+struct PropertyRNA *prop_dst,
+struct PropertyRNA *prop_src,
+struct PropertyRNA *prop_storage);
+
 bool BKE_lib_override_library_status_check_local(struct Main *bmain, struct ID 
*local);
 bool BKE_lib_override_library_status_check_reference(struct Main *bmain, 
struct ID *local);
 
diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 5b75b8ac181..6a206fc46d9 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -558,6 +558,46 @@ void BKE_lib_override_library_property_operation_delete(
   BLI_freelinkN(_property->operations, override_property_operation);
 }
 
+/**
+ * Validate that required data for a given operation are available.
+ */
+bool BKE_lib_override_library_property_operation_operands_validate(
+struct IDOverrideLibraryPropertyOperation *override_property_operation,
+struct PointerRNA *ptr_dst,
+struct PointerRNA *ptr_src,
+struct PointerRNA *ptr_storage,
+struct PropertyRNA *prop_dst,
+struct PropertyRNA *prop_src,
+struct PropertyRNA *prop_storage)
+{
+  switch (override_property_operation->operation) {
+case IDOVERRIDE_LIBRARY_OP_NOOP:
+  return true;
+case IDOVERRIDE_LIBRARY_OP_ADD:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_MULTIPLY:
+  if (ptr_storage == NULL || ptr_storage->data == NULL || prop_storage == 
NULL) {
+BLI_assert(!"Missing data to apply differential override operation.");
+return false;
+  }
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_INSERT_AFTER:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_REPLACE:
+  if ((ptr_dst == NULL || ptr_dst->data == NULL || prop_dst == NULL) ||
+  (ptr_src == NULL || ptr_src->data == NULL || prop_src == NULL)) {
+BLI_assert(!"Missing data to apply override operation.");
+return false;
+  }
+  }
+
+  return true;
+}
+
 /**
  * Check that status of local data-block is still valid against current 
reference one.
  *
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index 199d22ee3dc..32b375fda97 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -481,28 +481,13 @@ static bool rna_property_override_operation_apply(Main 
*bmain,
 
   const short override_op = opop->operation;
 
-  if (override_op == IDOVERRIDE_LIBRARY_OP_NOOP) {
-return true;
-  }
-
-  if (ELEM(override_op,
-   IDOVERRIDE_LIBRARY_OP_ADD,
-   IDOVERRIDE_LIBRARY_OP_SUBTRACT,
-   IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
-  !ptr_storage) {
-/* We cannot apply 'diff' override operations without some reference 
storage.
- * This should typically only happen at read time of .blend file... */
+  if (!BKE_lib_override_library_property_operation_operands_validate(
+  opop, ptr_dst, ptr_src, ptr_storage, prop_dst, prop_src, 
prop_storage)) {
 return false;
   }
 
-  if (ELEM(override_op,
-   IDOVERRIDE_LIBRARY_OP_ADD,
-   IDOVERRIDE_LIBRARY_OP_SUBTRACT,
-  

[Bf-blender-cvs] [b36e8b0d55f] modifier-panels-ui: Fix (unreported) Image Editor UI drawing too dark

2020-04-16 Thread Philipp Oeser
Commit: b36e8b0d55fc36c13da31c9646eac267c3157c01
Author: Philipp Oeser
Date:   Thu Apr 16 12:39:51 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBb36e8b0d55fc36c13da31c9646eac267c3157c01

Fix (unreported) Image Editor UI drawing too dark

Caused by rBf0221ff6674f.

Only draw the Image buffer itself in display space.

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

===

M   source/blender/editors/space_image/image_draw.c
M   source/blender/editors/space_image/space_image.c

===

diff --git a/source/blender/editors/space_image/image_draw.c 
b/source/blender/editors/space_image/image_draw.c
index 85f7f744abc..6037c1d2ec8 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -575,6 +575,9 @@ static void draw_image_buffer(const bContext *C,
   float zoomx,
   float zoomy)
 {
+  /* Image are still drawn in display space. */
+  glDisable(GL_FRAMEBUFFER_SRGB);
+
   int x, y;
   int sima_flag = sima->flag & ED_space_image_get_display_channel_mask(ibuf);
 
@@ -666,6 +669,8 @@ static void draw_image_buffer(const bContext *C,
   GPU_blend(false);
 }
   }
+
+  glEnable(GL_FRAMEBUFFER_SRGB);
 }
 
 static void draw_image_buffer_repeated(const bContext *C,
diff --git a/source/blender/editors/space_image/space_image.c 
b/source/blender/editors/space_image/space_image.c
index ed14593ed2d..d7d85112497 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -670,14 +670,9 @@ static void image_main_region_draw(const bContext *C, 
ARegion *region)
   /* we set view2d from own zoom and offset each time */
   image_main_region_set_view2d(sima, region);
 
-  /* Image are still drawn in display space. */
-  glDisable(GL_FRAMEBUFFER_SRGB);
-
   /* we draw image in pixelspace */
   draw_image_main(C, region);
 
-  glEnable(GL_FRAMEBUFFER_SRGB);
-
   /* and uvs in 0.0-1.0 space */
   UI_view2d_view_ortho(v2d);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [01ef0eba9a9] modifier-panels-ui: Cleanup: remove unused scene argument

2020-04-16 Thread Campbell Barton
Commit: 01ef0eba9a96db678d894d90462505af9f2ffa3f
Author: Campbell Barton
Date:   Thu Apr 16 11:05:52 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rB01ef0eba9a96db678d894d90462505af9f2ffa3f

Cleanup: remove unused scene argument

===

M   source/blender/blenkernel/BKE_animsys.h
M   source/blender/blenkernel/intern/action.c
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenkernel/intern/seqprefetch.c
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/draw/engines/eevee/eevee_motion_blur.c
M   source/blender/editors/armature/pose_transform.c
M   source/blender/editors/object/object_modifier.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/source/blender/blenkernel/BKE_animsys.h 
b/source/blender/blenkernel/BKE_animsys.h
index a8915c178d4..4076bca3b19 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -207,17 +207,15 @@ bool BKE_animsys_read_rna_setting(struct PathResolvedRNA 
*anim_rna, float *r_val
 bool BKE_animsys_write_rna_setting(struct PathResolvedRNA *anim_rna, const 
float value);
 
 /* Evaluation loop for evaluating animation data  */
-void BKE_animsys_evaluate_animdata(struct Scene *scene,
-   struct ID *id,
+void BKE_animsys_evaluate_animdata(struct ID *id,
struct AnimData *adt,
float ctime,
-   short recalc,
+   eAnimData_Recalc recalc,
const bool flush_to_original);
 
 /* Evaluation of all ID-blocks with Animation Data blocks - Animation Data 
Only */
 void BKE_animsys_evaluate_all_animation(struct Main *main,
 struct Depsgraph *depsgraph,
-struct Scene *scene,
 float ctime);
 
 /*  Specialized API --- */
diff --git a/source/blender/blenkernel/intern/action.c 
b/source/blender/blenkernel/intern/action.c
index ba77538bfb6..4f51e23496c 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1665,6 +1665,6 @@ void what_does_obaction(
 adt.action = act;
 
 /* execute effects of Action on to workob (or it's PoseChannels) */
-BKE_animsys_evaluate_animdata(NULL, >id, , cframe, 
ADT_RECALC_ANIM, false);
+BKE_animsys_evaluate_animdata(>id, , cframe, ADT_RECALC_ANIM, 
false);
   }
 }
diff --git a/source/blender/blenkernel/intern/anim_sys.c 
b/source/blender/blenkernel/intern/anim_sys.c
index 5f463be58b4..5825d7e4acd 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2500,7 +2500,7 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, 
AnimData *adt)
  * have been set already by the depsgraph. Now, we use the recalc
  */
 void BKE_animsys_evaluate_animdata(
-Scene *scene, ID *id, AnimData *adt, float ctime, short recalc, const bool 
flush_to_original)
+ID *id, AnimData *adt, float ctime, eAnimData_Recalc recalc, const bool 
flush_to_original)
 {
   PointerRNA id_ptr;
 
@@ -2556,10 +2556,7 @@ void BKE_animsys_evaluate_animdata(
  * 'local' (i.e. belonging in the nearest ID-block that setting is related to, 
not a
  * standard 'root') block are overridden by a larger 'user'
  */
-void BKE_animsys_evaluate_all_animation(Main *main,
-Depsgraph *depsgraph,
-Scene *scene,
-float ctime)
+void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, 
float ctime)
 {
   ID *id;
 
@@ -2578,7 +2575,7 @@ void BKE_animsys_evaluate_all_animation(Main *main,
   for (id = first; id; id = id->next) { \
 if (ID_REAL_USERS(id) > 0) { \
   AnimData *adt = BKE_animdata_from_id(id); \
-  BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag, 
flush_to_original); \
+  BKE_animsys_evaluate_animdata(id, adt, ctime, aflag, flush_to_original); 
\
 } \
   } \
   (void)0
@@ -2597,9 +2594,9 @@ void BKE_animsys_evaluate_all_animation(Main *main,
   if (ntp->nodetree) { \
 AnimData *adt2 = BKE_animdata_from_id((ID *)ntp->nodetree); \
 BKE_animsys_evaluate_animdata( \
-scene, (ID *)ntp->nodetree, adt2, ctime, ADT_RECALC_ANIM, 
flush_to_original); \
+>nodetree->id, adt2, ctime, ADT_RECALC_ANIM, 
flush_to_original); \
   } \
-  BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag, 
flush_to_original); \
+  BKE_animsys_evaluate_animdata(id, adt, 

[Bf-blender-cvs] [c9feac0afb8] modifier-panels-ui: Theme: adjust active UV face color in the theme

2020-04-16 Thread Campbell Barton
Commit: c9feac0afb801ac87c8e3dc823fb528f6c4b0e91
Author: Campbell Barton
Date:   Thu Apr 16 18:43:03 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rBc9feac0afb801ac87c8e3dc823fb528f6c4b0e91

Theme: adjust active UV face color in the theme

This color had it's alpha reduced in the drawing code,
as the active face is no longer stippled.

Now the color is used from the theme without adjusting the alpha.

===

M   release/datafiles/userdef/userdef_default_theme.c
M   release/scripts/presets/interface_theme/blender_light.xml
M   source/blender/editors/uvedit/uvedit_draw.c

===

diff --git a/release/datafiles/userdef/userdef_default_theme.c 
b/release/datafiles/userdef/userdef_default_theme.c
index 23d958de021..4d48bb8eaac 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -697,7 +697,7 @@ const bTheme U_theme_default = {
 .vertex_size = 3,
 .outline_width = 1,
 .facedot_size = 3,
-.editmesh_active = RGBA(0xff80),
+.editmesh_active = RGBA(0xff40),
 .handle_vertex_select = RGBA(0x00ff),
 .handle_vertex_size = 5,
 .gp_vertex_size = 3,
diff --git a/release/scripts/presets/interface_theme/blender_light.xml 
b/release/scripts/presets/interface_theme/blender_light.xml
index f4ec8233df3..48ad0a8367e 100644
--- a/release/scripts/presets/interface_theme/blender_light.xml
+++ b/release/scripts/presets/interface_theme/blender_light.xml
@@ -724,7 +724,7 @@
 freestyle_face_mark="#7fff7f33"
 face_back="#"
 face_front="#"
-editmesh_active="#ff80"
+editmesh_active="#ff40"
 wire_edit="#c0c0c0"
 edge_select="#ff8500"
 scope_back="#727272ff"
diff --git a/source/blender/editors/uvedit/uvedit_draw.c 
b/source/blender/editors/uvedit/uvedit_draw.c
index 0fd3005ac41..959ca1eeef1 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -347,7 +347,6 @@ static void draw_uvs(SpaceImage *sima,
   UI_GetThemeColor4fv(TH_FACE, col1);
   UI_GetThemeColor4fv(TH_FACE_SELECT, col2);
   UI_GetThemeColor4fv(TH_EDITMESH_ACTIVE, col3);
-  col3[3] *= 0.2; /* Simulate dithering */
 
   col1[3] *= overlay_alpha;
   col2[3] *= overlay_alpha;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [352b72791a4] modifier-panels-ui: Cleanup: Deduplicate getting node tree from id

2020-04-16 Thread Jacques Lucke
Commit: 352b72791a4f19728331026fad946ea78db2469a
Author: Jacques Lucke
Date:   Thu Apr 16 12:06:01 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB352b72791a4f19728331026fad946ea78db2469a

Cleanup: Deduplicate getting node tree from id

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

Reviewers: mont29

===

M   source/blender/editors/space_node/node_draw.c

===

diff --git a/source/blender/editors/space_node/node_draw.c 
b/source/blender/editors/space_node/node_draw.c
index 66f3cdc0178..591c6003153 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -94,23 +94,11 @@ void ED_node_tree_update(const bContext *C)
 static bNodeTree *node_tree_from_ID(ID *id)
 {
   if (id) {
-short idtype = GS(id->name);
-
-switch (idtype) {
-  case ID_NT:
-return (bNodeTree *)id;
-  case ID_MA:
-return ((Material *)id)->nodetree;
-  case ID_LA:
-return ((Light *)id)->nodetree;
-  case ID_WO:
-return ((World *)id)->nodetree;
-  case ID_SCE:
-return ((Scene *)id)->nodetree;
-  case ID_TE:
-return ((Tex *)id)->nodetree;
-  case ID_LS:
-return ((FreestyleLineStyle *)id)->nodetree;
+if (GS(id->name) == ID_NT) {
+  return (bNodeTree *)id;
+}
+else {
+  return ntreeFromID(id);
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f8b6a2faad3] modifier-panels-ui: Logging: log warnings which had been disabled since 2.4x

2020-04-16 Thread Campbell Barton
Commit: f8b6a2faad3fc4c08e433342bc1b9fad1ec1d0cb
Author: Campbell Barton
Date:   Thu Apr 16 10:46:08 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rBf8b6a2faad3fc4c08e433342bc1b9fad1ec1d0cb

Logging: log warnings which had been disabled since 2.4x

===

M   source/blender/editors/object/CMakeLists.txt
M   source/blender/editors/object/object_edit.c

===

diff --git a/source/blender/editors/object/CMakeLists.txt 
b/source/blender/editors/object/CMakeLists.txt
index c2c25e47908..de9cc72dfa4 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -34,6 +34,7 @@ set(INC
   ../../shader_fx
   ../../render/extern/include
   ../../windowmanager
+  ../../../../intern/clog
   ../../../../intern/glew-mx
   ../../../../intern/guardedalloc
 )
diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 5506895613b..871886da4eb 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -100,6 +100,8 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+#include "CLG_log.h"
+
 /* for menu/popup icons etc etc*/
 
 #include "UI_interface.h"
@@ -112,22 +114,14 @@
 
 #include "object_intern.h"  // own include
 
+static CLG_LogRef LOG = {"ed.object.edit"};
+
 /* prototypes */
 typedef struct MoveToCollectionData MoveToCollectionData;
 static void move_to_collection_menus_items(struct uiLayout *layout,
struct MoveToCollectionData *menu);
 static ListBase selected_objects_get(bContext *C);
 
-/* * XXX  */
-static void error(const char *UNUSED(arg))
-{
-}
-
-/* port over here */
-static void error_libdata(void)
-{
-}
-
 Object *ED_object_context(bContext *C)
 {
   return CTX_data_pointer_get_type(C, "object", _Object).data;
@@ -441,7 +435,11 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object 
*obedit, const bool f
 }
 
 if (me->edit_mesh->bm->totvert > MESH_MAX_VERTS) {
-  error("Too many vertices");
+  /* This used to be warned int the UI, we could warn again although it's 
quite rare. */
+  CLOG_WARN(,
+"Too many vertices for mesh '%s' (%d)",
+me->id.name + 2,
+me->edit_mesh->bm->totvert);
   return false;
 }
 
@@ -600,7 +598,8 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, 
Object *ob, int flag
   }
 
   if (BKE_object_obdata_is_libdata(ob)) {
-error_libdata();
+/* Ideally the caller should check this. */
+CLOG_WARN(, "Unable to enter edit-mode on library data for object 
'%s'", ob->id.name + 2);
 return false;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e7fcfe7d64b] modifier-panels-ui: Fix memcpy overlapping buffers

2020-04-16 Thread Germano Cavalcante
Commit: e7fcfe7d64b96ddd053fe943eb8b1a412e3cc1df
Author: Germano Cavalcante
Date:   Thu Apr 16 10:31:51 2020 -0300
Branches: modifier-panels-ui
https://developer.blender.org/rBe7fcfe7d64b96ddd053fe943eb8b1a412e3cc1df

Fix memcpy overlapping buffers

This crashes with ASAN enabled.
```
==39366==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges 
[0x623ae848,0x623ae85a) and [0x623ae851, 0x623ae863) overlap
```

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index d53b6cde4ae..7904e51a516 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4410,10 +4410,12 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
   ColorManagedViewSettings *view_settings;
   view_settings = >view_settings;
   if (BLI_str_startswith(view_settings->look, "Filmic - ")) {
-STRNCPY(view_settings->look, view_settings->look + strlen("Filmic - 
"));
+char *src = view_settings->look + strlen("Filmic - ");
+memmove(view_settings->look, src, strlen(src) + 1);
   }
   else if (BLI_str_startswith(view_settings->look, "Standard - ")) {
-STRNCPY(view_settings->look, view_settings->look + strlen("Standard - 
"));
+char *src = view_settings->look + strlen("Standard - ");
+memmove(view_settings->look, src, strlen(src) + 1);
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4bbfa924ade] modifier-panels-ui: Fix T75567: Paint Mode Wireframe Incorrect

2020-04-16 Thread Jeroen Bakker
Commit: 4bbfa924ade510159fa27ff439bba30a45a5643c
Author: Jeroen Bakker
Date:   Tue Apr 14 09:33:15 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB4bbfa924ade510159fa27ff439bba30a45a5643c

Fix T75567: Paint Mode Wireframe Incorrect

The loop normal VBO is used in two manners. In edit mode to draw the
edge normals. And in paint mode to draw the wireframe. This commit
checks which VBO is needed and build the correct one.

This allows show the wireframe correct in paint mode, when the object is
subdivided.

Reviewed By: Clément Foucault

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

===

M   source/blender/draw/intern/draw_cache_extract_mesh.c

===

diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c 
b/source/blender/draw/intern/draw_cache_extract_mesh.c
index fe63dec1294..4c51ed99f2c 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -1648,9 +1648,12 @@ static void extract_lnor_hq_loop_mesh(
 normal_float_to_short_v3(_data->x, mr->poly_normals[p]);
   }
 
-  /* Flag for paint mode overlay. */
-  if (mpoly->flag & ME_HIDE || (mr->extract_type == MR_EXTRACT_MAPPED && 
(mr->v_origindex) &&
-mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) {
+  /* Flag for paint mode overlay.
+   * Only use MR_EXTRACT_MAPPED in edit mode where it is used to display the 
edge-normals. In paint
+   * mode it will use the unmapped data to draw the wireframe. */
+  if (mpoly->flag & ME_HIDE ||
+  (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && 
(mr->v_origindex) &&
+   mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) {
 lnor_data->w = -1;
   }
   else if (mpoly->flag & ME_FACE_SEL) {
@@ -1724,9 +1727,12 @@ static void extract_lnor_loop_mesh(
 *lnor_data = GPU_normal_convert_i10_v3(mr->poly_normals[p]);
   }
 
-  /* Flag for paint mode overlay. */
-  if (mpoly->flag & ME_HIDE || (mr->extract_type == MR_EXTRACT_MAPPED && 
(mr->v_origindex) &&
-mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) {
+  /* Flag for paint mode overlay.
+   * Only use MR_EXTRACT_MAPPED in edit mode where it is used to display the 
edge-normals. In paint
+   * mode it will use the unmapped data to draw the wireframe. */
+  if (mpoly->flag & ME_HIDE ||
+  (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && 
(mr->v_origindex) &&
+   mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) {
 lnor_data->w = -1;
   }
   else if (mpoly->flag & ME_FACE_SEL) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4566f086796] modifier-panels-ui: Fix T75620: Lamp gizmo flips direction for negative scaled objects

2020-04-16 Thread Campbell Barton
Commit: 4566f086796ba4b2fa7e23f933f46bd4061d5a5e
Author: Campbell Barton
Date:   Thu Apr 16 15:50:04 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rB4566f086796ba4b2fa7e23f933f46bd4061d5a5e

Fix T75620: Lamp gizmo flips direction for negative scaled objects

===

M   source/blender/editors/object/object_transform.c

===

diff --git a/source/blender/editors/object/object_transform.c 
b/source/blender/editors/object/object_transform.c
index 46245d21d5b..eef8e29640c 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -1608,6 +1608,7 @@ struct XFormAxisItem {
   float rot_mat[3][3];
   void *obtfm;
   float xform_dist;
+  bool is_z_flip;
 
 #ifdef USE_RELATIVE_ROTATION
   /* use when translating multiple */
@@ -1730,11 +1731,16 @@ static void object_apply_location(Object *ob, const 
float loc[3])
 static void object_orient_to_location(Object *ob,
   const float rot_orig[3][3],
   const float axis[3],
-  const float location[3])
+  const float location[3],
+  const bool z_flip)
 {
   float delta[3];
   sub_v3_v3v3(delta, ob->obmat[3], location);
   if (normalize_v3(delta) != 0.0f) {
+if (z_flip) {
+  negate_v3(delta);
+}
+
 if (len_squared_v3v3(delta, axis) > FLT_EPSILON) {
   float delta_rot[3][3];
   float final_rot[3][3];
@@ -1840,6 +1846,11 @@ static int object_transform_axis_target_invoke(bContext 
*C, wmOperator *op, cons
 for (int i = 0; i < xfd->object_data_len; i++, item++) {
   item->obtfm = BKE_object_tfm_backup(item->ob);
   BKE_object_rot_to_mat3(item->ob, item->rot_mat, true);
+
+  /* Detect negative scale matrix. */
+  float full_mat3[3][3];
+  BKE_object_to_mat3(item->ob, full_mat3);
+  item->is_z_flip = dot_v3v3(item->rot_mat[2], full_mat3[2]) < 0.0f;
 }
   }
 
@@ -1964,7 +1975,7 @@ static int object_transform_axis_target_modal(bContext 
*C, wmOperator *op, const
 }
 
 object_orient_to_location(
-item->ob, item->rot_mat, item->rot_mat[2], location_world);
+item->ob, item->rot_mat, item->rot_mat[2], location_world, 
item->is_z_flip);
 WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob);
   }
   copy_v3_v3(xfd->prev.normal, normal);
@@ -1974,7 +1985,8 @@ static int object_transform_axis_target_modal(bContext 
*C, wmOperator *op, const
   else {
 struct XFormAxisItem *item = xfd->object_data;
 for (int i = 0; i < xfd->object_data_len; i++, item++) {
-  object_orient_to_location(item->ob, item->rot_mat, 
item->rot_mat[2], location_world);
+  object_orient_to_location(
+  item->ob, item->rot_mat, item->rot_mat[2], location_world, 
item->is_z_flip);
   WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob);
 }
 xfd->prev.is_normal_valid = false;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [062d7c8e967] modifier-panels-ui: Fix T75750 Image Editor: Rendered result is much brighter than in viewport

2020-04-16 Thread Clément Foucault
Commit: 062d7c8e96740ba5109a4b2e1671f2c56994a3f5
Author: Clément Foucault
Date:   Wed Apr 15 23:34:19 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB062d7c8e96740ba5109a4b2e1671f2c56994a3f5

Fix T75750 Image Editor: Rendered result is much brighter than in viewport

===

M   source/blender/editors/space_image/space_image.c

===

diff --git a/source/blender/editors/space_image/space_image.c 
b/source/blender/editors/space_image/space_image.c
index 1e1d4373fea..5c146a99efd 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -669,9 +669,14 @@ static void image_main_region_draw(const bContext *C, 
ARegion *region)
   /* we set view2d from own zoom and offset each time */
   image_main_region_set_view2d(sima, region);
 
+  /* Image are still drawn in display space. */
+  glDisable(GL_FRAMEBUFFER_SRGB);
+
   /* we draw image in pixelspace */
   draw_image_main(C, region);
 
+  glEnable(GL_FRAMEBUFFER_SRGB);
+
   /* and uvs in 0.0-1.0 space */
   UI_view2d_view_ortho(v2d);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7f9131bcc54] modifier-panels-ui: Fix T75455: High World Space Cavity Samples Crash

2020-04-16 Thread Jeroen Bakker
Commit: 7f9131bcc5483006cfec6266c360fe7541d63672
Author: Jeroen Bakker
Date:   Tue Apr 14 15:29:09 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB7f9131bcc5483006cfec6266c360fe7541d63672

Fix T75455: High World Space Cavity Samples Crash

When setting the number of cavity samples to a high number blender could
write out of bounds.

This patch will harmonize the number of iterations in the same way how
it is done during execution.

Reviewed By: Clément Foucault

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

===

M   source/blender/draw/engines/workbench/workbench_effect_cavity.c

===

diff --git a/source/blender/draw/engines/workbench/workbench_effect_cavity.c 
b/source/blender/draw/engines/workbench/workbench_effect_cavity.c
index cdf8a93fc57..4a8db65c02e 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_cavity.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_cavity.c
@@ -42,11 +42,11 @@
 /* Using Hammersley distribution */
 static float *create_disk_samples(int num_samples, int num_iterations)
 {
+  BLI_assert(num_samples * num_iterations <= CAVITY_MAX_SAMPLES);
   const int total_samples = num_samples * num_iterations;
   const float num_samples_inv = 1.0f / num_samples;
   /* vec4 to ensure memory alignment. */
   float(*texels)[4] = MEM_callocN(sizeof(float[4]) * CAVITY_MAX_SAMPLES, 
__func__);
-
   for (int i = 0; i < total_samples; i++) {
 float it_add = (i / num_samples) * 0.499f;
 float r = fmodf((i + 0.5f + it_add) * num_samples_inv, 1.0f);
@@ -102,7 +102,7 @@ void workbench_cavity_data_update(WORKBENCH_PrivateData 
*wpd, WORKBENCH_UBO_Worl
   if (CAVITY_ENABLED(wpd)) {
 int cavity_sample_count_single_iteration = 
scene->display.matcap_ssao_samples;
 int cavity_sample_count_total = workbench_cavity_total_sample_count(wpd, 
scene);
-int max_iter_count = cavity_sample_count_total / 
cavity_sample_count_single_iteration;
+const int max_iter_count = cavity_sample_count_total / 
cavity_sample_count_single_iteration;
 
 int sample = wpd->taa_sample % max_iter_count;
 wd->cavity_sample_start = cavity_sample_count_single_iteration * sample;
@@ -128,6 +128,7 @@ void 
workbench_cavity_samples_ubo_ensure(WORKBENCH_PrivateData *wpd)
 
   int cavity_sample_count_single_iteration = 
scene->display.matcap_ssao_samples;
   int cavity_sample_count = workbench_cavity_total_sample_count(wpd, scene);
+  const int max_iter_count = max_ii(1, cavity_sample_count / 
cavity_sample_count_single_iteration);
 
   if (wpd->vldata->cavity_sample_count != cavity_sample_count) {
 DRW_UBO_FREE_SAFE(wpd->vldata->cavity_sample_ubo);
@@ -135,8 +136,7 @@ void 
workbench_cavity_samples_ubo_ensure(WORKBENCH_PrivateData *wpd)
   }
 
   if (wpd->vldata->cavity_sample_ubo == NULL) {
-float *samples = create_disk_samples(cavity_sample_count_single_iteration,
- max_ii(1, wpd->taa_sample_len));
+float *samples = create_disk_samples(cavity_sample_count_single_iteration, 
max_iter_count);
 wpd->vldata->cavity_jitter_tx = create_jitter_texture(cavity_sample_count);
 /* NOTE: Uniform buffer needs to always be filled to be valid. */
 wpd->vldata->cavity_sample_ubo = DRW_uniformbuffer_create(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [77a8f89a500] modifier-panels-ui: UV: support changing the opacity of the UV overlay

2020-04-16 Thread Campbell Barton
Commit: 77a8f89a5001e7886bb0cdc416e05f6f1e2dcbe5
Author: Campbell Barton
Date:   Thu Apr 16 18:10:21 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rB77a8f89a5001e7886bb0cdc416e05f6f1e2dcbe5

UV: support changing the opacity of the UV overlay

Add this option as it's useful to adjust how much UV's
cover the image when UV mapping.

D5348 by @EitanSomething with edits

===

M   release/scripts/startup/bl_ui/space_image.py
M   source/blender/blenloader/CMakeLists.txt
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/readfile.h
A   source/blender/blenloader/intern/versioning_290.c
M   source/blender/editors/space_image/space_image.c
M   source/blender/editors/uvedit/uvedit_draw.c
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_space.c

===

diff --git a/release/scripts/startup/bl_ui/space_image.py 
b/release/scripts/startup/bl_ui/space_image.py
index 4506307067e..05924600db7 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -955,6 +955,7 @@ class IMAGE_PT_view_display_uv_edit_overlays(Panel):
 col = layout.column()
 col.prop(uvedit, "show_smooth_edges", text="Smooth")
 col.prop(uvedit, "show_modified_edges", text="Modified")
+col.prop(uvedit, "uv_opacity")
 
 
 class IMAGE_PT_view_display_uv_edit_overlays_stretch(Panel):
diff --git a/source/blender/blenloader/CMakeLists.txt 
b/source/blender/blenloader/CMakeLists.txt
index 450d3fc2371..1555b9231ed 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -53,6 +53,7 @@ set(SRC
   intern/versioning_260.c
   intern/versioning_270.c
   intern/versioning_280.c
+  intern/versioning_290.c
   intern/versioning_cycles.c
   intern/versioning_defaults.c
   intern/versioning_dna.c
diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 9ff5ab3a648..cf68caebc65 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9911,6 +9911,7 @@ static void do_versions(FileData *fd, Library *lib, Main 
*main)
   blo_do_versions_260(fd, lib, main);
   blo_do_versions_270(fd, lib, main);
   blo_do_versions_280(fd, lib, main);
+  blo_do_versions_290(fd, lib, main);
   blo_do_versions_cycles(fd, lib, main);
 
   /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
diff --git a/source/blender/blenloader/intern/readfile.h 
b/source/blender/blenloader/intern/readfile.h
index 80f8bfc3f07..55abbe703de 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -199,6 +199,7 @@ void blo_do_versions_250(struct FileData *fd, struct 
Library *lib, struct Main *
 void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main 
*bmain);
 void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main 
*bmain);
 void blo_do_versions_280(struct FileData *fd, struct Library *lib, struct Main 
*bmain);
+void blo_do_versions_290(struct FileData *fd, struct Library *lib, struct Main 
*bmain);
 void blo_do_versions_cycles(struct FileData *fd, struct Library *lib, struct 
Main *bmain);
 
 void do_versions_after_linking_250(struct Main *bmain);
diff --git a/source/blender/blenloader/intern/versioning_290.c 
b/source/blender/blenloader/intern/versioning_290.c
new file mode 100644
index 000..c6adbb5c7d2
--- /dev/null
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -0,0 +1,63 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup blenloader
+ */
+/* allow readfile to use deprecated functionality */
+#define DNA_DEPRECATED_ALLOW
+
+#include "BLI_listbase.h"
+#include "BLI_utildefines.h"
+
+#include "DNA_screen_types.h"
+
+#include "BKE_collection.h"
+#include "BKE_main.h"
+
+#include "BLO_readfile.h"
+#include "readfile.h"
+
+/* Make preferences read-only, use versioning_userdef.c. */
+#define U (*((const UserDef *)))
+
+void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)

[Bf-blender-cvs] [b2a4eb75abe] modifier-panels-ui: Update RNA Manual References

2020-04-16 Thread Aaron Carlisle
Commit: b2a4eb75abebf1c69f9b1ed3fc9783823b0a6835
Author: Aaron Carlisle
Date:   Wed Apr 15 13:48:59 2020 -0400
Branches: modifier-panels-ui
https://developer.blender.org/rBb2a4eb75abebf1c69f9b1ed3fc9783823b0a6835

Update RNA Manual References

===

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 7b266d66d29..9964981e02a 100644
--- a/release/scripts/modules/rna_manual_reference.py
+++ b/release/scripts/modules/rna_manual_reference.py
@@ -58,6 +58,7 @@ url_manual_mapping = (
("bpy.types.gpencilsculptsettings.use_multiframe_falloff*", 
"grease_pencil/multiframe.html#bpy-types-gpencilsculptsettings-use-multiframe-falloff"),
("bpy.types.rendersettings_simplify_gpencil_remove_lines*", 
"render/cycles/render_settings/simplify.html#bpy-types-rendersettings-simplify-gpencil-remove-lines"),
("bpy.types.toolsettings.use_transform_pivot_point_align*", 
"scene_layout/object/editing/transform/control/options.html#bpy-types-toolsettings-use-transform-pivot-point-align"),
+   ("bpy.types.brush.show_multiplane_scrape_planes_preview*", 
"sculpt_paint/sculpting/tools/multiplane_scrape.html#bpy-types-brush-show-multiplane-scrape-planes-preview"),
("bpy.types.cyclesrendersettings.offscreen_dicing_scale*", 
"render/cycles/render_settings/subdivision.html#bpy-types-cyclesrendersettings-offscreen-dicing-scale"),
("bpy.types.fluiddomainsettings.sndparticle_bubble_drag*", 
"physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-bubble-drag"),
("bpy.types.linestylegeometrymodifier_backbonestretcher*", 
"render/freestyle/parameter_editor/line_style/modifiers/geometry/backbone_stretcher.html#bpy-types-linestylegeometrymodifier-backbonestretcher"),
@@ -72,6 +73,7 @@ url_manual_mapping = (
("bpy.types.materialgpencilstyle.use_fill_texture_mix*", 
"grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-use-fill-texture-mix"),
("bpy.types.rendersettings_simplify_gpencil_shader_fx*", 
"render/cycles/render_settings/simplify.html#bpy-types-rendersettings-simplify-gpencil-shader-fx"),
("bpy.types.rendersettings_simplify_gpencil_view_fill*", 
"render/cycles/render_settings/simplify.html#bpy-types-rendersettings-simplify-gpencil-view-fill"),
+   ("bpy.types.brush.elastic_deform_volume_preservation*", 
"sculpt_paint/sculpting/tools/elastic_deform.html#bpy-types-brush-elastic-deform-volume-preservation"),
("bpy.types.brushgpencilsettings.use_jitter_pressure*", 
"grease_pencil/modes/draw/tool_settings/brushes/draw_brush.html#bpy-types-brushgpencilsettings-use-jitter-pressure"),
("bpy.types.brushgpencilsettings.use_settings_random*", 
"grease_pencil/modes/draw/tool_settings/brushes/draw_brush.html#bpy-types-brushgpencilsettings-use-settings-random"),
("bpy.types.fluiddomainsettings.mesh_particle_radius*", 
"physics/fluid/type/domain/liquid/mesh.html#bpy-types-fluiddomainsettings-mesh-particle-radius"),
@@ -92,7 +94,9 @@ url_manual_mapping = (
("bpy.types.fluiddomainsettings.vector_display_type*", 
"physics/fluid/type/domain/gas/viewport_display.html#bpy-types-fluiddomainsettings-vector-display-type"),
("bpy.types.linestylegeometrymodifier_perlinnoise1d*", 
"render/freestyle/parameter_editor/line_style/modifiers/geometry/perlin_noise_1d.html#bpy-types-linestylegeometrymodifier-perlinnoise1d"),
("bpy.types.linestylegeometrymodifier_perlinnoise2d*", 
"render/freestyle/parameter_editor/line_style/modifiers/geometry/perlin_noise_2d.html#bpy-types-linestylegeometrymodifier-perlinnoise2d"),
+   ("bpy.types.rendersettings.use_high_quality_normals*", 
"render/eevee/render_settings/performance.html#bpy-types-rendersettings-use-high-quality-normals"),
("bpy.types.cyclesrendersettings.use_distance_cull*", 
"render/cycles/render_settings/simplify.html#bpy-types-cyclesrendersettings-use-distance-cull"),
+   ("bpy.types.fluiddomainsettings.delete_in_obstacle*", 
"physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-delete-in-obstacle"),
("bpy.types.fluiddomainsettings.mesh_concave_lower*", 
"physics/fluid/type/domain/liquid/mesh.html#bpy-types-fluiddomainsettings-mesh-concave-lower"),
("bpy.types.fluiddomainsettings.mesh_concave_upper*", 
"physics/fluid/type/domain/liquid/mesh.html#bpy-types-fluiddomainsettings-mesh-concave-upper"),
("bpy.types.fluiddomainsettings.use_dissolve_smoke*", 
"physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-use-dissolve-smoke"),
@@ -134,6 +138,7 @@ url_manual_mapping = (
("bpy.types.linestylegeometrymodifier_tipremover*", 

[Bf-blender-cvs] [1e7e94588da] modifier-panels-ui: Cleanup: PEP8 for python changes

2020-04-16 Thread Julian Eisel
Commit: 1e7e94588daa66483190f45a9de5e98228f80e05
Author: Julian Eisel
Date:   Tue Apr 14 17:26:47 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB1e7e94588daa66483190f45a9de5e98228f80e05

Cleanup: PEP8 for python changes

===

M   intern/cycles/blender/addon/ui.py
M   release/scripts/startup/bl_ui/properties_data_armature.py
M   release/scripts/startup/bl_ui/properties_data_camera.py
M   release/scripts/startup/bl_ui/properties_data_curve.py
M   release/scripts/startup/bl_ui/properties_data_empty.py
M   release/scripts/startup/bl_ui/properties_data_mesh.py
M   release/scripts/startup/bl_ui/properties_object.py
M   release/scripts/startup/bl_ui/properties_output.py
M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/properties_physics_common.py
M   release/scripts/startup/bl_ui/properties_view_layer.py
M   release/scripts/startup/bl_ui/space_sequencer.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   release/scripts/startup/bl_ui/space_userpref.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 9bd59788b84..92f0a8fb830 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -500,9 +500,9 @@ class 
CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel):
 
 col = layout.column()
 col.prop(cscene, "blur_glossy")
-col = layout.column(heading = "Caustics", align = True)
-col.prop(cscene, "caustics_reflective", text = "Reflective")
-col.prop(cscene, "caustics_refractive", text = "Refractive")
+col = layout.column(heading="Caustics", align=True)
+col.prop(cscene, "caustics_reflective", text="Reflective")
+col.prop(cscene, "caustics_refractive", text="Refractive")
 
 
 class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
@@ -763,7 +763,7 @@ class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
 rd = scene.render
 view_layer = context.view_layer
 
-col = layout.column(heading = "Include")
+col = layout.column(heading="Include")
 col.prop(view_layer, "use_sky", text="Environment")
 col.prop(view_layer, "use_ao", text="Ambient Occlusion")
 col.prop(view_layer, "use_solid", text="Surfaces")
@@ -813,7 +813,7 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, 
Panel):
 view_layer = context.view_layer
 cycles_view_layer = view_layer.cycles
 
-col = layout.column(heading = "Include", align = True)
+col = layout.column(heading="Include", align=True)
 col.prop(view_layer, "use_pass_combined")
 col.prop(view_layer, "use_pass_z")
 col.prop(view_layer, "use_pass_mist")
@@ -825,11 +825,11 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, 
Panel):
 
 col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising 
Data")
 
-col = layout.column(heading = "Indexes", align = True)
+col = layout.column(heading="Indexes", align=True)
 col.prop(view_layer, "use_pass_object_index")
 col.prop(view_layer, "use_pass_material_index")
 
-col = layout.column(heading = "Debug", align = True)
+col = layout.column(heading="Debug", align=True)
 col.prop(cycles_view_layer, "pass_debug_render_time", text="Render 
Time")
 col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample 
Count")
 
@@ -851,27 +851,26 @@ class CYCLES_RENDER_PT_passes_light(CyclesButtonsPanel, 
Panel):
 view_layer = context.view_layer
 cycles_view_layer = view_layer.cycles
 
-
-col = layout.column(heading = "Diffuse", align = True)
+col = layout.column(heading="Diffuse", align=True)
 col.prop(view_layer, "use_pass_diffuse_direct", text="Direct")
 col.prop(view_layer, "use_pass_diffuse_indirect", text="Indirect")
 col.prop(view_layer, "use_pass_diffuse_color", text="Color")
 
-col = layout.column(heading = "Glossy", align = True)
+col = layout.column(heading="Glossy", align=True)
 col.prop(view_layer, "use_pass_glossy_direct", text="Direct")
 col.prop(view_layer, "use_pass_glossy_indirect", text="Indirect")
 col.prop(view_layer, "use_pass_glossy_color", text="Color")
 
-col = layout.column(heading = "Transmission", align = True)
+col = layout.column(heading="Transmission", align=True)
 col.prop(view_layer, "use_pass_transmission_direct", text="Direct")
 col.prop(view_layer, "use_pass_transmission_indirect", text="Indirect")
 col.prop(view_layer, "use_pass_transmission_color", 

[Bf-blender-cvs] [3679a1f6018] modifier-panels-ui: Cleanup: use sections for object_edit.c

2020-04-16 Thread Campbell Barton
Commit: 3679a1f601837310fe44bc82b427053a6af87978
Author: Campbell Barton
Date:   Thu Apr 16 10:58:09 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rB3679a1f601837310fe44bc82b427053a6af87978

Cleanup: use sections for object_edit.c

===

M   source/blender/editors/object/object_edit.c

===

diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 871886da4eb..cb04c459e55 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -122,6 +122,10 @@ static void move_to_collection_menus_items(struct uiLayout 
*layout,
struct MoveToCollectionData *menu);
 static ListBase selected_objects_get(bContext *C);
 
+/*  */
+/** \name Internal Utilities
+ * \{ */
+
 Object *ED_object_context(bContext *C)
 {
   return CTX_data_pointer_get_type(C, "object", _Object).data;
@@ -141,7 +145,11 @@ Object *ED_object_active_context(bContext *C)
   return ob;
 }
 
-/* ** object hiding *** */
+/** \} */
+
+/*  */
+/** \name Hide Operator
+ * \{ */
 
 static bool object_hide_poll(bContext *C)
 {
@@ -395,7 +403,11 @@ void OBJECT_OT_hide_collection(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
 }
 
-/* *** toggle editmode operator  * */
+/** \} */
+
+/*  */
+/** \name Toggle Edit-Mode Operator
+ * \{ */
 
 static bool mesh_needs_keyindex(Main *bmain, const Mesh *me)
 {
@@ -776,7 +788,11 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* *** */
+/** \} */
+
+/*  */
+/** \name Toggle Pose-Mode Operator
+ * \{ */
 
 static int posemode_exec(bContext *C, wmOperator *op)
 {
@@ -860,7 +876,11 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* *** force field toggle operator * */
+/** \} */
+
+/*  */
+/** \name Force Field Toggle Operator
+ * \{ */
 
 void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object)
 {
@@ -923,8 +943,11 @@ void OBJECT_OT_forcefield_toggle(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* ** */
-/* Motion Paths */
+/** \} */
+
+/*  */
+/** \name Calculate Motion Paths Operator
+ * \{ */
 
 static eAnimvizCalcRange object_path_convert_range(eObjectPathCalcRange range)
 {
@@ -1018,7 +1041,7 @@ static int object_calculate_paths_invoke(bContext *C, 
wmOperator *op, const wmEv
   }
 
   /* show popup dialog to allow editing of range... */
-  /* FIXME: hardcoded dimensions here are just arbitrary */
+  /* FIXME: hard-coded dimensions here are just arbitrary. */
   return WM_operator_props_dialog_popup(C, op, 200);
 }
 
@@ -1087,7 +1110,11 @@ void OBJECT_OT_paths_calculate(wmOperatorType *ot)
   MAXFRAME / 2.0);
 }
 
-/* - */
+/** \} */
+
+/*  */
+/** \name Update Motion Paths Operator
+ * \{ */
 
 static bool object_update_paths_poll(bContext *C)
 {
@@ -1131,7 +1158,11 @@ void OBJECT_OT_paths_update(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* - */
+/** \} */
+
+/*  */
+/** \name Clear Motion Paths Operator
+ * \{ */
 
 /* Helper for ED_objects_clear_paths() */
 static void object_clear_mpath(Object *ob)
@@ -1150,14 +1181,14 @@ static void object_clear_mpath(Object *ob)
 void ED_objects_clear_paths(bContext *C, bool only_selected)
 {
   if (only_selected) {
-/* loop over all selected + sedtiable objects in scene */
+/* Loop over all selected + editable objects in scene. */
 CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
   object_clear_mpath(ob);
 }
 CTX_DATA_END;
   }
   else {
-/* loop over all edtiable objects in scene */
+/* Loop over all editable objects in scene. */
 CTX_DATA_BEGIN (C, Object *, ob, editable_objects) {
   object_clear_mpath(ob);
 }
@@ -1209,13 +1240,17 @@ void OBJECT_OT_paths_clear(wmOperatorType *ot)
   RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
 }
 
-/* - */
+/** \} */
+
+/*  */
+/** \name Update Motion 

[Bf-blender-cvs] [202bdf1e99d] modifier-panels-ui: Operator: Add 'dissolve_and_intersect' option for 'Extrude and Move on Normals'

2020-04-16 Thread Germano Cavalcante
Commit: 202bdf1e99d6938f755619fb644e4541dbc32171
Author: Germano Cavalcante
Date:   Wed Apr 15 16:02:16 2020 -0300
Branches: modifier-panels-ui
https://developer.blender.org/rB202bdf1e99d6938f755619fb644e4541dbc32171

Operator: Add 'dissolve_and_intersect' option for 'Extrude and Move on Normals'

This allows easy choice of operators when editing keymaps

===

M   release/scripts/startup/bl_operators/view3d.py

===

diff --git a/release/scripts/startup/bl_operators/view3d.py 
b/release/scripts/startup/bl_operators/view3d.py
index fcabee94a89..4a6791f1627 100644
--- a/release/scripts/startup/bl_operators/view3d.py
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -72,13 +72,19 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
 bl_label = "Extrude and Move on Normals"
 bl_idname = "view3d.edit_mesh_extrude_move_normal"
 
+dissolve_and_intersect: BoolProperty(
+name="dissolve_and_intersect",
+default=False,
+description="Dissolves adjacent faces and intersects new geometry"
+)
+
 @classmethod
 def poll(cls, context):
 obj = context.active_object
 return (obj is not None and obj.mode == 'EDIT')
 
 @staticmethod
-def extrude_region(context, use_vert_normals):
+def extrude_region(context, use_vert_normals, dissolve_and_intersect):
 mesh = context.object.data
 
 totface = mesh.total_face_sel
@@ -91,6 +97,17 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
 'INVOKE_REGION_WIN',
 TRANSFORM_OT_shrink_fatten={},
 )
+elif dissolve_and_intersect:
+bpy.ops.mesh.extrude_region_dissolve_move_intersect(
+'INVOKE_REGION_WIN',
+MESH_OT_extrude_region={
+"use_dissolve_ortho_edges": True,
+},
+TRANSFORM_OT_translate={
+"orient_type": 'NORMAL',
+"constraint_axis": (False, False, True),
+},
+)
 else:
 bpy.ops.mesh.extrude_region_move(
 'INVOKE_REGION_WIN',
@@ -119,7 +136,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
 return {'FINISHED'}
 
 def execute(self, context):
-return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, False)
+return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, False, 
self.dissolve_and_intersect)
 
 def invoke(self, context, _event):
 return self.execute(context)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [57cbedf602b] modifier-panels-ui: Cleanup: Remove unused operator

2020-04-16 Thread Germano Cavalcante
Commit: 57cbedf602bb6f9fc25077acbcad13c2575cfef9
Author: Germano Cavalcante
Date:   Wed Apr 15 15:52:26 2020 -0300
Branches: modifier-panels-ui
https://developer.blender.org/rB57cbedf602bb6f9fc25077acbcad13c2575cfef9

Cleanup: Remove unused operator

===

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

===

diff --git a/release/scripts/startup/bl_operators/view3d.py 
b/release/scripts/startup/bl_operators/view3d.py
index 7fab1c8ce14..fcabee94a89 100644
--- a/release/scripts/startup/bl_operators/view3d.py
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -125,68 +125,6 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
 return self.execute(context)
 
 
-class VIEW3D_OT_edit_mesh_extrude_dissolve_and_intersect(Operator):
-"""Extrude region together along the average normal"""
-bl_label = "Extrude, Dissolve, Move and Intersect"
-bl_idname = "view3d.edit_mesh_extrude_dissolve_and_intersect"
-
-@classmethod
-def poll(cls, context):
-obj = context.active_object
-return (obj is not None and obj.mode == 'EDIT')
-
-@staticmethod
-def extrude_region(context, use_vert_normals):
-mesh = context.object.data
-
-totface = mesh.total_face_sel
-totedge = mesh.total_edge_sel
-# totvert = mesh.total_vert_sel
-
-if totface >= 1:
-if use_vert_normals:
-bpy.ops.mesh.extrude_region_shrink_fatten(
-'INVOKE_REGION_WIN',
-TRANSFORM_OT_shrink_fatten={},
-)
-else:
-bpy.ops.mesh.extrude_region_dissolve_move_intersect(
-'INVOKE_REGION_WIN',
-MESH_OT_extrude_region_move={
-"use_dissolve_ortho_edges": True,
-},
-TRANSFORM_OT_translate={
-"orient_type": 'NORMAL',
-"constraint_axis": (False, False, True),
-"use_automerge_and_split": True,
-},
-)
-
-elif totedge == 1:
-bpy.ops.mesh.extrude_region_move(
-'INVOKE_REGION_WIN',
-TRANSFORM_OT_translate={
-# Don't set the constraint axis since users will expect MMB
-# to use the user setting, see: T61637
-# "orient_type": 'NORMAL',
-# Not a popular choice, too restrictive for retopo.
-# "constraint_axis": (True, True, False)})
-"constraint_axis": (False, False, False),
-})
-else:
-bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
-
-# ignore return from operators above because they are 'RUNNING_MODAL',
-# and cause this one not to be freed. [#24671]
-return {'FINISHED'}
-
-def execute(self, context):
-return 
VIEW3D_OT_edit_mesh_extrude_dissolve_and_intersect.extrude_region(context, 
False)
-
-def invoke(self, context, _event):
-return self.execute(context)
-
-
 class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
 """Extrude region together along local normals"""
 bl_label = "Extrude and Move on Individual Normals"
@@ -252,7 +190,6 @@ class VIEW3D_OT_transform_gizmo_set(Operator):
 classes = (
 VIEW3D_OT_edit_mesh_extrude_individual_move,
 VIEW3D_OT_edit_mesh_extrude_move,
-VIEW3D_OT_edit_mesh_extrude_dissolve_and_intersect,
 VIEW3D_OT_edit_mesh_extrude_shrink_fatten,
 VIEW3D_OT_transform_gizmo_set,
 )
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index d89705f55bc..8638f1a2a27 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -681,7 +681,6 @@ class _defs_edit_mesh:
 ),
 icon="none",
 widget="VIEW3D_GGT_tool_generic_handle_normal",
-operator="view3d.edit_mesh_extrude_dissolve_and_intersect",
 keymap=(),
 )

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7a9aa8ad27f] modifier-panels-ui: Mantaflow: Change Defaults to Improve Instantaneous Playback

2020-04-16 Thread Aaron Carlisle
Commit: 7a9aa8ad27f131be0b42485fb4a6a547fd66
Author: Aaron Carlisle
Date:   Wed Apr 15 13:54:08 2020 -0400
Branches: modifier-panels-ui
https://developer.blender.org/rB7a9aa8ad27f131be0b42485fb4a6a547fd66

Mantaflow: Change Defaults to Improve Instantaneous Playback

- Change the default cache method to replay
- Change the default resolution to 32 (The same as old smoke)
  which have a speedup of about 4x (~4 FPS vs. ~16 FPS on initial 
playback)

Peformance was tested with 3700x and RTX 2070

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

Fixes T73799

===

M   source/blender/blenkernel/intern/fluid.c

===

diff --git a/source/blender/blenkernel/intern/fluid.c 
b/source/blender/blenkernel/intern/fluid.c
index c4dd674790b..578a6a13bb7 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4804,7 +4804,7 @@ void BKE_fluid_modifier_create_type_data(struct 
FluidModifierData *mmd)
 mmd->domain->adapt_threshold = 0.02f;
 
 /* fluid domain options */
-mmd->domain->maxres = 64;
+mmd->domain->maxres = 32;
 mmd->domain->solver_res = 3;
 mmd->domain->border_collisions = 0;  // open domain
 mmd->domain->flags = FLUID_DOMAIN_USE_DISSOLVE_LOG | 
FLUID_DOMAIN_USE_ADAPTIVE_TIME;
@@ -4906,7 +4906,7 @@ void BKE_fluid_modifier_create_type_data(struct 
FluidModifierData *mmd)
 mmd->domain->cache_frame_pause_particles = 0;
 mmd->domain->cache_frame_pause_guide = 0;
 mmd->domain->cache_flag = 0;
-mmd->domain->cache_type = FLUID_DOMAIN_CACHE_MODULAR;
+mmd->domain->cache_type = FLUID_DOMAIN_CACHE_REPLAY;
 mmd->domain->cache_mesh_format = FLUID_DOMAIN_FILE_BIN_OBJECT;
 #ifdef WITH_OPENVDB
 mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_OPENVDB;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [25f854552ef] modifier-panels-ui: UI: disable shade flat/smooth in sculpt mode

2020-04-16 Thread Campbell Barton
Commit: 25f854552efed68d11015d4ec1ce15ffebd87bd6
Author: Campbell Barton
Date:   Thu Apr 16 12:06:50 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rB25f854552efed68d11015d4ec1ce15ffebd87bd6

UI: disable shade flat/smooth in sculpt mode

===

M   source/blender/editors/object/object_edit.c

===

diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 6833143dec0..d944d4c4dd3 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1364,7 +1364,15 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
 
 static bool shade_poll(bContext *C)
 {
-  return (CTX_data_edit_object(C) == NULL);
+  ViewLayer *view_layer = CTX_data_view_layer(C);
+  Object *obact = OBACT(view_layer);
+  if (obact != NULL) {
+/* Doesn't handle edit-data, sculpt dynamic-topology, or their undo 
systems. */
+if (obact->mode & (OB_MODE_EDIT | OB_MODE_SCULPT)) {
+  return false;
+}
+  }
+  return true;
 }
 
 void OBJECT_OT_shade_flat(wmOperatorType *ot)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [02caa87e529] modifier-panels-ui: GPUViewport: Use GPUBatch for viewport drawing

2020-04-16 Thread Jeroen Bakker
Commit: 02caa87e529f05186c1f3248f99b0e78b8588d2c
Author: Jeroen Bakker
Date:   Thu Apr 16 08:40:22 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB02caa87e529f05186c1f3248f99b0e78b8588d2c

GPUViewport: Use GPUBatch for viewport drawing

When drawing the viewport to the screen the draw calls were not batched.
This resulted in measurable slowdown on Windows Intel 10th gen
platforms.

This patch would cache the last draw calls per viewport. Our API does
support partial redrawing of the viewport, but that isn't used anywhere.

This patch does not include stereoscopy rendering. This still uses the
imm approach and would still be slow on certain hardware.

Reviewed By: Clément Foucault

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

===

M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/gpu/intern/gpu_viewport.c 
b/source/blender/gpu/intern/gpu_viewport.c
index 704d1c3155e..ad74ce02731 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -65,6 +65,24 @@ typedef struct ViewportTempTexture {
   GPUTexture *texture;
 } ViewportTempTexture;
 
+/* Struct storing a viewport specific GPUBatch.
+ * The end-goal is to have a single batch shared across viewport and use a 
model matrix to place
+ * the batch. Due to OCIO and Image/UV editor we are not able to use an model 
matrix yet. */
+struct GPUViewportBatch {
+  GPUBatch *batch;
+  struct {
+rctf rect_pos;
+rctf rect_uv;
+  } last_used_parameters;
+} GPUViewportBatch;
+
+static struct {
+  GPUVertFormat format;
+  struct {
+uint pos, tex_coord;
+  } attr_id;
+} g_viewport = {{0}};
+
 struct GPUViewport {
   int size[2];
   int flag;
@@ -98,6 +116,7 @@ struct GPUViewport {
   /* TODO(fclem) the uvimage display use the viewport but do not set any view 
transform for the
* moment. The end goal would be to let the GPUViewport do the color 
management. */
   bool do_color_management;
+  struct GPUViewportBatch batch;
 };
 
 enum {
@@ -661,6 +680,76 @@ void GPU_viewport_stereo_composite(GPUViewport *viewport, 
Stereo3dFormat *stereo
 
   GPU_framebuffer_restore();
 }
+/*  */
+/** \name Viewport Batches
+ * \{ */
+
+static GPUVertFormat *gpu_viewport_batch_format(void)
+{
+  if (g_viewport.format.attr_len == 0) {
+GPUVertFormat *format = _viewport.format;
+g_viewport.attr_id.pos = GPU_vertformat_attr_add(
+format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+g_viewport.attr_id.tex_coord = GPU_vertformat_attr_add(
+format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+  }
+  return _viewport.format;
+}
+
+static GPUBatch *gpu_viewport_batch_create(const rctf *rect_pos, const rctf 
*rect_uv)
+{
+  GPUVertBuf *vbo = 
GPU_vertbuf_create_with_format(gpu_viewport_batch_format());
+  const uint vbo_len = 4;
+  GPU_vertbuf_data_alloc(vbo, vbo_len);
+
+  GPUVertBufRaw pos_step, tex_coord_step;
+  GPU_vertbuf_attr_get_raw_data(vbo, g_viewport.attr_id.pos, _step);
+  GPU_vertbuf_attr_get_raw_data(vbo, g_viewport.attr_id.tex_coord, 
_coord_step);
+
+  copy_v2_fl2(GPU_vertbuf_raw_step(_step), rect_pos->xmin, rect_pos->ymin);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_coord_step), rect_uv->xmin, 
rect_uv->ymin);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_step), rect_pos->xmax, rect_pos->ymin);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_coord_step), rect_uv->xmax, 
rect_uv->ymin);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_step), rect_pos->xmin, rect_pos->ymax);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_coord_step), rect_uv->xmin, 
rect_uv->ymax);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_step), rect_pos->xmax, rect_pos->ymax);
+  copy_v2_fl2(GPU_vertbuf_raw_step(_coord_step), rect_uv->xmax, 
rect_uv->ymax);
+
+  return GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, 
GPU_BATCH_OWNS_VBO);
+}
+
+static GPUBatch *gpu_viewport_batch_get(GPUViewport *viewport,
+const rctf *rect_pos,
+const rctf *rect_uv)
+{
+  const float compare_limit = 0.0001f;
+  const bool parameters_changed =
+  (!BLI_rctf_compare(
+   >batch.last_used_parameters.rect_pos, rect_pos, 
compare_limit) ||
+   !BLI_rctf_compare(>batch.last_used_parameters.rect_uv, 
rect_uv, compare_limit));
+
+  if (viewport->batch.batch && parameters_changed) {
+GPU_batch_discard(viewport->batch.batch);
+viewport->batch.batch = NULL;
+  }
+
+  if (!viewport->batch.batch) {
+viewport->batch.batch = gpu_viewport_batch_create(rect_pos, rect_uv);
+viewport->batch.last_used_parameters.rect_pos = *rect_pos;
+viewport->batch.last_used_parameters.rect_uv = *rect_uv;
+  }
+  return viewport->batch.batch;
+}
+
+static void gpu_viewport_batch_free(GPUViewport *viewport)
+{
+  if (viewport->batch.batch) {
+

[Bf-blender-cvs] [b39e9bfca0c] modifier-panels-ui: Fix T75443 Color Management: Use after free crash when using curve mapping

2020-04-16 Thread Clément Foucault
Commit: b39e9bfca0c23f5bbf50a711eb993716a79b0c60
Author: Clément Foucault
Date:   Wed Apr 15 22:26:20 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBb39e9bfca0c23f5bbf50a711eb993716a79b0c60

Fix T75443 Color Management: Use after free crash when using curve mapping

The root cause is that viewport can draw cached version of themself but
the scene can have been updated and the pointed curvemapping could have
been freed.

To workaround this we just keep a copy of the curvemap at the viewport
level.

===

M   source/blender/blenkernel/intern/colortools.c
M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/blenkernel/intern/colortools.c 
b/source/blender/blenkernel/intern/colortools.c
index 315035c1bc2..f82b8b6675c 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1805,6 +1805,7 @@ void 
BKE_color_managed_view_settings_free(ColorManagedViewSettings *settings)
 {
   if (settings->curve_mapping) {
 BKE_curvemapping_free(settings->curve_mapping);
+settings->curve_mapping = NULL;
   }
 }
 
diff --git a/source/blender/gpu/intern/gpu_viewport.c 
b/source/blender/gpu/intern/gpu_viewport.c
index b2e1cb17946..704d1c3155e 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -93,6 +93,7 @@ struct GPUViewport {
   /* Color management. */
   ColorManagedViewSettings view_settings;
   ColorManagedDisplaySettings display_settings;
+  CurveMapping *orig_curve_mapping;
   float dither;
   /* TODO(fclem) the uvimage display use the viewport but do not set any view 
transform for the
* moment. The end goal would be to let the GPUViewport do the color 
management. */
@@ -552,8 +553,43 @@ void GPU_viewport_colorspace_set(GPUViewport *viewport,
  ColorManagedDisplaySettings *display_settings,
  float dither)
 {
-  memcpy(>view_settings, view_settings, sizeof(*view_settings));
-  memcpy(>display_settings, display_settings, 
sizeof(*display_settings));
+  /**
+   * HACK(fclem): We copy the settings here to avoid use after free if an 
update frees the scene
+   * and the viewport stays cached (see T75443). But this means the OCIO 
curvemapping caching
+   * (which is based on CurveMap pointer address) cannot operate correctly and 
it will create
+   * a different OCIO processor for each viewport. We try to only realloc the 
curvemap copy if
+   * needed to avoid uneeded cache invalidation.
+   */
+  if (view_settings->curve_mapping) {
+if (viewport->view_settings.curve_mapping) {
+  if (view_settings->curve_mapping->changed_timestamp !=
+  viewport->view_settings.curve_mapping->changed_timestamp) {
+BKE_color_managed_view_settings_free(>view_settings);
+  }
+}
+  }
+
+  if (viewport->orig_curve_mapping != view_settings->curve_mapping) {
+viewport->orig_curve_mapping = view_settings->curve_mapping;
+BKE_color_managed_view_settings_free(>view_settings);
+  }
+  /* Don't copy the curve mapping already. */
+  CurveMapping *tmp_curve_mapping = view_settings->curve_mapping;
+  CurveMapping *tmp_curve_mapping_vp = viewport->view_settings.curve_mapping;
+  view_settings->curve_mapping = NULL;
+  viewport->view_settings.curve_mapping = NULL;
+
+  BKE_color_managed_view_settings_copy(>view_settings, 
view_settings);
+  /* Restore. */
+  view_settings->curve_mapping = tmp_curve_mapping;
+  viewport->view_settings.curve_mapping = tmp_curve_mapping_vp;
+  /* Only copy curvemapping if needed. Avoid uneeded OCIO cache miss. */
+  if (tmp_curve_mapping && viewport->view_settings.curve_mapping == NULL) {
+BKE_color_managed_view_settings_free(>view_settings);
+viewport->view_settings.curve_mapping = 
BKE_curvemapping_copy(tmp_curve_mapping);
+  }
+
+  BKE_color_managed_display_settings_copy(>display_settings, 
display_settings);
   viewport->dither = dither;
   viewport->do_color_management = true;
 }
@@ -923,5 +959,7 @@ void GPU_viewport_free(GPUViewport *viewport)
   DRW_instance_data_list_free(viewport->idatalist);
   MEM_freeN(viewport->idatalist);
 
+  BKE_color_managed_view_settings_free(>view_settings);
+
   MEM_freeN(viewport);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c3929039422] modifier-panels-ui: Object: only apply smooth/flat to the active object in paint modes

2020-04-16 Thread Campbell Barton
Commit: c39290394225be494d00daf829f4e4a6482f9bd2
Author: Campbell Barton
Date:   Thu Apr 16 11:43:19 2020 +1000
Branches: modifier-panels-ui
https://developer.blender.org/rBc39290394225be494d00daf829f4e4a6482f9bd2

Object: only apply smooth/flat to the active object in paint modes

Also some minor improvements:

- Only run once per object data instance.
- Correction for mesh smooth flag being used on curves.
- Move curve operation into utility function.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/blenkernel/BKE_curve.h
M   source/blender/blenkernel/intern/curve.c
M   source/blender/editors/object/object_edit.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index fe9b265a727..b3cf06b77b3 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5300,6 +5300,7 @@ class VIEW3D_MT_sculpt_mask_edit_pie(Menu):
 op.auto_iteration_count = False
 
 class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
+
 bl_label = "Face Sets Edit"
 
 def draw(self, _context):
diff --git a/source/blender/blenkernel/BKE_curve.h 
b/source/blender/blenkernel/BKE_curve.h
index 164867b228b..adc94a833c3 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -111,6 +111,8 @@ void BKE_curve_material_index_clear(struct Curve *cu);
 bool BKE_curve_material_index_validate(struct Curve *cu);
 void BKE_curve_material_remap(struct Curve *cu, const unsigned int *remap, 
unsigned int remap_len);
 
+void BKE_curve_smooth_flag_set(struct Curve *cu, bool set);
+
 ListBase *BKE_curve_nurbs_get(struct Curve *cu);
 
 int BKE_curve_nurb_vert_index_get(const struct Nurb *nu, const void *vert);
diff --git a/source/blender/blenkernel/intern/curve.c 
b/source/blender/blenkernel/intern/curve.c
index b4a8625c0bb..76dec63903b 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -5506,6 +5506,20 @@ void BKE_curve_material_remap(Curve *cu, const unsigned 
int *remap, unsigned int
 #undef MAT_NR_REMAP
 }
 
+void BKE_curve_smooth_flag_set(Curve *cu, const bool use_smooth)
+{
+  if (use_smooth) {
+for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) {
+  nu->flag |= CU_SMOOTH;
+}
+  }
+  else {
+for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) {
+  nu->flag &= ~CU_SMOOTH;
+}
+  }
+}
+
 void BKE_curve_rect_from_textbox(const struct Curve *cu,
  const struct TextBox *tb,
  struct rctf *r_rect)
diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index cb04c459e55..6833143dec0 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1288,54 +1288,78 @@ void OBJECT_OT_paths_range_update(wmOperatorType *ot)
 
 static int shade_smooth_exec(bContext *C, wmOperator *op)
 {
-  ID *data;
-  Curve *cu;
-  Nurb *nu;
-  int clear = (STREQ(op->idname, "OBJECT_OT_shade_flat"));
-  bool done = false, linked_data = false;
+  const bool use_smooth = STREQ(op->idname, "OBJECT_OT_shade_smooth");
+  bool changed_multi = false;
+  bool has_linked_data = false;
 
-  CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
-data = ob->data;
+  ListBase ctx_objects = {NULL, NULL};
+  CollectionPointerLink ctx_ob_single_active = {NULL};
+
+  /* For modes that only use an active object, don't handle the whole 
selection. */
+  {
+ViewLayer *view_layer = CTX_data_view_layer(C);
+Object *obact = OBACT(view_layer);
+if (obact && ((obact->mode & OB_MODE_ALL_PAINT))) {
+  ctx_ob_single_active.ptr.data = obact;
+  BLI_addtail(_objects, _ob_single_active);
+}
+  }
+
+  if (ctx_objects.first != _ob_single_active) {
+CTX_data_selected_editable_objects(C, _objects);
+  }
+
+  for (CollectionPointerLink *ctx_ob = ctx_objects.first; ctx_ob; ctx_ob = 
ctx_ob->next) {
+Object *ob = ctx_ob->ptr.data;
+ID *data = ob->data;
+if (data != NULL) {
+  data->tag |= LIB_TAG_DOIT;
+}
+  }
+
+  for (CollectionPointerLink *ctx_ob = ctx_objects.first; ctx_ob; ctx_ob = 
ctx_ob->next) {
+/* Always un-tag all object data-blocks irrespective of our ability to 
operate on them. */
+Object *ob = ctx_ob->ptr.data;
+ID *data = ob->data;
+if ((data == NULL) || ((data->tag & LIB_TAG_DOIT) == 0)) {
+  continue;
+}
+data->tag &= ~LIB_TAG_DOIT;
+/* Finished un-tagging, continue with regular logic. */
 
 if (data && ID_IS_LINKED(data)) {
-  linked_data = true;
+  has_linked_data = true;
   continue;
 }
 
+bool changed = false;
 if (ob->type == OB_MESH) {
-  BKE_mesh_smooth_flag_set(ob->data, !clear);
-
+  

[Bf-blender-cvs] [c3475ebe613] modifier-panels-ui: Use column header for Armature Viewport Display panel.

2020-04-16 Thread William Reynish
Commit: c3475ebe613fc5eb0f85ef0722e2c55f93207427
Author: William Reynish
Date:   Mon Apr 13 15:04:56 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBc3475ebe613fc5eb0f85ef0722e2c55f93207427

Use column header for Armature Viewport Display panel.

===

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

===

diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py 
b/release/scripts/startup/bl_ui/properties_data_armature.py
index d44af702d46..1376920b953 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -84,17 +84,12 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
 
 layout.prop(arm, "display_type", text="Display As")
 
-flow = layout.grid_flow(row_major=False, columns=0, 
even_columns=False, even_rows=False, align=True)
-col = flow.column()
+col = layout.column(heading = "Show")
 col.prop(arm, "show_names", text="Names")
-col = flow.column()
 col.prop(arm, "show_axes", text="Axes")
-col = flow.column()
 col.prop(arm, "show_bone_custom_shapes", text="Shapes")
-col = flow.column()
 col.prop(arm, "show_group_colors", text="Group Colors")
 if ob:
-col = flow.column()
 col.prop(ob, "show_in_front", text="In Front")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b05dadea6b5] modifier-panels-ui: Fix T75751 Overlay: Clipping Region crashes Blender

2020-04-16 Thread Clément Foucault
Commit: b05dadea6b56f6bc4582e0135a9b4b4c9433f042
Author: Clément Foucault
Date:   Wed Apr 15 22:30:22 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBb05dadea6b56f6bc4582e0135a9b4b4c9433f042

Fix T75751 Overlay: Clipping Region crashes Blender

===

M   source/blender/draw/engines/overlay/overlay_shader.c

===

diff --git a/source/blender/draw/engines/overlay/overlay_shader.c 
b/source/blender/draw/engines/overlay/overlay_shader.c
index 2bb3555b8d1..607981cb0d0 100644
--- a/source/blender/draw/engines/overlay/overlay_shader.c
+++ b/source/blender/draw/engines/overlay/overlay_shader.c
@@ -233,10 +233,12 @@ GPUShader *OVERLAY_shader_background(void)
 GPUShader *OVERLAY_shader_clipbound(void)
 {
   OVERLAY_Shaders *sh_data = _data.sh_data[0];
+  const GPUShaderConfigData *sh_cfg = _shader_cfg_data[0];
   if (!sh_data->clipbound) {
 sh_data->clipbound = GPU_shader_create_from_arrays({
 .vert = (const char *[]){datatoc_common_view_lib_glsl, 
datatoc_clipbound_vert_glsl, NULL},
 .frag = (const char *[]){datatoc_gpu_shader_uniform_color_frag_glsl, 
NULL},
+.defs = (const char *[]){sh_cfg->def, NULL},
 });
   }
   return sh_data->clipbound;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d1917237562] modifier-panels-ui: Change padding around checkboxes

2020-04-16 Thread Julian Eisel
Commit: d1917237562f2964d2da22e3716dc2219fd17b8c
Author: Julian Eisel
Date:   Mon Apr 13 00:02:39 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBd1917237562f2964d2da22e3716dc2219fd17b8c

Change padding around checkboxes

Two changes:
* Reduce padding between checkbox and text. That makes it clearer what
  the checkbox belongs to if there's also a column heading in front of
  the checkbox.
* Don't add padding on the left side of checkboxes. That makes them line
  up better with items above and below it.

===

M   source/blender/editors/interface/interface_layout.c
M   source/blender/editors/interface/interface_widgets.c

===

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 95431531ed6..dec925a7eb4 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1784,6 +1784,7 @@ static void ui_item_rna_size(uiLayout *layout,
   PropertyType type;
   PropertySubType subtype;
   int len, w = 0, h;
+  bool is_checkbox_only = false;
 
   /* arbitrary extended width by type */
   type = RNA_property_type(prop);
@@ -1795,6 +1796,10 @@ static void ui_item_rna_size(uiLayout *layout,
   name = "non-empty text";
 }
 else if (type == PROP_BOOLEAN) {
+  if (icon == ICON_NONE) {
+/* Exception for checkboxes, they need a little less space to align 
nicely. */
+is_checkbox_only = true;
+  }
   icon = ICON_DOT;
 }
 else if (type == PROP_ENUM) {
@@ -1854,6 +1859,9 @@ static void ui_item_rna_size(uiLayout *layout,
 if (type == PROP_BOOLEAN && name[0]) {
   w += UI_UNIT_X / 5;
 }
+else if (is_checkbox_only) {
+  w -= UI_UNIT_X / 4;
+}
 else if (type == PROP_ENUM && !icon_only) {
   w += UI_UNIT_X / 4;
 }
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index ae40b01c77d..fedf552632b 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4121,10 +4121,10 @@ static void widget_optionbut(uiWidgetColors *wcol,
 
   /* smaller */
   delta = 1 + BLI_rcti_size_y() / 8;
-  recttemp.xmin += delta;
-  recttemp.ymin += delta;
-  recttemp.xmax -= delta;
-  recttemp.ymax -= delta;
+  BLI_rcti_resize(
+  , BLI_rcti_size_x() - delta, 
BLI_rcti_size_y() - delta);
+  /* Keep one edge in place. */
+  BLI_rcti_translate(, text_before_widget ? delta : -delta, 0);
 
   rad = wcol->roundness * BLI_rcti_size_y();
   round_box_edges(, UI_CNR_ALL, , rad);
@@ -4136,8 +4136,8 @@ static void widget_optionbut(uiWidgetColors *wcol,
 
   widgetbase_draw(, wcol);
 
-  /* text space */
-  const float offset = BLI_rcti_size_y(rect) * 0.7 + delta;
+  /* Text space - factor is really just eyeballed. */
+  const float offset = BLI_rcti_size_y(rect) * 0.31f + delta;
   if (text_before_widget) {
 rect->xmax -= offset;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [17db2e69e9b] modifier-panels-ui: Draw node socket icons in properties using real node socket shape/color

2020-04-16 Thread Julian Eisel
Commit: 17db2e69e9b506924993107a6c94818bc76d4b5e
Author: Julian Eisel
Date:   Mon Apr 13 15:03:56 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB17db2e69e9b506924993107a6c94818bc76d4b5e

Draw node socket icons in properties using real node socket shape/color

===

M   source/blender/editors/include/ED_node.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/space_node/node_buttons.c
M   source/blender/editors/space_node/node_draw.c
M   source/blender/editors/space_node/node_intern.h
M   source/blender/editors/space_node/node_templates.c
M   source/blender/makesrna/intern/rna_ui_api.c

===

diff --git a/source/blender/editors/include/ED_node.h 
b/source/blender/editors/include/ED_node.h
index 7a1f64b61d4..b5fcddf9c16 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -37,6 +37,7 @@ struct Tex;
 struct View2D;
 struct bContext;
 struct bNode;
+struct bNodeSocket;
 struct bNodeSocketType;
 struct bNodeTree;
 struct bNodeTree;
@@ -79,6 +80,7 @@ void ED_node_draw_snap(
 struct View2D *v2d, const float cent[2], float size, NodeBorder border, 
unsigned int pos);
 
 /* node_draw.c */
+void ED_node_socket_draw(struct bNodeSocket *sock, const struct rcti *rect, 
const float color[4]);
 void ED_node_tree_update(const struct bContext *C);
 void ED_node_tag_update_id(struct ID *id);
 void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, 
struct bNode *node);
diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index b72cd462b23..866f2657ce4 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1588,6 +1588,8 @@ int UI_searchbox_size_x(void);
 /* check if a string is in an existing search box */
 int UI_search_items_find_index(uiSearchItems *items, const char *name);
 
+void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float 
draw_color[4]);
+
 void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void 
*arg);
 void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void 
*arg);
 void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void 
*arg2);
@@ -2109,6 +2111,7 @@ void uiTemplateList(uiLayout *layout,
 bool sort_reverse,
 bool sort_lock);
 void uiTemplateNodeLink(uiLayout *layout,
+struct bContext *C,
 struct bNodeTree *ntree,
 struct bNode *node,
 struct bNodeSocket *input);
diff --git a/source/blender/editors/interface/interface.c 
b/source/blender/editors/interface/interface.c
index 069c3e44d96..a47c869c21f 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -6503,6 +6503,13 @@ uiBut *uiDefSearchButO_ptr(uiBlock *block,
   return but;
 }
 
+void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float 
draw_color[4])
+{
+  but->flag |= UI_BUT_NODE_LINK;
+  but->custom_data = socket;
+  rgba_float_to_uchar(but->col, draw_color);
+}
+
 /**
  * push a new event onto event queue to activate the given button
  * (usually a text-field) upon entering a popup
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 5ea9c5b5406..1480535ee36 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -42,6 +42,8 @@
 
 #include "BLF_api.h"
 
+#include "ED_node.h"
+
 #include "UI_interface.h"
 #include "UI_interface_icons.h"
 
@@ -2394,6 +2396,28 @@ static void widget_draw_extra_icons(const uiWidgetColors 
*wcol,
   }
 }
 
+static void widget_draw_node_link_socket(const uiWidgetColors *wcol,
+ const rcti *rect,
+ uiBut *but,
+ float alpha)
+{
+  if (but->custom_data) {
+float col[4];
+rgba_uchar_to_float(col, but->col);
+col[3] *= alpha;
+
+GPU_blend(true);
+UI_widgetbase_draw_cache_flush();
+GPU_blend(false);
+
+/* See UI_but_node_link_set() */
+ED_node_socket_draw(but->custom_data, rect, col);
+  }
+  else {
+widget_draw_icon(but, ICON_LAYER_USED, alpha, rect, wcol->text);
+  }
+}
+
 /* draws text and icons for buttons */
 static void widget_draw_text_icon(const uiFontStyle *fstyle,
   const uiWidgetColors *wcol,
@@ -2410,7 +2434,7 @@ static void widget_draw_text_icon(const uiFontStyle 
*fstyle,
   if (ELEM(but->type, 

[Bf-blender-cvs] [9ced07fa76f] modifier-panels-ui: Use row headings and correct alignment for more Symmetry panels

2020-04-16 Thread William Reynish
Commit: 9ced07fa76f8dccec42df1f5c4226d77c7281fc8
Author: William Reynish
Date:   Mon Apr 13 15:40:27 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB9ced07fa76f8dccec42df1f5c4226d77c7281fc8

Use row headings and correct alignment for more Symmetry panels

===

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 515b9e72753..115b8263a35 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -125,21 +125,15 @@ class View3DPanel:
 # Used by vertex & weight paint
 def draw_vpaint_symmetry(layout, vpaint):
 
-split = layout.split()
-
-col = split.column()
-col.alignment = 'RIGHT'
-col.label(text="Mirror")
+col = layout.column()
+col.use_property_split = True
+col.use_property_decorate = False
 
-col = split.column()
-row = col.row(align=True)
+row = col.row(heading = "Mirror", align=True)
 row.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
 row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
 row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
 
-col = layout.column()
-col.use_property_split = True
-col.use_property_decorate = False
 col.prop(vpaint, "radial_symmetry", text="Radial")
 
 
@@ -209,16 +203,11 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, 
Panel):
 
 split = layout.split()
 
-col = split.column()
-col.alignment = 'RIGHT'
-col.label(text="Mirror")
-
-col = split.column()
-
-row = col.row(align=True)
-row.prop(mesh, "use_mirror_x", text="X", toggle=True)
-row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
-row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
+row = layout.row(heading = "Mirror")
+sub = row.row(align=True)
+sub.prop(mesh, "use_mirror_x", text="X", toggle=True)
+sub.prop(mesh, "use_mirror_y", text="Y", toggle=True)
+sub.prop(mesh, "use_mirror_z", text="Z", toggle=True)
 
 row = layout.row(align=True)
 row.active = ob.data.use_mirror_x or ob.data.use_mirror_y or 
ob.data.use_mirror_z

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [759da271df0] modifier-panels-ui: Cleanup: PEP8 for python changes

2020-04-16 Thread Julian Eisel
Commit: 759da271df04a11a060f343ddc3ebeb566c6775a
Author: Julian Eisel
Date:   Tue Apr 14 17:26:47 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB759da271df04a11a060f343ddc3ebeb566c6775a

Cleanup: PEP8 for python changes

===

M   release/scripts/startup/bl_ui/properties_data_mesh.py
M   release/scripts/startup/bl_ui/space_text.py

===

diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py 
b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 62716358695..425c94dfdcd 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -192,7 +192,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
 def draw(self, context):
 layout = self.layout
 layout.use_property_split = True
-
+
 mesh = context.mesh
 
 col = layout.column(align=False, heading="Auto Smooth")
diff --git a/release/scripts/startup/bl_ui/space_text.py 
b/release/scripts/startup/bl_ui/space_text.py
index 19c2df39fb2..f6f22ad464f 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -131,7 +131,7 @@ class TEXT_PT_properties(Panel):
 
 if not st.text:
 layout.active = False
-
+
 st = context.space_data
 
 col = layout.column(align=False, heading="Margin")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [00b45c3dcef] modifier-panels-ui: Don't use split layout for operator properties if all are checkboxes

2020-04-16 Thread Julian Eisel
Commit: 00b45c3dcefd06ef6feeffc857edb0e129a4b15a
Author: Julian Eisel
Date:   Tue Apr 14 14:39:35 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB00b45c3dcefd06ef6feeffc857edb0e129a4b15a

Don't use split layout for operator properties if all are checkboxes

Having a split layout looks broken if all items are checkboxes and there
is no heading text, because it only uses half the width then.
So this checks if all visible properties are booleans and if so,
disables the split layout. A bit hacky but this should generally work.
If needed we can add more control in future (e.g. default layout hints
for operators).

===

M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface_templates.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index 866f2657ce4..a907da8e47d 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1803,6 +1803,9 @@ enum {
   UI_TEMPLATE_OP_PROPS_SHOW_EMPTY = 1 << 1,
   UI_TEMPLATE_OP_PROPS_COMPACT = 1 << 2,
   UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED = 1 << 3,
+  /* Disable property split for the default layout (custom ui callbacks still 
have full control
+   * over the layout and can enable it). */
+  UI_TEMPLATE_OP_PROPS_NO_SPLIT_LAYOUT = 1 << 4,
 };
 
 /* used for transp checkers */
@@ -2067,11 +2070,11 @@ void uiTemplateOperatorSearch(uiLayout *layout);
 void UI_but_func_menu_search(uiBut *but);
 void uiTemplateMenuSearch(uiLayout *layout);
 
-eAutoPropButsReturn uiTemplateOperatorPropertyButs(const struct bContext *C,
-   uiLayout *layout,
-   struct wmOperator *op,
-   const eButLabelAlign 
label_align,
-   const short flag);
+void uiTemplateOperatorPropertyButs(const struct bContext *C,
+uiLayout *layout,
+struct wmOperator *op,
+eButLabelAlign label_align,
+short flag);
 void uiTemplateHeader3D_mode(uiLayout *layout, struct bContext *C);
 void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
 void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index d7be80d6000..503dd0b580a 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2161,21 +2161,196 @@ uiLayout *uiTemplateShaderFx(uiLayout *layout, 
bContext *UNUSED(C), PointerRNA *
 /** \} */
 
 /*  */
-/** \name Operator Redo Buttons Template
+/** \name Operator Property Buttons Template
  * \{ */
 
-static void template_operator_redo_property_buts_draw(
-const bContext *C, wmOperator *op, uiLayout *layout, int layout_flags, 
bool *r_has_advanced)
+typedef struct uiTemplateOperatorPropertyPollParam {
+  const bContext *C;
+  wmOperator *op;
+  short flag;
+} uiTemplateOperatorPropertyPollParam;
+
+#ifdef USE_OP_RESET_BUT
+static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C),
+  void *op_pt,
+  void *UNUSED(arg_dummy2))
+{
+  WM_operator_properties_reset((wmOperator *)op_pt);
+}
+#endif
+
+static bool ui_layout_operator_buts_poll_property(struct PointerRNA 
*UNUSED(ptr),
+  struct PropertyRNA *prop,
+  void *user_data)
+{
+  uiTemplateOperatorPropertyPollParam *params = user_data;
+
+  if ((params->flag & UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED) &&
+  (RNA_property_tags(prop) & OP_PROP_TAG_ADVANCED)) {
+return false;
+  }
+  return params->op->type->poll_property(params->C, params->op, prop);
+}
+
+static eAutoPropButsReturn template_operator_property_buts_draw_single(
+const bContext *C,
+wmOperator *op,
+uiLayout *layout,
+const eButLabelAlign label_align,
+int layout_flags)
+{
+  uiBlock *block = uiLayoutGetBlock(layout);
+  eAutoPropButsReturn return_info = 0;
+
+  if (!op->properties) {
+IDPropertyTemplate val = {0};
+op->properties = IDP_New(IDP_GROUP, , "wmOperatorProperties");
+  }
+
+  /* poll() on this operator may still fail,
+   * at the moment there is no nice feedback when this happens just fails 
silently. */
+  if (!WM_operator_repeat_check(C, op)) {
+UI_block_lock_set(block, true, 

[Bf-blender-cvs] [93f8363516a] modifier-panels-ui: Fix wrong use of heading in Preferences

2020-04-16 Thread William Reynish
Commit: 93f8363516a8f465fd6b8bc0fe6979227f3f39f1
Author: William Reynish
Date:   Mon Apr 13 17:01:48 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB93f8363516a8f465fd6b8bc0fe6979227f3f39f1

Fix wrong use of heading in Preferences

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 3b7e0a152f2..5b3d5106765 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1406,7 +1406,7 @@ class USERPREF_PT_input_tablet(InputPanel, 
CenterAlignMixIn, Panel):
 layout.prop(inputs, "tablet_api")
 layout.separator()
 
-col = layouts.column(heading = "Pressure")
+col = layout.column()
 col.prop(inputs, "pressure_threshold_max")
 col.prop(inputs, "pressure_softness")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0dc1873477e] modifier-panels-ui: UI: Draw real node sockets for node-input buttons and left-align them

2020-04-16 Thread Julian Eisel
Commit: 0dc1873477e6b686c08104127cf97d225b5b6555
Author: Julian Eisel
Date:   Mon Apr 13 16:35:42 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB0dc1873477e6b686c08104127cf97d225b5b6555

UI: Draw real node sockets for node-input buttons and left-align them

Couple of reasons for this:
* Makes it easier to understand that and how these buttons map to nodes.
* These buttons represent node inputs, so it makes more sense to have the icons
  on the left.
* We'd like to show the usual decorators on the right, but having two circles
  for different purposes next to each other would be confusing.

Also respects the socket shape. So if a diamond shape is used for example, the
properties show that too.

I'm not sure if the previous icon textures were cached, either way this method
doesn't use the caching. So this adds a draw call for every socket icon which
is a bit annoying, but probably neglectable. Would be better if we'd use proper
icon textures or batches, but that's a separate change.

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

===

M   source/blender/editors/include/ED_node.h
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/space_node/node_draw.c
M   source/blender/editors/space_node/node_templates.c

===

diff --git a/source/blender/editors/include/ED_node.h 
b/source/blender/editors/include/ED_node.h
index b5fcddf9c16..dfdd809dbd1 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -80,7 +80,10 @@ void ED_node_draw_snap(
 struct View2D *v2d, const float cent[2], float size, NodeBorder border, 
unsigned int pos);
 
 /* node_draw.c */
-void ED_node_socket_draw(struct bNodeSocket *sock, const struct rcti *rect, 
const float color[4]);
+void ED_node_socket_draw(struct bNodeSocket *sock,
+ const struct rcti *rect,
+ const float color[4],
+ float scale);
 void ED_node_tree_update(const struct bContext *C);
 void ED_node_tag_update_id(struct ID *id);
 void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, 
struct bNode *node);
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 1480535ee36..ba7bea8b428 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2402,6 +2402,8 @@ static void widget_draw_node_link_socket(const 
uiWidgetColors *wcol,
  float alpha)
 {
   if (but->custom_data) {
+const float scale = 0.9f / but->block->aspect;
+
 float col[4];
 rgba_uchar_to_float(col, but->col);
 col[3] *= alpha;
@@ -2411,7 +2413,7 @@ static void widget_draw_node_link_socket(const 
uiWidgetColors *wcol,
 GPU_blend(false);
 
 /* See UI_but_node_link_set() */
-ED_node_socket_draw(but->custom_data, rect, col);
+ED_node_socket_draw(but->custom_data, rect, col, scale);
   }
   else {
 widget_draw_icon(but, ICON_LAYER_USED, alpha, rect, wcol->text);
@@ -2427,15 +2429,27 @@ static void widget_draw_text_icon(const uiFontStyle 
*fstyle,
   const bool show_menu_icon = ui_but_draw_menu_icon(but);
   float alpha = (float)wcol->text[3] / 255.0f;
   char password_str[UI_MAX_DRAW_STR];
+  bool no_text_padding = false;
 
   ui_but_text_password_hide(password_str, but, false);
 
   /* check for button text label */
   if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_POPOVER) && (but->flag & 
UI_BUT_NODE_LINK)) {
 rcti temp = *rect;
-temp.xmin = rect->xmax - BLI_rcti_size_y(rect) - 1;
+const int size = BLI_rcti_size_y(rect) + 1; /* Not the icon size! */
+
+if (but->drawflag & UI_BUT_ICON_LEFT) {
+  temp.xmax = rect->xmin + size;
+  rect->xmin = temp.xmax;
+  /* Further padding looks off. */
+  no_text_padding = true;
+}
+else {
+  temp.xmin = rect->xmax - size;
+  rect->xmax = temp.xmin;
+}
+
 widget_draw_node_link_socket(wcol, , but, alpha);
-rect->xmax = temp.xmin;
   }
 
   /* If there's an icon too (made with uiDefIconTextBut) then draw the icon
@@ -2520,28 +2534,30 @@ static void widget_draw_text_icon(const uiFontStyle 
*fstyle,
 rect->xmin += icon_size + icon_padding;
   }
 
-  int text_padding = (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
-  if (but->editstr) {
-rect->xmin += text_padding;
-  }
-  else if (but->flag & UI_BUT_DRAG_MULTI) {
-bool text_is_edited = ui_but_drag_multi_edit_get(but) != NULL;
-if (text_is_edited) {
+  if (!no_text_padding) {
+int text_padding = (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
+if (but->editstr) {
   rect->xmin += text_padding;
 }
-  }
-  else if (but->drawflag & UI_BUT_TEXT_LEFT) {
-
-/* Reduce 

[Bf-blender-cvs] [fbe9ee62cd2] modifier-panels-ui: Use new layout features throughout all Cycles properties

2020-04-16 Thread William Reynish
Commit: fbe9ee62cd29cbfd775583b0e43a13628061fd80
Author: William Reynish
Date:   Sun Apr 12 12:01:08 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBfbe9ee62cd29cbfd775583b0e43a13628061fd80

Use new layout features throughout all Cycles properties

===

M   intern/cycles/blender/addon/ui.py

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 7cf615620a3..da7b87d01e8 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -500,8 +500,9 @@ class 
CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel):
 
 col = layout.column()
 col.prop(cscene, "blur_glossy")
-col.prop(cscene, "caustics_reflective")
-col.prop(cscene, "caustics_refractive")
+col = layout.column(heading = "Caustics", align = True)
+col.prop(cscene, "caustics_reflective", text = "Reflective")
+col.prop(cscene, "caustics_refractive", text = "Refractive")
 
 
 class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
@@ -762,20 +763,13 @@ class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
 rd = scene.render
 view_layer = context.view_layer
 
-flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, 
even_rows=False, align=False)
-
-col = flow.column()
+col = layout.column(heading = "Include")
 col.prop(view_layer, "use_sky", text="Environment")
-col = flow.column()
 col.prop(view_layer, "use_ao", text="Ambient Occlusion")
-col = flow.column()
 col.prop(view_layer, "use_solid", text="Surfaces")
-col = flow.column()
 col.prop(view_layer, "use_strand", text="Hair")
-col = flow.column()
 col.prop(view_layer, "use_volumes", text="Volumes")
 if with_freestyle:
-col = flow.column()
 col.prop(view_layer, "use_freestyle", text="Freestyle")
 col.active = rd.use_freestyle
 
@@ -819,36 +813,27 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, 
Panel):
 view_layer = context.view_layer
 cycles_view_layer = view_layer.cycles
 
-flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, 
even_rows=False, align=False)
-col = flow.column()
+col = layout.column(heading = "Include", align = True)
 col.prop(view_layer, "use_pass_combined")
-col = flow.column()
 col.prop(view_layer, "use_pass_z")
-col = flow.column()
 col.prop(view_layer, "use_pass_mist")
-col = flow.column()
 col.prop(view_layer, "use_pass_normal")
-col = flow.column()
-col.prop(view_layer, "use_pass_vector")
-col.active = not rd.use_motion_blur
-col = flow.column()
+sub = col.column()
+sub.active = not rd.use_motion_blur
+sub.prop(view_layer, "use_pass_vector")
 col.prop(view_layer, "use_pass_uv")
-col = flow.column()
+
+col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising 
Data")
+
+col = layout.column(heading = "Indexes", align = True)
 col.prop(view_layer, "use_pass_object_index")
-col = flow.column()
 col.prop(view_layer, "use_pass_material_index")
 
-layout.separator()
-
-flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, 
even_rows=False, align=False)
-col = flow.column()
-col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising 
Data")
-col = flow.column()
+col = layout.column(heading = "Debug", align = True)
 col.prop(cycles_view_layer, "pass_debug_render_time", text="Render 
Time")
-col = flow.column()
 col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample 
Count")
 
-layout.separator()
+
 
 layout.prop(view_layer, "pass_alpha_threshold")
 
@@ -866,38 +851,27 @@ class CYCLES_RENDER_PT_passes_light(CyclesButtonsPanel, 
Panel):
 view_layer = context.view_layer
 cycles_view_layer = view_layer.cycles
 
-split = layout.split(factor=0.35)
-split.use_property_split = False
-split.label(text="Diffuse")
-row = split.row(align=True)
-row.prop(view_layer, "use_pass_diffuse_direct", text="Direct", 
toggle=True)
-row.prop(view_layer, "use_pass_diffuse_indirect", text="Indirect", 
toggle=True)
-row.prop(view_layer, "use_pass_diffuse_color", text="Color", 
toggle=True)
-
-split = layout.split(factor=0.35)
-split.use_property_split = False
-split.label(text="Glossy")
-row = split.row(align=True)
-row.prop(view_layer, "use_pass_glossy_direct", text="Direct", 
toggle=True)
-row.prop(view_layer, "use_pass_glossy_indirect", text="Indirect", 

[Bf-blender-cvs] [e654a7d67f0] modifier-panels-ui: Fix error in previous commit

2020-04-16 Thread Julian Eisel
Commit: e654a7d67f07b39ec726b9b635d27453860bbd9b
Author: Julian Eisel
Date:   Mon Apr 13 01:44:32 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBe654a7d67f07b39ec726b9b635d27453860bbd9b

Fix error in previous commit

I unintentionally changed the size of checkboxes, should be back to the
old size now.

===

M   source/blender/editors/interface/interface_widgets.c

===

diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index fedf552632b..5ea9c5b5406 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4122,7 +4122,7 @@ static void widget_optionbut(uiWidgetColors *wcol,
   /* smaller */
   delta = 1 + BLI_rcti_size_y() / 8;
   BLI_rcti_resize(
-  , BLI_rcti_size_x() - delta, 
BLI_rcti_size_y() - delta);
+  , BLI_rcti_size_x() - delta * 2, 
BLI_rcti_size_y() - delta * 2);
   /* Keep one edge in place. */
   BLI_rcti_translate(, text_before_widget ? delta : -delta, 0);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0af8fcee76b] modifier-panels-ui: Support using property split for menu items & use for output FPS setting

2020-04-16 Thread Julian Eisel
Commit: 0af8fcee76b909361f152141f1360ed21821bdbe
Author: Julian Eisel
Date:   Mon Apr 13 18:22:26 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB0af8fcee76b909361f152141f1360ed21821bdbe

Support using property split for menu items & use for output FPS setting

We could add an extra parameter for the label string, for now we can
just use the headings. So if a layout heading is available (set and not
already added) use that to enable the split layout.

===

M   release/scripts/startup/bl_ui/properties_output.py
M   source/blender/editors/interface/interface_layout.c

===

diff --git a/release/scripts/startup/bl_ui/properties_output.py 
b/release/scripts/startup/bl_ui/properties_output.py
index e2158d3644a..e90a0a06429 100644
--- a/release/scripts/startup/bl_ui/properties_output.py
+++ b/release/scripts/startup/bl_ui/properties_output.py
@@ -94,14 +94,14 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
 return args
 
 @staticmethod
-def draw_framerate(layout, sub, rd):
+def draw_framerate(layout, rd):
 if RENDER_PT_dimensions._preset_class is None:
 RENDER_PT_dimensions._preset_class = 
bpy.types.RENDER_MT_framerate_presets
 
 args = rd.fps, rd.fps_base, RENDER_PT_dimensions._preset_class.bl_label
 fps_label_text, show_framerate = 
RENDER_PT_dimensions._draw_framerate_label(*args)
 
-sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
+layout.menu("RENDER_MT_framerate_presets", text=fps_label_text)
 
 if show_framerate:
 col = layout.column(align=True)
@@ -136,10 +136,8 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, 
Panel):
 col.prop(scene, "frame_end", text="End")
 col.prop(scene, "frame_step", text="Step")
 
-col = layout.split()
-col.alignment = 'RIGHT'
-col.label(text="Frame Rate")
-self.draw_framerate(layout, col, rd)
+col = layout.column(heading="Frame Rate")
+self.draw_framerate(col, rd)
 
 
 class RENDER_PT_frame_remapping(RenderOutputButtonsPanel, Panel):
diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index dec925a7eb4..32fb77b774d 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1894,7 +1894,8 @@ static uiLayout *ui_layout_heading_find(uiLayout 
*cur_layout)
 
 static void ui_layout_heading_label_add(uiLayout *layout,
 uiLayout *heading_layout,
-bool right_align)
+bool right_align,
+bool respect_prop_split)
 {
   const int prev_alignment = layout->alignment;
 
@@ -1902,7 +1903,12 @@ static void ui_layout_heading_label_add(uiLayout *layout,
 uiLayoutSetAlignment(layout, UI_LAYOUT_ALIGN_RIGHT);
   }
 
-  uiItemL(layout, heading_layout->heading, ICON_NONE);
+  if (respect_prop_split) {
+uiItemL_respect_property_split(layout, heading_layout->heading, ICON_NONE);
+  }
+  else {
+uiItemL(layout, heading_layout->heading, ICON_NONE);
+  }
   /* After adding the heading label, we have to mark it somehow as added, so 
it's not added again
* for other items in this layout. For now just clear it. */
   heading_layout->heading[0] = '\0';
@@ -2110,7 +2116,7 @@ void uiItemFullR(uiLayout *layout,
   layout = uiLayoutColumn(layout_row ? layout_row : layout, true);
   layout->space = 0;
   if (heading_layout) {
-ui_layout_heading_label_add(layout, heading_layout, false);
+ui_layout_heading_label_add(layout, heading_layout, false, false);
   }
 }
 else {
@@ -2171,7 +2177,7 @@ void uiItemFullR(uiLayout *layout,
   }
 
   if (!label_added && heading_layout) {
-ui_layout_heading_label_add(layout_sub, heading_layout, true);
+ui_layout_heading_label_add(layout_sub, heading_layout, true, false);
   }
 
   layout_split = ui_item_prop_split_layout_hack(layout_parent, 
layout_split);
@@ -2214,7 +2220,7 @@ void uiItemFullR(uiLayout *layout,
   else if (heading_layout) {
 /* Could not add heading to split layout, fallback to inserting it to the 
layout with the
  * heading itself. */
-ui_layout_heading_label_add(heading_layout, heading_layout, false);
+ui_layout_heading_label_add(heading_layout, heading_layout, false, false);
   }
   else if (inside_prop_sep) {
 /* When placing further items in a split row, add them to a column so they 
match the column
@@ -2814,6 +2820,7 @@ static uiBut *ui_item_menu(uiLayout *layout,
bool force_menu)
 {
   uiBlock *block = layout->root->block;
+  uiLayout *heading_layout = ui_layout_heading_find(layout);
   

[Bf-blender-cvs] [c9fd25b0709] modifier-panels-ui: Use row header for strip proxy resolutions

2020-04-16 Thread William Reynish
Commit: c9fd25b07090b8692efeefcf5a81092274546cc1
Author: William Reynish
Date:   Sun Apr 12 22:20:06 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBc9fd25b07090b8692efeefcf5a81092274546cc1

Use row header for strip proxy resolutions

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index e927dda2308..ff7e5cfeba3 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1868,21 +1868,19 @@ class SEQUENCER_PT_strip_proxy(SequencerButtonsPanel, 
Panel):
 
 flow = layout.column_flow()
 if ed.proxy_storage == 'PER_STRIP':
-flow.prop(proxy, "use_proxy_custom_directory")
-flow.prop(proxy, "use_proxy_custom_file")
-
+col = layout.column(heading = "Custom Proxy")
+col.prop(proxy, "use_proxy_custom_directory", text = 
"Directory")
 if proxy.use_proxy_custom_directory and not 
proxy.use_proxy_custom_file:
-flow.prop(proxy, "directory")
+col.prop(proxy, "directory")
+col.prop(proxy, "use_proxy_custom_file", text = "File")
 if proxy.use_proxy_custom_file:
-flow.prop(proxy, "filepath")
+col.prop(proxy, "filepath")
 
-box = layout.box()
-row = box.row(align=True)
-row.prop(strip.proxy, "build_25")
-row.prop(strip.proxy, "build_75")
-row = box.row(align=True)
-row.prop(strip.proxy, "build_50")
-row.prop(strip.proxy, "build_100")
+row = layout.row(heading = "Resolutions", align = True)
+row.prop(strip.proxy, "build_25", toggle = True)
+row.prop(strip.proxy, "build_75", toggle = True)
+row.prop(strip.proxy, "build_50", toggle = True)
+row.prop(strip.proxy, "build_100", toggle = True)
 
 layout.use_property_split = True
 layout.use_property_decorate = False

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1ac55cad304] modifier-panels-ui: Use heading row for the Sequencer Flip X/Y controls

2020-04-16 Thread William Reynish
Commit: 1ac55cad304a2d9a1deb835376cc4d8a626a5a7c
Author: William Reynish
Date:   Sun Apr 12 21:52:45 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB1ac55cad304a2d9a1deb835376cc4d8a626a5a7c

Use heading row for the Sequencer Flip X/Y controls

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index 4197def3017..e927dda2308 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1687,18 +1687,15 @@ class 
SEQUENCER_PT_adjust_transform(SequencerButtonsPanel, Panel):
 layout = self.layout
 strip = act_strip(context)
 
-layout.active = not strip.mute
-
-split = layout.split()
+layout.use_property_split = True
+layout.use_property_decorate = False
 
-col = split.column()
-col.alignment = 'RIGHT'
-col.label(text="Mirror")
+layout.active = not strip.mute
 
-col = split.column()
-row = col.row(align=True)
-row.prop(strip, "use_flip_x", text="X", toggle=True)
-row.prop(strip, "use_flip_y", text="Y", toggle=True)
+row = layout.row(heading = "Mirror")
+sub = row.row(align = True)
+sub.prop(strip, "use_flip_x", text="X", toggle=True)
+sub.prop(strip, "use_flip_y", text="Y", toggle=True)
 
 
 class SEQUENCER_PT_adjust_video(SequencerButtonsPanel, Panel):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [966431c2dc5] modifier-panels-ui: Use column header for Transform Affect Only toggles

2020-04-16 Thread William Reynish
Commit: 966431c2dc53e2a52c9f1326a66d5c92718eaca6
Author: William Reynish
Date:   Sun Apr 12 12:23:54 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB966431c2dc53e2a52c9f1326a66d5c92718eaca6

Use column header for Transform Affect Only toggles

===

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 960257cd805..515b9e72753 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -179,10 +179,10 @@ class 
VIEW3D_PT_tools_object_options_transform(View3DPanel, Panel):
 
 tool_settings = context.tool_settings
 
-layout.label(text="Affect Only")
-layout.prop(tool_settings, "use_transform_data_origin", text="Origins")
-layout.prop(tool_settings, "use_transform_pivot_point_align", 
text="Locations")
-layout.prop(tool_settings, "use_transform_skip_children", 
text="Parents")
+col = layout.column(heading = "Affect Only", align = True)
+col.prop(tool_settings, "use_transform_data_origin", text="Origins")
+col.prop(tool_settings, "use_transform_pivot_point_align", 
text="Locations")
+col.prop(tool_settings, "use_transform_skip_children", text="Parents")
 
 
 # ** default tools for editmode_mesh 

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3e43c5f2ccd] modifier-panels-ui: Better alignment in Experimental Preferences

2020-04-16 Thread William Reynish
Commit: 3e43c5f2ccd10f7f64f98ff8d08673df9fd0cb30
Author: William Reynish
Date:   Sun Apr 12 10:16:32 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB3e43c5f2ccd10f7f64f98ff8d08673df9fd0cb30

Better alignment in Experimental Preferences

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 9c4750a6307..3b7e0a152f2 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2110,7 +2110,7 @@ class ExperimentalPanel:
 experimental = prefs.experimental
 
 layout = self.layout
-layout.use_property_split = True
+layout.use_property_split = False
 layout.use_property_decorate = False
 
 for prop_keywords, task in items:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [55884976398] modifier-panels-ui: Fix error in prior commit

2020-04-16 Thread William Reynish
Commit: 558849763985af1a823c31fe1a573160019e5adb
Author: William Reynish
Date:   Sun Apr 12 12:04:12 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB558849763985af1a823c31fe1a573160019e5adb

Fix error in prior commit

===

M   intern/cycles/blender/addon/ui.py

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index da7b87d01e8..9bd59788b84 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1267,8 +1267,8 @@ class 
CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
 col.prop(visibility, "scatter")
 
 if ob.type != 'LIGHT':
-col = flow.column()
-col.prop(visibility, "shadow")
+sub = col.column()
+sub.prop(visibility, "shadow")
 
 
 class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5b14027f546] modifier-panels-ui: Use checkbox+value for Sculpt Plane Trim & fix column headers

2020-04-16 Thread William Reynish
Commit: 5b14027f546c7e8c7dc546cbec4a5bce63ebfcce
Author: William Reynish
Date:   Sun Apr 12 10:08:19 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB5b14027f546c7e8c7dc546cbec4a5bce63ebfcce

Use checkbox+value for Sculpt Plane Trim & fix column headers

===

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

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 9ddf74211dd..68a2be011ee 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -587,10 +587,12 @@ def brush_settings(layout, context, brush, popover=False):
 slider=True,
 )
 
-layout.prop(brush, "use_plane_trim", text="Plane Trim")
-row = layout.row()
-row.active = brush.use_plane_trim
-row.prop(brush, "plane_trim", slider=True, text="Distance")
+row = layout.row(heading = "Plane Trim")
+row.prop(brush, "use_plane_trim", text="")
+sub = row.row()
+sub.active = brush.use_plane_trim
+sub.prop(brush, "plane_trim", slider=True, text="")
+
 layout.separator()
 
 # height
@@ -811,24 +813,24 @@ def brush_settings_advanced(layout, context, brush, 
popover=False):
 col = layout.column(heading = "Auto-Masking", align = True)
 
 # topology automasking
-layout.prop(brush, "use_automasking_topology", text = "Topology")
+col.prop(brush, "use_automasking_topology", text = "Topology")
 
 # face masks automasking
-layout.prop(brush, "use_automasking_face_sets", text = "Face Sets")
+col.prop(brush, "use_automasking_face_sets", text = "Face Sets")
 
 # boundary edges/face sets automasking
-layout.prop(brush, "use_automasking_boundary_edges", text = "Mesh 
Boundary")
-layout.prop(brush, "use_automasking_boundary_face_sets", text = "Face 
Sets")
-layout.prop(brush, "automasking_boundary_edges_propagation_steps")
+col.prop(brush, "use_automasking_boundary_edges", text = "Mesh 
Boundary")
+col.prop(brush, "use_automasking_boundary_face_sets", text = "Face 
Sets")
+col.prop(brush, "automasking_boundary_edges_propagation_steps")
 
 layout.separator()
 
 # sculpt plane settings
 if capabilities.has_sculpt_plane:
 layout.prop(brush, "sculpt_plane")
-col = layout.column(heading = "Original", align = True)
-layout.prop(brush, "use_original_normal", text ="Normal")
-layout.prop(brush, "use_original_plane", text ="Plane")
+col = layout.column(heading = "Use Original", align = True)
+col.prop(brush, "use_original_normal", text ="Normal")
+col.prop(brush, "use_original_plane", text ="Plane")
 layout.separator()
 
 # 3D and 2D Texture Paint.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d85887e5cef] temp-checkbox-layout-tweaks: Fix expanded enums using columns within split layout

2020-04-16 Thread Julian Eisel
Commit: d85887e5cef256b945f1391104f31c25e9a9bbc7
Author: Julian Eisel
Date:   Thu Apr 16 21:26:11 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rBd85887e5cef256b945f1391104f31c25e9a9bbc7

Fix expanded enums using columns within split layout

===

M   source/blender/editors/interface/interface_layout.c

===

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 5309c43aba7..80e248650e5 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -,15 +,15 @@ void uiItemFullR(uiLayout *layout,
  * heading itself. */
 ui_layout_heading_label_add(heading_layout, heading_layout, false, false);
   }
-  else if (inside_prop_sep) {
-/* When placing further items in a split row, add them to a column so they 
match the column
- * layout of previous items (e.g. transform vector with lock icon for each 
item). */
-layout = uiLayoutColumn(layout_parent, true);
-layout->space = 0;
-  }
 
   /* array property */
   if (index == RNA_NO_INDEX && is_array) {
+if (inside_prop_sep) {
+  /* Within a split row, add array items to a column so they match the 
column layout of
+   * previous items (e.g. transform vector with lock icon for each item). 
*/
+  layout = uiLayoutColumn(layout, true);
+}
+
 ui_item_array(layout,
   block,
   name,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8383fc55d59] modifier-panels-ui: UI: Tweaks to modifier layouts

2020-04-16 Thread William Reynish
Commit: 8383fc55d593b03ef61a4673bf7df8601f4a0509
Author: William Reynish
Date:   Thu Apr 16 21:15:34 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB8383fc55d593b03ef61a4673bf7df8601f4a0509

UI: Tweaks to modifier layouts

  - Use checkbox + values configuration and expand 3-axis enums.

===

M   source/blender/modifiers/intern/MOD_hook.c
M   source/blender/modifiers/intern/MOD_mirror.c
M   source/blender/modifiers/intern/MOD_screw.c
M   source/blender/modifiers/intern/MOD_wave.c
M   source/blender/modifiers/intern/MOD_wireframe.c

===

diff --git a/source/blender/modifiers/intern/MOD_hook.c 
b/source/blender/modifiers/intern/MOD_hook.c
index 7219c713400..fee8d284658 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -457,12 +457,12 @@ static void falloff_panel_draw(const bContext *C, Panel 
*panel)
 
   uiItemR(layout, , "falloff_type", 0, IFACE_("Type"), ICON_NONE);
 
-  uiItemR(layout, , "use_falloff_uniform", 0, NULL, ICON_NONE);
-
   row = uiLayoutRow(layout, false);
   uiLayoutSetActive(row, use_falloff);
   uiItemR(row, , "falloff_radius", 0, NULL, ICON_NONE);
 
+  uiItemR(layout, , "use_falloff_uniform", 0, NULL, ICON_NONE);
+
   if (RNA_enum_get(, "falloff_type") == eWarp_Falloff_Curve) {
 uiTemplateCurveMapping(layout, , "falloff_curve", 0, false, false, 
false, false);
   }
diff --git a/source/blender/modifiers/intern/MOD_mirror.c 
b/source/blender/modifiers/intern/MOD_mirror.c
index ff2ba1e38af..b31af81617c 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -126,7 +126,7 @@ static Mesh *applyModifier(ModifierData *md, const 
ModifierEvalContext *ctx, Mes
 
 static void panel_draw(const bContext *C, Panel *panel)
 {
-  uiLayout *row, *col;
+  uiLayout *row, *col, *sub;
   uiLayout *layout = panel->layout;
   int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE;
 
@@ -168,32 +168,13 @@ static void panel_draw(const bContext *C, Panel *panel)
 
   uiItemR(col, , "use_clip", 0, IFACE_("Clipping"), ICON_NONE);
 
-  modifier_panel_end(layout, );
-}
-
-static void merge_panel_draw_header(const bContext *C, Panel *panel)
-{
-  uiLayout *layout = panel->layout;
-
-  PointerRNA ptr;
-  modifier_panel_get_property_pointers(C, panel, NULL, );
-
-  uiItemR(layout, , "use_mirror_merge", 0, IFACE_("Merge"), ICON_NONE);
-}
-
-static void symmetry_panel_draw(const bContext *C, Panel *panel)
-{
-  uiLayout *row;
-  uiLayout *layout = panel->layout;
-
-  PointerRNA ptr;
-  modifier_panel_get_property_pointers(C, panel, NULL, );
-
-  uiLayoutSetPropSep(layout, true);
+  row = uiLayoutRowWithHeading(col, true, IFACE_("Merge"));
+  uiItemR(row, , "use_mirror_merge", 0, "", ICON_NONE);
+  sub = uiLayoutRow(row, true);
+  uiLayoutSetActive(sub, RNA_boolean_get(, "use_mirror_merge"));
+  uiItemR(sub, , "merge_threshold", 0, "", ICON_NONE);
 
-  row = uiLayoutRow(layout, false);
-  uiLayoutSetActive(row, RNA_boolean_get(, "use_mirror_merge"));
-  uiItemR(row, , "merge_threshold", 0, NULL, ICON_NONE);
+  modifier_panel_end(layout, );
 }
 
 static void data_panel_draw(const bContext *C, Panel *panel)
@@ -232,8 +213,6 @@ static void data_panel_draw(const bContext *C, Panel *panel)
 static void panelRegister(ARegionType *region_type)
 {
   PanelType *panel_type = modifier_panel_register(region_type, "Mirror", 
panel_draw);
-  modifier_subpanel_register(
-  region_type, "mirror_merge", "", merge_panel_draw_header, 
symmetry_panel_draw, panel_type);
   modifier_subpanel_register(
   region_type, "mirror_data", "Data", NULL, data_panel_draw, panel_type);
 }
diff --git a/source/blender/modifiers/intern/MOD_screw.c 
b/source/blender/modifiers/intern/MOD_screw.c
index 4bbcb78d45e..52f9d69af3d 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -1193,7 +1193,8 @@ static void panel_draw(const bContext *C, Panel *panel)
 
   uiItemS(layout);
   col = uiLayoutColumn(layout, false);
-  uiItemR(col, , "axis", 0, NULL, ICON_NONE);
+  row = uiLayoutRow(col, false);
+  uiItemR(row, , "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
   uiItemR(col, , "object", 0, IFACE_("Axis Object"), ICON_NONE);
   sub = uiLayoutColumn(col, false);
   uiLayoutSetActive(sub, !RNA_pointer_is_null(_obj_ptr));
@@ -1205,6 +1206,16 @@ static void panel_draw(const bContext *C, Panel *panel)
   uiItemR(col, , "steps", 0, IFACE_("Steps Viewport"), ICON_NONE);
   uiItemR(col, , "render_steps", 0, IFACE_("Render"), ICON_NONE);
 
+  uiItemS(layout);
+
+  row = uiLayoutRowWithHeading(layout, true, IFACE_("Merge"));
+  uiItemR(row, , "use_merge_vertices", 0, "", ICON_NONE);
+  sub = uiLayoutRow(row, true);
+  uiLayoutSetActive(sub, RNA_boolean_get(, "use_merge_vertices"));
+  uiItemR(sub, , 

[Bf-blender-cvs] [78f74c6c503] temp-checkbox-layout-tweaks: Merge branch 'temp-checkbox-layout-tweaks-patch' into temp-checkbox-layout-tweaks

2020-04-16 Thread Julian Eisel
Commit: 78f74c6c5039cb93539a6b856d35d1a11827689b
Author: Julian Eisel
Date:   Thu Apr 16 21:02:43 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rB78f74c6c5039cb93539a6b856d35d1a11827689b

Merge branch 'temp-checkbox-layout-tweaks-patch' into 
temp-checkbox-layout-tweaks

===



===

diff --cc release/scripts/startup/bl_ui/properties_data_empty.py
index cf7e401d36f,898ab2e4359..1523f69536f
--- a/release/scripts/startup/bl_ui/properties_data_empty.py
+++ b/release/scripts/startup/bl_ui/properties_data_empty.py
@@@ -49,13 -49,13 +49,15 @@@ class DATA_PT_empty(DataButtonsPanel, P
  col.prop(ob, "empty_image_offset", text="Y", index=1)
  
  col = layout.column()
- col.row().prop(ob, "empty_image_depth", text="Depth", expand=True)
+ depth_row = col.row()
+ depth_row.enabled = not ob.show_in_front
+ depth_row.prop(ob, "empty_image_depth", text="Depth", expand=True)
  col.row().prop(ob, "empty_image_side", text="Side", expand=True)
 -col.prop(ob, "show_empty_image_orthographic", text="Display 
Orthographic")
 -col.prop(ob, "show_empty_image_perspective", text="Display 
Perspective")
 -col.prop(ob, "show_empty_image_only_axis_aligned")
 +
 +col = layout.column(heading="Show in", align=True)
 +col.prop(ob, "show_empty_image_orthographic", text="Orthographic")
 +col.prop(ob, "show_empty_image_perspective", text="Perspective")
 +col.prop(ob, "show_empty_image_only_axis_aligned", text="Only 
Axis Aligned")
  
  
  class DATA_PT_empty_alpha(DataButtonsPanel, Panel):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f95b96aec40] temp-checkbox-layout-tweaks: Merge branch 'master' into temp-checkbox-layout-tweaks-patch

2020-04-16 Thread Julian Eisel
Commit: f95b96aec409a22502871885f334d26ae97e4a05
Author: Julian Eisel
Date:   Thu Apr 16 21:02:24 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rBf95b96aec409a22502871885f334d26ae97e4a05

Merge branch 'master' into temp-checkbox-layout-tweaks-patch

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [61be5a0c067] temp-checkbox-layout-tweaks: UI: Better split layout support for checkboxes

2020-04-16 Thread Julian Eisel
Commit: 61be5a0c067161b3fd3486224b514c1c24b97abf
Author: Julian Eisel
Date:   Tue Apr 14 18:20:44 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rB61be5a0c067161b3fd3486224b514c1c24b97abf

UI: Better split layout support for checkboxes

Makes these kinds of layouts possible:

Best test this in the `temp-checkbox-changes` branch which contains layout
tweaks all over to make good use of the changes here. These will be submitted
separately.
Patch on top of D7409.

Main changes:
* Add support for row and column headers (i.e.
  `uiLayout.column(heading="Foo")`, `uiLayout.row(heading="Bar")). If the
  first property added to this layout doesn't insert anything into the label
  split column, the heading is inserted there. Otherwise, it's inserted as own
  item.
* Add support for manually inserting decorators for an existing item
  (`uiLayout.prop_decorator()`). That way layout creators can manually insert
  this, which was the only way I saw to support these layouts:
* Autogenerated layouts for operator properties look bad if there are only
  checkboxes (which only use half the region width). So before creating the
  layout, we iterate over visible properties and disable split layout if all
  are booleans. I think this is fine, if needed we could also add layout hints
  to operators.
* `uiTemplateOperatorPropertyButs()` now handles macros itself, the caller
  used to be responsible for this. Code that didn't handle these so far never
  used macros I think, so this change should be visible.
* Remove manual property split layout from autogenerated operator properties
  layout.
* Padding of checkboxes is tweaked to make their label visually more connected
  to the checkboxes.
* Support split layout for menus (should work for `uiLayout.menu()`,
  `.operator_menu_enum()`, `.prop_menu_enum()`, maybe more)
* Add `uiLayout.`

Maniphest Task: T65965

Reviewers: brecht pablovazquez billreynish

===

M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_anim.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_layout.c
M   source/blender/editors/interface/interface_templates.c
M   source/blender/editors/interface/interface_utils.c
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/makesrna/intern/rna_ui_api.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index 4716e7f0972..02f714f8520 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1774,6 +1774,8 @@ enum {
   UI_ITEM_O_DEPRESS = 1 << 10,
   UI_ITEM_R_COMPACT = 1 << 11,
   UI_ITEM_R_CHECKBOX_INVERT = 1 << 12,
+  /** Don't add a real decorator item, just blank space. */
+  UI_ITEM_R_FORCE_BLANK_DECORATE = 1 << 13,
 };
 
 #define UI_HEADER_OFFSET ((void)0, 0.4f * UI_UNIT_X)
@@ -1784,6 +1786,9 @@ enum {
   UI_TEMPLATE_OP_PROPS_SHOW_EMPTY = 1 << 1,
   UI_TEMPLATE_OP_PROPS_COMPACT = 1 << 2,
   UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED = 1 << 3,
+  /* Disable property split for the default layout (custom ui callbacks still 
have full control
+   * over the layout and can enable it). */
+  UI_TEMPLATE_OP_PROPS_NO_SPLIT_LAYOUT = 1 << 4,
 };
 
 /* used for transp checkers */
@@ -1871,7 +1876,9 @@ bool uiLayoutGetPropDecorate(uiLayout *layout);
 
 /* layout specifiers */
 uiLayout *uiLayoutRow(uiLayout *layout, bool align);
+uiLayout *uiLayoutRowWithHeading(uiLayout *layout, bool align, const char 
*heading);
 uiLayout *uiLayoutColumn(uiLayout *layout, bool align);
+uiLayout *uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char 
*heading);
 uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, bool align);
 uiLayout *uiLayoutGridFlow(uiLayout *layout,
bool row_major,
@@ -2046,11 +2053,11 @@ void uiTemplateOperatorSearch(uiLayout *layout);
 void UI_but_func_menu_search(uiBut *but);
 void uiTemplateMenuSearch(uiLayout *layout);
 
-eAutoPropButsReturn uiTemplateOperatorPropertyButs(const struct bContext *C,
-   uiLayout *layout,
-   struct wmOperator *op,
-   const eButLabelAlign 
label_align,
-   const short flag);
+void uiTemplateOperatorPropertyButs(const struct bContext *C,
+uiLayout *layout,
+struct wmOperator *op,
+eButLabelAlign label_align,
+short flag);
 void 

[Bf-blender-cvs] [7b55740c9de] temp-checkbox-layout-tweaks: Merge branch 'master' into temp-node-socket-buttons

2020-04-16 Thread Julian Eisel
Commit: 7b55740c9de81fda73580ad4cac114ab1288e092
Author: Julian Eisel
Date:   Tue Apr 14 17:27:40 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rB7b55740c9de81fda73580ad4cac114ab1288e092

Merge branch 'master' into temp-node-socket-buttons

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9029690a5df] master: UI: Remove old hacks for dynamic scrollbar hiding

2020-04-16 Thread Julian Eisel
Commit: 9029690a5df8fc34dd8246a6d0104d2c9bd1102c
Author: Julian Eisel
Date:   Thu Apr 16 20:42:56 2020 +0200
Branches: master
https://developer.blender.org/rB9029690a5df8fc34dd8246a6d0104d2c9bd1102c

UI: Remove old hacks for dynamic scrollbar hiding

Although we still dynamically hide scrollbars, they don't change the
region size anymore. They are simply drawn on top of the region content.
Because of this, some hacks introduced by fa28e50ac2a7 are no longer
necessary.
Without these hacks, the scrollbar visibility is evaluated much more
often (cheap operation) which should be more reliable and possibly solve
some glitches.

Also replaces integers passed as booleans.

Fixes T75782.

===

M   source/blender/editors/interface/view2d.c
M   source/blender/editors/screen/area.c

===

diff --git a/source/blender/editors/interface/view2d.c 
b/source/blender/editors/interface/view2d.c
index c07166b9ad2..72f6535eadf 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -60,7 +60,7 @@
 
 #include "interface_intern.h"
 
-static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool 
mask_scrollers);
+static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize);
 
 /*  */
 /** \name Internal Utilities
@@ -134,7 +134,7 @@ void UI_view2d_mask_from_win(const View2D *v2d, rcti 
*r_mask)
  *
  * \param mask_scroll: Optionally clamp scrollbars by this region.
  */
-static void view2d_masks(View2D *v2d, bool check_scrollers, const rcti 
*mask_scroll)
+static void view2d_masks(View2D *v2d, const rcti *mask_scroll)
 {
   int scroll;
 
@@ -144,26 +144,24 @@ static void view2d_masks(View2D *v2d, bool 
check_scrollers, const rcti *mask_scr
 mask_scroll = >mask;
   }
 
-  if (check_scrollers) {
-/* check size if hiding flag is set: */
-if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) {
-  if (!(v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES)) {
-if (BLI_rctf_size_x(>tot) > BLI_rctf_size_x(>cur)) {
-  v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR;
-}
-else {
-  v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR;
-}
+  /* check size if hiding flag is set: */
+  if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) {
+if (!(v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES)) {
+  if (BLI_rctf_size_x(>tot) > BLI_rctf_size_x(>cur)) {
+v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR;
+  }
+  else {
+v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR;
   }
 }
-if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) {
-  if (!(v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES)) {
-if (BLI_rctf_size_y(>tot) + 0.01f > BLI_rctf_size_y(>cur)) {
-  v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR;
-}
-else {
-  v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR;
-}
+  }
+  if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) {
+if (!(v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES)) {
+  if (BLI_rctf_size_y(>tot) + 0.01f > BLI_rctf_size_y(>cur)) {
+v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR;
+  }
+  else {
+v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR;
   }
 }
   }
@@ -385,8 +383,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
   v2d->winx = winx;
   v2d->winy = winy;
 
-  /* set masks (always do), but leave scroller scheck to totrect_set */
-  view2d_masks(v2d, 0, NULL);
+  view2d_masks(v2d, NULL);
 
   if (do_init) {
 /* Visible by default. */
@@ -394,13 +391,12 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
   }
 
   /* set 'tot' rect before setting cur? */
-  /* XXX confusing stuff here still -
-   * I made this function not check scroller hide - that happens in 
totrect_set */
+  /* XXX confusing stuff here still */
   if (tot_changed) {
 UI_view2d_totRect_set_resize(v2d, winx, winy, !do_init);
   }
   else {
-ui_view2d_curRect_validate_resize(v2d, !do_init, 0);
+ui_view2d_curRect_validate_resize(v2d, !do_init);
   }
 }
 
@@ -409,7 +405,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int 
winx, int winy)
  * 'cur' is not allowed to be: larger than max, smaller than min, or outside 
of 'tot'
  */
 // XXX pre2.5 -> this used to be called  test_view2d()
-static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool 
mask_scrollers)
+static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize)
 {
   float totwidth, totheight, curwidth, curheight, width, height;
   float winx, winy;
@@ -851,12 +847,12 @@ static void ui_view2d_curRect_validate_resize(View2D 
*v2d, bool resize, bool mas
   }
 
   /* set masks */
-  view2d_masks(v2d, mask_scrollers, NULL);
+  view2d_masks(v2d, NULL);
 }
 
 void UI_view2d_curRect_validate(View2D *v2d)
 {
-  

[Bf-blender-cvs] [71582af3384] greasepencil-object: GPencil: Change Y and U keys to use popovers

2020-04-16 Thread Antonio Vazquez
Commit: 71582af3384db6c96718347d47763167d16ebac9
Author: Antonio Vazquez
Date:   Thu Apr 16 18:51:14 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB71582af3384db6c96718347d47763167d16ebac9

GPencil: Change Y and U keys to use popovers

Instead to use the menus to change Layer and Materials, now the popover is 
displayed.

===

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/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 691cfe01f37..9c7ae2cda02 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3174,7 +3174,7 @@ def km_grease_pencil_stroke_edit_mode(params):
 ("gpencil.selectmode_toggle", {"type": 'THREE', "value": 'PRESS'},
  {"properties": [("mode", 2)]}),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 # Context menu
@@ -3221,9 +3221,9 @@ def km_grease_pencil_stroke_paint_mode(params):
 ("gpencil.hide", {"type": 'H', "value": 'PRESS', "shift": True},
  {"properties": [("unselected", True)]}),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Active material
-op_menu("GPENCIL_MT_material_active", {"type": 'U', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_materials", {"type": 'U', "value": 
'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 # Draw context menu
@@ -3383,7 +3383,7 @@ def km_grease_pencil_stroke_sculpt_mode(params):
 ("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', 
"shift": True}, None),
 ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', 
"shift": True}, None),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 # Context menu
@@ -3595,7 +3595,7 @@ def km_grease_pencil_stroke_weight_mode(params):
 ("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', 
"shift": True}, None),
 ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', 
"shift": True}, None),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 # Context menu
@@ -3648,7 +3648,7 @@ def km_grease_pencil_stroke_vertex_mode(params):
 ("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', 
"shift": True}, None),
 ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', 
"shift": True}, None),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 # Vertex Paint context menu
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 0005e7dd3d2..c64e879db54 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2376,7 +2376,7 @@ def km_grease_pencil_stroke_paint_mode(params):
 op_tool_cycle("builtin.cutter", {"type": 'K', "value": 'PRESS'}),
 op_tool_cycle("builtin.cursor", {"type": 'C', "value": 'PRESS'}),
 # Active layer
-op_menu("GPENCIL_MT_layer_active", {"type": 'M', "value": 'PRESS'}),
+op_panel("TOPBAR_PT_gpencil_layers", {"type": 'Y', "value": 'PRESS'}),
 # Keyframe menu
 op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 
'PRESS'}),
 ])

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org

[Bf-blender-cvs] [b374fcc98f9] master: Merge branch 'blender-v2.83-release'

2020-04-16 Thread Philipp Oeser
Commit: b374fcc98f99db50c93ee445de2a6532e9adb998
Author: Philipp Oeser
Date:   Thu Apr 16 17:45:07 2020 +0200
Branches: master
https://developer.blender.org/rBb374fcc98f99db50c93ee445de2a6532e9adb998

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8cb10c124ef] blender-v2.83-release: Fix T75675: Unlinking [with setting users to zero] not clearing LIB_TAG_EXTRAUSER_SET flag

2020-04-16 Thread Philipp Oeser
Commit: 8cb10c124efebc27a7451f3d3a4c62d23c3927b5
Author: Philipp Oeser
Date:   Thu Apr 16 17:09:04 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB8cb10c124efebc27a7451f3d3a4c62d23c3927b5

Fix T75675: Unlinking [with setting users to zero] not clearing
LIB_TAG_EXTRAUSER_SET flag

For example in the Image Editor, an assert would be triggered after
unlinking an image [with setting users to zero] and then setting the
image for the Image Editor again.

Whenever we set an Image for Image Editor, the Image ID is flagged
LIB_TAG_EXTRAUSER_SET, when we unlink [with setting users to zero] this
flag was not cleared.

quote @mont29: "a proper fix would be to move this to modern code, and
actually delete the ID..." but that is for later.

Maniphest Tasks: T75675

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

===

M   source/blender/editors/interface/interface_templates.c

===

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 6f6a4a1718a..52afb17079d 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -536,6 +536,7 @@ static void template_id_cb(bContext *C, void *arg_litem, 
void *arg_event)
 
   if (id && CTX_wm_window(C)->eventstate->shift) {
 /* only way to force-remove data (on save) */
+id_us_clear_real(id);
 id_fake_user_clear(id);
 id->us = 0;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [67ddf68dd95] master: Merge branch 'blender-v2.83-release'

2020-04-16 Thread Bastien Montagne
Commit: 67ddf68dd9531a00a4d69ee28c44d82e87f69e8d
Author: Bastien Montagne
Date:   Thu Apr 16 17:09:01 2020 +0200
Branches: master
https://developer.blender.org/rB67ddf68dd9531a00a4d69ee28c44d82e87f69e8d

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e9bf624a498] blender-v2.83-release: Fix T75680: Nodegroup user count increased when file saved in edit group mode.

2020-04-16 Thread Bastien Montagne
Commit: e9bf624a498a4f0074374740737d47c5df7fd87d
Author: Bastien Montagne
Date:   Thu Apr 16 17:05:58 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBe9bf624a498a4f0074374740737d47c5df7fd87d

Fix T75680: Nodegroup user count increased when file saved in edit group mode.

This editor's code was a bit schizophrenic, some parts considering its
nodetree usages as real refcounted ones, others, as shallow 'user one'
ones...

Editors should not be real ID users anyway, unless there are *very* good
reasons for it, so swich it to fully 'shallow' usage now.

===

M   source/blender/blenkernel/intern/lib_query.c
M   source/blender/editors/space_node/space_node.c

===

diff --git a/source/blender/blenkernel/intern/lib_query.c 
b/source/blender/blenkernel/intern/lib_query.c
index 9c0fa33157c..4ffdcf14fa7 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -492,16 +492,17 @@ static void 
library_foreach_screen_area(LibraryForeachIDData *data, ScrArea *are
 FOREACH_CALLBACK_INVOKE_ID(data, snode->from, IDWALK_CB_NOP);
 
 FOREACH_CALLBACK_INVOKE(
-data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER);
+data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER_ONE);
 
 for (path = snode->treepath.first; path; path = path->next) {
   if (path == snode->treepath.first) {
 /* first nodetree in path is same as snode->nodetree */
-FOREACH_CALLBACK_INVOKE(
-data, path->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED 
: IDWALK_CB_NOP);
+FOREACH_CALLBACK_INVOKE(data,
+path->nodetree,
+is_private_nodetree ? IDWALK_CB_EMBEDDED : 
IDWALK_CB_USER_ONE);
   }
   else {
-FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER);
+FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER_ONE);
   }
 
   if (path->nodetree == NULL) {
diff --git a/source/blender/editors/space_node/space_node.c 
b/source/blender/editors/space_node/space_node.c
index d682cab7293..b6ee393b991 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -890,8 +890,7 @@ static void node_id_remap(ScrArea *UNUSED(area), SpaceLink 
*slink, ID *old_id, I
 for (path = snode->treepath.first; path; path = path->next) {
   if ((ID *)path->nodetree == old_id) {
 path->nodetree = (bNodeTree *)new_id;
-id_us_min(old_id);
-id_us_plus(new_id);
+id_us_ensure_real(new_id);
   }
   if (path == snode->treepath.first) {
 /* first nodetree in path is same as snode->nodetree */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [db600fd6399] master: Fix Memory Leak in Shader Interface

2020-04-16 Thread Jeroen Bakker
Commit: db600fd63998b81022f01e0b1b6b71c9cd359130
Author: Jeroen Bakker
Date:   Thu Apr 16 16:55:46 2020 +0200
Branches: master
https://developer.blender.org/rBdb600fd63998b81022f01e0b1b6b71c9cd359130

Fix Memory Leak in Shader Interface

===

M   source/blender/gpu/intern/gpu_shader_interface.c

===

diff --git a/source/blender/gpu/intern/gpu_shader_interface.c 
b/source/blender/gpu/intern/gpu_shader_interface.c
index db8ec60fa9a..1caa88d18ae 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -257,6 +257,7 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t 
program)
 input->location = glGetAttribLocation(program, name);
 /* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and 
`gl_VertexID`. */
 if (input->location == -1) {
+  MEM_freeN(input);
   continue;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2a68b41b7df] blender-v2.83-release: Fix T74964 Stereo 3D anaglyph and interlace not working

2020-04-16 Thread Clément Foucault
Commit: 2a68b41b7df18299952f83f4499fa132c7141a1e
Author: Clément Foucault
Date:   Thu Apr 16 15:47:18 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB2a68b41b7df18299952f83f4499fa132c7141a1e

Fix T74964 Stereo 3D anaglyph and interlace not working

Caused by framebuffer initialized in the wrong context.

===

M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/gpu/intern/gpu_viewport.c 
b/source/blender/gpu/intern/gpu_viewport.c
index ad74ce02731..ed825db26ac 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -217,18 +217,6 @@ static void gpu_viewport_framebuffer_view_set(GPUViewport 
*viewport, int view)
 
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
 });
 
-  if (((viewport->flag & GPU_VIEWPORT_STEREO) != 0)) {
-GPU_framebuffer_ensure_config(>stereo_comp_fb,
-  {
-  GPU_ATTACHMENT_NONE,
-  GPU_ATTACHMENT_TEXTURE(dtxl->color),
-  
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
-  });
-  }
-  else {
-dfbl->stereo_comp_fb = NULL;
-  }
-
   viewport->active_view = view;
 }
 
@@ -492,9 +480,6 @@ static void gpu_viewport_default_fb_create(GPUViewport 
*viewport)
   ok = ok && GPU_framebuffer_check_valid(dfbl->color_only_fb, NULL);
   ok = ok && GPU_framebuffer_check_valid(dfbl->depth_only_fb, NULL);
   ok = ok && GPU_framebuffer_check_valid(dfbl->overlay_only_fb, NULL);
-  if (((viewport->flag & GPU_VIEWPORT_STEREO) != 0)) {
-ok = ok && GPU_framebuffer_check_valid(dfbl->stereo_comp_fb, NULL);
-  }
 cleanup:
   if (!ok) {
 GPU_viewport_free(viewport);
@@ -625,6 +610,14 @@ void GPU_viewport_stereo_composite(GPUViewport *viewport, 
Stereo3dFormat *stereo
   DefaultTextureList *dtxl = viewport->txl;
   DefaultFramebufferList *dfbl = viewport->fbl;
 
+  /* The composite framebuffer object needs to be created in the window 
context. */
+  GPU_framebuffer_ensure_config(>stereo_comp_fb,
+{
+GPU_ATTACHMENT_NONE,
+GPU_ATTACHMENT_TEXTURE(dtxl->color),
+
GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
+});
+
   GPUVertFormat *vert_format = immVertexFormat();
   uint pos = GPU_vertformat_attr_add(vert_format, "pos", GPU_COMP_F32, 2, 
GPU_FETCH_FLOAT);
   GPU_framebuffer_bind(dfbl->stereo_comp_fb);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d34c5eec19a] master: GPU: Fix Negative Shift

2020-04-16 Thread Jeroen Bakker
Commit: d34c5eec19ad828237cff0916cc23240d0c25aa1
Author: Jeroen Bakker
Date:   Thu Apr 16 10:39:30 2020 +0200
Branches: master
https://developer.blender.org/rBd34c5eec19ad828237cff0916cc23240d0c25aa1

GPU: Fix Negative Shift

glAttributes also include `gl_` names. These don't have a location and
should be ignored during shader interface creation. Those internal names
received a location of -1 and therefore the bitmasking was undefined.

Users wouldn't notice this, but ASAN warned developers of this situation.
ASAN could quit making ASAN un-usable as most shaders have this issue.

Reviewed By: Clément Foucault`

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

===

M   source/blender/gpu/intern/gpu_shader_interface.c

===

diff --git a/source/blender/gpu/intern/gpu_shader_interface.c 
b/source/blender/gpu/intern/gpu_shader_interface.c
index cb1cd9a6f6d..db8ec60fa9a 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -254,8 +254,11 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t 
program)
 }
 
 /* TODO: reject DOUBLE gl_types */
-
 input->location = glGetAttribLocation(program, name);
+/* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and 
`gl_VertexID`. */
+if (input->location == -1) {
+  continue;
+}
 
 shaderface->enabled_attr_mask |= (1 << input->location);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e22e766cf82] master: Merge branch 'blender-v2.83-release'

2020-04-16 Thread Bastien Montagne
Commit: e22e766cf82315adfbef6687c29b809ac24994c6
Author: Bastien Montagne
Date:   Thu Apr 16 16:22:08 2020 +0200
Branches: master
https://developer.blender.org/rBe22e766cf82315adfbef6687c29b809ac24994c6

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dac60912078] blender-v2.83-release: Fix (unreported) crash on use-after-free in liboverride deletion code.

2020-04-16 Thread Bastien Montagne
Commit: dac609120785ad26a3ba56cb32019226c0f9762d
Author: Bastien Montagne
Date:   Thu Apr 16 12:24:21 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBdac609120785ad26a3ba56cb32019226c0f9762d

Fix (unreported) crash on use-after-free in liboverride deletion code.

===

M   source/blender/blenkernel/intern/lib_override.c

===

diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 6a206fc46d9..e6a792bc58a 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -383,10 +383,10 @@ void 
lib_override_library_property_clear(IDOverrideLibraryProperty *op)
 void BKE_lib_override_library_property_delete(IDOverrideLibrary *override,
   IDOverrideLibraryProperty 
*override_property)
 {
-  lib_override_library_property_clear(override_property);
   if (override->runtime != NULL) {
 BLI_ghash_remove(override->runtime, override_property->rna_path, NULL, 
NULL);
   }
+  lib_override_library_property_clear(override_property);
   BLI_freelinkN(>properties, override_property);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e3d575b3765] blender-v2.83-release: Fix T75730: Crash on read of liboverride data when missing source modifier.

2020-04-16 Thread Bastien Montagne
Commit: e3d575b37651b20b281f431047d97b43c0ce028d
Author: Bastien Montagne
Date:   Wed Apr 15 17:23:56 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBe3d575b37651b20b281f431047d97b43c0ce028d

Fix T75730: Crash on read of liboverride data when missing source modifier.

While this should not happen, we still want to handle those errors
gracefully from user perspective (i.e. assert for devs, no crash for
users).

Actual fix of root cause of the issue will come later.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index cb8dffe3168..b81a175a94b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1625,7 +1625,10 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
   }
   mod_src = mod_src ? mod_src->next : ob_src->modifiers.first;
 
-  BLI_assert(mod_src != NULL);
+  if (mod_src == NULL) {
+BLI_assert(mod_src != NULL);
+return false;
+  }
 
   /* While it would be nicer to use lower-level modifier_new() here, this one 
is lacking
* special-cases handling (particles and other physics modifiers mostly), so 
using the ED version

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0438944b343] blender-v2.83-release: Refactor/strengthen a bit invalid operands checks when applying an override operation.

2020-04-16 Thread Bastien Montagne
Commit: 0438944b343ed11abad47964f4dccb4e171da179
Author: Bastien Montagne
Date:   Wed Apr 15 17:26:34 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB0438944b343ed11abad47964f4dccb4e171da179

Refactor/strengthen a bit invalid operands checks when applying an override 
operation.

===

M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/makesrna/intern/rna_access_compare_override.c

===

diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 6f2882f3565..699d1ee23e9 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -48,6 +48,8 @@ struct IDOverrideLibrary;
 struct IDOverrideLibraryProperty;
 struct IDOverrideLibraryPropertyOperation;
 struct Main;
+struct PointerRNA;
+struct PropertyRNA;
 
 void BKE_lib_override_library_enable(const bool do_enable);
 bool BKE_lib_override_library_is_enabled(void);
@@ -92,6 +94,15 @@ void BKE_lib_override_library_property_operation_delete(
 struct IDOverrideLibraryProperty *override_property,
 struct IDOverrideLibraryPropertyOperation *override_property_operation);
 
+bool BKE_lib_override_library_property_operation_operands_validate(
+struct IDOverrideLibraryPropertyOperation *override_property_operation,
+struct PointerRNA *ptr_dst,
+struct PointerRNA *ptr_src,
+struct PointerRNA *ptr_storage,
+struct PropertyRNA *prop_dst,
+struct PropertyRNA *prop_src,
+struct PropertyRNA *prop_storage);
+
 bool BKE_lib_override_library_status_check_local(struct Main *bmain, struct ID 
*local);
 bool BKE_lib_override_library_status_check_reference(struct Main *bmain, 
struct ID *local);
 
diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 5b75b8ac181..6a206fc46d9 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -558,6 +558,46 @@ void BKE_lib_override_library_property_operation_delete(
   BLI_freelinkN(_property->operations, override_property_operation);
 }
 
+/**
+ * Validate that required data for a given operation are available.
+ */
+bool BKE_lib_override_library_property_operation_operands_validate(
+struct IDOverrideLibraryPropertyOperation *override_property_operation,
+struct PointerRNA *ptr_dst,
+struct PointerRNA *ptr_src,
+struct PointerRNA *ptr_storage,
+struct PropertyRNA *prop_dst,
+struct PropertyRNA *prop_src,
+struct PropertyRNA *prop_storage)
+{
+  switch (override_property_operation->operation) {
+case IDOVERRIDE_LIBRARY_OP_NOOP:
+  return true;
+case IDOVERRIDE_LIBRARY_OP_ADD:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_MULTIPLY:
+  if (ptr_storage == NULL || ptr_storage->data == NULL || prop_storage == 
NULL) {
+BLI_assert(!"Missing data to apply differential override operation.");
+return false;
+  }
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_INSERT_AFTER:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE:
+  ATTR_FALLTHROUGH;
+case IDOVERRIDE_LIBRARY_OP_REPLACE:
+  if ((ptr_dst == NULL || ptr_dst->data == NULL || prop_dst == NULL) ||
+  (ptr_src == NULL || ptr_src->data == NULL || prop_src == NULL)) {
+BLI_assert(!"Missing data to apply override operation.");
+return false;
+  }
+  }
+
+  return true;
+}
+
 /**
  * Check that status of local data-block is still valid against current 
reference one.
  *
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index 199d22ee3dc..32b375fda97 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -481,28 +481,13 @@ static bool rna_property_override_operation_apply(Main 
*bmain,
 
   const short override_op = opop->operation;
 
-  if (override_op == IDOVERRIDE_LIBRARY_OP_NOOP) {
-return true;
-  }
-
-  if (ELEM(override_op,
-   IDOVERRIDE_LIBRARY_OP_ADD,
-   IDOVERRIDE_LIBRARY_OP_SUBTRACT,
-   IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
-  !ptr_storage) {
-/* We cannot apply 'diff' override operations without some reference 
storage.
- * This should typically only happen at read time of .blend file... */
+  if (!BKE_lib_override_library_property_operation_operands_validate(
+  opop, ptr_dst, ptr_src, ptr_storage, prop_dst, prop_src, 
prop_storage)) {
 return false;
   }
 
-  if (ELEM(override_op,
-   IDOVERRIDE_LIBRARY_OP_ADD,
-   IDOVERRIDE_LIBRARY_OP_SUBTRACT,
-   

[Bf-blender-cvs] [81bb2a143c5] blender-v2.83-release: Fix T75730: Properly remove unused override properties/operations.

2020-04-16 Thread Bastien Montagne
Commit: 81bb2a143c5e9cb5885717b7f1dca84fdba41c0b
Author: Bastien Montagne
Date:   Thu Apr 16 16:19:44 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB81bb2a143c5e9cb5885717b7f1dca84fdba41c0b

Fix T75730: Properly remove unused override properties/operations.

While code is supposed to handle gracefully invalid override operations,
it is much cleaner to avoid those completely.

===

M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesrna/intern/rna_access_compare_override.c

===

diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 699d1ee23e9..fb49f60d8b5 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -111,6 +111,17 @@ bool BKE_lib_override_library_operations_create(struct 
Main *bmain,
 const bool force_auto);
 void BKE_lib_override_library_main_operations_create(struct Main *bmain, const 
bool force_auto);
 
+void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty 
*override_property,
+ const short tag,
+ const bool do_set);
+void BKE_lib_override_library_properties_tag(struct IDOverrideLibrary 
*override,
+ const short tag,
+ const bool do_set);
+void BKE_lib_override_library_main_tag(struct Main *bmain, const short tag, 
const bool do_set);
+
+void BKE_lib_override_library_id_unused_cleanup(struct ID *local);
+void BKE_lib_override_library_main_unused_cleanup(struct Main *bmain);
+
 void BKE_lib_override_library_update(struct Main *bmain, struct ID *local);
 void BKE_lib_override_library_main_update(struct Main *bmain);
 
diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index e6a792bc58a..795390f1940 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -744,8 +744,8 @@ bool BKE_lib_override_library_operations_create(Main 
*bmain, ID *local, const bo
 
 if (GS(local->name) == ID_OB) {
   /* Our beloved pose's bone cross-data pointers... Usually, depsgraph 
evaluation would ensure
-   * this is valid, but in some cases (like hidden collections etc.) this 
won't be the case, so
-   * we need to take care of this ourselves. */
+   * this is valid, but in some situations (like hidden collections etc.) 
this won't be the
+   * case, so we need to take care of this ourselves. */
   Object *ob_local = (Object *)local;
   if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && 
ob_local->pose != NULL &&
   ob_local->pose->flag & POSE_RECALC) {
@@ -788,6 +788,12 @@ void BKE_lib_override_library_main_operations_create(Main 
*bmain, const bool for
 {
   ID *id;
 
+  /* When force-auto is set, we also remove all unused existing override 
properties & operations.
+   */
+  if (force_auto) {
+BKE_lib_override_library_main_tag(bmain, IDOVERRIDE_LIBRARY_TAG_UNUSED, 
true);
+  }
+
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
 if ((ID_IS_OVERRIDE_LIBRARY(id) && force_auto) ||
 (ID_IS_OVERRIDE_LIBRARY_AUTO(id) && (id->tag & 
LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
@@ -796,6 +802,92 @@ void BKE_lib_override_library_main_operations_create(Main 
*bmain, const bool for
 }
   }
   FOREACH_MAIN_ID_END;
+
+  if (force_auto) {
+BKE_lib_override_library_main_unused_cleanup(bmain);
+  }
+}
+
+/** Set or clear given tag in all operations as unused in that override 
property data. */
+void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty 
*override_property,
+ const short tag,
+ const bool do_set)
+{
+  if (override_property != NULL) {
+if (do_set) {
+  override_property->tag |= tag;
+}
+else {
+  override_property->tag &= ~tag;
+}
+
+LISTBASE_FOREACH (IDOverrideLibraryPropertyOperation *, opop, 
_property->operations) {
+  if (do_set) {
+opop->tag |= tag;
+  }
+  else {
+opop->tag &= ~tag;
+  }
+}
+  }
+}
+
+/** Set or clear given tag in all properties and operations in that override 
data. */
+void BKE_lib_override_library_properties_tag(struct IDOverrideLibrary 
*override,
+ const short tag,
+ const bool do_set)
+{
+  if (override != NULL) {
+LISTBASE_FOREACH (IDOverrideLibraryProperty 

[Bf-blender-cvs] [79a58eef059] blender-v2.83-release: Fix T73977, T73825: ignore Python user site-packages directory by default

2020-04-16 Thread Brecht Van Lommel
Commit: 79a58eef059ffc3f12d11bd68938cfb1b4cd2462
Author: Brecht Van Lommel
Date:   Thu Apr 16 15:54:34 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB79a58eef059ffc3f12d11bd68938cfb1b4cd2462

Fix T73977, T73825: ignore Python user site-packages directory by default

This goes along with the existing changes to ignore PYTHONPATH by default.
--python-use-system-env now controls both.

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

===

M   source/blender/python/intern/bpy_interface.c
M   source/creator/creator_args.c

===

diff --git a/source/blender/python/intern/bpy_interface.c 
b/source/blender/python/intern/bpy_interface.c
index b09d3187f3c..6da1715b02d 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -279,9 +279,10 @@ void BPY_python_start(int argc, const char **argv)
* While harmless, it's noisy. */
   Py_FrozenFlag = 1;
 
-  /* Only use the systems environment variables when explicitly requested.
+  /* Only use the systems environment variables and site when explicitly 
requested.
* Since an incorrect 'PYTHONPATH' causes difficult to debug errors, see: 
T72807. */
   Py_IgnoreEnvironmentFlag = !py_use_system_env;
+  Py_NoUserSiteDirectory = !py_use_system_env;
 
   Py_Initialize();
 
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 381a43ff521..a13733fd897 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1924,7 +1924,8 @@ static int arg_handle_python_exit_code_set(int argc, 
const char **argv, void *UN
 
 static const char arg_handle_python_use_system_env_set_doc[] =
 "\n\t"
-"Allow Python to use system environment variables such as 'PYTHONPATH'.";
+"Allow Python to use system environment variables such as 'PYTHONPATH' and 
the user "
+"site-packages directory.";
 static int arg_handle_python_use_system_env_set(int UNUSED(argc),
 const char **UNUSED(argv),
 void *UNUSED(data))

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [94fdfe312bc] greasepencil-object: Merge branch 'master' into greasepencil-object

2020-04-16 Thread Antonio Vazquez
Commit: 94fdfe312bc89ab605805aabadb869e72bfd5b06
Author: Antonio Vazquez
Date:   Thu Apr 16 15:58:43 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB94fdfe312bc89ab605805aabadb869e72bfd5b06

Merge branch 'master' into greasepencil-object

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a9dd6d004b4] blender-v2.83-release: Fix T75780: Gpencil Sculpt brushes not working with old files

2020-04-16 Thread Antonio Vazquez
Commit: a9dd6d004b4f6798e62618dd6cf87369509b33a6
Author: Antonio Vazquez
Date:   Thu Apr 16 15:53:03 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBa9dd6d004b4f6798e62618dd6cf87369509b33a6

Fix T75780: Gpencil Sculpt brushes not working with old files

The patching of brushes was not done.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 7904e51a516..087fef9ee09 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1666,6 +1666,19 @@ void do_versions_after_linking_280(Main *bmain, 
ReportList *UNUSED(reports))
 LISTBASE_FOREACH (Object *, ob, >objects) {
   BKE_fcurves_id_cb(>id, do_version_fcurve_hide_viewport_fix, NULL);
 }
+
+/* Reset all grease pencil brushes. */
+LISTBASE_FOREACH (Scene *, scene, >scenes) {
+  BKE_brush_gpencil_paint_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_sculpt_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_weight_presets(bmain, scene->toolsettings);
+  BKE_brush_gpencil_vertex_presets(bmain, scene->toolsettings);
+
+  /* Ensure new Paint modes. */
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL);
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_SCULPT_GPENCIL);
+  BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_WEIGHT_GPENCIL);
+}
   }
 
   /**

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a1420da0276] master: Merge branch 'blender-v2.83-release'

2020-04-16 Thread Antonio Vazquez
Commit: a1420da0276a49c4f259a1df7da73937cd34f5d4
Author: Antonio Vazquez
Date:   Thu Apr 16 15:57:37 2020 +0200
Branches: master
https://developer.blender.org/rBa1420da0276a49c4f259a1df7da73937cd34f5d4

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [21eda8c4601] greasepencil-object: GPencil: Display preview icon in material select

2020-04-16 Thread Antonio Vazquez
Commit: 21eda8c460152e1908250122584a04dd19bd6141
Author: Antonio Vazquez
Date:   Thu Apr 16 15:51:41 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB21eda8c460152e1908250122584a04dd19bd6141

GPencil: Display preview icon in material select

===

M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   source/blender/editors/gpencil/gpencil_utils.c

===

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 6b9e41db12a..3492f7a4973 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -386,8 +386,8 @@ class GPENCIL_MT_material_active(Menu):
 for slot in ob.material_slots:
 mat = slot.material
 if mat:
-layout.operator("gpencil.material_set", text=mat.name,
-icon='MATERIAL' if mat == mat_active else 
'BLANK1').slot = mat.name
+icon = mat.id_data.preview.icon_id
+layout.operator("gpencil.material_set", text=mat.name, 
icon_value=icon).slot = mat.name
 
 
 class GPENCIL_MT_gpencil_draw_delete(Menu):
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index 76fee890e03..bd76839adf8 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -504,13 +504,7 @@ const EnumPropertyItem 
*ED_gpencil_material_enum_itemf(bContext *C,
   item_tmp.identifier = ma->id.name + 2;
   item_tmp.name = ma->id.name + 2;
   item_tmp.value = i;
-
-  if (i == ob->actcol) {
-item_tmp.icon = ICON_MATERIAL;
-  }
-  else {
-item_tmp.icon = ICON_NONE;
-  }
+  item_tmp.icon = ma->preview->icon_id;
 
   RNA_enum_item_add(, , _tmp);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [816597d6da0] master: Fix T75785: "Extrude Faces Along Normals" throws error

2020-04-16 Thread Germano Cavalcante
Commit: 816597d6da0534e613956994257f059bb6c08234
Author: Germano Cavalcante
Date:   Thu Apr 16 10:44:48 2020 -0300
Branches: master
https://developer.blender.org/rB816597d6da0534e613956994257f059bb6c08234

Fix T75785: "Extrude Faces Along Normals" throws error

===

M   release/scripts/startup/bl_operators/view3d.py

===

diff --git a/release/scripts/startup/bl_operators/view3d.py 
b/release/scripts/startup/bl_operators/view3d.py
index 4a6791f1627..88fa06a913f 100644
--- a/release/scripts/startup/bl_operators/view3d.py
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -153,7 +153,7 @@ class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
 return (obj is not None and obj.mode == 'EDIT')
 
 def execute(self, context):
-return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True)
+return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True, 
False)
 
 def invoke(self, context, _event):
 return self.execute(context)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8a506b96607] master: Merge branch 'blender-v2.83-release'

2020-04-16 Thread Germano Cavalcante
Commit: 8a506b966078e427c18f9bced25d93c3430c7911
Author: Germano Cavalcante
Date:   Thu Apr 16 10:32:46 2020 -0300
Branches: master
https://developer.blender.org/rB8a506b966078e427c18f9bced25d93c3430c7911

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dcb443416e0] blender-v2.83-release: Fix memcpy overlapping buffers

2020-04-16 Thread Germano Cavalcante
Commit: dcb443416e09a95f41693e1d5030867f5278e08f
Author: Germano Cavalcante
Date:   Thu Apr 16 10:31:51 2020 -0300
Branches: blender-v2.83-release
https://developer.blender.org/rBdcb443416e09a95f41693e1d5030867f5278e08f

Fix memcpy overlapping buffers

This crashes with ASAN enabled.
```
==39366==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges 
[0x623ae848,0x623ae85a) and [0x623ae851, 0x623ae863) overlap
```

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index d53b6cde4ae..7904e51a516 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4410,10 +4410,12 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
   ColorManagedViewSettings *view_settings;
   view_settings = >view_settings;
   if (BLI_str_startswith(view_settings->look, "Filmic - ")) {
-STRNCPY(view_settings->look, view_settings->look + strlen("Filmic - 
"));
+char *src = view_settings->look + strlen("Filmic - ");
+memmove(view_settings->look, src, strlen(src) + 1);
   }
   else if (BLI_str_startswith(view_settings->look, "Standard - ")) {
-STRNCPY(view_settings->look, view_settings->look + strlen("Standard - 
"));
+char *src = view_settings->look + strlen("Standard - ");
+memmove(view_settings->look, src, strlen(src) + 1);
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7ef2dd84246] master: UI: Move node socket icons to the left of node input buttons

2020-04-16 Thread Julian Eisel
Commit: 7ef2dd84246ceb8c8f88662470360f57a97f7e90
Author: Julian Eisel
Date:   Thu Apr 16 15:21:06 2020 +0200
Branches: master
https://developer.blender.org/rB7ef2dd84246ceb8c8f88662470360f57a97f7e90

UI: Move node socket icons to the left of node input buttons

Node input buttons (e.g. in the material properties) used to draw their
icons on the right of the buttons. However since they represent inputs,
it makes more sense conceptually to have them on the left.
Further, we might want to add the usual decorator buttons (to control
keyframes or display other states) to the material properties as well.
Having two circle icons next to each other would be confusing.

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

Reviewed by: Brecht Van Lommel, William Reynish

===

M   source/blender/editors/space_node/node_templates.c

===

diff --git a/source/blender/editors/space_node/node_templates.c 
b/source/blender/editors/space_node/node_templates.c
index da0058585cb..91fe6a97432 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -695,6 +695,7 @@ void uiTemplateNodeLink(
 
   UI_but_type_set_menu_from_pulldown(but);
   UI_but_node_link_set(but, sock, socket_col);
+  UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT);
 
   but->poin = (char *)but;
   but->func_argN = arg;
@@ -816,6 +817,10 @@ static void ui_node_draw_input(
 }
   }
   else {
+row = uiLayoutRow(split, true);
+
+uiTemplateNodeLink(row, C, ntree, node, input);
+
 /* input not linked, show value */
 if (!(input->flag & SOCK_HIDE_VALUE)) {
   switch (input->type) {
@@ -824,25 +829,15 @@ static void ui_node_draw_input(
 case SOCK_BOOLEAN:
 case SOCK_RGBA:
 case SOCK_STRING:
-  row = uiLayoutRow(split, true);
   uiItemR(row, , "default_value", 0, "", ICON_NONE);
   break;
 case SOCK_VECTOR:
-  row = uiLayoutRow(split, false);
+  uiItemS(row);
   col = uiLayoutColumn(row, false);
   uiItemR(col, , "default_value", 0, "", ICON_NONE);
   break;
-
-default:
-  row = uiLayoutRow(split, false);
-  break;
   }
 }
-else {
-  row = uiLayoutRow(split, false);
-}
-
-uiTemplateNodeLink(row, C, ntree, node, input);
   }
 
   /* clear */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


  1   2   >