[Bf-blender-cvs] [093dfdfc949] master: Merge branch 'blender-v2.91-release'

2020-11-02 Thread Nathan Craddock
Commit: 093dfdfc949d7d65a1c66f9c833d26c904029a7b
Author: Nathan Craddock
Date:   Mon Nov 2 22:59:00 2020 -0700
Branches: master
https://developer.blender.org/rB093dfdfc949d7d65a1c66f9c833d26c904029a7b

Merge branch 'blender-v2.91-release'

===



===



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


[Bf-blender-cvs] [20e982e78d7] blender-v2.91-release: Fix T77161: Outliner - Hiding a Collection does not gray out children objects

2020-11-02 Thread Manuel Castilla
Commit: 20e982e78d71c5d55b041ddfef0de306d779469a
Author: Manuel Castilla
Date:   Mon Nov 2 22:52:53 2020 -0700
Branches: blender-v2.91-release
https://developer.blender.org/rB20e982e78d71c5d55b041ddfef0de306d779469a

Fix T77161: Outliner - Hiding a Collection does not gray out children objects

Ensure that When checking "Hide in Viewport" option for a collection
that child objects are drawn grayed out for consistency with the
"Disable in Viewports" toggle.

For checking an object visibility in the viewport the flag
BASE_VISIBLE_VIEWLAYER should be used instead of BASE_VISIBLE_DEPSGRAPH
because the latter ignores viewport visibility.

Manifest Task: T77161

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

===

M   source/blender/editors/space_outliner/outliner_tree.c

===

diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index c44a1554478..4fbb394c38f 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1556,7 +1556,7 @@ static void 
outliner_add_layer_collection_objects(SpaceOutliner *space_outliner,
 TreeElement *te_object = outliner_add_element(space_outliner, tree, 
base->object, ten, 0, 0);
 te_object->directdata = base;
 
-if (!(base->flag & BASE_VISIBLE_DEPSGRAPH)) {
+if (!(base->flag & BASE_VISIBLE_VIEWLAYER)) {
   te_object->flag |= TE_DISABLED;
 }
   }

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


[Bf-blender-cvs] [fbf29086745] master: Outliner: Add "Selectable" object filter

2020-11-02 Thread Jaggz H
Commit: fbf29086745f7e3a2ddb86eb11ed4433b4409946
Author: Jaggz H
Date:   Sat Oct 31 23:37:31 2020 -0600
Branches: master
https://developer.blender.org/rBfbf29086745f7e3a2ddb86eb11ed4433b4409946

Outliner: Add "Selectable" object filter

This addition to the filters allows the user to enable the
outliner tree to restrict the listing to only Selectable objects.

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

===

M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/editors/space_outliner/outliner_tree.c
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_space.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 472400998b1..f568f9befe9 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3420,7 +3420,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 case SPACE_OUTLINER: {
   SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
   space_outliner->filter &= ~(SO_FILTER_UNUSED_1 | 
SO_FILTER_UNUSED_5 |
-  SO_FILTER_UNUSED_12);
+  SO_FILTER_OB_STATE_SELECTABLE);
   space_outliner->storeflag &= ~(SO_TREESTORE_UNUSED_1);
   break;
 }
diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index 79376686342..232585fd7e3 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -2207,6 +2207,9 @@ static int outliner_exclude_filter_get(const 
SpaceOutliner *space_outliner)
 case SO_FILTER_OB_ACTIVE:
   exclude_filter |= SO_FILTER_OB_STATE_ACTIVE;
   break;
+case SO_FILTER_OB_SELECTABLE:
+  exclude_filter |= SO_FILTER_OB_STATE_SELECTABLE;
+  break;
   }
 
   return exclude_filter;
@@ -2289,6 +2292,11 @@ static bool outliner_element_visible_get(ViewLayer 
*view_layer,
   return false;
 }
   }
+  else if (exclude_filter & SO_FILTER_OB_STATE_SELECTABLE) {
+if ((base->flag & BASE_SELECTABLE) == 0) {
+  return false;
+}
+  }
   else {
 BLI_assert(exclude_filter & SO_FILTER_OB_STATE_ACTIVE);
 if (base != BASACT(view_layer)) {
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index 95cc0317a46..fe8ef421963 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -305,7 +305,7 @@ typedef enum eSpaceOutliner_Filter {
   SO_FILTER_NO_OB_CAMERA = (1 << 10),
   SO_FILTER_NO_OB_OTHERS = (1 << 11),
 
-  SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */
+  SO_FILTER_OB_STATE_SELECTABLE = (1 << 12), /* Not set via DNA. */
   SO_FILTER_OB_STATE_VISIBLE = (1 << 13),  /* Not set via DNA. */
   SO_FILTER_OB_STATE_HIDDEN = (1 << 14),   /* Not set via DNA. */
   SO_FILTER_OB_STATE_SELECTED = (1 << 15), /* Not set via DNA. */
@@ -321,7 +321,7 @@ typedef enum eSpaceOutliner_Filter {
 
 #define SO_FILTER_OB_STATE \
   (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_HIDDEN | 
SO_FILTER_OB_STATE_SELECTED | \
-   SO_FILTER_OB_STATE_ACTIVE)
+   SO_FILTER_OB_STATE_ACTIVE | SO_FILTER_OB_STATE_SELECTABLE)
 
 #define SO_FILTER_ANY \
   (SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | 
SO_FILTER_OB_STATE | \
@@ -334,6 +334,7 @@ typedef enum eSpaceOutliner_StateFilter {
   SO_FILTER_OB_HIDDEN = 2,
   SO_FILTER_OB_SELECTED = 3,
   SO_FILTER_OB_ACTIVE = 4,
+  SO_FILTER_OB_SELECTABLE = 5,
 } eSpaceOutliner_StateFilter;
 
 /* SpaceOutliner.show_restrict_flags */
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index 203b8459ae6..605d5c97d72 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3050,6 +3050,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
   {SO_FILTER_OB_HIDDEN, "HIDDEN", 0, "Hidden", "Show hidden objects"},
   {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected 
objects"},
   {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active 
object"},
+  {SO_FILTER_OB_SELECTABLE, "SELECTABLE", 0, "Selectable", "Show only 
selectable objects"},
   {0, NULL, 0, NULL, NULL},
   };

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


[Bf-blender-cvs] [084db58fbd1] master: Cleanup: Use typedef for bevel angle kind enum

2020-11-02 Thread Hans Goudey
Commit: 084db58fbd10a5118baa3c7a2a94d0e51d13e77d
Author: Hans Goudey
Date:   Mon Nov 2 23:05:15 2020 -0600
Branches: master
https://developer.blender.org/rB084db58fbd10a5118baa3c7a2a94d0e51d13e77d

Cleanup: Use typedef for bevel angle kind enum

This makes debugging slightly easier, and makes the code slightly more
explicit about its intentions.

===

M   source/blender/bmesh/tools/bmesh_bevel.c

===

diff --git a/source/blender/bmesh/tools/bmesh_bevel.c 
b/source/blender/bmesh/tools/bmesh_bevel.c
index e8ded83dfbe..4a4a87be6e0 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -303,14 +303,14 @@ typedef enum {
 } FKind;
 
 /** Helper for keeping track of angle kind. */
-enum {
+typedef enum AngleKind {
   /** Angle less than 180 degrees. */
   ANGLE_SMALLER = -1,
   /** 180 degree angle. */
   ANGLE_STRAIGHT = 0,
   /** Angle greater than 180 degrees. */
   ANGLE_LARGER = 1,
-};
+} AngleKind;
 
 /** Bevel parameters and state. */
 typedef struct BevelParams {
@@ -1101,7 +1101,7 @@ static bool is_outside_edge(EdgeHalf *e, const float 
co[3], BMVert **ret_closer_
 }
 
 /* Return whether the angle is less than, equal to, or larger than 180 
degrees. */
-static int edges_angle_kind(EdgeHalf *e1, EdgeHalf *e2, BMVert *v)
+static AngleKind edges_angle_kind(EdgeHalf *e1, EdgeHalf *e2, BMVert *v)
 {
   BMVert *v1 = BM_edge_other_vert(e1->e, v);
   BMVert *v2 = BM_edge_other_vert(e2->e, v);
@@ -3027,7 +3027,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv, 
bool construct)
   for (EdgeHalf *e3 = e->next; e3 != e2; e3 = e3->next) {
 e3->leftv = e3->rightv = v;
   }
-  int ang_kind = edges_angle_kind(e, e2, bv->v);
+  AngleKind ang_kind = edges_angle_kind(e, e2, bv->v);
 
   /* Are we doing special mitering?
* There can only be one outer reflex angle, so only one outer miter,
@@ -3105,7 +3105,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv, 
bool construct)
   }
 }
 else { /* construct == false. */
-  int ang_kind = edges_angle_kind(e, e2, bv->v);
+  AngleKind ang_kind = edges_angle_kind(e, e2, bv->v);
   if ((miter_outer != BEVEL_MITER_SHARP && !emiter && ang_kind == 
ANGLE_LARGER) ||
   (miter_inner != BEVEL_MITER_SHARP && ang_kind == ANGLE_SMALLER)) {
 if (ang_kind == ANGLE_LARGER) {
@@ -4928,7 +4928,7 @@ static VMesh *square_out_adj_vmesh(BevelParams *bp, 
BevVert *bv)
 copy_v3_v3(bndco, bndv->nv.co);
 EdgeHalf *e1 = bndv->efirst;
 EdgeHalf *e2 = bndv->elast;
-int ang_kind = ANGLE_STRAIGHT;
+AngleKind ang_kind = ANGLE_STRAIGHT;
 if (e1 && e2) {
   ang_kind = edges_angle_kind(e1, e2, bv->v);
 }

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


[Bf-blender-cvs] [c6d8300823b] blender-v2.91-release: Fix T82120: Arc miter bevel creates miters on straight edges

2020-11-02 Thread Hans Goudey
Commit: c6d8300823b4e21729450531f2d5a6826ab5a4fa
Author: Hans Goudey
Date:   Mon Nov 2 22:34:57 2020 -0600
Branches: blender-v2.91-release
https://developer.blender.org/rBc6d8300823b4e21729450531f2d5a6826ab5a4fa

Fix T82120: Arc miter bevel creates miters on straight edges

In some situations where two beveled edges were very close to in-line
but not quite straight, bevel would build a miter when it shouldn't.
The code that chose whether to use a miter at each vertex was slightly
incorrect.

For outer miters there is a check for 3 or more selected edges, but an
inner miter can still be useful with only two beveled edges at a vertex,
so we can't use that here. Instead I changed the check for in-line edges
to run before determining whether the angle is reflex or not. The logic
ends up a bit more straightforward as well. This doesn't completely
remove the rather strange looking triangle vertex meshes at each corner,
but it does make it stable when locations are slightly adjusted.

The only other place this `edges_angle_kind` function was used is for
profile=1.0 vertex meshes. I tested and made sure that still works well.

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

===

M   source/blender/bmesh/tools/bmesh_bevel.c

===

diff --git a/source/blender/bmesh/tools/bmesh_bevel.c 
b/source/blender/bmesh/tools/bmesh_bevel.c
index 3a6ae9883e2..e8ded83dfbe 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -59,6 +59,8 @@
 #define BEVEL_SMALL_ANG DEG2RADF(10.0f)
 /** Difference in dot products that corresponds to 10 degree difference 
between vectors. */
 #define BEVEL_SMALL_ANG_DOT 1 - cosf(BEVEL_SMALL_ANG)
+/** Difference in dot products that corresponds to 2.0 degree difference 
between vectors. */
+#define BEVEL_EPSILON_ANG_DOT 1 - cosf(BEVEL_EPSILON_ANG)
 #define BEVEL_MAX_ADJUST_PCT 10.0f
 #define BEVEL_MAX_AUTO_ADJUST_PCT 300.0f
 #define BEVEL_MATCH_SPEC_WEIGHT 0.2
@@ -432,6 +434,18 @@ static bool nearly_parallel(const float d1[3], const float 
d2[3])
   return (fabsf(ang) < BEVEL_EPSILON_ANG) || (fabsf(ang - (float)M_PI) < 
BEVEL_EPSILON_ANG);
 }
 
+/**
+ * \return True if d1 and d2 are parallel or nearly parallel.
+ */
+static bool nearly_parallel_normalized(const float d1[3], const float d2[3])
+{
+  BLI_ASSERT_UNIT_V3(d1);
+  BLI_ASSERT_UNIT_V3(d2);
+
+  const float direction_dot = dot_v3v3(d1, d2);
+  return compare_ff(fabsf(direction_dot), 1.0f, BEVEL_EPSILON_ANG_DOT);
+}
+
 /* Make a new BoundVert of the given kind, inserting it at the end of the 
circular linked
  * list with entry point bv->boundstart, and return it. */
 static BoundVert *add_new_bound_vert(MemArena *mem_arena, VMesh *vm, const 
float co[3])
@@ -1096,6 +1110,12 @@ static int edges_angle_kind(EdgeHalf *e1, EdgeHalf *e2, 
BMVert *v)
   sub_v3_v3v3(dir2, v->co, v2->co);
   normalize_v3(dir1);
   normalize_v3(dir2);
+
+  /* First check for in-line edges using a simpler test. */
+  if (nearly_parallel_normalized(dir1, dir2)) {
+return ANGLE_STRAIGHT;
+  }
+
   /* Angles are in [0,pi]. Need to compare cross product with normal to see if 
they are reflex. */
   float cross[3];
   cross_v3_v3v3(cross, dir1, dir2);
@@ -1110,11 +1130,8 @@ static int edges_angle_kind(EdgeHalf *e1, EdgeHalf *e2, 
BMVert *v)
   else {
 no = v->no;
   }
-  float dot = dot_v3v3(cross, no);
-  if (fabsf(dot) < BEVEL_EPSILON_BIG) {
-return ANGLE_STRAIGHT;
-  }
-  if (dot < 0.0f) {
+
+  if (dot_v3v3(cross, no) < 0.0f) {
 return ANGLE_LARGER;
   }
   return ANGLE_SMALLER;

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


[Bf-blender-cvs] [6290bc4a372] master: Merge branch 'blender-v2.91-release'

2020-11-02 Thread Hans Goudey
Commit: 6290bc4a372f6499397fb9c489fee7e9b45c744c
Author: Hans Goudey
Date:   Mon Nov 2 22:35:15 2020 -0600
Branches: master
https://developer.blender.org/rB6290bc4a372f6499397fb9c489fee7e9b45c744c

Merge branch 'blender-v2.91-release'

===



===



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


[Bf-blender-cvs] [23f3c30b584] master: Fix T64138: Windows Ink continuous grab at window edge.

2020-11-02 Thread Nicholas Rishel
Commit: 23f3c30b5843c69c0eb2f531793a470fadb612e3
Author: Nicholas Rishel
Date:   Mon Nov 2 16:41:40 2020 -0800
Branches: master
https://developer.blender.org/rB23f3c30b5843c69c0eb2f531793a470fadb612e3

Fix T64138: Windows Ink continuous grab at window edge.

WM_POINTERLEAVE occurs when the pen goes out of range or when a
hovering pen leaves the window's boundary. When leaving the window
boundary the xy position is invalid for some Wacom devices.

This change removes creation of GHOST_EventCursor during
WM_POINTERLEAVE events. This prevents unexpected jumping behavior
during continuous grab.

===

M   intern/ghost/intern/GHOST_SystemWin32.cpp

===

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp 
b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 70933bd668e..b820358600c 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1137,11 +1137,6 @@ void GHOST_SystemWin32::processPointerEvent(
   break;
 case WM_POINTERLEAVE:
   window->m_tabletInRange = false;
-  system->pushEvent(new GHOST_EventButton(pointerInfo[0].time,
-  GHOST_kEventCursorMove,
-  window,
-  pointerInfo[0].buttonMask,
-  pointerInfo[0].tabletData));
   break;
 default:
   break;

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


[Bf-blender-cvs] [3049704b150] master: Cleanup: Remove unused parameter in panel code

2020-11-02 Thread Hans Goudey
Commit: 3049704b150579dd267b2631408c2bbbc5f5351c
Author: Hans Goudey
Date:   Mon Nov 2 18:00:46 2020 -0600
Branches: master
https://developer.blender.org/rB3049704b150579dd267b2631408c2bbbc5f5351c

Cleanup: Remove unused parameter in panel code

This is no longer used after rB54da72d3cd546ecb, but passing it to a
recursive call hid the warning.

===

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

===

diff --git a/source/blender/editors/interface/interface_panel.c 
b/source/blender/editors/interface/interface_panel.c
index 7fa45545a16..691035d4662 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -907,13 +907,11 @@ bool UI_panel_matches_search_filter(const Panel *panel)
 }
 
 /**
- * Set the flag telling the panel to use its search result status for
- * its expansion. Also activate animation if that changes the expansion.
+ * Set the flag telling the panel to use its search result status for its 
expansion.
  */
 static void panel_set_expansion_from_seach_filter_recursive(const bContext *C,
 Panel *panel,
-const bool 
use_search_closed,
-const bool 
use_animation)
+const bool 
use_search_closed)
 {
   /* This has to run on inactive panels that may not have a type,
* but we can prevent running on header-less panels in some cases. */
@@ -924,8 +922,7 @@ static void 
panel_set_expansion_from_seach_filter_recursive(const bContext *C,
   LISTBASE_FOREACH (Panel *, child_panel, >children) {
 /* Don't check if the sub-panel is active, otherwise the
  * expansion won't be reset when the parent is closed. */
-panel_set_expansion_from_seach_filter_recursive(
-C, child_panel, use_search_closed, use_animation);
+panel_set_expansion_from_seach_filter_recursive(C, child_panel, 
use_search_closed);
   }
 }
 
@@ -934,14 +931,13 @@ static void 
panel_set_expansion_from_seach_filter_recursive(const bContext *C,
  */
 static void region_panels_set_expansion_from_seach_filter(const bContext *C,
   ARegion *region,
-  const bool 
use_search_closed,
-  const bool 
use_animation)
+  const bool 
use_search_closed)
 {
   LISTBASE_FOREACH (Panel *, panel, >panels) {
 /* Checking if the panel is active is only an optimization, it would be 
fine to run this on
  * inactive panels. */
 if (panel->runtime_flag & PANEL_ACTIVE) {
-  panel_set_expansion_from_seach_filter_recursive(C, panel, 
use_search_closed, use_animation);
+  panel_set_expansion_from_seach_filter_recursive(C, panel, 
use_search_closed);
 }
   }
   set_panels_list_data_expand_flag(C, region);
@@ -1906,10 +1902,10 @@ void UI_panels_end(const bContext *C, ARegion *region, 
int *r_x, int *r_y)
   const bool region_search_filter_active = region->flag & 
RGN_FLAG_SEARCH_FILTER_ACTIVE;
 
   if (properties_space_needs_realign(area, region)) {
-region_panels_set_expansion_from_seach_filter(C, region, 
region_search_filter_active, false);
+region_panels_set_expansion_from_seach_filter(C, region, 
region_search_filter_active);
   }
   else if (region->flag & RGN_FLAG_SEARCH_FILTER_UPDATE) {
-region_panels_set_expansion_from_seach_filter(C, region, 
region_search_filter_active, true);
+region_panels_set_expansion_from_seach_filter(C, region, 
region_search_filter_active);
   }
 
   if (region->flag & RGN_FLAG_SEARCH_FILTER_ACTIVE) {

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


[Bf-blender-cvs] [c067b7460a1] master: Fix C operators can't set default display or sort type for File Browser

2020-11-02 Thread Julian Eisel
Commit: c067b7460a1fb54dc6b21c3cbc2819d9398392ef
Author: Julian Eisel
Date:   Mon Nov 2 23:55:59 2020 +0100
Branches: master
https://developer.blender.org/rBc067b7460a1fb54dc6b21c3cbc2819d9398392ef

Fix C operators can't set default display or sort type for File Browser

`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)

The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.

Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.



This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.

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

Reviewed by: Bastien Montagne

===

M   source/blender/editors/curve/editfont.c
M   source/blender/editors/io/io_alembic.c
M   source/blender/editors/io/io_cache.c
M   source/blender/editors/io/io_collada.c
M   source/blender/editors/io/io_usd.c
M   source/blender/editors/object/object_modifier.c
M   source/blender/editors/object/object_volume.c
M   source/blender/editors/physics/rigidbody_world.c
M   source/blender/editors/screen/screendump.c
M   source/blender/editors/sound/sound_ops.c
M   source/blender/editors/space_buttons/buttons_ops.c
M   source/blender/editors/space_clip/clip_ops.c
M   source/blender/editors/space_file/file_ops.c
M   source/blender/editors/space_file/filelist.c
M   source/blender/editors/space_file/filesel.c
M   source/blender/editors/space_graph/graph_edit.c
M   source/blender/editors/space_image/image_ops.c
M   source/blender/editors/space_info/info_ops.c
M   source/blender/editors/space_node/node_add.c
M   source/blender/editors/space_sequencer/sequencer_add.c
M   source/blender/editors/space_sequencer/sequencer_edit.c
M   source/blender/editors/space_text/text_ops.c
M   source/blender/editors/space_view3d/view3d_edit.c
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/RNA_enum_types.h
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/windowmanager/intern/wm_event_system.c
M   source/blender/windowmanager/intern/wm_files.c
M   source/blender/windowmanager/intern/wm_files_link.c
M   source/blender/windowmanager/intern/wm_operator_props.c

===

diff --git a/source/blender/editors/curve/editfont.c 
b/source/blender/editors/curve/editfont.c
index 1e5984ee14c..1eb35b2c647 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -626,7 +626,7 @@ void FONT_OT_text_paste_from_file(wmOperatorType *ot)
  FILE_OPENFILE,
  WM_FILESEL_FILEPATH,
  FILE_DEFAULTDISPLAY,
- FILE_SORT_ALPHA);
+ FILE_SORT_DEFAULT);
 }
 
 /** \} */
@@ -2160,7 +2160,7 @@ void FONT_OT_open(wmOperatorType *ot)
  FILE_OPENFILE,
  WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH,
  FILE_DEFAULTDISPLAY,
- FILE_SORT_ALPHA);
+ FILE_SORT_DEFAULT);
 }
 
 /** \} */
diff --git a/source/blender/editors/io/io_alembic.c 
b/source/blender/editors/io/io_alembic.c
index 292d8e6066c..70125ff35fc 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -292,7 +292,7 @@ void WM_OT_alembic_export(wmOperatorType *ot)
  FILE_SAVE,
  WM_FILESEL_FILEPATH | WM_FILESEL_SHOW_PROPS,
  FILE_DEFAULTDISPLAY,
- FILE_SORT_ALPHA);
+ FILE_SORT_DEFAULT);
 
   RNA_def_int(ot->srna,
   "start",
@@ -677,7 +677,7 @@ void WM_OT_alembic_import(wmOperatorType *ot)
  FILE_OPENFILE,
  WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | 
WM_FILESEL_SHOW_PROPS,
  FILE_DEFAULTDISPLAY,
- FILE_SORT_ALPHA);
+ FILE_SORT_DEFAULT);
 
   RNA_def_float(
   

[Bf-blender-cvs] [a750acab78c] master: Fix possible use-after-free when closing Blender with File Browser open

2020-11-02 Thread Julian Eisel
Commit: a750acab78cf38ca8f010c4ac81ec948faa79dd5
Author: Julian Eisel
Date:   Mon Nov 2 21:47:08 2020 +0100
Branches: master
https://developer.blender.org/rBa750acab78cf38ca8f010c4ac81ec948faa79dd5

Fix possible use-after-free when closing Blender with File Browser open

I think there wasn't actually any issue currently, but only by luck. We still
passed around and NULL-checked a pointer to freed memory (the file operator,
`SpaceFile.op`) which is easy to break and should be avoided.
Noticed while testing D8598.

===

M   source/blender/editors/include/ED_fileselect.h
M   source/blender/editors/space_file/filesel.c
M   source/blender/windowmanager/intern/wm_event_system.c

===

diff --git a/source/blender/editors/include/ED_fileselect.h 
b/source/blender/editors/include/ED_fileselect.h
index 341f97943a5..84808416074 100644
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@ -35,6 +35,7 @@ struct SpaceFile;
 struct bContext;
 struct bScreen;
 struct uiBlock;
+struct wmOperator;
 struct wmWindow;
 struct wmWindowManager;
 
@@ -145,6 +146,9 @@ void ED_fileselect_window_params_get(const struct wmWindow 
*win,
  int win_size[2],
  bool *is_maximized);
 
+struct ScrArea *ED_fileselect_handler_area_find(const struct wmWindow *win,
+const struct wmOperator 
*file_operator);
+
 int ED_path_extension_type(const char *path);
 int ED_file_extension_icon(const char *path);
 
diff --git a/source/blender/editors/space_file/filesel.c 
b/source/blender/editors/space_file/filesel.c
index 42b2806814b..5d90403937a 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -61,6 +61,7 @@
 #include "BLF_api.h"
 
 #include "ED_fileselect.h"
+#include "ED_screen.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -1050,3 +1051,20 @@ void file_params_renamefile_activate(SpaceFile *sfile, 
FileSelectParams *params)
 params->rename_flag = 0;
   }
 }
+
+ScrArea *ED_fileselect_handler_area_find(const wmWindow *win, const wmOperator 
*file_operator)
+{
+  bScreen *screen = WM_window_get_active_screen(win);
+
+  ED_screen_areas_iter (win, screen, area) {
+if (area->spacetype == SPACE_FILE) {
+  SpaceFile *sfile = area->spacedata.first;
+
+  if (sfile->op == file_operator) {
+return area;
+  }
+}
+  }
+
+  return NULL;
+}
diff --git a/source/blender/windowmanager/intern/wm_event_system.c 
b/source/blender/windowmanager/intern/wm_event_system.c
index 4f2be59eb1a..a6b8eb9d3fd 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1731,8 +1731,21 @@ void WM_event_remove_handlers(bContext *C, ListBase 
*handlers)
 BLI_assert(handler_base->type != 0);
 if (handler_base->type == WM_HANDLER_TYPE_OP) {
   wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
+
   if (handler->op) {
 wmWindow *win = CTX_wm_window(C);
+
+if (handler->is_fileselect) {
+  /* Exit File Browsers refering to this handler/operator. */
+  LISTBASE_FOREACH (wmWindow *, temp_win, >windows) {
+ScrArea *file_area = ED_fileselect_handler_area_find(temp_win, 
handler->op);
+if (!file_area) {
+  continue;
+}
+ED_area_exit(C, file_area);
+  }
+}
+
 if (handler->op->type->cancel) {
   ScrArea *area = CTX_wm_area(C);
   ARegion *region = CTX_wm_region(C);

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


[Bf-blender-cvs] [0c8d40d2dea] temp_bmesh_multires: Fixed bug with multires editmode code messing up loop indices for draw code.

2020-11-02 Thread Joseph Eagar
Commit: 0c8d40d2deacc20e3bb7a58d0af07ec419c664dc
Author: Joseph Eagar
Date:   Mon Nov 2 14:29:45 2020 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rB0c8d40d2deacc20e3bb7a58d0af07ec419c664dc

Fixed bug with multires editmode code messing up loop indices for draw
code.

Also fixed a bug in dyntopo ray tracing, where r_active_vertex_index
wasn't always being set.

===

M   source/blender/blenkernel/intern/multires.c
M   source/blender/blenkernel/intern/pbvh_bmesh.c

===

diff --git a/source/blender/blenkernel/intern/multires.c 
b/source/blender/blenkernel/intern/multires.c
index 823790c8368..780f7cd3438 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -1302,6 +1302,9 @@ void BKE_multires_bmesh_space_set(Object *ob, BMesh *bm, 
int mode)
 
   BKE_mesh_free(me);
   BKE_subdiv_free(sd);
+
+  bm->elem_index_dirty |= BM_FACE|BM_LOOP;
+  bm->elem_table_dirty |= BM_FACE|BM_LOOP;
 }
 
 static void multires_disp_run_cb(void *__restrict userdata,
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c 
b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 08af3cf9eb9..14334500cb4 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -2216,12 +2216,50 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node,
   if (use_original && node->bm_tot_ortri) {
 for (int i = 0; i < node->bm_tot_ortri; i++) {
   const int *t = node->bm_ortri[i];
-  hit |= ray_face_intersection_tri(ray_start,
-   isect_precalc,
-   node->bm_orco[t[0]],
-   node->bm_orco[t[1]],
-   node->bm_orco[t[2]],
-   depth);
+
+  bool hit2 = ray_face_intersection_tri(ray_start,
+isect_precalc,
+node->bm_orco[t[0]],
+node->bm_orco[t[1]],
+node->bm_orco[t[2]],
+depth);
+
+  // ensure sculpt active vertex is set r_active_vertex_index
+  if (hit2) {
+int k = 0;
+BMFace *f = NULL;
+
+TGSET_ITER_INDEX(f, node->bm_faces, k)
+{
+  if (k == i) {
+break;
+  }
+}
+TGSET_ITER_INDEX_END
+
+if (!f) {
+  continue;
+}
+
+BMLoop *l = f->l_first;
+
+for (int j = 0; j < 3; j++, l = l->next) {
+  float dist = len_squared_v3v3(node->bm_orco[t[j]], ray_start);
+
+  if (!hit || dist < len_squared_v3v3(ray_start, nearest_vertex_co)) {
+int idx = t[j];
+
+hit = true;
+copy_v3_v3(nearest_vertex_co, node->bm_orco[t[j]]);
+
+if (r_active_vertex_index) {
+  *r_active_vertex_index = BKE_pbvh_make_vref((intptr_t)l->v);
+}
+  }
+}
+  }
+
+  hit = true;
 }
   }
   else {
@@ -2233,10 +2271,10 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node,
 BMVert *v_tri[3];
 
 BM_face_as_array_vert_tri(f, v_tri);
+bool hit2;
 
-if (ray_face_intersection_tri(
+if (hit2 = ray_face_intersection_tri(
 ray_start, isect_precalc, v_tri[0]->co, v_tri[1]->co, 
v_tri[2]->co, depth)) {
-  hit = true;
 
   if (r_face_normal) {
 normal_tri_v3(r_face_normal, v_tri[0]->co, v_tri[1]->co, 
v_tri[2]->co);
@@ -2245,8 +2283,9 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node,
   if (r_active_vertex_index) {
 float location[3] = {0.0f};
 madd_v3_v3v3fl(location, ray_start, ray_normal, *depth);
+
 for (int j = 0; j < 3; j++) {
-  if (len_squared_v3v3(location, v_tri[j]->co) <
+  if (!hit || len_squared_v3v3(location, v_tri[j]->co) <
   len_squared_v3v3(location, nearest_vertex_co)) {
 copy_v3_v3(nearest_vertex_co, v_tri[j]->co);
 SculptVertRef vref = {(intptr_t)v_tri[j]};  // 
BM_elem_index_get(v_tri[j]);
@@ -2254,6 +2293,8 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node,
   }
 }
   }
+
+  hit = true;
 }
   }
 }
@@ -2717,7 +2758,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh,
   if (view_normal) {
 BLI_assert(len_squared_v3(view_normal) != 0.0f);
   }
-
+#if 1
   if (mode & PBVH_Collapse) {
 EdgeQueue q;
 BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert *) * 2, 0, 128, 
BLI_MEMPOOL_NOP);
@@ -2761,7 +2802,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh,
 BLI_heapsimple_free(q.heap, NULL);
 BLI_mempool_destroy(queue_pool);
   }
-

[Bf-blender-cvs] [9cfcc273194] master: Cleanup: Mark arguments as const

2020-11-02 Thread Hans Goudey
Commit: 9cfcc273194e6e9706fefaac739b3d73eca2f62f
Author: Hans Goudey
Date:   Mon Nov 2 16:25:59 2020 -0600
Branches: master
https://developer.blender.org/rB9cfcc273194e6e9706fefaac739b3d73eca2f62f

Cleanup: Mark arguments as const

===

M   source/blender/blenkernel/BKE_screen.h
M   source/blender/blenkernel/intern/screen.c

===

diff --git a/source/blender/blenkernel/BKE_screen.h 
b/source/blender/blenkernel/BKE_screen.h
index da87ff3e969..50ba4f76144 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -365,8 +365,8 @@ typedef struct Menu {
 
 /* spacetypes */
 struct SpaceType *BKE_spacetype_from_id(int spaceid);
-struct ARegionType *BKE_regiontype_from_id_or_first(struct SpaceType *st, int 
regionid);
-struct ARegionType *BKE_regiontype_from_id(struct SpaceType *st, int regionid);
+struct ARegionType *BKE_regiontype_from_id_or_first(const struct SpaceType 
*st, int regionid);
+struct ARegionType *BKE_regiontype_from_id(const struct SpaceType *st, int 
regionid);
 const struct ListBase *BKE_spacetypes_list(void);
 void BKE_spacetype_register(struct SpaceType *st);
 bool BKE_spacetype_exists(int spaceid);
@@ -387,7 +387,7 @@ void BKE_spacedata_callback_id_remap_set(void (*func)(
 void BKE_spacedata_id_unref(struct ScrArea *area, struct SpaceLink *sl, struct 
ID *id);
 
 /* area/regions */
-struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion 
*region);
+struct ARegion *BKE_area_region_copy(const struct SpaceType *st, const struct 
ARegion *region);
 void BKE_area_region_free(struct SpaceType *st, struct ARegion *region);
 void BKE_area_region_panels_free(struct ListBase *panels);
 void BKE_screen_area_free(struct ScrArea *area);
diff --git a/source/blender/blenkernel/intern/screen.c 
b/source/blender/blenkernel/intern/screen.c
index 17ea19bd824..ee2006f1635 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -354,7 +354,7 @@ SpaceType *BKE_spacetype_from_id(int spaceid)
   return NULL;
 }
 
-ARegionType *BKE_regiontype_from_id_or_first(SpaceType *st, int regionid)
+ARegionType *BKE_regiontype_from_id_or_first(const SpaceType *st, int regionid)
 {
   ARegionType *art;
 
@@ -369,7 +369,7 @@ ARegionType *BKE_regiontype_from_id_or_first(SpaceType *st, 
int regionid)
   return st->regiontypes.first;
 }
 
-ARegionType *BKE_regiontype_from_id(SpaceType *st, int regionid)
+ARegionType *BKE_regiontype_from_id(const SpaceType *st, int regionid)
 {
   ARegionType *art;
 
@@ -446,7 +446,7 @@ static void panel_list_copy(ListBase *newlb, const ListBase 
*lb)
   }
 }
 
-ARegion *BKE_area_region_copy(SpaceType *st, ARegion *region)
+ARegion *BKE_area_region_copy(const SpaceType *st, const ARegion *region)
 {
   ARegion *newar = MEM_dupallocN(region);

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


[Bf-blender-cvs] [e1665c3d319] master: VSE: Media transform redesign

2020-11-02 Thread Richard Antalik
Commit: e1665c3d31906aed195bfdc10a4dd7582f31b1f5
Author: Richard Antalik
Date:   Mon Nov 2 22:15:52 2020 +0100
Branches: master
https://developer.blender.org/rBe1665c3d31906aed195bfdc10a4dd7582f31b1f5

VSE: Media transform redesign

This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

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

===

M   release/scripts/startup/bl_ui/space_sequencer.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenlib/BLI_math_matrix.h
M   source/blender/blenlib/intern/math_matrix.c
M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/imbuf/IMB_imbuf.h
M   source/blender/imbuf/intern/rectop.c
M   source/blender/makesdna/DNA_sequence_types.h
M   source/blender/makesrna/intern/rna_sequencer.c
M   source/blender/sequencer/SEQ_sequencer.h
M   source/blender/sequencer/intern/sequencer.c

===

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index 7d881948466..0171fa902db 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -949,54 +949,28 @@ class SEQUENCER_PT_strip(SequencerButtonsPanel, Panel):
 row.prop(strip, "mute", toggle=True, icon_only=True, emboss=False)
 
 
-class SEQUENCER_PT_adjust_transform_offset(SequencerButtonsPanel, Panel):
-bl_label = "Offset"
-bl_parent_id = "SEQUENCER_PT_adjust_transform"
+class SEQUENCER_PT_adjust_crop(SequencerButtonsPanel, Panel):
+bl_label = "Crop"
 bl_options = {'DEFAULT_CLOSED'}
 bl_category = "Strip"
 
 @classmethod
 def poll(cls, context):
-strip = act_strip(context)
-return strip.type != 'SOUND'
-
-def draw_header(self, context):
-strip = act_strip(context)
-self.layout.prop(strip, "use_translation", text="")
+if not cls.has_sequencer(context):
+return False
 
-def draw(self, context):
 strip = act_strip(context)
-layout = self.layout
-layout.use_property_split = True
-
-layout.active = strip.use_translation and (not strip.mute)
-
-col = layout.column(align=True)
-col.prop(strip.transform, "offset_x", text="Position X")
-col.prop(strip.transform, "offset_y", text="Y")
-
-
-class SEQUENCER_PT_adjust_transform_crop(SequencerButtonsPanel, Panel):
-bl_label = "Crop"
-bl_parent_id = "SEQUENCER_PT_adjust_transform"
-bl_options = {'DEFAULT_CLOSED'}
-bl_category = "Strip"
+if not strip:
+return False
 
-@classmethod
-def poll(cls, context):
 strip = act_strip(context)
 return strip.type != 'SOUND'
 
-def draw_header(self, context):
-strip = act_strip(context)
-self.layout.prop(strip, "use_crop", text="")
-
 def draw(self, context):
 strip = act_strip(context)
 layout = self.layout
 layout.use_property_split = True
-
-layout.active = strip.use_crop and (not strip.mute)
+layout.active = not strip.mute
 
 col = layout.column(align=True)
 

[Bf-blender-cvs] [6b3eca661dc] master: Revert "VSE: Media transform redesign"

2020-11-02 Thread Richard Antalik
Commit: 6b3eca661dc2d0791ecf07b94ef51f13c3aa6d25
Author: Richard Antalik
Date:   Mon Nov 2 20:59:21 2020 +0100
Branches: master
https://developer.blender.org/rB6b3eca661dc2d0791ecf07b94ef51f13c3aa6d25

Revert "VSE: Media transform redesign"

This reverts commit 0277579b2850f0ba097741ca22eb8ae9ccd9bcea.

This commit caused build errors on Linux.

===

M   release/scripts/startup/bl_ui/space_sequencer.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenlib/BLI_math_matrix.h
M   source/blender/blenlib/intern/math_matrix.c
M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/imbuf/IMB_imbuf.h
M   source/blender/imbuf/intern/rectop.c
M   source/blender/makesdna/DNA_sequence_types.h
M   source/blender/makesrna/intern/rna_sequencer.c
M   source/blender/sequencer/SEQ_sequencer.h
M   source/blender/sequencer/intern/sequencer.c

===

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index 0171fa902db..7d881948466 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -949,28 +949,54 @@ class SEQUENCER_PT_strip(SequencerButtonsPanel, Panel):
 row.prop(strip, "mute", toggle=True, icon_only=True, emboss=False)
 
 
-class SEQUENCER_PT_adjust_crop(SequencerButtonsPanel, Panel):
-bl_label = "Crop"
+class SEQUENCER_PT_adjust_transform_offset(SequencerButtonsPanel, Panel):
+bl_label = "Offset"
+bl_parent_id = "SEQUENCER_PT_adjust_transform"
 bl_options = {'DEFAULT_CLOSED'}
 bl_category = "Strip"
 
 @classmethod
 def poll(cls, context):
-if not cls.has_sequencer(context):
-return False
+strip = act_strip(context)
+return strip.type != 'SOUND'
 
+def draw_header(self, context):
 strip = act_strip(context)
-if not strip:
-return False
+self.layout.prop(strip, "use_translation", text="")
+
+def draw(self, context):
+strip = act_strip(context)
+layout = self.layout
+layout.use_property_split = True
+
+layout.active = strip.use_translation and (not strip.mute)
+
+col = layout.column(align=True)
+col.prop(strip.transform, "offset_x", text="Position X")
+col.prop(strip.transform, "offset_y", text="Y")
 
+
+class SEQUENCER_PT_adjust_transform_crop(SequencerButtonsPanel, Panel):
+bl_label = "Crop"
+bl_parent_id = "SEQUENCER_PT_adjust_transform"
+bl_options = {'DEFAULT_CLOSED'}
+bl_category = "Strip"
+
+@classmethod
+def poll(cls, context):
 strip = act_strip(context)
 return strip.type != 'SOUND'
 
+def draw_header(self, context):
+strip = act_strip(context)
+self.layout.prop(strip, "use_crop", text="")
+
 def draw(self, context):
 strip = act_strip(context)
 layout = self.layout
 layout.use_property_split = True
-layout.active = not strip.mute
+
+layout.active = strip.use_crop and (not strip.mute)
 
 col = layout.column(align=True)
 col.prop(strip.crop, "min_x")
@@ -1564,19 +1590,21 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
 split.label(text="%d-%d (%d)" % (sta, end, end - sta + 1), 
translate=False)
 
 
+class SEQUENCER_PT_adjust(SequencerButtonsPanel, Panel):
+bl_label = "Adjust"
+bl_category = "Strip"
+
+def draw(self, context):
+pass
+
+
 class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel):
 bl_label = "Sound"
+bl_parent_id = "SEQUENCER_PT_adjust"
 bl_category = "Strip"
 
 @classmethod
 def poll(cls, context):
-if not cls.has_sequencer(context):
-return False
-
-strip = act_strip(context)
-if not strip:
-return False
-
 strip = act_strip(context)
 return strip.type == 'SOUND'
 
@@ -1608,17 +1636,11 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, 
Panel):
 
 class SEQUENCER_PT_adjust_comp(SequencerButtonsPanel, Panel):
 bl_label = "Compositing"
+bl_parent_id = "SEQUENCER_PT_adjust"
 bl_category = "Strip"
 
 @classmethod
 def poll(cls, context):
-if not cls.has_sequencer(context):
-return False
-
-strip = act_strip(context)
-if not strip:
-return False
-
 strip = act_strip(context)
 return strip.type != 'SOUND'
 
@@ -1637,8 +1659,8 @@ class SEQUENCER_PT_adjust_comp(SequencerButtonsPanel, 
Panel):
 
 class SEQUENCER_PT_adjust_transform(SequencerButtonsPanel, Panel):
 bl_label = "Transform"
+bl_parent_id = "SEQUENCER_PT_adjust"
 bl_category = "Strip"
-bl_options = {'DEFAULT_CLOSED'}
 
 @classmethod
 def poll(cls, context):
@@ -1649,25 +1671,22 @@ 

[Bf-blender-cvs] [b9ec6c305cc] master: Revert "Cleanup: store results of function calls in const values."

2020-11-02 Thread Bastien Montagne
Commit: b9ec6c305cc8c5fe217ea49e36b8edd3ed195f76
Author: Bastien Montagne
Date:   Mon Nov 2 20:31:12 2020 +0100
Branches: master
https://developer.blender.org/rBb9ec6c305cc8c5fe217ea49e36b8edd3ed195f76

Revert "Cleanup: store results of function calls in const values."

This reverts commit 20c4aa13de7ba403e113df8ec69c632b6815eac8.

Wrong buggy commit breaking tests, and not actually adding anything to
code quality.

===

M   source/blender/python/intern/bpy_props.c

===

diff --git a/source/blender/python/intern/bpy_props.c 
b/source/blender/python/intern/bpy_props.c
index a2552ab25b9..d45c8e8b131 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -3388,10 +3388,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject 
*args, PyObject *kw)
 if (!ptype) {
   return NULL;
 }
-const bool is_property_group = RNA_struct_is_a(ptype, _PropertyGroup);
-const bool is_id = RNA_struct_is_ID(ptype);
-
-if (!is_property_group && !is_id) {
+if (!RNA_struct_is_a(ptype, _PropertyGroup) && 
!RNA_struct_is_ID(ptype)) {
   PyErr_Format(PyExc_TypeError,
"PointerProperty(...) expected an RNA type derived from 
%.200s or %.200s",
RNA_struct_ui_name(_ID),
@@ -3416,7 +3413,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject 
*args, PyObject *kw)
 }
 
 if (RNA_struct_idprops_contains_datablock(ptype)) {
-  if (is_property_group) {
+  if (RNA_struct_is_a(srna, _PropertyGroup)) {
 RNA_def_struct_flag(srna, STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES);
   }
 }

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


[Bf-blender-cvs] [0277579b285] master: VSE: Media transform redesign

2020-11-02 Thread Richard Antalik
Commit: 0277579b2850f0ba097741ca22eb8ae9ccd9bcea
Author: Richard Antalik
Date:   Mon Nov 2 19:53:33 2020 +0100
Branches: master
https://developer.blender.org/rB0277579b2850f0ba097741ca22eb8ae9ccd9bcea

VSE: Media transform redesign

This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

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

===

M   release/scripts/startup/bl_ui/space_sequencer.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenlib/BLI_math_matrix.h
M   source/blender/blenlib/intern/math_matrix.c
M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/imbuf/IMB_imbuf.h
M   source/blender/imbuf/intern/rectop.c
M   source/blender/makesdna/DNA_sequence_types.h
M   source/blender/makesrna/intern/rna_sequencer.c
M   source/blender/sequencer/SEQ_sequencer.h
M   source/blender/sequencer/intern/sequencer.c

===

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py 
b/release/scripts/startup/bl_ui/space_sequencer.py
index 7d881948466..0171fa902db 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -949,54 +949,28 @@ class SEQUENCER_PT_strip(SequencerButtonsPanel, Panel):
 row.prop(strip, "mute", toggle=True, icon_only=True, emboss=False)
 
 
-class SEQUENCER_PT_adjust_transform_offset(SequencerButtonsPanel, Panel):
-bl_label = "Offset"
-bl_parent_id = "SEQUENCER_PT_adjust_transform"
+class SEQUENCER_PT_adjust_crop(SequencerButtonsPanel, Panel):
+bl_label = "Crop"
 bl_options = {'DEFAULT_CLOSED'}
 bl_category = "Strip"
 
 @classmethod
 def poll(cls, context):
-strip = act_strip(context)
-return strip.type != 'SOUND'
-
-def draw_header(self, context):
-strip = act_strip(context)
-self.layout.prop(strip, "use_translation", text="")
+if not cls.has_sequencer(context):
+return False
 
-def draw(self, context):
 strip = act_strip(context)
-layout = self.layout
-layout.use_property_split = True
-
-layout.active = strip.use_translation and (not strip.mute)
-
-col = layout.column(align=True)
-col.prop(strip.transform, "offset_x", text="Position X")
-col.prop(strip.transform, "offset_y", text="Y")
-
-
-class SEQUENCER_PT_adjust_transform_crop(SequencerButtonsPanel, Panel):
-bl_label = "Crop"
-bl_parent_id = "SEQUENCER_PT_adjust_transform"
-bl_options = {'DEFAULT_CLOSED'}
-bl_category = "Strip"
+if not strip:
+return False
 
-@classmethod
-def poll(cls, context):
 strip = act_strip(context)
 return strip.type != 'SOUND'
 
-def draw_header(self, context):
-strip = act_strip(context)
-self.layout.prop(strip, "use_crop", text="")
-
 def draw(self, context):
 strip = act_strip(context)
 layout = self.layout
 layout.use_property_split = True
-
-layout.active = strip.use_crop and (not strip.mute)
+layout.active = not strip.mute
 
 col = layout.column(align=True)
 

[Bf-blender-cvs] [5ed4e1e23ab] master: Fix T77819: Snap Incremental does not match grid in all cases

2020-11-02 Thread Germano Cavalcante
Commit: 5ed4e1e23ab19282a8673bdeba3724026b80a880
Author: Germano Cavalcante
Date:   Mon Nov 2 16:13:51 2020 -0300
Branches: master
https://developer.blender.org/rB5ed4e1e23ab19282a8673bdeba3724026b80a880

Fix T77819: Snap Incremental does not match grid in all cases

The behavior of the incremental snap did not take into account the
relative dimensions of the window, which resulted in a different behavior
if the area height was greater than the width.

===

M   source/blender/editors/gpencil/gpencil_edit.c
M   source/blender/editors/include/ED_view3d.h
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/editors/space_view3d/view3d_snap.c
M   source/blender/editors/transform/transform.c

===

diff --git a/source/blender/editors/gpencil/gpencil_edit.c 
b/source/blender/editors/gpencil/gpencil_edit.c
index 77575d88cd3..6258e6e8481 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2737,12 +2737,12 @@ static bool gpencil_snap_poll(bContext *C)
 static int gpencil_snap_to_grid(bContext *C, wmOperator *UNUSED(op))
 {
   bGPdata *gpd = ED_gpencil_data_get_active(C);
-  RegionView3D *rv3d = CTX_wm_region_data(C);
+  ARegion *region = CTX_wm_region(C);
   View3D *v3d = CTX_wm_view3d(C);
   Scene *scene = CTX_data_scene(C);
   Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
   Object *obact = CTX_data_active_object(C);
-  const float gridf = ED_view3d_grid_view_scale(scene, v3d, rv3d, NULL);
+  const float gridf = ED_view3d_grid_view_scale(scene, v3d, region, NULL);
 
   LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
 /* only editable and visible layers are considered */
diff --git a/source/blender/editors/include/ED_view3d.h 
b/source/blender/editors/include/ED_view3d.h
index d3eb6c00f57..f64c6a42f18 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -693,7 +693,7 @@ void ED_view3d_grid_steps(const struct Scene *scene,
   float *r_grid_steps);
 float ED_view3d_grid_view_scale(struct Scene *scene,
 struct View3D *v3d,
-struct RegionView3D *rv3d,
+struct ARegion *region,
 const char **r_grid_unit);
 
 void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index 633344837a1..d4c85eeb3d2 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -949,15 +949,16 @@ void ED_view3d_grid_steps(const Scene *scene,
  * Currently the simulation is only done when RV3D_VIEW_IS_AXIS. */
 float ED_view3d_grid_view_scale(Scene *scene,
 View3D *v3d,
-RegionView3D *rv3d,
+ARegion *region,
 const char **r_grid_unit)
 {
   float grid_scale;
+  RegionView3D *rv3d = region->regiondata;
   if (!rv3d->is_persp && RV3D_VIEW_IS_AXIS(rv3d->view)) {
 /* Decrease the distance between grid snap points depending on zoom. */
 /* `0.38` was a value visually obtained in order to get a snap distance
  * that matches previous versions Blender.*/
-float min_dist = 0.38f * (rv3d->dist / v3d->lens);
+float min_dist = 16.0f / (region->sizex * rv3d->winmat[0][0]);
 float grid_steps[STEPS_LEN];
 ED_view3d_grid_steps(scene, v3d, rv3d, grid_steps);
 /* Skip last item, in case the 'mid_dist' is greater than the largest 
unit. */
@@ -1468,12 +1469,13 @@ static void draw_selected_name(
 }
 
 static void draw_grid_unit_name(
-Scene *scene, RegionView3D *rv3d, View3D *v3d, int xoffset, int *yoffset)
+Scene *scene, ARegion *region, View3D *v3d, int xoffset, int *yoffset)
 {
+  RegionView3D *rv3d = region->regiondata;
   if (!rv3d->is_persp && RV3D_VIEW_IS_AXIS(rv3d->view)) {
 const char *grid_unit = NULL;
 int font_id = BLF_default();
-ED_view3d_grid_view_scale(scene, v3d, rv3d, _unit);
+ED_view3d_grid_view_scale(scene, v3d, region, _unit);
 
 if (grid_unit) {
   char numstr[32] = "";
@@ -1558,7 +1560,7 @@ void view3d_draw_region_info(const bContext *C, ARegion 
*region)
 
 if (v3d->gridflag & (V3D_SHOW_FLOOR | V3D_SHOW_X | V3D_SHOW_Y | 
V3D_SHOW_Z)) {
   /* draw below the viewport name */
-  draw_grid_unit_name(scene, rv3d, v3d, xoffset, );
+  draw_grid_unit_name(scene, region, v3d, xoffset, );
 }
 
 DRW_draw_region_engine_info(xoffset, , VIEW3D_OVERLAY_LINEHEIGHT);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c 
b/source/blender/editors/space_view3d/view3d_snap.c
index 

[Bf-blender-cvs] [ef4aa42ea4f] master: UI: Enable writing global area data (top-bar, status-bar) to .blend's

2020-11-02 Thread Julian Eisel
Commit: ef4aa42ea4ffa1bf7f5ad7f8e7f7b6acf9e3c3e6
Author: Julian Eisel
Date:   Mon Nov 2 18:32:12 2020 +0100
Branches: master
https://developer.blender.org/rBef4aa42ea4ffa1bf7f5ad7f8e7f7b6acf9e3c3e6

UI: Enable writing global area data (top-bar, status-bar) to .blend's

There should not be much user visible here (other than T73668 being addressed).

I added the writing code already for the initial implementation of workspaces,
but we decided to keep it disabled until the top-bar design is more clear. It
was never planned to keep this disabled for so long.

Fixes T73668.

===

M   source/blender/blenkernel/intern/screen.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/makesdna/DNA_screen_types.h
M   source/blender/makesdna/DNA_space_types.h

===

diff --git a/source/blender/blenkernel/intern/screen.c 
b/source/blender/blenkernel/intern/screen.c
index a357b5d98fb..17ea19bd824 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -1368,14 +1368,12 @@ static void write_area_regions(BlendWriter *writer, 
ScrArea *area)
   }
   BLO_write_struct(writer, SpaceConsole, sl);
 }
-#ifdef WITH_GLOBAL_AREA_WRITING
 else if (sl->spacetype == SPACE_TOPBAR) {
   BLO_write_struct(writer, SpaceTopBar, sl);
 }
 else if (sl->spacetype == SPACE_STATUSBAR) {
   BLO_write_struct(writer, SpaceStatusBar, sl);
 }
-#endif
 else if (sl->spacetype == SPACE_USERPREF) {
   BLO_write_struct(writer, SpaceUserPref, sl);
 }
@@ -1397,9 +1395,7 @@ void BKE_screen_area_map_blend_write(BlendWriter *writer, 
ScrAreaMap *area_map)
 
 BLO_write_struct(writer, ScrArea, area);
 
-#ifdef WITH_GLOBAL_AREA_WRITING
 BLO_write_struct(writer, ScrGlobalAreaData, area->global);
-#endif
 
 write_area_regions(writer, area);
 
diff --git a/source/blender/blenloader/intern/writefile.c 
b/source/blender/blenloader/intern/writefile.c
index 95cfeef4243..e4995c991e1 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1639,12 +1639,6 @@ static void write_windowmanager(BlendWriter *writer, 
wmWindowManager *wm, const
   write_wm_xr_data(writer, >xr);
 
   LISTBASE_FOREACH (wmWindow *, win, >windows) {
-#ifndef WITH_GLOBAL_AREA_WRITING
-/* Don't write global areas yet, while we make changes to them. */
-ScrAreaMap global_areas = win->global_areas;
-memset(>global_areas, 0, sizeof(win->global_areas));
-#endif
-
 /* update deprecated screen member (for so loading in 2.7x uses the 
correct screen) */
 win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
 
@@ -1652,11 +1646,7 @@ static void write_windowmanager(BlendWriter *writer, 
wmWindowManager *wm, const
 BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
 BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
 
-#ifdef WITH_GLOBAL_AREA_WRITING
 BKE_screen_area_map_blend_write(writer, >global_areas);
-#else
-win->global_areas = global_areas;
-#endif
 
 /* data is written, clear deprecated data again */
 win->screen = NULL;
diff --git a/source/blender/makesdna/DNA_screen_types.h 
b/source/blender/makesdna/DNA_screen_types.h
index d2360d700d2..bf57dd9ab77 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -322,10 +322,6 @@ typedef struct uiPreview {
   char _pad1[6];
 } uiPreview;
 
-/* These two lines with # tell makesdna this struct can be excluded.
- * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
-#
-#
 typedef struct ScrGlobalAreaData {
   /* Global areas have a non-dynamic size. That means, changing the window
* size doesn't affect their size at all. However, they can still be
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index 7785c700e1c..8eb52bb776b 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -59,10 +59,6 @@ struct wmTimer;
 /* Defined in `buttons_intern.h`. */
 typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
 
-/* TODO 2.8: We don't write the global areas to files currently. Uncomment
- * define to enable writing (should become the default in a bit). */
-//#define WITH_GLOBAL_AREA_WRITING
-
 /*  */
 /** \name SpaceLink (Base)
  * \{ */
@@ -1672,10 +1668,6 @@ typedef enum eSpaceClip_GPencil_Source {
 /** \name Top Bar
  * \{ */
 
-/* These two lines with # tell makesdna this struct can be excluded.
- * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
-#
-#
 typedef struct SpaceTopBar {
   SpaceLink *next, *prev;
   /** Storage of regions for inactive spaces. */
@@ -1692,10 +1684,6 @@ typedef struct SpaceTopBar {
 /** \name Status Bar
  * \{ 

[Bf-blender-cvs] [cf7343a3555] master: Fix Cycles kernel compile error with NanoVDB because of type redefinition

2020-11-02 Thread Patrick Mours
Commit: cf7343a35559c7fec2047c3e5d7ef4dd7c1e64a5
Author: Patrick Mours
Date:   Mon Nov 2 18:00:13 2020 +0100
Branches: master
https://developer.blender.org/rBcf7343a35559c7fec2047c3e5d7ef4dd7c1e64a5

Fix Cycles kernel compile error with NanoVDB because of type redefinition

Cycles defines some basic integer types since it cannot use the standard 
headers when
compiling with NVRTC. NanoVDB however only does this when the "__CUDACC_RTC__" 
define
is set and otherwise includes the standard "stdint.h" header which clashes with 
those typedefs.
So for compatibility do the same thing in the Cycles kernel headers. See also 
T81454.

===

M   intern/cycles/kernel/kernel_compat_cuda.h
M   intern/cycles/kernel/kernel_compat_optix.h

===

diff --git a/intern/cycles/kernel/kernel_compat_cuda.h 
b/intern/cycles/kernel/kernel_compat_cuda.h
index 4094e173da9..ea3b78b7cef 100644
--- a/intern/cycles/kernel/kernel_compat_cuda.h
+++ b/intern/cycles/kernel/kernel_compat_cuda.h
@@ -32,8 +32,12 @@
 
 /* Manual definitions so we can compile without CUDA toolkit. */
 
+#ifdef __CUDACC_RTC__
 typedef unsigned int uint32_t;
 typedef unsigned long long uint64_t;
+#else
+#  include 
+#endif
 typedef unsigned short half;
 typedef unsigned long long CUtexObject;
 
diff --git a/intern/cycles/kernel/kernel_compat_optix.h 
b/intern/cycles/kernel/kernel_compat_optix.h
index e58d8b2aa63..064c99ca100 100644
--- a/intern/cycles/kernel/kernel_compat_optix.h
+++ b/intern/cycles/kernel/kernel_compat_optix.h
@@ -31,8 +31,12 @@
 #  define ATTR_FALLTHROUGH
 #endif
 
+#ifdef __CUDACC_RTC__
 typedef unsigned int uint32_t;
 typedef unsigned long long uint64_t;
+#else
+#  include 
+#endif
 typedef unsigned short half;
 typedef unsigned long long CUtexObject;

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


[Bf-blender-cvs] [1408052781d] master: LibOverride: make some pose options overridable.

2020-11-02 Thread Bastien Montagne
Commit: 1408052781d06b784cdb5e7cbf03874ba42dc9a6
Author: Bastien Montagne
Date:   Mon Nov 2 17:28:30 2020 +0100
Branches: master
https://developer.blender.org/rB1408052781d06b784cdb5e7cbf03874ba42dc9a6

LibOverride: make some pose options overridable.

Request from the studio.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_pose.c 
b/source/blender/makesrna/intern/rna_pose.c
index 942cd3d1a20..7bbf04b17c6 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -1695,6 +1695,8 @@ static void rna_def_pose(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_EDITABLE);
   RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver");
 
+  RNA_define_lib_overridable(true);
+
   /* pose edit options */
   prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", POSE_MIRROR_EDIT);
@@ -1722,6 +1724,8 @@ static void rna_def_pose(BlenderRNA *brna)
   RNA_def_property_update(prop, 0, "rna_Pose_update");
   RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
 
+  RNA_define_lib_overridable(false);
+
   /* animviz */
   rna_def_animviz_common(srna);

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


[Bf-blender-cvs] [c830f213045] temp-T82134-anim-group-colors-to-prefs: Update Grease Pencil anim channel side panel to show a warning when channel colors are disabled.

2020-11-02 Thread Sybren A. Stüvel
Commit: c830f213045ed81c28e60858d90adecf0ba03002
Author: Sybren A. Stüvel
Date:   Mon Nov 2 17:20:47 2020 +0100
Branches: temp-T82134-anim-group-colors-to-prefs
https://developer.blender.org/rBc830f213045ed81c28e60858d90adecf0ba03002

Update Grease Pencil anim channel side panel to show a warning when channel 
colors are disabled.

===

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

===

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 d9dbb60b3b6..da7563b2d4b 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -880,13 +880,18 @@ class GreasePencilLayerDisplayPanel:
 gpd = ob.data
 gpl = gpd.layers.active
 
-row = layout.row(align=True)
+use_colors = context.preferences.edit.use_anim_channel_group_colors
+
+col = layout.column(align=True)
+col.active = use_colors
+row = col.row(align=True)
 row.prop(gpl, "channel_color")
+if not use_colors:
+col.label(text="Channel Colors are disabled in Animation 
preferences")
 
 row = layout.row(align=True)
 row.prop(gpl, "use_solo_mode", text="Show Only on Keyframed")
 
-
 class GreasePencilFlipTintColors(Operator):
 bl_label = "Flip Colors"
 bl_idname = "gpencil.tint_flip"

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


[Bf-blender-cvs] [87b8d6a7b58] temp-T82134-anim-group-colors-to-prefs: Merge remote-tracking branch 'origin/master' into temp-T82134-anim-group-colors-to-prefs

2020-11-02 Thread Sybren A. Stüvel
Commit: 87b8d6a7b5812ed448eb36f27c713ac439f63f12
Author: Sybren A. Stüvel
Date:   Mon Nov 2 17:22:32 2020 +0100
Branches: temp-T82134-anim-group-colors-to-prefs
https://developer.blender.org/rB87b8d6a7b5812ed448eb36f27c713ac439f63f12

Merge remote-tracking branch 'origin/master' into 
temp-T82134-anim-group-colors-to-prefs

===



===



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


[Bf-blender-cvs] [576bd986220] master: Grease Pencil UI code: use `row` for rows in the UI

2020-11-02 Thread Sybren A. Stüvel
Commit: 576bd9862209125c03dc1b12afb0aade618f9bc0
Author: Sybren A. Stüvel
Date:   Mon Nov 2 17:18:21 2020 +0100
Branches: master
https://developer.blender.org/rB576bd9862209125c03dc1b12afb0aade618f9bc0

Grease Pencil UI code: use `row` for rows in the UI

Rename `col` to `row` when it's actually a row (and not a column).

No functional changes.

===

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

===

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 97e87f5451c..d9dbb60b3b6 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -880,11 +880,11 @@ class GreasePencilLayerDisplayPanel:
 gpd = ob.data
 gpl = gpd.layers.active
 
-col = layout.row(align=True)
-col.prop(gpl, "channel_color")
+row = layout.row(align=True)
+row.prop(gpl, "channel_color")
 
-col = layout.row(align=True)
-col.prop(gpl, "use_solo_mode", text="Show Only on Keyframed")
+row = layout.row(align=True)
+row.prop(gpl, "use_solo_mode", text="Show Only on Keyframed")
 
 
 class GreasePencilFlipTintColors(Operator):

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


[Bf-blender-cvs] [aee1e4fc6a1] master: UI: Simplify some tool icon geometry

2020-11-02 Thread Hans Goudey
Commit: aee1e4fc6a1f434ebec0b8d5ddbfb8096c99d0e2
Author: Hans Goudey
Date:   Mon Nov 2 10:10:49 2020 -0600
Branches: master
https://developer.blender.org/rBaee1e4fc6a1f434ebec0b8d5ddbfb8096c99d0e2

UI: Simplify some tool icon geometry

Removing interior vertices can remove some complexity from the final
exports. Also improved the topology slightly in some cases.

===

M   release/datafiles/icons/ops.gpencil.sculpt_randomize.dat
M   release/datafiles/icons/ops.gpencil.sculpt_thickness.dat
M   release/datafiles/icons/ops.gpencil.sculpt_weight.dat
M   release/datafiles/icons/ops.sculpt.border_mask.dat
M   release/datafiles/icons/ops.sculpt.box_trim.dat
M   release/datafiles/icons/ops.sculpt.lasso_mask.dat
M   release/datafiles/icons/ops.sculpt.lasso_trim.dat
M   release/datafiles/icons/ops.sculpt.line_project.dat

===

diff --git a/release/datafiles/icons/ops.gpencil.sculpt_randomize.dat 
b/release/datafiles/icons/ops.gpencil.sculpt_randomize.dat
index cfd1e186f61..6ce7f1948c0 100644
Binary files a/release/datafiles/icons/ops.gpencil.sculpt_randomize.dat and 
b/release/datafiles/icons/ops.gpencil.sculpt_randomize.dat differ
diff --git a/release/datafiles/icons/ops.gpencil.sculpt_thickness.dat 
b/release/datafiles/icons/ops.gpencil.sculpt_thickness.dat
index 1e558806888..7204343c08a 100644
Binary files a/release/datafiles/icons/ops.gpencil.sculpt_thickness.dat and 
b/release/datafiles/icons/ops.gpencil.sculpt_thickness.dat differ
diff --git a/release/datafiles/icons/ops.gpencil.sculpt_weight.dat 
b/release/datafiles/icons/ops.gpencil.sculpt_weight.dat
index 01c9587ec2e..e66af3555c5 100644
Binary files a/release/datafiles/icons/ops.gpencil.sculpt_weight.dat and 
b/release/datafiles/icons/ops.gpencil.sculpt_weight.dat differ
diff --git a/release/datafiles/icons/ops.sculpt.border_mask.dat 
b/release/datafiles/icons/ops.sculpt.border_mask.dat
index 701b96e31d9..0c616d5dc42 100644
Binary files a/release/datafiles/icons/ops.sculpt.border_mask.dat and 
b/release/datafiles/icons/ops.sculpt.border_mask.dat differ
diff --git a/release/datafiles/icons/ops.sculpt.box_trim.dat 
b/release/datafiles/icons/ops.sculpt.box_trim.dat
index c4cd2282a2a..9a2e691a621 100644
Binary files a/release/datafiles/icons/ops.sculpt.box_trim.dat and 
b/release/datafiles/icons/ops.sculpt.box_trim.dat differ
diff --git a/release/datafiles/icons/ops.sculpt.lasso_mask.dat 
b/release/datafiles/icons/ops.sculpt.lasso_mask.dat
index 109ce3991ce..5406def96a7 100644
Binary files a/release/datafiles/icons/ops.sculpt.lasso_mask.dat and 
b/release/datafiles/icons/ops.sculpt.lasso_mask.dat differ
diff --git a/release/datafiles/icons/ops.sculpt.lasso_trim.dat 
b/release/datafiles/icons/ops.sculpt.lasso_trim.dat
index 31e7919d3c5..e87cdb97fec 100644
Binary files a/release/datafiles/icons/ops.sculpt.lasso_trim.dat and 
b/release/datafiles/icons/ops.sculpt.lasso_trim.dat differ
diff --git a/release/datafiles/icons/ops.sculpt.line_project.dat 
b/release/datafiles/icons/ops.sculpt.line_project.dat
index 816048d26c2..44cdf70a0df 100644
Binary files a/release/datafiles/icons/ops.sculpt.line_project.dat and 
b/release/datafiles/icons/ops.sculpt.line_project.dat differ

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


[Bf-blender-cvs] [db18ba07b50] master: Fix py-defined pointer properties wrong tag re ID ownership.

2020-11-02 Thread Bastien Montagne
Commit: db18ba07b502fd64955626241a6a40333cdc63bd
Author: Bastien Montagne
Date:   Mon Nov 2 17:00:55 2020 +0100
Branches: master
https://developer.blender.org/rBdb18ba07b502fd64955626241a6a40333cdc63bd

Fix py-defined pointer properties wrong tag re ID ownership.

This fixes critical bug with liboverride when soe add-ons add some
RNA ID Pointer properties.

ID pointers should **never** have ownership of their ID when defined
from python.

(As a reminder, RNA properties owning their ID pointers are extremely
rare even from C code, only embedded IDs (root node trees, master
collections) and the shape keys snowflakes are concerned.)

===

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

===

diff --git a/source/blender/makesrna/intern/rna_define.c 
b/source/blender/makesrna/intern/rna_define.c
index 8eb964b8c17..c31d170113d 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1843,6 +1843,10 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, 
StructRNA *type)
   DefRNA.error = true;
   break;
   }
+
+  if ((type->flag & STRUCT_ID) != 0) {
+prop->flag |= PROP_PTR_NO_OWNERSHIP;
+  }
 }
 
 void RNA_def_property_enum_native_type(PropertyRNA *prop, const char 
*native_enum_type)

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


[Bf-blender-cvs] [20c4aa13de7] master: Cleanup: store results of function calls in const values.

2020-11-02 Thread Bastien Montagne
Commit: 20c4aa13de7ba403e113df8ec69c632b6815eac8
Author: Bastien Montagne
Date:   Mon Nov 2 17:07:39 2020 +0100
Branches: master
https://developer.blender.org/rB20c4aa13de7ba403e113df8ec69c632b6815eac8

Cleanup: store results of function calls in const values.

===

M   source/blender/python/intern/bpy_props.c

===

diff --git a/source/blender/python/intern/bpy_props.c 
b/source/blender/python/intern/bpy_props.c
index d45c8e8b131..a2552ab25b9 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -3388,7 +3388,10 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject 
*args, PyObject *kw)
 if (!ptype) {
   return NULL;
 }
-if (!RNA_struct_is_a(ptype, _PropertyGroup) && 
!RNA_struct_is_ID(ptype)) {
+const bool is_property_group = RNA_struct_is_a(ptype, _PropertyGroup);
+const bool is_id = RNA_struct_is_ID(ptype);
+
+if (!is_property_group && !is_id) {
   PyErr_Format(PyExc_TypeError,
"PointerProperty(...) expected an RNA type derived from 
%.200s or %.200s",
RNA_struct_ui_name(_ID),
@@ -3413,7 +3416,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject 
*args, PyObject *kw)
 }
 
 if (RNA_struct_idprops_contains_datablock(ptype)) {
-  if (RNA_struct_is_a(srna, _PropertyGroup)) {
+  if (is_property_group) {
 RNA_def_struct_flag(srna, STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES);
   }
 }

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


[Bf-blender-cvs] [4c460a2dbd0] master: Fix incorrect colors in grease pencil strength tool icon

2020-11-02 Thread Hans Goudey
Commit: 4c460a2dbd0eed9950737690ce691092fb107d1e
Author: Hans Goudey
Date:   Mon Nov 2 09:52:23 2020 -0600
Branches: master
https://developer.blender.org/rB4c460a2dbd0eed9950737690ce691092fb107d1e

Fix incorrect colors in grease pencil strength tool icon

===

M   release/datafiles/icons/ops.gpencil.sculpt_strength.dat

===

diff --git a/release/datafiles/icons/ops.gpencil.sculpt_strength.dat 
b/release/datafiles/icons/ops.gpencil.sculpt_strength.dat
index 7fced673192..a280ad7ab3e 100644
Binary files a/release/datafiles/icons/ops.gpencil.sculpt_strength.dat and 
b/release/datafiles/icons/ops.gpencil.sculpt_strength.dat differ

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


[Bf-blender-cvs] [abcb0845405] temp-T82156-parenting-and-constraints: Merge remote-tracking branch 'origin/master' into temp-T82156-parenting-and-constraints

2020-11-02 Thread Sybren A. Stüvel
Commit: abcb0845405036640bbbdce7b2fe1cfc9293236c
Author: Sybren A. Stüvel
Date:   Mon Nov 2 15:50:44 2020 +0100
Branches: temp-T82156-parenting-and-constraints
https://developer.blender.org/rBabcb0845405036640bbbdce7b2fe1cfc9293236c

Merge remote-tracking branch 'origin/master' into 
temp-T82156-parenting-and-constraints

===



===



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


[Bf-blender-cvs] [3e9823ac4af] temp-T82156-parenting-and-constraints: Cleanup: Sanitise return value of `ED_object_parent_set()`

2020-11-02 Thread Sybren A. Stüvel
Commit: 3e9823ac4afa42f7f9e2d89e5b29f7d74d6d0359
Author: Sybren A. Stüvel
Date:   Mon Nov 2 10:56:45 2020 +0100
Branches: temp-T82156-parenting-and-constraints
https://developer.blender.org/rB3e9823ac4afa42f7f9e2d89e5b29f7d74d6d0359

Cleanup: Sanitise return value of `ED_object_parent_set()`

Return `false` from `ED_object_parent_set()` when parent and child are
the same object. This would break the parenting operator, as returning
`false` stops its loop over all selected objects. This tight coupling
caused T82312.

The loop now has its own check for this, so that it properly continues,
and the implementation of `ED_object_parent_set()` is decoupled from its
surrounding code.

No functional changes.

===

M   source/blender/editors/include/ED_object.h
M   source/blender/editors/object/object_relations.c

===

diff --git a/source/blender/editors/include/ED_object.h 
b/source/blender/editors/include/ED_object.h
index 6fdd65fdcc9..2e9b711c99a 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -160,6 +160,7 @@ extern struct EnumPropertyItem prop_clear_parent_types[];
 extern struct EnumPropertyItem prop_make_parent_types[];
 #endif
 
+/* Set the object's parent, return true iff successful. */
 bool ED_object_parent_set(struct ReportList *reports,
   const struct bContext *C,
   struct Scene *scene,
diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 3d65a9e5fcb..46624a76999 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -696,7 +696,7 @@ bool ED_object_parent_set(ReportList *reports,
   /* Preconditions. */
   if (ob == par) {
 /* Parenting an object to itself is impossible. */
-return true;
+return false;
   }
 
   if (BKE_object_parent_loop_check(par, ob)) {
@@ -981,6 +981,12 @@ struct ParentingContext {
 static bool parent_set_nonvertex_parent(bContext *C, struct ParentingContext 
*parenting_context)
 {
   CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
+if (ob == parenting_context->par) {
+  /* ED_object_parent_set() will fail (and thus return false), but this 
case shouldn't break
+   * this loop. It's expected that the active object is also selected. */
+  continue;
+}
+
 if (!ED_object_parent_set(parenting_context->reports,
   C,
   parenting_context->scene,
@@ -1005,6 +1011,12 @@ static bool 
parent_set_vertex_parent_with_kdtree(bContext *C,
   int vert_par[3] = {0, 0, 0};
 
   CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
+if (ob == parenting_context->par) {
+  /* ED_object_parent_set() will fail (and thus return false), but this 
case shouldn't break
+   * this loop. It's expected that the active object is also selected. */
+  continue;
+}
+
 parent_set_vert_find(tree, ob, vert_par, parenting_context->is_vertex_tri);
 if (!ED_object_parent_set(parenting_context->reports,
   C,

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


[Bf-blender-cvs] [e5e2a10a137] temp-T82156-parenting-and-constraints: Cleanup: Document output of `BKE_object_where_is_calc` and friends

2020-11-02 Thread Sybren A. Stüvel
Commit: e5e2a10a137081060e1e64dee16523ebd4d617ae
Author: Sybren A. Stüvel
Date:   Mon Nov 2 15:16:05 2020 +0100
Branches: temp-T82156-parenting-and-constraints
https://developer.blender.org/rBe5e2a10a137081060e1e64dee16523ebd4d617ae

Cleanup: Document output of `BKE_object_where_is_calc` and friends

Add a comment to the declaration of the `BKE_object_where_is_calc...()`
functions to explain where the result of the calculation is stored.

No functional changes.

===

M   source/blender/blenkernel/BKE_object.h

===

diff --git a/source/blender/blenkernel/BKE_object.h 
b/source/blender/blenkernel/BKE_object.h
index 0a992f2cb58..b7015942cb4 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -191,6 +191,8 @@ struct Base **BKE_object_pose_base_array_get(struct 
ViewLayer *view_layer,
  unsigned int *r_bases_len);
 
 void BKE_object_get_parent_matrix(struct Object *ob, struct Object *par, float 
r_parentmat[4][4]);
+
+/* Compute object world transform and store it in ob->obmat. */
 void BKE_object_where_is_calc(struct Depsgraph *depsgraph, struct Scene 
*scene, struct Object *ob);
 void BKE_object_where_is_calc_ex(struct Depsgraph *depsgraph,
  struct Scene *scene,

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


[Bf-blender-cvs] [75d1139fb52] temp-T82156-parenting-and-constraints: Fix T82156: Object with Copy Rotation Constraints translates when being parented

2020-11-02 Thread Sybren A. Stüvel
Commit: 75d1139fb522b15655efca103f3354e8018fb591
Author: Sybren A. Stüvel
Date:   Mon Nov 2 15:20:33 2020 +0100
Branches: temp-T82156-parenting-and-constraints
https://developer.blender.org/rB75d1139fb522b15655efca103f3354e8018fb591

Fix T82156: Object with Copy Rotation Constraints translates when being parented

Avoid application of constraints when computing the parent-inverse
matrix.

Constraints are meant to be evaluated last; object transforms are
computed this order:

1. `parent->obmat` (the parent object's world matrix)
2. `ob->parentinv` (the object's parent-inverse matrix)
3. Object's loc/rot/scale
4. Object's constraint evaluation

When the constraints are used to compute the parent-inverse matrix,
their effect is moved from step 4 to step 2 in this list, potentially
rotating or scaling the object's local transform. This causes unwanted
movement as reported in T82156.

This behaviour (erroneously taking the constraints into account) has
been in Blender since the first commit, so historically I can only find
"Initial revision" as context.

===

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

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 6bfee0194b0..8f3cb06273d 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2855,7 +2855,11 @@ void BKE_object_workob_calc_parent(Depsgraph *depsgraph, 
Scene *scene, Object *o
   workob->par2 = ob->par2;
   workob->par3 = ob->par3;
 
-  workob->constraints = ob->constraints;
+  /* The effects of constraints should NOT be included in the parent-inverse 
matrix. Constraints
+   * are supposed to be applied after the object's local loc/rot/scale. If the 
(inverted) effect of
+   * constraints would be included in the parent inverse matrix, these would 
be applied before the
+   * object's local loc/rot/scale instead of after. For example, a "Copy 
Rotation" constraint would
+   * rotate the object's local translation as well. See T82156. */
 
   BLI_strncpy(workob->parsubstr, ob->parsubstr, sizeof(workob->parsubstr));

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


[Bf-blender-cvs] [7872bcafa0f] master: Cleanup: Document output of `BKE_object_where_is_calc` and friends

2020-11-02 Thread Sybren A. Stüvel
Commit: 7872bcafa0ffdc642406ac87e5261f69bb0d7bfb
Author: Sybren A. Stüvel
Date:   Mon Nov 2 15:16:05 2020 +0100
Branches: master
https://developer.blender.org/rB7872bcafa0ffdc642406ac87e5261f69bb0d7bfb

Cleanup: Document output of `BKE_object_where_is_calc` and friends

Add a comment to the declaration of the `BKE_object_where_is_calc...()`
functions to explain where the result of the calculation is stored.

No functional changes.

===

M   source/blender/blenkernel/BKE_object.h

===

diff --git a/source/blender/blenkernel/BKE_object.h 
b/source/blender/blenkernel/BKE_object.h
index 0a992f2cb58..b7015942cb4 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -191,6 +191,8 @@ struct Base **BKE_object_pose_base_array_get(struct 
ViewLayer *view_layer,
  unsigned int *r_bases_len);
 
 void BKE_object_get_parent_matrix(struct Object *ob, struct Object *par, float 
r_parentmat[4][4]);
+
+/* Compute object world transform and store it in ob->obmat. */
 void BKE_object_where_is_calc(struct Depsgraph *depsgraph, struct Scene 
*scene, struct Object *ob);
 void BKE_object_where_is_calc_ex(struct Depsgraph *depsgraph,
  struct Scene *scene,

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


[Bf-blender-cvs] [7887e91d316] master: Cleanup: Sanitise return value of `ED_object_parent_set()`

2020-11-02 Thread Sybren A. Stüvel
Commit: 7887e91d316567366e99fb0d066861cb89ae5816
Author: Sybren A. Stüvel
Date:   Mon Nov 2 10:56:45 2020 +0100
Branches: master
https://developer.blender.org/rB7887e91d316567366e99fb0d066861cb89ae5816

Cleanup: Sanitise return value of `ED_object_parent_set()`

Consistently return `false` from `ED_object_parent_set()` when parenting
is not possible. Before, when parent and child were the same object, the
function would return `true` even though the parent-child relation was
not made.

Just returning `false` in the `parent == child` case would break the
parenting operator, as `false` stops its loop over all selected objects.
This tight coupling caused T82312. The loop now has its own check for
this, so that it properly continues, and the implementation of
`ED_object_parent_set()` is decoupled from its surrounding code.

No functional changes.

===

M   source/blender/editors/include/ED_object.h
M   source/blender/editors/object/object_relations.c

===

diff --git a/source/blender/editors/include/ED_object.h 
b/source/blender/editors/include/ED_object.h
index 6fdd65fdcc9..2e9b711c99a 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -160,6 +160,7 @@ extern struct EnumPropertyItem prop_clear_parent_types[];
 extern struct EnumPropertyItem prop_make_parent_types[];
 #endif
 
+/* Set the object's parent, return true iff successful. */
 bool ED_object_parent_set(struct ReportList *reports,
   const struct bContext *C,
   struct Scene *scene,
diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 3d65a9e5fcb..46624a76999 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -696,7 +696,7 @@ bool ED_object_parent_set(ReportList *reports,
   /* Preconditions. */
   if (ob == par) {
 /* Parenting an object to itself is impossible. */
-return true;
+return false;
   }
 
   if (BKE_object_parent_loop_check(par, ob)) {
@@ -981,6 +981,12 @@ struct ParentingContext {
 static bool parent_set_nonvertex_parent(bContext *C, struct ParentingContext 
*parenting_context)
 {
   CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
+if (ob == parenting_context->par) {
+  /* ED_object_parent_set() will fail (and thus return false), but this 
case shouldn't break
+   * this loop. It's expected that the active object is also selected. */
+  continue;
+}
+
 if (!ED_object_parent_set(parenting_context->reports,
   C,
   parenting_context->scene,
@@ -1005,6 +1011,12 @@ static bool 
parent_set_vertex_parent_with_kdtree(bContext *C,
   int vert_par[3] = {0, 0, 0};
 
   CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
+if (ob == parenting_context->par) {
+  /* ED_object_parent_set() will fail (and thus return false), but this 
case shouldn't break
+   * this loop. It's expected that the active object is also selected. */
+  continue;
+}
+
 parent_set_vert_find(tree, ob, vert_par, parenting_context->is_vertex_tri);
 if (!ED_object_parent_set(parenting_context->reports,
   C,

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


[Bf-blender-cvs] [417ba6aa1ca] master: GPencil: Cleanup comments typo error

2020-11-02 Thread Antonio Vazquez
Commit: 417ba6aa1cacd7e69df7f54207627f13328fd3f9
Author: Antonio Vazquez
Date:   Mon Nov 2 15:27:16 2020 +0100
Branches: master
https://developer.blender.org/rB417ba6aa1cacd7e69df7f54207627f13328fd3f9

GPencil: Cleanup comments typo error

===

M   source/blender/makesdna/DNA_brush_types.h

===

diff --git a/source/blender/makesdna/DNA_brush_types.h 
b/source/blender/makesdna/DNA_brush_types.h
index 713f5ee2afa..866c1c44e3f 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -183,7 +183,7 @@ typedef enum eGPBrush_Presets {
   GP_BRUSH_PRESET_DRAW_WEIGHT = 300,
 } eGPBrush_Presets;
 
-/* BrushGpencilSettings->gp_flag */
+/* BrushGpencilSettings->flag */
 typedef enum eGPDbrush_Flag {
   /* brush use pressure */
   GP_BRUSH_USE_PRESSURE = (1 << 0),

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


[Bf-blender-cvs] [11d12d543d1] geometry-nodes: Fix build error on windows: Don't use designated initializers in C++

2020-11-02 Thread Hans Goudey
Commit: 11d12d543d15993810861db70c83bf6b9e58eb02
Author: Hans Goudey
Date:   Mon Nov 2 08:15:49 2020 -0600
Branches: geometry-nodes
https://developer.blender.org/rB11d12d543d15993810861db70c83bf6b9e58eb02

Fix build error on windows: Don't use designated initializers in C++

===

M   source/blender/modifiers/intern/MOD_nodes.cc
M   source/blender/nodes/geometry/nodes/node_geo_boolean.cc

===

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc 
b/source/blender/modifiers/intern/MOD_nodes.cc
index 03c986fc6e4..093947a42f5 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -399,22 +399,26 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket 
   static const SocketPropertyType float_type = {
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueFloat *value = (bNodeSocketValueFloat 
*)socket.default_value;
-IDPropertyTemplate idprop = {.f = value->value};
+IDPropertyTemplate idprop = {0};
+idprop.f = value->value;
 return IDP_New(IDP_FLOAT, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueFloat *value = (bNodeSocketValueFloat 
*)socket.default_value;
-IDPropertyTemplate idprop = {.d = value->min};
+IDPropertyTemplate idprop = {0};
+idprop.d = value->min;
 return IDP_New(IDP_DOUBLE, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueFloat *value = (bNodeSocketValueFloat 
*)socket.default_value;
-IDPropertyTemplate idprop = {.d = value->max};
+IDPropertyTemplate idprop = {0};
+idprop.d = value->max;
 return IDP_New(IDP_DOUBLE, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueFloat *value = (bNodeSocketValueFloat 
*)socket.default_value;
-IDPropertyTemplate idprop = {.d = value->value};
+IDPropertyTemplate idprop = {0};
+idprop.d = value->value;
 return IDP_New(IDP_DOUBLE, , name);
   },
   [](const bNodeSocket ) {
@@ -431,22 +435,26 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket 
   static const SocketPropertyType int_type = {
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueInt *value = (bNodeSocketValueInt 
*)socket.default_value;
-IDPropertyTemplate idprop = {.i = value->value};
+IDPropertyTemplate idprop = {0};
+idprop.i = value->value;
 return IDP_New(IDP_INT, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueInt *value = (bNodeSocketValueInt 
*)socket.default_value;
-IDPropertyTemplate idprop = {.i = value->min};
+IDPropertyTemplate idprop = {0};
+idprop.i = value->min;
 return IDP_New(IDP_INT, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueInt *value = (bNodeSocketValueInt 
*)socket.default_value;
-IDPropertyTemplate idprop = {.i = value->max};
+IDPropertyTemplate idprop = {0};
+idprop.i = value->max;
 return IDP_New(IDP_INT, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueInt *value = (bNodeSocketValueInt 
*)socket.default_value;
-IDPropertyTemplate idprop = {.i = value->value};
+IDPropertyTemplate idprop = {0};
+idprop.i = value->value;
 return IDP_New(IDP_INT, , name);
   },
   [](const bNodeSocket ) {
@@ -470,12 +478,14 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket 
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueVector *value = (bNodeSocketValueVector 
*)socket.default_value;
-IDPropertyTemplate idprop = {.d = value->min};
+IDPropertyTemplate idprop = {0};
+idprop.d = value->min;
 return IDP_New(IDP_DOUBLE, , name);
   },
   [](const bNodeSocket , const char *name) {
 bNodeSocketValueVector *value = (bNodeSocketValueVector 
*)socket.default_value;
-IDPropertyTemplate idprop = {.d = value->max};
+IDPropertyTemplate idprop = {0};
+idprop.d = value->max;
 return IDP_New(IDP_DOUBLE, , name);
   },
   [](const bNodeSocket , const char *name) {
@@ -504,20 +514,24 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket 
   static const SocketPropertyType boolean_type = {
   

[Bf-blender-cvs] [2c6114b238d] geometry-nodes: Merge branch 'master' into geometry-nodes

2020-11-02 Thread Hans Goudey
Commit: 2c6114b238d308a1a036c2e3fef4418cb80d7c68
Author: Hans Goudey
Date:   Mon Nov 2 08:15:15 2020 -0600
Branches: geometry-nodes
https://developer.blender.org/rB2c6114b238d308a1a036c2e3fef4418cb80d7c68

Merge branch 'master' into geometry-nodes

===



===



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


[Bf-blender-cvs] [b1213e8cf91] master: Add comment about size of generated previews of filebrowser thumnails.

2020-11-02 Thread Bastien Montagne
Commit: b1213e8cf91667d6b35adade71c0511d0d7746b5
Author: Bastien Montagne
Date:   Mon Nov 2 15:10:38 2020 +0100
Branches: master
https://developer.blender.org/rBb1213e8cf91667d6b35adade71c0511d0d7746b5

Add comment about size of generated previews of filebrowser thumnails.

===

M   source/blender/editors/space_file/filelist.c

===

diff --git a/source/blender/editors/space_file/filelist.c 
b/source/blender/editors/space_file/filelist.c
index faa23bc4f83..465f05246ca 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1294,6 +1294,8 @@ static void filelist_cache_preview_runf(TaskPool 
*__restrict pool, void *taskdat
   }
 
   IMB_thumb_path_lock(preview->path);
+  /* Always generate biggest preview size for now, it's simpler and avoids 
having to re-generate in
+   * case user switch to a biger preview size... */
   preview->img = IMB_thumb_manage(preview->path, THB_LARGE, source);
   IMB_thumb_path_unlock(preview->path);

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


[Bf-blender-cvs] [42f6aada98a] blender-v2.91-release: Fix crash opening some 2.4x .blend files with drivers or NLA editor

2020-11-02 Thread Brecht Van Lommel
Commit: 42f6aada98a655bce975a8dc24aa67e33200fbd9
Author: Brecht Van Lommel
Date:   Mon Nov 2 14:26:49 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB42f6aada98a655bce975a8dc24aa67e33200fbd9

Fix crash opening some 2.4x .blend files with drivers or NLA editor

For example, outlinertest.blend from test240.zip.

===

M   source/blender/blenloader/intern/readfile.c
M   source/blender/editors/space_nla/space_nla.c

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index c49808c3718..5a6324eb8e1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2527,7 +2527,9 @@ static void direct_link_ipo(BlendDataReader *reader, Ipo 
*ipo)
   /* Undo generic endian switching. */
   if (BLO_read_requires_endian_switch(reader)) {
 BLI_endian_switch_int16(>blocktype);
-BLI_endian_switch_int16(>driver->blocktype);
+if (icu->driver != NULL) {
+  BLI_endian_switch_int16(>driver->blocktype);
+}
   }
 }
   }
diff --git a/source/blender/editors/space_nla/space_nla.c 
b/source/blender/editors/space_nla/space_nla.c
index 7e3f90b01ba..c6fe1b8539e 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -148,7 +148,7 @@ static void nla_init(struct wmWindowManager *wm, ScrArea 
*area)
   /* init dopesheet data if non-existent (i.e. for old files) */
   if (snla->ads == NULL) {
 snla->ads = MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet");
-snla->ads->source = (ID *)WM_window_get_active_scene(wm->winactive);
+snla->ads->source = (wm->winactive) ? (ID 
*)WM_window_get_active_scene(wm->winactive) : NULL;
   }
 
   ED_area_tag_refresh(area);

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


[Bf-blender-cvs] [dca65390f05] master: Another attempt at fixing T81963: Random rare crashes in override code.

2020-11-02 Thread Bastien Montagne
Commit: dca65390f056051ae02efe6a2b7ec82a8c26d2ac
Author: Bastien Montagne
Date:   Mon Nov 2 11:56:34 2020 +0100
Branches: master
https://developer.blender.org/rBdca65390f056051ae02efe6a2b7ec82a8c26d2ac

Another attempt at fixing T81963: Random rare crashes in override code.

Adding another pass of ensuring valid up-to-date pose data in RNA
function itself...

===

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

===

diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 57dc83f1db7..aa5e28b35bf 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1359,7 +1359,7 @@ bool BKE_lib_override_library_operations_create(Main 
*bmain, ID *local)
 }
 
 if (GS(local->name) == ID_OB) {
-  /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph 
evaluation would
+  /* Our beloved pose's bone cross-data pointers. Usually, depsgraph 
evaluation would
* ensure 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;
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index 562738efdaa..d367bc663f1 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -26,6 +26,7 @@
 #include "DNA_constraint_types.h"
 #include "DNA_key_types.h"
 #include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
 
 #include "BLI_listbase.h"
 #include "BLI_string.h"
@@ -37,6 +38,7 @@
 #  include "PIL_time_utildefines.h"
 #endif
 
+#include "BKE_armature.h"
 #include "BKE_idprop.h"
 #include "BKE_lib_override.h"
 #include "BKE_main.h"
@@ -593,6 +595,27 @@ bool RNA_struct_override_matches(Main *bmain,
   }
 #endif
 
+  if (ptr_local->owner_id == ptr_local->data && GS(ptr_local->owner_id->name) 
== ID_OB) {
+/* Our beloved pose's bone cross-data pointers. Usually, depsgraph 
evaluation would
+ * ensure 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.
+ *
+ * Note: Typically callers of this function (from BKE_lib_override area) 
will already have
+ * ensured this. However, studio is still reporting sporadic, 
unreproducible crashes due to
+ * invalid pose data, so think there are still some cases where some 
armatures are somehow
+ * missing updates (possibly due to dependencies?). Since calling this 
function on same ID
+ * several time is almost free, and safe even in a threaded context as 
long as it has been done
+ * at least once first outside of threaded processing, we do it another 
time here. */
+Object *ob_local = (Object *)ptr_local->owner_id;
+if (ob_local->type == OB_ARMATURE) {
+  Object *ob_reference = (Object 
*)ptr_local->owner_id->override_library->reference;
+  BLI_assert(ob_local->data != NULL);
+  BLI_assert(ob_reference->data != NULL);
+  BKE_pose_ensure(bmain, ob_local, ob_local->data, true);
+  BKE_pose_ensure(bmain, ob_reference, ob_reference->data, true);
+}
+  }
+
   iterprop = RNA_struct_iterator_property(ptr_local->type);
 
   for (RNA_property_collection_begin(ptr_local, iterprop, ); iter.valid;

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


[Bf-blender-cvs] [2b98a9269b4] master: LibOverride: Do not assert on missing operands in apply function.

2020-11-02 Thread Bastien Montagne
Commit: 2b98a9269b46fe909f07125930651a6a8b58e8da
Author: Bastien Montagne
Date:   Mon Nov 2 11:55:26 2020 +0100
Branches: master
https://developer.blender.org/rB2b98a9269b46fe909f07125930651a6a8b58e8da

LibOverride: Do not assert on missing operands in apply function.

This can happen after some changes in lib file and resync in user file
e.g..

===

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

===

diff --git a/source/blender/makesrna/intern/rna_collection.c 
b/source/blender/makesrna/intern/rna_collection.c
index df1d7abd6b1..90414613fdd 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -275,7 +275,7 @@ static bool rna_Collection_children_override_apply(Main 
*bmain,
   Collection *coll_dst = (Collection *)ptr_dst->owner_id;
 
   if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
-BLI_assert(0 && "invalid source or destination sub-collection.");
+/* This can happen when reference and overrides differ, just ignore then. 
*/
 return false;
   }

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


[Bf-blender-cvs] [152bd43ae17] geometry-nodes: Merge branch 'master' into geometry-nodes

2020-11-02 Thread Jacques Lucke
Commit: 152bd43ae17bbdd5484c8d34915c53c9363ca4d4
Author: Jacques Lucke
Date:   Mon Nov 2 11:44:46 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rB152bd43ae17bbdd5484c8d34915c53c9363ca4d4

Merge branch 'master' into geometry-nodes

===



===

diff --cc source/blender/blenloader/intern/readfile.c
index 32056d03509,5d63456cfab..004b0664fd3
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -156,8 -156,8 +156,7 @@@
  #include "BKE_report.h"
  #include "BKE_scene.h"
  #include "BKE_screen.h"
- #include "BKE_sequencer.h"
  #include "BKE_shader_fx.h"
 -#include "BKE_simulation.h"
  #include "BKE_sound.h"
  #include "BKE_volume.h"
  #include "BKE_workspace.h"

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


[Bf-blender-cvs] [f2c7b4a1c54] master: Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.

2020-11-02 Thread Ankit Meel
Commit: f2c7b4a1c54e27bc7df3f51871f8767c9f280f37
Author: Ankit Meel
Date:   Mon Nov 2 16:11:10 2020 +0530
Branches: master
https://developer.blender.org/rBf2c7b4a1c54e27bc7df3f51871f8767c9f280f37

Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.

The issue was in `buildinfo.c`:
  char build_c[xx]flags[] = BUILD_C[XX]FLAGS;

Non-escaped double-quotes were terminating the string early, and
causing the compile error. So use single-quotes.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab69048e205..f8fe1a234cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -571,7 +571,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES 
"Clang")
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ 
relative to top level source and build directories." OFF)
+  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ 
relative to top level source and build directories." ON)
   mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
 endif()
 
@@ -1679,8 +1679,8 @@ if(WITH_COMPILER_SHORT_FILE_MACRO)
 endif()
 if(WITH_COMPILER_SHORT_FILE_MACRO)
   set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} \
--fmacro-prefix-map=\"${CMAKE_SOURCE_DIR}/\"=\"\" \
--fmacro-prefix-map=\"${CMAKE_BINARY_DIR}/\"=\"\""
+-fmacro-prefix-map='${CMAKE_SOURCE_DIR}/'='' \
+-fmacro-prefix-map='${CMAKE_BINARY_DIR}/'=''"
   )
 endif()
   else()

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


[Bf-blender-cvs] [19dec6c8a7c] master: Turn off WITH_COMPILER_SHORT_FILE_MACRO temporarily.

2020-11-02 Thread Ankit Meel
Commit: 19dec6c8a7ce99079a4850c3e958130ec434705e
Author: Ankit Meel
Date:   Mon Nov 2 15:42:59 2020 +0530
Branches: master
https://developer.blender.org/rB19dec6c8a7ce99079a4850c3e958130ec434705e

Turn off WITH_COMPILER_SHORT_FILE_MACRO temporarily.

It's causing build errors on compilers that I don't have. Turn it off
while I fix them.

Added in {rB1daa3c3f0a1cfd74bef527e0207f38154e591d46}.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c5ab607bf6..ab69048e205 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -571,7 +571,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES 
"Clang")
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ 
relative to top level source and build directories." ON)
+  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ 
relative to top level source and build directories." OFF)
   mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
 endif()

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


[Bf-blender-cvs] [b801369c8e6] master: Merge remote-tracking branch 'origin/blender-v2.91-release'

2020-11-02 Thread Sybren A. Stüvel
Commit: b801369c8e6edb4da4c6558f024c8c868626f86b
Author: Sybren A. Stüvel
Date:   Mon Nov 2 11:06:22 2020 +0100
Branches: master
https://developer.blender.org/rBb801369c8e6edb4da4c6558f024c8c868626f86b

Merge remote-tracking branch 'origin/blender-v2.91-release'

===



===



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


[Bf-blender-cvs] [9e736fc9848] blender-v2.91-release: Revert "Parenting: fix return value when parenting object to itself"

2020-11-02 Thread Sybren A. Stüvel
Commit: 9e736fc98481949e50f50dc59aaedc336ea76811
Author: Sybren A. Stüvel
Date:   Mon Nov 2 10:11:19 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB9e736fc98481949e50f50dc59aaedc336ea76811

Revert "Parenting: fix return value when parenting object to itself"

This reverts commit ad35fa1993a49f663f782af1c9c41640e94b7eb8, it had
unintended side-effects (T82312).

===

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

===

diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 97e4203c3ac..de3e5f3d5f9 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -696,7 +696,7 @@ bool ED_object_parent_set(ReportList *reports,
   /* Preconditions. */
   if (ob == par) {
 /* Parenting an object to itself is impossible. */
-return false;
+return true;
   }
 
   if (BKE_object_parent_loop_check(par, ob)) {

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


[Bf-blender-cvs] [1daa3c3f0a1] master: Clang/GCC: use relative path in __FILE__ macro

2020-11-02 Thread Ankit Meel
Commit: 1daa3c3f0a1cfd74bef527e0207f38154e591d46
Author: Ankit Meel
Date:   Mon Nov 2 15:10:10 2020 +0530
Branches: master
https://developer.blender.org/rB1daa3c3f0a1cfd74bef527e0207f38154e591d46

Clang/GCC: use relative path in __FILE__ macro

This change removes the user-specific information from
macros like `__FILE__` and keeps it relative to top level
source or build (for generated files) directory.
It makes traces concise.

Added option `WITH_COMPILER_SHORT_FILE_MACRO` enabled by default.

Reviewed By: campbellbarton

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

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb04da749ab..9c5ab607bf6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -570,6 +570,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES 
"Clang")
   endif()
 endif()
 
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ 
relative to top level source and build directories." ON)
+  mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
+endif()
+
 if(WIN32)
   # Use hardcoded paths or find_package to find externals
   option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -1655,6 +1660,38 @@ if(UNIX AND NOT APPLE)
   endif()
 endif()
 
+if(WITH_COMPILER_SHORT_FILE_MACRO)
+  # Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
+  if((CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION 
VERSION_GREATER_EQUAL 8.4) OR
+ (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION 
VERSION_GREATER_EQUAL 10.0) OR
+ (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION 
VERSION_GREATER_EQUAL 12.0)
+  )
+
+if(APPLE)
+  if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0)
+  # Developers may have say LLVM Clang-10.0.1 toolchain with Xcode-11.
+message_first_run(WARNING
+  "-fmacro-prefix-map flag is NOT supported by Clang shipped with 
Xcode-${XCODE_VERSION}."
+  " Some Xcode functionality in Product menu may not work. Disabling 
WITH_COMPILER_SHORT_FILE_MACRO."
+)
+set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
+  endif()
+endif()
+if(WITH_COMPILER_SHORT_FILE_MACRO)
+  set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} \
+-fmacro-prefix-map=\"${CMAKE_SOURCE_DIR}/\"=\"\" \
+-fmacro-prefix-map=\"${CMAKE_BINARY_DIR}/\"=\"\""
+  )
+endif()
+  else()
+message_first_run(WARNING
+  "-fmacro-prefix-map flag is NOT supported by ${CMAKE_C_COMPILER_ID} 
version-${CMAKE_C_COMPILER_VERSION}."
+  " Disabling WITH_COMPILER_SHORT_FILE_MACRO."
+)
+set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
+  endif()
+endif()
+
 # Include warnings first, so its possible to disable them with user defined 
flags
 # eg: -Wno-uninitialized
 set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")

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


[Bf-blender-cvs] [cc09c0d0484] master: Revert "Parenting: fix return value when parenting object to itself"

2020-11-02 Thread Sybren A. Stüvel
Commit: cc09c0d0484be334c985ccd143c46c266abb8aa0
Author: Sybren A. Stüvel
Date:   Mon Nov 2 10:11:19 2020 +0100
Branches: master
https://developer.blender.org/rBcc09c0d0484be334c985ccd143c46c266abb8aa0

Revert "Parenting: fix return value when parenting object to itself"

This reverts commit ad35fa1993a49f663f782af1c9c41640e94b7eb8, it had
unintended side-effects (T82312).

===

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

===

diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 12c61b75ff7..3d65a9e5fcb 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -696,7 +696,7 @@ bool ED_object_parent_set(ReportList *reports,
   /* Preconditions. */
   if (ob == par) {
 /* Parenting an object to itself is impossible. */
-return false;
+return true;
   }
 
   if (BKE_object_parent_loop_check(par, ob)) {

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


[Bf-blender-cvs] [d49c71e96e5] master: Cleanup: use logging for "Found bundled Python" message

2020-11-02 Thread Campbell Barton
Commit: d49c71e96e55e16f117043a05aa0a35493bd768c
Author: Campbell Barton
Date:   Mon Nov 2 19:33:32 2020 +1100
Branches: master
https://developer.blender.org/rBd49c71e96e55e16f117043a05aa0a35493bd768c

Cleanup: use logging for "Found bundled Python" message

This was added when Python was initially bundled so any problems
finding Python could be investigated.

Move this to use logging so we can show this information when needed.

===

M   source/blender/python/generic/py_capi_utils.c
M   source/blender/python/intern/bpy.h
M   source/blender/python/intern/bpy_interface.c

===

diff --git a/source/blender/python/generic/py_capi_utils.c 
b/source/blender/python/generic/py_capi_utils.c
index 6c02e293789..d944cb435d0 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -893,18 +893,6 @@ void PyC_MainModule_Restore(PyObject *main_mod)
  */
 void PyC_SetHomePath(const char *py_path_bundle)
 {
-  if (py_path_bundle == NULL) {
-/* Common enough to have bundled *nix python but complain on OSX/Win */
-#  if defined(__APPLE__) || defined(_WIN32)
-fprintf(stderr,
-"Warning! bundled python not found and is expected on this 
platform. "
-"(if you built with CMake: 'install' target may have not been 
built)\n");
-#  endif
-return;
-  }
-  /* set the environment path */
-  printf("found bundled python: %s\n", py_path_bundle);
-
 #  ifdef __APPLE__
   /* OSX allow file/directory names to contain : character (represented as / 
in the Finder)
* but current Python lib (release 3.1.1) doesn't handle these correctly */
@@ -915,19 +903,14 @@ void PyC_SetHomePath(const char *py_path_bundle)
   }
 #  endif
 
-  {
-wchar_t py_path_bundle_wchar[1024];
-
-/* Can't use this, on linux gives bug: T23018,
- * TODO: try LANG="en_US.UTF-8" /usr/bin/blender, suggested 2008 */
-/* mbstowcs(py_path_bundle_wchar, py_path_bundle, FILE_MAXDIR); */
+  /* Set the environment path. */
+  wchar_t py_path_bundle_wchar[1024];
 
-BLI_strncpy_wchar_from_utf8(
-py_path_bundle_wchar, py_path_bundle, 
ARRAY_SIZE(py_path_bundle_wchar));
+  /* Can't use `mbstowcs` on linux gives bug: T23018. */
+  BLI_strncpy_wchar_from_utf8(
+  py_path_bundle_wchar, py_path_bundle, ARRAY_SIZE(py_path_bundle_wchar));
 
-Py_SetPythonHome(py_path_bundle_wchar);
-// printf("found python (wchar_t) '%ls'\n", py_path_bundle_wchar);
-  }
+  Py_SetPythonHome(py_path_bundle_wchar);
 }
 
 bool PyC_IsInterpreterActive(void)
diff --git a/source/blender/python/intern/bpy.h 
b/source/blender/python/intern/bpy.h
index e2fe84f71c7..25a047edfb5 100644
--- a/source/blender/python/intern/bpy.h
+++ b/source/blender/python/intern/bpy.h
@@ -35,6 +35,7 @@ void BPY_atexit_unregister(void);
 
 extern struct CLG_LogRef *BPY_LOG_CONTEXT;
 extern struct CLG_LogRef *BPY_LOG_RNA;
+extern struct CLG_LogRef *BPY_LOG_INTERFACE;
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/python/intern/bpy_interface.c 
b/source/blender/python/intern/bpy_interface.c
index d343b4fff10..0b11ac639c7 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -80,6 +80,7 @@
 
 /* Logging types to use anywhere in the Python modules. */
 CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_CONTEXT, "bpy.context");
+CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_INTERFACE, "bpy.interface");
 CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_RNA, "bpy.rna");
 
 /* for internal use, when starting and ending python scripts */
@@ -304,7 +305,6 @@ void BPY_python_start(bContext *C, int argc, const char 
**argv)
 {
 #ifndef WITH_PYTHON_MODULE
   PyThreadState *py_tstate = NULL;
-  const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, 
NULL);
 
   /* Needed for Python's initialization for portable Python installations.
* We could use #Py_SetPath, but this overrides Python's internal logic
@@ -321,8 +321,21 @@ void BPY_python_start(bContext *C, int argc, const char 
**argv)
   /* must run before python initializes */
   PyImport_ExtendInittab(bpy_internal_modules);
 
-  /* allow to use our own included python */
-  PyC_SetHomePath(py_path_bundle);
+  /* Allow to use our own included Python. `py_path_bundle` may be NULL. */
+  {
+const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, 
NULL);
+if (py_path_bundle != NULL) {
+  PyC_SetHomePath(py_path_bundle);
+}
+else {
+  /* Common enough to use the system Python on Linux/Unix, warn on other 
systems. */
+#  if defined(__APPLE__) || defined(_WIN32)
+  fprintf(stderr,
+  "Bundled Python not found and is expected on this platform "
+  "(the 'install' target may have not been built)\n");
+#  endif
+}
+  }
 
   /* Without this the `sys.stdout` may be set to 'ascii'
* (it is on my system at least), where 

[Bf-blender-cvs] [2ff102e6519] lanpr-under-gp: LineArt: reduce chaining_geometry_threshold to 0.01 to reduce small bleedings in a typical scene.

2020-11-02 Thread YimingWu
Commit: 2ff102e6519dfacfc1ba963f45cf2b9d8fb46b01
Author: YimingWu
Date:   Mon Nov 2 16:40:51 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB2ff102e6519dfacfc1ba963f45cf2b9d8fb46b01

LineArt: reduce chaining_geometry_threshold to 0.01 to reduce small bleedings 
in a typical scene.

===

M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/makesdna/DNA_scene_defaults.h
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/blenloader/intern/versioning_290.c 
b/source/blender/blenloader/intern/versioning_290.c
index 57f4ffe6d5f..64641075944 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -977,7 +977,7 @@ void blo_do_versions_290(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
   scene->lineart.line_types |= LRT_EDGE_FLAG_ALL_TYPE;
   scene->lineart.flags |= (LRT_ALLOW_DUPLI_OBJECTS | 
LRT_REMOVE_DOUBLES);
   scene->lineart.angle_splitting_threshold = DEG2RAD(60.0f);
-  scene->lineart.chaining_geometry_threshold = 0.1f;
+  scene->lineart.chaining_geometry_threshold = 0.01f;
   scene->lineart.chaining_image_threshold = 0.01f;
 }
   }
diff --git a/source/blender/makesdna/DNA_scene_defaults.h 
b/source/blender/makesdna/DNA_scene_defaults.h
index c1bf716c6cd..ac902ffbf55 100644
--- a/source/blender/makesdna/DNA_scene_defaults.h
+++ b/source/blender/makesdna/DNA_scene_defaults.h
@@ -242,7 +242,7 @@
   { \
 .crease_threshold = 140.0f,\
 .angle_splitting_threshold = DEG2RAD(60.0f),\
-.chaining_geometry_threshold = 0.1f,\
+.chaining_geometry_threshold = 0.01f,\
 .chaining_image_threshold = 0.01f,\
   }
 
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 967a4b05711..055c81e42da 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7490,7 +7490,7 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
   /* Below these two are only for grease pencil, thus no viewport updates. */
 
   prop = RNA_def_property(srna, "chaining_geometry_threshold", PROP_FLOAT, 
PROP_NONE);
-  RNA_def_property_float_default(prop, 0.1f);
+  RNA_def_property_float_default(prop, 0.01f);
   RNA_def_property_ui_text(prop,
"Geometry Threshold",
"Segments where their geometric distance between 
them lower than this "

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