[Bf-blender-cvs] [0964ae52665] blender-v2.82-release: Fix T73234: Undo/redo with local collection crashes

2020-02-03 Thread Campbell Barton
Commit: 0964ae5266541f09a1d54d8941393bada97d08a2
Author: Campbell Barton
Date:   Tue Feb 4 18:26:57 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB0964ae5266541f09a1d54d8941393bada97d08a2

Fix T73234: Undo/redo with local collection crashes

Resolves crashes when edit-mode undo data wasn't included
because it wasn't visible, also resolves T73416.

===

M   source/blender/editors/armature/editarmature_undo.c
M   source/blender/editors/curve/editcurve_undo.c
M   source/blender/editors/include/ED_undo.h
M   source/blender/editors/lattice/editlattice_undo.c
M   source/blender/editors/mesh/editmesh_undo.c
M   source/blender/editors/metaball/editmball_undo.c
M   source/blender/editors/undo/ed_undo.c

===

diff --git a/source/blender/editors/armature/editarmature_undo.c 
b/source/blender/editors/armature/editarmature_undo.c
index 4e3ab11a9f7..4753698ae40 100644
--- a/source/blender/editors/armature/editarmature_undo.c
+++ b/source/blender/editors/armature/editarmature_undo.c
@@ -108,7 +108,8 @@ static void undoarm_free_data(UndoArmature *uarm)
 
 static Object *editarm_object_from_context(bContext *C)
 {
-  Object *obedit = CTX_data_edit_object(C);
+  ViewLayer *view_layer = CTX_data_view_layer(C);
+  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
   if (obedit && obedit->type == OB_ARMATURE) {
 bArmature *arm = obedit->data;
 if (arm->edbo != NULL) {
@@ -151,8 +152,7 @@ static bool armature_undosys_step_encode(struct bContext 
*C, struct Main *bmain,
* outside of this list will be moved out of edit-mode when reading back 
undo steps. */
   ViewLayer *view_layer = CTX_data_view_layer(C);
   uint objects_len = 0;
-  Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
-  view_layer, NULL, _len);
+  Object **objects = ED_undo_editmode_objects_from_view_layer(view_layer, 
_len);
 
   us->elems = MEM_callocN(sizeof(*us->elems) * objects_len, __func__);
   us->elems_len = objects_len;
diff --git a/source/blender/editors/curve/editcurve_undo.c 
b/source/blender/editors/curve/editcurve_undo.c
index ff3a1386fd9..8bcabb5ed85 100644
--- a/source/blender/editors/curve/editcurve_undo.c
+++ b/source/blender/editors/curve/editcurve_undo.c
@@ -216,8 +216,7 @@ static bool curve_undosys_step_encode(struct bContext *C, 
struct Main *bmain, Un
* outside of this list will be moved out of edit-mode when reading back 
undo steps. */
   ViewLayer *view_layer = CTX_data_view_layer(C);
   uint objects_len = 0;
-  Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
-  view_layer, NULL, _len);
+  Object **objects = ED_undo_editmode_objects_from_view_layer(view_layer, 
_len);
 
   us->elems = MEM_callocN(sizeof(*us->elems) * objects_len, __func__);
   us->elems_len = objects_len;
diff --git a/source/blender/editors/include/ED_undo.h 
b/source/blender/editors/include/ED_undo.h
index fa2630ba726..1fbf2f96cfa 100644
--- a/source/blender/editors/include/ED_undo.h
+++ b/source/blender/editors/include/ED_undo.h
@@ -23,6 +23,7 @@
 
 #include "BLI_compiler_attrs.h"
 
+struct Base;
 struct CLG_LogRef;
 struct Object;
 struct UndoStack;
@@ -62,6 +63,10 @@ void ED_undo_object_editmode_restore_helper(struct bContext 
*C,
 uint object_array_len,
 uint object_array_stride);
 
+struct Object **ED_undo_editmode_objects_from_view_layer(struct ViewLayer 
*view_layer,
+ uint *r_len);
+struct Base **ED_undo_editmode_bases_from_view_layer(struct ViewLayer 
*view_layer, uint *r_len);
+
 struct UndoStack *ED_undo_stack_get(void);
 
 /* helpers */
diff --git a/source/blender/editors/lattice/editlattice_undo.c 
b/source/blender/editors/lattice/editlattice_undo.c
index ed2560698b6..f90b70c492f 100644
--- a/source/blender/editors/lattice/editlattice_undo.c
+++ b/source/blender/editors/lattice/editlattice_undo.c
@@ -146,7 +146,8 @@ static int validate_undoLatt(void *data, void *edata)
 
 static Object *editlatt_object_from_context(bContext *C)
 {
-  Object *obedit = CTX_data_edit_object(C);
+  ViewLayer *view_layer = CTX_data_view_layer(C);
+  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
   if (obedit && obedit->type == OB_LATTICE) {
 Lattice *lt = obedit->data;
 if (lt->editlatt != NULL) {
@@ -189,8 +190,7 @@ static bool lattice_undosys_step_encode(struct bContext *C, 
Main *bmain, UndoSte
* outside of this list will be moved out of edit-mode when reading back 
undo steps. */
   ViewLayer *view_layer = CTX_data_view_layer(C);
   uint objects_len = 0;
-  Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
-  view_layer, NULL, _len);
+  Object **objects = ED_undo_editmode_objects_from_view_layer(view_layer, 

[Bf-blender-cvs] [d09646a40b1] blender-v2.82-release: Fix T73095: Edit Mode Overlay Linked Mesh

2020-02-03 Thread Jeroen Bakker
Commit: d09646a40b1928308025d8ceb2c2d505651fc9a4
Author: Jeroen Bakker
Date:   Mon Feb 3 08:16:38 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd09646a40b1928308025d8ceb2c2d505651fc9a4

Fix T73095: Edit Mode Overlay Linked Mesh

When using duplicate linked meshes, objects that are not in edit-mode will be 
drawn as
it is in edit mode, when another object with the same mesh is in edit mode.
This will not be the case when one of the objects are influenced by modifiers. 
The change
reflects more how it was done in Blender 2.79.

The current change introduces a draw manager method that checks in detail who 
is responsible
for the drawing (render engine or overlay engine). If the edit mesh is not the 
original or
the object that is drawn doesn't draw the original mesh the object will be 
drawn by the render
engine.

Known Limitation of this patch is that the rendering outside edit mode doesn't 
reflect the
latest changes until the user switches between object and edit mode. When there 
are no
modifiers in use, the updating is done immediately.

IMO this would be sufficient for blender 2.82, it also fixes parts of T72733.
The updating of the surface batches requires more development and is
post-poned for now.

Reviewed By: fclem, brecht

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

===

M   source/blender/draw/engines/overlay/overlay_engine.c
M   source/blender/draw/engines/overlay/overlay_wireframe.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_manager.c

===

diff --git a/source/blender/draw/engines/overlay/overlay_engine.c 
b/source/blender/draw/engines/overlay/overlay_engine.c
index 59a03d10fbe..c83b3487db0 100644
--- a/source/blender/draw/engines/overlay/overlay_engine.c
+++ b/source/blender/draw/engines/overlay/overlay_engine.c
@@ -179,7 +179,7 @@ BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object 
*ob, void *vedata, bo
 
 static bool overlay_object_is_edit_mode(const OVERLAY_PrivateData *pd, const 
Object *ob)
 {
-  if ((ob->mode & OB_MODE_EDIT) && BKE_object_is_in_editmode(ob)) {
+  if (DRW_object_is_in_edit_mode(ob)) {
 /* Also check for context mode as the object mode is not 100% reliable. 
(see T72490) */
 switch (ob->type) {
   case OB_MESH:
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c 
b/source/blender/draw/engines/overlay/overlay_wireframe.c
index d3c513e5963..e39f51aa606 100644
--- a/source/blender/draw/engines/overlay/overlay_wireframe.c
+++ b/source/blender/draw/engines/overlay/overlay_wireframe.c
@@ -154,7 +154,7 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
 }
   }
 
-  const bool is_edit_mode = BKE_object_is_in_editmode(ob);
+  const bool is_edit_mode = DRW_object_is_in_edit_mode(ob);
   bool has_edit_mesh_cage = false;
   if (is_mesh && is_edit_mode) {
 /* TODO: Should be its own function. */
diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 8037bd03383..ddaf851324d 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -617,6 +617,7 @@ void **DRW_duplidata_get(void *vedata);
 
 /* Settings */
 bool DRW_object_is_renderable(const struct Object *ob);
+bool DRW_object_is_in_edit_mode(const struct Object *ob);
 int DRW_object_visibility_in_active_context(const struct Object *ob);
 bool DRW_object_is_flat_normal(const struct Object *ob);
 bool DRW_object_use_hide_faces(const struct Object *ob);
diff --git a/source/blender/draw/intern/draw_cache.c 
b/source/blender/draw/intern/draw_cache.c
index d1823292585..1dcc605fc50 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -3449,7 +3449,7 @@ void drw_batch_cache_generate_requested(Object *ob)
   const bool use_hide = ((ob->type == OB_MESH) &&
  ((is_paint_mode && (ob == draw_ctx->obact) &&
DRW_object_use_hide_faces(ob)) ||
-  ((mode == CTX_MODE_EDIT_MESH) && 
BKE_object_is_in_editmode(ob;
+  ((mode == CTX_MODE_EDIT_MESH) && 
DRW_object_is_in_edit_mode(ob;
 
   struct Mesh *mesh_eval = ob->runtime.mesh_eval;
   switch (ob->type) {
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c 
b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 167e48e9c2d..a1eb9b57629 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1076,13 +1076,7 @@ void DRW_mesh_batch_cache_create_requested(
 BLI_assert(me->edit_mesh->mesh_eval_final != NULL);
   }
 
-  const bool is_editmode =
-  (me->edit_mesh != NULL) &&
-  (/* Simple case, 

[Bf-blender-cvs] [c482e22f3ff] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Aaron Carlisle
Commit: c482e22f3fff291183683fee29c352ef57edd166
Author: Aaron Carlisle
Date:   Mon Feb 3 22:39:28 2020 -0500
Branches: master
https://developer.blender.org/rBc482e22f3fff291183683fee29c352ef57edd166

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [fdb68e18471] blender-v2.82-release: Fix: UI: Spelling and Capitalization

2020-02-03 Thread Aaron Carlisle
Commit: fdb68e184714f480c87c13c3c34480e9adfe4620
Author: Aaron Carlisle
Date:   Mon Feb 3 22:35:39 2020 -0500
Branches: blender-v2.82-release
https://developer.blender.org/rBfdb68e184714f480c87c13c3c34480e9adfe4620

Fix: UI: Spelling and Capitalization

===

M   release/scripts/startup/bl_ui/properties_physics_cloth.py
M   source/blender/makesrna/intern/rna_cloth.c

===

diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py 
b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index d9713cb8608..0bf667482c4 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -230,7 +230,7 @@ class PHYSICS_PT_cloth_pressure(PhysicButtonsPanel, Panel):
 col.prop(cloth, "uniform_pressure_force")
 
 col = flow.column()
-col.prop(cloth, "use_pressure_volume", text="Custom volume")
+col.prop(cloth, "use_pressure_volume", text="Custom Volume")
 
 col = flow.column()
 col.active = cloth.use_pressure_volume
diff --git a/source/blender/makesrna/intern/rna_cloth.c 
b/source/blender/makesrna/intern/rna_cloth.c
index c000e1059e6..59040df56c3 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -986,7 +986,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
   RNA_def_property_ui_text(
   prop,
   "Pressure",
-  "The uniform pressure that is constanty applied to the mesh. Can be 
negative");
+  "The uniform pressure that is constantly applied to the mesh. Can be 
negative");
   RNA_def_property_update(prop, 0, "rna_cloth_update");
 
   prop = RNA_def_property(srna, "target_volume", PROP_FLOAT, PROP_NONE);

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


[Bf-blender-cvs] [e268fe6e64d] blender-v2.82-release: Fix T73537: Particle system Crash

2020-02-03 Thread Sebastián Barschkis
Commit: e268fe6e64dd872534944e825c0fe7483e18010a
Author: Sebastián Barschkis
Date:   Mon Feb 3 22:02:17 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBe268fe6e64dd872534944e825c0fe7483e18010a

Fix T73537: Particle system Crash

Added sanity check in the flow / obstacle object loops that check if the 
modifier data is valid. Ideally this should not be needed. However, in 
remove_particle_systems_from_object() the fluid modifier can get freed. It is 
not yet clear whether the modifier free call is really needed or not.

===

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

===

diff --git a/source/blender/blenkernel/intern/fluid.c 
b/source/blender/blenkernel/intern/fluid.c
index f19137bf796..91adbf2301d 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -872,6 +872,11 @@ static void update_obstacleflags(FluidDomainSettings *mds,
 FluidModifierData *mmd2 = (FluidModifierData 
*)modifiers_findByType(coll_ob,
 
eModifierType_Fluid);
 
+/* Sanity check. */
+if (!mmd2) {
+  continue;
+}
+
 if ((mmd2->type & MOD_FLUID_TYPE_EFFEC) && mmd2->effector) {
   FluidEffectorSettings *mes = mmd2->effector;
   if (!mes) {
@@ -959,6 +964,11 @@ static void update_obstacles(Depsgraph *depsgraph,
 FluidModifierData *mmd2 = (FluidModifierData 
*)modifiers_findByType(coll_ob,
 
eModifierType_Fluid);
 
+/* Sanity check. */
+if (!mmd2) {
+  continue;
+}
+
 /* TODO (sebbas): check if modifier is active? */
 if ((mmd2->type & MOD_FLUID_TYPE_EFFEC) && mmd2->effector) {
   FluidEffectorSettings *mes = mmd2->effector;
@@ -2298,7 +2308,7 @@ static void update_flowsflags(FluidDomainSettings *mds, 
Object **flowobjs, int n
 FluidModifierData *mmd2 = (FluidModifierData 
*)modifiers_findByType(coll_ob,
 
eModifierType_Fluid);
 
-// Sanity check
+/* Sanity check. */
 if (!mmd2) {
   continue;
 }
@@ -2411,6 +2421,11 @@ static void update_flowsfluids(struct Depsgraph 
*depsgraph,
 FluidModifierData *mmd2 = (FluidModifierData 
*)modifiers_findByType(flowobj,
 
eModifierType_Fluid);
 
+/* Sanity check. */
+if (!mmd2) {
+  continue;
+}
+
 /* Check for initialized smoke object. */
 if ((mmd2->type & MOD_FLUID_TYPE_FLOW) && mmd2->flow) {
   FluidFlowSettings *mfs = mmd2->flow;
@@ -2607,6 +2622,11 @@ static void update_flowsfluids(struct Depsgraph 
*depsgraph,
 FluidModifierData *mmd2 = (FluidModifierData 
*)modifiers_findByType(flowobj,
 
eModifierType_Fluid);
 
+/* Sanity check. */
+if (!mmd2) {
+  continue;
+}
+
 /* Check for initialized flow object. */
 if ((mmd2->type & MOD_FLUID_TYPE_FLOW) && mmd2->flow) {
   FluidFlowSettings *mfs = mmd2->flow;
@@ -3313,7 +,7 @@ static void 
BKE_fluid_modifier_processDomain(FluidModifierData *mmd,
   guide_parent = mds->guide_parent;
   if (guide_parent) {
 mmd_parent = (FluidModifierData *)modifiers_findByType(guide_parent, 
eModifierType_Fluid);
-if (mmd_parent->domain) {
+if (mmd_parent && mmd_parent->domain) {
   copy_v3_v3_int(mds->guide_res, mmd_parent->domain->res);
 }
   }

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


[Bf-blender-cvs] [0cd0058e270] blender-v2.82-release: Fix T72261 Overlay: Edit Mesh: Edges not visible when using "In front"

2020-02-03 Thread Clément Foucault
Commit: 0cd0058e27025b97b1d187cf2299694c6696cb19
Author: Clément Foucault
Date:   Mon Feb 3 19:54:47 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB0cd0058e27025b97b1d187cf2299694c6696cb19

Fix T72261 Overlay: Edit Mesh: Edges not visible when using "In front"

This was caused by additional depth pass not rendering in the correct
view.

===

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

===

diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c 
b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
index 6a65be0b84c..e016ccc6c0e 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
@@ -407,7 +407,11 @@ void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
   GPU_framebuffer_clear_depth(fbl->overlay_default_fb, 1.0f);
 }
 
-DRW_draw_pass(psl->edit_mesh_depth_ps[IN_FRONT]);
+if (!DRW_pass_is_empty(psl->edit_mesh_depth_ps[IN_FRONT])) {
+  DRW_view_set_active(NULL);
+  DRW_draw_pass(psl->edit_mesh_depth_ps[IN_FRONT]);
+}
+
 overlay_edit_mesh_draw_components(psl, pd, true);
   }
 }

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


[Bf-blender-cvs] [5d4f8d31a5b] vr_scene_inspection: Allow setting any object as "anchor" (to set base location/rotation)

2020-02-03 Thread Julian Eisel
Commit: 5d4f8d31a5b489d3fb4542542d2c3fd92d4fc89e
Author: Julian Eisel
Date:   Mon Feb 3 19:47:41 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rB5d4f8d31a5b489d3fb4542542d2c3fd92d4fc89e

Allow setting any object as "anchor" (to set base location/rotation)

Not sure how much of this will actually stay in, but it should allow us
experimenting with different ways to set the base position.
Also, when an anchor is set, the location/rotation of it and the VR base
position are synched.

===

M   source/blender/blenloader/intern/readfile.c
M   source/blender/makesdna/DNA_xr_types.h
M   source/blender/makesrna/intern/rna_xr.c
M   source/blender/windowmanager/intern/wm_xr.c

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index cb83a28e87a..40cb69ce2d8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7826,6 +7826,12 @@ static void direct_link_wm_xr_data(FileData *fd, 
wmXrData *xr_data)
   direct_link_view3dshading(fd, _data->session_settings.shading);
 }
 
+static void lib_link_wm_xr_data(FileData *fd, ID *parent_id, wmXrData *xr_data)
+{
+  xr_data->session_settings.anchor_object = newlibadr(
+  fd, parent_id->lib, xr_data->session_settings.anchor_object);
+}
+
 #endif
 
 /** \} */
@@ -7935,6 +7941,8 @@ static void lib_link_windowmanager(FileData *fd, Main 
*main)
 }
   }
 
+  lib_link_wm_xr_data(fd, >id, >xr);
+
   wm->id.tag &= ~LIB_TAG_NEED_LINK;
 }
   }
diff --git a/source/blender/makesdna/DNA_xr_types.h 
b/source/blender/makesdna/DNA_xr_types.h
index 79c366ebda7..0eff72ae248 100644
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@ -24,8 +24,12 @@
 #include "DNA_view3d_types.h"
 
 typedef struct bXrSessionSettings {
+  /** Shading settings, struct shared with 3D-View so settings are the same. */
   struct View3DShading shading;
 
+  /** Object to take the location and rotation as base position from. */
+  Object *anchor_object;
+
   /** View3D draw flags (V3D_OFSDRAW_NONE, V3D_OFSDRAW_SHOW_ANNOTATION, ...). 
*/
   char draw_flags;
   char _pad[3];
diff --git a/source/blender/makesrna/intern/rna_xr.c 
b/source/blender/makesrna/intern/rna_xr.c
index 0967ff1639e..79abe00293d 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -83,6 +83,12 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Shading Settings", "");
   RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
 
+  prop = RNA_def_property(srna, "anchor_object", PROP_POINTER, PROP_NONE);
+  RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_ui_text(
+  prop, "Anchor Object", "Object to take the location and rotation as base 
position from");
+  RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
+
   prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "draw_flags", 
V3D_OFSDRAW_SHOW_GRIDFLOOR);
   RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane 
grid");
diff --git a/source/blender/windowmanager/intern/wm_xr.c 
b/source/blender/windowmanager/intern/wm_xr.c
index e595f6b66bc..75f7bb18c61 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -225,6 +225,13 @@ static void 
wm_xr_runtime_session_state_update(bXrRuntimeSessionState *state,
  (settings->flag & 
XR_SESSION_USE_POSITION_TRACKING);
   const bool use_position_tracking = settings->flag & 
XR_SESSION_USE_POSITION_TRACKING;
 
+  if (settings->anchor_object) {
+copy_v3_v3(state->reference_pose.position, 
settings->anchor_object->obmat[3]);
+mat4_to_quat(state->reference_pose.orientation_quat, 
settings->anchor_object->obmat);
+
+copy_v3_v3(state->final_reference_pose.position, 
state->reference_pose.position);
+  }
+
   copy_v4_v4(state->final_reference_pose.orientation_quat, 
state->reference_pose.orientation_quat);
 
   if (position_tracking_toggled) {

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


[Bf-blender-cvs] [7ce7bf08565] greasepencil-refactor: GPencil: Hide other frames in multiedit if Overlay main switch is OFF

2020-02-03 Thread Antonio Vazquez
Commit: 7ce7bf085657fd21ce5e2f8b4c60e4e66cf842f1
Author: Antonio Vazquez
Date:   Mon Feb 3 19:16:18 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB7ce7bf085657fd21ce5e2f8b4c60e4e66cf842f1

GPencil: Hide other frames in multiedit if Overlay main switch is OFF

===

M   source/blender/draw/engines/gpencil/gpencil_engine.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index c4b7fe5391a..be2ac9cb818 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -126,7 +126,7 @@ void GPENCIL_engine_init(void *ved)
 
 /* For non active frame, use only lines in multiedit mode. */
 const bool overlays_on = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
-stl->pd->use_multiedit_lines_only = overlays_on &&
+stl->pd->use_multiedit_lines_only = !overlays_on ||
 (v3d->gp_flag & 
V3D_GP_SHOW_MULTIEDIT_LINES) != 0;
   }
   else if (stl->pd->is_render) {

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


[Bf-blender-cvs] [06a8f55104d] blender-v2.82-release: Overlay: Armature: Fix Display armature as bound box in object mode

2020-02-03 Thread Clément Foucault
Commit: 06a8f55104d05d876ecaf0c0c4fa2b2a8b2d5137
Author: Clément Foucault
Date:   Mon Feb 3 18:53:20 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB06a8f55104d05d876ecaf0c0c4fa2b2a8b2d5137

Overlay: Armature: Fix Display armature as bound box in object mode

===

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

===

diff --git a/source/blender/draw/engines/overlay/overlay_armature.c 
b/source/blender/draw/engines/overlay/overlay_armature.c
index 849807e24b5..be1ff1753ab 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -2287,6 +2287,11 @@ void OVERLAY_armature_cache_populate(OVERLAY_Data 
*vedata, Object *ob)
   OVERLAY_PrivateData *pd = vedata->stl->pd;
   ArmatureDrawContext arm_ctx;
   float *color;
+
+  if (ob->dt == OB_BOUNDBOX) {
+return;
+  }
+
   DRW_object_wire_theme_get(ob, draw_ctx->view_layer, );
   armature_context_setup(_ctx, pd, ob, false, false, false, color);
   draw_armature_pose(_ctx);

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


[Bf-blender-cvs] [95ad34c5d70] blender-v2.82-release: Fix CMake error with versions older than 3.9

2020-02-03 Thread Brecht Van Lommel
Commit: 95ad34c5d70f3def18a8286f2cdde85371031988
Author: Brecht Van Lommel
Date:   Mon Feb 3 18:44:52 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB95ad34c5d70f3def18a8286f2cdde85371031988

Fix CMake error with versions older than 3.9

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbb528607c8..2bac16c339a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,7 +98,9 @@ cmake_policy(SET CMP0010 NEW)
 cmake_policy(SET CMP0014 NEW)
 
 # Silence draco warning on macOS, new policy works fine.
-cmake_policy(SET CMP0068 NEW)
+if(POLICY CMP0068)
+  cmake_policy(SET CMP0068 NEW)
+endif()
 
 #-
 # Load some macros.

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


[Bf-blender-cvs] [03a29090b57] master: UI: invert toolbar icon colors for light toolbar button background

2020-02-03 Thread Yevgeny Makarov
Commit: 03a29090b57d087b7996dd25e1505537221233f9
Author: Yevgeny Makarov
Date:   Mon Feb 3 17:47:04 2020 +0100
Branches: master
https://developer.blender.org/rB03a29090b57d087b7996dd25e1505537221233f9

UI: invert toolbar icon colors for light toolbar button background

Fixes T64177.

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

===

M   source/blender/blenkernel/BKE_icons.h
M   source/blender/blenkernel/intern/icons.c
M   source/blender/blenkernel/intern/icons_rasterize.c
M   source/blender/editors/interface/interface_icons.c

===

diff --git a/source/blender/blenkernel/BKE_icons.h 
b/source/blender/blenkernel/BKE_icons.h
index 417591e03c5..27d7f45e480 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -62,8 +62,8 @@ struct Icon_Geom {
   int icon_id;
   int coords_len;
   int coords_range[2];
-  const unsigned char (*coords)[2];
-  const unsigned char (*colors)[4];
+  unsigned char (*coords)[2];
+  unsigned char (*colors)[4];
   /* when not NULL, the memory of coords and colors is a sub-region of this 
pointer. */
   const void *mem;
 };
@@ -160,6 +160,7 @@ struct Icon_Geom *BKE_icon_geom_from_file(const char 
*filename);
 struct ImBuf *BKE_icon_geom_rasterize(const struct Icon_Geom *geom,
   const unsigned int size_x,
   const unsigned int size_y);
+void BKE_icon_geom_invert_lightness(struct Icon_Geom *geom);
 
 int BKE_icon_ensure_studio_light(struct StudioLight *sl, int id_type);
 
diff --git a/source/blender/blenkernel/intern/icons.c 
b/source/blender/blenkernel/intern/icons.c
index 7b8a0a8894f..6363a23de6c 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -842,8 +842,8 @@ struct Icon_Geom *BKE_icon_geom_from_memory(const uchar 
*data, size_t data_len)
   p += 2;
 
   geom->coords_len = coords_len;
-  geom->coords = (const void *)p;
-  geom->colors = (const void *)(p + (data_len / 3));
+  geom->coords = (void *)p;
+  geom->colors = (void *)(p + (data_len / 3));
   geom->icon_id = 0;
   geom->mem = data;
   return geom;
diff --git a/source/blender/blenkernel/intern/icons_rasterize.c 
b/source/blender/blenkernel/intern/icons_rasterize.c
index e87180ce732..f731285e029 100644
--- a/source/blender/blenkernel/intern/icons_rasterize.c
+++ b/source/blender/blenkernel/intern/icons_rasterize.c
@@ -139,3 +139,17 @@ ImBuf *BKE_icon_geom_rasterize(const struct Icon_Geom 
*geom,
   IMB_scaleImBuf(ibuf, size_x, size_y);
   return ibuf;
 }
+
+void BKE_icon_geom_invert_lightness(struct Icon_Geom *geom)
+{
+  const int length = 3 * geom->coords_len;
+
+  for (int i = 0; i < length; i++) {
+float rgb[3], hsl[3];
+
+rgb_uchar_to_float(rgb, geom->colors[i]);
+rgb_to_hsl_v(rgb, hsl);
+hsl_to_rgb(hsl[0], hsl[1], 1.0f - hsl[2], [0], [1], [2]);
+rgb_float_to_uchar(geom->colors[i], rgb);
+  }
+}
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index 41606fce915..c1018a67fb3 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -119,6 +119,7 @@ typedef struct DrawInfo {
 } vector;
 struct {
   ImBuf *image_cache;
+  bool inverted;
 } geom;
 struct {
   IconImage *image;
@@ -1833,15 +1834,23 @@ static void icon_draw_size(float x,
 }
 #endif
 
+/* If the theme is light, we will adjust the icon colors. */
+const bool invert = 
(rgb_to_grayscale_byte(btheme->tui.wcol_toolbar_item.inner) > 128);
+const bool geom_inverted = di->data.geom.inverted;
+
 /* This could re-generate often if rendered at different sizes in the one 
interface.
  * TODO(campbell): support caching multiple sizes. */
 ImBuf *ibuf = di->data.geom.image_cache;
-if ((ibuf == NULL) || (ibuf->x != w) || (ibuf->y != h)) {
+if ((ibuf == NULL) || (ibuf->x != w) || (ibuf->y != h) || (invert != 
geom_inverted)) {
   if (ibuf) {
 IMB_freeImBuf(ibuf);
   }
+  if (invert != geom_inverted) {
+BKE_icon_geom_invert_lightness(icon->obj);
+  }
   ibuf = BKE_icon_geom_rasterize(icon->obj, w, h);
   di->data.geom.image_cache = ibuf;
+  di->data.geom.inverted = invert;
 }
 
 GPU_blend_set_func_separate(

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


[Bf-blender-cvs] [5f056fb742f] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Brecht Van Lommel
Commit: 5f056fb742fcc79df74d74911369e6b473ec10f0
Author: Brecht Van Lommel
Date:   Mon Feb 3 18:40:21 2020 +0100
Branches: master
https://developer.blender.org/rB5f056fb742fcc79df74d74911369e6b473ec10f0

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [0936f2f52c5] blender-v2.82-release: Fix T73045 Crash entering edit mode for "Object Font" instance mesh

2020-02-03 Thread Clément Foucault
Commit: 0936f2f52c584ba623ba6ec722d1581dea97f1f3
Author: Clément Foucault
Date:   Mon Feb 3 18:37:12 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB0936f2f52c584ba623ba6ec722d1581dea97f1f3

Fix T73045 Crash entering edit mode for "Object Font" instance mesh

Font duplicator was not outputing dupli-objects using evaluated object
pointers, leading to crash because original object are not supposed to
be drawable.

===

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

===

diff --git a/source/blender/blenkernel/intern/object_dupli.c 
b/source/blender/blenkernel/intern/object_dupli.c
index eceeb231285..c10ab3cddab 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -521,6 +521,9 @@ static void make_duplis_font(const DupliContext *ctx)
   family_len = strlen(cu->family);
   family_gh = BLI_ghash_int_new_ex(__func__, 256);
 
+  /* Safety check even if it might fail badly when called for original object. 
*/
+  const bool is_eval_curve = DEG_is_evaluated_id(>id);
+
   /* advance matching BLI_strncpy_wchar_from_utf8 */
   for (a = 0; a < text_len; a++, ct++) {
 
@@ -528,6 +531,12 @@ static void make_duplis_font(const DupliContext *ctx)
  * Definitively don't think it would be safe to put back Main *bmain 
pointer
  * in DupliContext as done in 2.7x? */
 ob = find_family_object(G.main, cu->family, family_len, (unsigned 
int)text[a], family_gh);
+
+if (is_eval_curve) {
+  /* Workaround for the above hack. */
+  ob = DEG_get_evaluated_object(ctx->depsgraph, ob);
+}
+
 if (ob) {
   vec[0] = fsize * (ct->xof - xof);
   vec[1] = fsize * (ct->yof - yof);

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


[Bf-blender-cvs] [3d6e7cd67c2] blender-v2.82-release: Fix Cycles particle hair rendering broken after recent changes

2020-02-03 Thread Brecht Van Lommel
Commit: 3d6e7cd67c2dac8acbce585efed2fa34341f2676
Author: Brecht Van Lommel
Date:   Mon Feb 3 17:40:03 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB3d6e7cd67c2dac8acbce585efed2fa34341f2676

Fix Cycles particle hair rendering broken after recent changes

This code was already wrong, we were just lucky that the previous coordinate
was repeated due to using the same memory location.

===

M   intern/cycles/blender/blender_curves.cpp
M   source/blender/makesrna/intern/rna_particle.c

===

diff --git a/intern/cycles/blender/blender_curves.cpp 
b/intern/cycles/blender/blender_curves.cpp
index 4dba8ffbe0e..78db1d5c832 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -173,19 +173,20 @@ static bool ObtainCacheParticleData(
   CData->curve_firstkey.push_back_slow(keyno);
 
   float curve_length = 0.0f;
-  float3 pcKey;
+  float3 prev_co_world = make_float3(0.0f, 0.0f, 0.0f);
+  float3 prev_co_object = make_float3(0.0f, 0.0f, 0.0f);
   for (int step_no = 0; step_no < ren_step; step_no++) {
-float nco[3];
-b_psys.co_hair(*b_ob, pa_no, step_no, nco);
-float3 cKey = make_float3(nco[0], nco[1], nco[2]);
-cKey = transform_point(, cKey);
+float3 co_world = prev_co_world;
+b_psys.co_hair(*b_ob, pa_no, step_no, _world.x);
+float3 co_object = transform_point(, co_world);
 if (step_no > 0) {
-  const float step_length = len(cKey - pcKey);
+  const float step_length = len(co_object - prev_co_object);
   curve_length += step_length;
 }
-CData->curvekey_co.push_back_slow(cKey);
+CData->curvekey_co.push_back_slow(co_object);
 CData->curvekey_time.push_back_slow(curve_length);
-pcKey = cKey;
+prev_co_object = co_object;
+prev_co_world = co_world;
 keynum++;
   }
   keyno += keynum;
diff --git a/source/blender/makesrna/intern/rna_particle.c 
b/source/blender/makesrna/intern/rna_particle.c
index 36320be9270..a5852a30661 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -400,7 +400,6 @@ static void rna_ParticleSystem_co_hair(
 }
   }
   else {
-zero_v3(n_co);
 return;
   }
 
@@ -410,9 +409,6 @@ static void rna_ParticleSystem_co_hair(
 mul_m4_v3(particlesystem->imat, n_co);
 mul_m4_v3(object->obmat, n_co);
   }
-  else {
-zero_v3(n_co);
-  }
 }
 
 static const EnumPropertyItem *rna_Particle_Material_itemf(bContext *C,

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


[Bf-blender-cvs] [602e9e47324] greasepencil-refactor: GPencil: Recalc geometry only for deform sculpt

2020-02-03 Thread Antonio Vazquez
Commit: 602e9e47324e0eb1a9b58e844a8c933622ac3f19
Author: Antonio Vazquez
Date:   Mon Feb 3 18:35:02 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB602e9e47324e0eb1a9b58e844a8c933622ac3f19

GPencil: Recalc geometry only for deform sculpt

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 67fdbd3dfc6..5ed8a182713 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1569,6 +1569,7 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 const float diff_mat[4][4])
 {
   bool changed = false;
+  bool redo_geom = false;
   Object *ob = gso->object;
   char tool = gso->brush->gpencil_sculpt_tool;
 
@@ -1586,6 +1587,7 @@ static bool gpsculpt_brush_do_frame(bContext *C,
   case GPSCULPT_TOOL_SMOOTH: /* Smooth strokes */
   {
 changed |= gpsculpt_brush_do_stroke(gso, gps, diff_mat, 
gp_brush_smooth_apply);
+redo_geom |= changed;
 break;
   }
 
@@ -1619,30 +1621,35 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 changed |= true;
   }
 }
+redo_geom |= changed;
 break;
   }
 
   case GPSCULPT_TOOL_PUSH: /* Push points */
   {
 changed |= gpsculpt_brush_do_stroke(gso, gps, diff_mat, 
gp_brush_push_apply);
+redo_geom |= changed;
 break;
   }
 
   case GPSCULPT_TOOL_PINCH: /* Pinch points */
   {
 changed |= gpsculpt_brush_do_stroke(gso, gps, diff_mat, 
gp_brush_pinch_apply);
+redo_geom |= changed;
 break;
   }
 
   case GPSCULPT_TOOL_TWIST: /* Twist points around midpoint */
   {
 changed |= gpsculpt_brush_do_stroke(gso, gps, diff_mat, 
gp_brush_twist_apply);
+redo_geom |= changed;
 break;
   }
 
   case GPSCULPT_TOOL_RANDOMIZE: /* Apply jitter */
   {
 changed |= gpsculpt_brush_do_stroke(gso, gps, diff_mat, 
gp_brush_randomize_apply);
+redo_geom |= changed;
 break;
   }
 
@@ -1652,7 +1659,7 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 }
 
 /* Triangulation must be calculated. */
-if (changed) {
+if (redo_geom) {
   bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig 
: gps;
   if (gpl->actframe == gpf) {
 MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, 
gps->mat_nr + 1);

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


[Bf-blender-cvs] [d58e2c36d9d] greasepencil-refactor: GPencil: Remove double calculation of geometry in Push sculpt brush

2020-02-03 Thread Antonio Vazquez
Commit: d58e2c36d9d213f869627a0f8adbc53fb1013214
Author: Antonio Vazquez
Date:   Mon Feb 3 18:16:17 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBd58e2c36d9d213f869627a0f8adbc53fb1013214

GPencil: Remove double calculation of geometry in Push sculpt brush

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 46c5b15a6e6..67fdbd3dfc6 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -620,9 +620,6 @@ static bool gp_brush_push_apply(tGP_BrushEditData *gso,
   /* compute lock axis */
   gpsculpt_compute_lock_axis(gso, pt, save_pt);
 
-  /* Calc geometry data. */
-  BKE_gpencil_stroke_geometry_update(gps);
-
   /* done */
   return true;
 }

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


[Bf-blender-cvs] [85776521f8d] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Sergey Sharybin
Commit: 85776521f8d3e49abddfa35ae36c5074a88d8936
Author: Sergey Sharybin
Date:   Mon Feb 3 17:53:28 2020 +0100
Branches: master
https://developer.blender.org/rB85776521f8d3e49abddfa35ae36c5074a88d8936

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [26ba7573e61] blender-v2.82-release: Codesign: Fix wrong logging message

2020-02-03 Thread Sergey Sharybin
Commit: 26ba7573e61e80de5f87967ba2e517972f689de7
Author: Sergey Sharybin
Date:   Mon Feb 3 17:53:03 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB26ba7573e61e80de5f87967ba2e517972f689de7

Codesign: Fix wrong logging message

===

M   build_files/buildbot/codesign/macos_code_signer.py

===

diff --git a/build_files/buildbot/codesign/macos_code_signer.py 
b/build_files/buildbot/codesign/macos_code_signer.py
index ce2bfb6d1b5..44677339afa 100644
--- a/build_files/buildbot/codesign/macos_code_signer.py
+++ b/build_files/buildbot/codesign/macos_code_signer.py
@@ -389,8 +389,7 @@ class MacOSCodeSigner(BaseCodeSigner):
 Staple notarial label on the file
 """
 
-logger_server.info(
-'Waiting for a result from the notarization office.')
+logger_server.info('Stapling notarial stamp.')
 
 command = ['xcrun', 'stapler', 'staple', '-v', file.absolute_filepath]
 self.check_output_or_mock(command, util.Platform.MACOS)

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


[Bf-blender-cvs] [7799890d8e7] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Sergey Sharybin
Commit: 7799890d8e7514186cf252daa5f8ccd713122007
Author: Sergey Sharybin
Date:   Mon Feb 3 17:31:26 2020 +0100
Branches: master
https://developer.blender.org/rB7799890d8e7514186cf252daa5f8ccd713122007

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [3125cfceec3] blender-v2.82-release: Codesign: Add codesign for macOS worker

2020-02-03 Thread Sergey Sharybin
Commit: 3125cfceec35ef14374ae98f9a400e7a678287a2
Author: Sergey Sharybin
Date:   Mon Feb 3 17:03:51 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB3125cfceec35ef14374ae98f9a400e7a678287a2

Codesign: Add codesign for macOS worker

Works similarly to Windows configuration where buildbot worker and
codesign machines are communicating with each other using network
drive.

===

M   build_files/buildbot/codesign/absolute_and_relative_filename.py
M   build_files/buildbot/codesign/base_code_signer.py
M   build_files/buildbot/codesign/config_builder.py
M   build_files/buildbot/codesign/config_common.py
M   build_files/buildbot/codesign/config_server_template.py
M   build_files/buildbot/codesign/linux_code_signer.py
A   build_files/buildbot/codesign/macos_code_signer.py
M   build_files/buildbot/codesign/simple_code_signer.py
M   build_files/buildbot/codesign/util.py
M   build_files/buildbot/codesign/windows_code_signer.py
A   build_files/buildbot/codesign_server_macos.py
M   build_files/buildbot/codesign_server_windows.py
A   build_files/buildbot/slave_bundle_dmg.py
M   build_files/buildbot/slave_codesign.py
M   build_files/buildbot/slave_pack.py

===

diff --git a/build_files/buildbot/codesign/absolute_and_relative_filename.py 
b/build_files/buildbot/codesign/absolute_and_relative_filename.py
index bea9ea7e8d0..cb42710e785 100644
--- a/build_files/buildbot/codesign/absolute_and_relative_filename.py
+++ b/build_files/buildbot/codesign/absolute_and_relative_filename.py
@@ -65,10 +65,14 @@ class AbsoluteAndRelativeFileName:
 """
 Create list of AbsoluteAndRelativeFileName for all the files in the
 given directory.
+
+NOTE: Result will be pointing to a resolved paths.
 """
 assert base_dir.is_absolute()
 assert base_dir.is_dir()
 
+base_dir = base_dir.resolve()
+
 result = []
 for filename in base_dir.glob('**/*'):
 if not filename.is_file():
diff --git a/build_files/buildbot/codesign/base_code_signer.py 
b/build_files/buildbot/codesign/base_code_signer.py
index ff4b4539658..0505905c6f4 100644
--- a/build_files/buildbot/codesign/base_code_signer.py
+++ b/build_files/buildbot/codesign/base_code_signer.py
@@ -45,13 +45,16 @@
 import abc
 import logging
 import shutil
+import subprocess
 import time
-import zipfile
+import tarfile
 
 from pathlib import Path
 from tempfile import TemporaryDirectory
 from typing import Iterable, List
 
+import codesign.util as util
+
 from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
 from codesign.archive_with_indicator import ArchiveWithIndicator
 
@@ -64,14 +67,14 @@ logger_server = logger.getChild('server')
 def pack_files(files: Iterable[AbsoluteAndRelativeFileName],
archive_filepath: Path) -> None:
 """
-Create zip archive from given files for the signing pipeline.
+Create tar archive from given files for the signing pipeline.
 Is used by buildbot worker to create an archive of files which are to be
 signed, and by signing server to send signed files back to the worker.
 """
-with zipfile.ZipFile(archive_filepath, 'w') as zip_file_handle:
+with tarfile.TarFile.open(archive_filepath, 'w') as tar_file_handle:
 for file_info in files:
-zip_file_handle.write(file_info.absolute_filepath,
-  arcname=file_info.relative_filepath)
+tar_file_handle.add(file_info.absolute_filepath,
+arcname=file_info.relative_filepath)
 
 
 def extract_files(archive_filepath: Path,
@@ -82,8 +85,8 @@ def extract_files(archive_filepath: Path,
 
 # TODO(sergey): Verify files in the archive have relative path.
 
-with zipfile.ZipFile(archive_filepath, mode='r') as zip_file_handle:
-zip_file_handle.extractall(path=extraction_dir)
+with tarfile.TarFile.open(archive_filepath, mode='r') as tar_file_handle:
+tar_file_handle.extractall(path=extraction_dir)
 
 
 class BaseCodeSigner(metaclass=abc.ABCMeta):
@@ -133,6 +136,9 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
 # This archive is created by the code signing server.
 signed_archive_info: ArchiveWithIndicator
 
+# Platform the code is currently executing on.
+platform: util.Platform
+
 def __init__(self, config):
 self.config = config
 
@@ -141,12 +147,14 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
 # Unsigned (signing server input) configuration.
 self.unsigned_storage_dir = absolute_shared_storage_dir / 'unsigned'
 self.unsigned_archive_info = ArchiveWithIndicator(
-self.unsigned_storage_dir, 'unsigned_files.zip', 'ready.stamp')
+self.unsigned_storage_dir, 'unsigned_files.tar', 

[Bf-blender-cvs] [ed29fca3c0e] greasepencil-refactor: GPencil: Fix crash when remove points in cyclic strokes

2020-02-03 Thread Antonio Vazquez
Commit: ed29fca3c0e1df5222dad1e1bea0628ca951439c
Author: Antonio Vazquez
Date:   Mon Feb 3 16:58:20 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBed29fca3c0e1df5222dad1e1bea0628ca951439c

GPencil: Fix crash when remove points in cyclic strokes

The geometry must be calculated for new joined stroke, not for parts to join.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_edit.c 
b/source/blender/editors/gpencil/gpencil_edit.c
index 5f9da601007..468487e1a7e 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2256,6 +2256,8 @@ static void gp_stroke_join_islands(bGPDframe *gpf, 
bGPDstroke *gps_first, bGPDst
 
   /* add new stroke at head */
   BLI_addhead(>strokes, join_stroke);
+  /* Calc geometry data. */
+  BKE_gpencil_stroke_geometry_update(join_stroke);
 
   /* remove first stroke */
   BLI_remlink(>strokes, gps_first);
@@ -2416,9 +2418,6 @@ void gp_stroke_delete_tagged_points(bGPDframe *gpf,
 /* if cyclic, need to join last stroke with first stroke */
 if ((is_cyclic) && (gps_first != NULL) && (gps_first != new_stroke)) {
   gp_stroke_join_islands(gpf, gps_first, new_stroke);
-  /* Calc geometry data. */
-  BKE_gpencil_stroke_geometry_update(gps_first);
-  BKE_gpencil_stroke_geometry_update(new_stroke);
 }
   }

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


[Bf-blender-cvs] [735a33b5acc] codesign: Codesign: Tweaks to make it work on final machines

2020-02-03 Thread Sergey Sharybin
Commit: 735a33b5accad6b4141675ab462c079e1c72e7a3
Author: Sergey Sharybin
Date:   Mon Feb 3 16:37:24 2020 +0100
Branches: codesign
https://developer.blender.org/rB735a33b5accad6b4141675ab462c079e1c72e7a3

Codesign: Tweaks to make it work on final machines

===

M   build_files/buildbot/codesign/config_builder.py
M   build_files/buildbot/codesign/macos_code_signer.py
M   build_files/buildbot/slave_pack.py

===

diff --git a/build_files/buildbot/codesign/config_builder.py 
b/build_files/buildbot/codesign/config_builder.py
index 1fa725ed28b..1f41619ba13 100644
--- a/build_files/buildbot/codesign/config_builder.py
+++ b/build_files/buildbot/codesign/config_builder.py
@@ -35,7 +35,7 @@ if platform == util.Platform.LINUX:
 elif platform == util.Platform.WINDOWS:
 SHARED_STORAGE_DIR = Path('Z:\\codesign')
 elif platform == util.Platform.MACOS:
-SHARED_STORAGE_DIR = Path('/Users/sergey/Developer/blender/codesign')
+SHARED_STORAGE_DIR = Path('/Volumes/codesign_macos/codesign')
 
 # 
https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
 LOGGING = {
diff --git a/build_files/buildbot/codesign/macos_code_signer.py 
b/build_files/buildbot/codesign/macos_code_signer.py
index aea7313d1c7..ce2bfb6d1b5 100644
--- a/build_files/buildbot/codesign/macos_code_signer.py
+++ b/build_files/buildbot/codesign/macos_code_signer.py
@@ -251,6 +251,8 @@ class MacOSCodeSigner(BaseCodeSigner):
bundle_name)
 
 # It is not possible to remove signature from DMG.
+if bundle.relative_filepath.name.endswith('.app'):
+self.codesign_remove_signature(bundle)
 self.codesign_file(bundle)
 
 signed_bundles.add(bundle_name)
@@ -328,6 +330,7 @@ class MacOSCodeSigner(BaseCodeSigner):
 f'The package has been already submitted under UUID 
{request_uuid}')
 return request_uuid
 
+logger_server.error(output)
 logger_server.error('xcrun command did not report RequestUUID')
 return None
 
@@ -362,6 +365,7 @@ class MacOSCodeSigner(BaseCodeSigner):
 'Package successfully notarized: %s', status_message)
 return True
 elif status == 'invalid':
+logger_server.error(output)
 logger_server.error(
 'Package notarization has failed: %s', status_message)
 return False
diff --git a/build_files/buildbot/slave_pack.py 
b/build_files/buildbot/slave_pack.py
index bbacedca0ce..dd321f6c737 100644
--- a/build_files/buildbot/slave_pack.py
+++ b/build_files/buildbot/slave_pack.py
@@ -109,14 +109,15 @@ def pack_mac(builder):
 package_filepath = os.path.join(builder.build_dir, package_filename)
 
 release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
-bundle_sh = os.path.join(release_dir, 'bundle.sh')
+buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot')
+bundle_script = os.path.join(buildbot_dir, 'slave_bundle_dmg.py')
 
-command = [bundle_sh]
-command += ['--source', builder.install_dir]
+command = [bundle_script]
 command += ['--dmg', package_filepath]
 if info.is_development_build:
 background_image = os.path.join(release_dir, 'buildbot', 
'background.tif')
 command += ['--background-image', background_image]
+command += [builder.install_dir]
 buildbot_utils.call(command)
 
 create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])

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


[Bf-blender-cvs] [59e1c2f6296] blender-v2.82-release: Overlay: Armature: Fix wireframe display type not working as 2.81

2020-02-03 Thread Clément Foucault
Commit: 59e1c2f6296e38ab21f2650e32089c22b80777f6
Author: Clément Foucault
Date:   Mon Feb 3 15:58:29 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB59e1c2f6296e38ab21f2650e32089c22b80777f6

Overlay: Armature: Fix wireframe display type not working as 2.81

===

M   source/blender/draw/engines/overlay/overlay_armature.c
M   source/blender/draw/engines/overlay/overlay_private.h

===

diff --git a/source/blender/draw/engines/overlay/overlay_armature.c 
b/source/blender/draw/engines/overlay/overlay_armature.c
index 9fde3ec0902..849807e24b5 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -184,10 +184,10 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
 DRWPass **p_armature_ps = >armature_ps[i];
 
 cb->custom_shapes_ghash = BLI_ghash_ptr_new(__func__);
+cb->custom_shapes_transp_ghash = BLI_ghash_ptr_new(__func__);
 
 DRWState infront_state = (DRW_state_is_select() && (i == 1)) ? 
DRW_STATE_IN_FRONT_SELECT : 0;
-state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL |
-(pd->armature.transparent ? DRW_STATE_BLEND_ALPHA : 
DRW_STATE_WRITE_DEPTH);
+state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | 
DRW_STATE_WRITE_DEPTH;
 DRW_PASS_CREATE(*p_armature_ps, state | pd->clipping_state | 
infront_state);
 
 DRWPass *armature_ps = *p_armature_ps;
@@ -201,32 +201,44 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
   sh = OVERLAY_shader_armature_sphere(false);
   grp = DRW_shgroup_create(sh, armature_ps);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
-  DRW_shgroup_uniform_float_copy(grp, "alpha", pd->armature.transparent ? 
0.4f : 1.0f);
+  DRW_shgroup_uniform_float_copy(grp, "alpha", 1.0f);
   cb->point_solid = BUF_INSTANCE(grp, format, DRW_cache_bone_point_get());
 
+  grp = DRW_shgroup_create(sh, armature_ps);
+  DRW_shgroup_state_disable(grp, DRW_STATE_WRITE_DEPTH);
+  DRW_shgroup_state_enable(grp, DRW_STATE_BLEND_ALPHA);
+  DRW_shgroup_uniform_float_copy(grp, "alpha", 0.4f);
+  cb->point_transp = BUF_INSTANCE(grp, format, DRW_cache_bone_point_get());
+
   sh = OVERLAY_shader_armature_shape(false);
-  cb->custom_solid = grp = DRW_shgroup_create(sh, armature_ps);
+  grp = DRW_shgroup_create(sh, armature_ps);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
-  DRW_shgroup_uniform_float_copy(grp, "alpha", pd->armature.transparent ? 
0.6f : 1.0f);
+  DRW_shgroup_uniform_float_copy(grp, "alpha", 1.0f);
+  cb->custom_solid = grp;
   cb->box_solid = BUF_INSTANCE(grp, format, DRW_cache_bone_box_get());
   cb->octa_solid = BUF_INSTANCE(grp, format, 
DRW_cache_bone_octahedral_get());
 
+  grp = DRW_shgroup_create(sh, armature_ps);
+  DRW_shgroup_state_disable(grp, DRW_STATE_WRITE_DEPTH);
+  DRW_shgroup_state_enable(grp, DRW_STATE_BLEND_ALPHA);
+  DRW_shgroup_uniform_float_copy(grp, "alpha", 0.6f);
+  cb->custom_transp = grp;
+  cb->box_transp = BUF_INSTANCE(grp, format, DRW_cache_bone_box_get());
+  cb->octa_transp = BUF_INSTANCE(grp, format, 
DRW_cache_bone_octahedral_get());
+
   sh = OVERLAY_shader_armature_sphere(true);
   grp = DRW_shgroup_create(sh, armature_ps);
-  DRW_shgroup_state_disable(grp, DRW_STATE_BLEND_ALPHA);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
   cb->point_outline = BUF_INSTANCE(grp, format, 
DRW_cache_bone_point_wire_outline_get());
 
   sh = OVERLAY_shader_armature_shape(true);
   cb->custom_outline = grp = DRW_shgroup_create(sh, armature_ps);
-  DRW_shgroup_state_disable(grp, DRW_STATE_BLEND_ALPHA);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
   cb->box_outline = BUF_INSTANCE(grp, format, 
DRW_cache_bone_box_wire_get());
   cb->octa_outline = BUF_INSTANCE(grp, format, 
DRW_cache_bone_octahedral_wire_get());
 
   sh = OVERLAY_shader_armature_shape_wire();
   cb->custom_wire = grp = DRW_shgroup_create(sh, armature_ps);
-  DRW_shgroup_state_disable(grp, DRW_STATE_BLEND_ALPHA);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
 }
 {
@@ -235,7 +247,6 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
   sh = OVERLAY_shader_armature_degrees_of_freedom();
   grp = DRW_shgroup_create(sh, armature_ps);
   DRW_shgroup_uniform_block_persistent(grp, "globalsBlock", 
G_draw.block_ubo);
-  DRW_shgroup_state_disable(grp, DRW_STATE_BLEND_ALPHA);
   cb->dof_lines = BUF_INSTANCE(grp, format, 
DRW_cache_bone_dof_lines_get());
 
   grp = DRW_shgroup_create(sh, psl->armature_transp_ps);
@@ -255,16 +266,22 @@ void 

[Bf-blender-cvs] [dcf44dfe8e0] blender-v2.82-release: Fix T65114 Overlay: Armature: Bones with negative scale have wrong display

2020-02-03 Thread Clément Foucault
Commit: dcf44dfe8e0b0a084554ecb2cb2d34f0e273d933
Author: Clément Foucault
Date:   Mon Feb 3 13:30:41 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBdcf44dfe8e0b0a084554ecb2cb2d34f0e273d933

Fix T65114 Overlay: Armature: Bones with negative scale have wrong display

This moves the backface culling to the fragment shader to avoid all the
limitations of the current system. This has a cost but it is unlikely that
bone drawing will be a bottleneck.

===

M   source/blender/draw/engines/overlay/overlay_armature.c
M   
source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
M   
source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
M   
source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
M   
source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl

===

diff --git a/source/blender/draw/engines/overlay/overlay_armature.c 
b/source/blender/draw/engines/overlay/overlay_armature.c
index 0b77fcad265..9fde3ec0902 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -186,7 +186,7 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
 cb->custom_shapes_ghash = BLI_ghash_ptr_new(__func__);
 
 DRWState infront_state = (DRW_state_is_select() && (i == 1)) ? 
DRW_STATE_IN_FRONT_SELECT : 0;
-state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | 
DRW_STATE_CULL_BACK |
+state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL |
 (pd->armature.transparent ? DRW_STATE_BLEND_ALPHA : 
DRW_STATE_WRITE_DEPTH);
 DRW_PASS_CREATE(*p_armature_ps, state | pd->clipping_state | 
infront_state);
 
diff --git 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
index ffc941149c7..db5975ea226 100644
--- 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
@@ -7,6 +7,7 @@ in vec3 vPos[];
 in vec2 ssPos[];
 in vec2 ssNor[];
 in vec4 vColSize[];
+in int inverted[];
 
 flat out vec4 finalColor;
 flat out vec2 edgeStart;
@@ -39,6 +40,7 @@ void main(void)
 }
   }
 
+  n0 = (inverted[0] == 1) ? -n0 : n0;
   /* Don't outline if concave edge. */
   if (dot(n0, v13) > 0.0001) {
 return;
diff --git 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
index cd9368a997a..b720be0c7d1 100644
--- 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
@@ -12,6 +12,7 @@ out vec3 vPos;
 out vec2 ssPos;
 out vec2 ssNor;
 out vec4 vColSize;
+out int inverted;
 
 /* project to screen space */
 vec2 proj(vec4 pos)
@@ -30,6 +31,8 @@ void main()
   vPos = viewpos.xyz;
   pPos = ProjectionMatrix * viewpos;
 
+  inverted = int(dot(cross(model_mat[0].xyz, model_mat[1].xyz), 
model_mat[2].xyz) < 0.0);
+
   /* This is slow and run per vertex, but it's still faster than
* doing it per instance on CPU and sending it on via instance attribute. */
   mat3 normal_mat = transpose(inverse(mat3(model_mat)));
diff --git 
a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl 
b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
index 54cd807edaa..17e8d0da5d9 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
@@ -2,12 +2,19 @@
 uniform float alpha = 0.6;
 
 in vec4 finalColor;
+flat in int inverted;
 
 layout(location = 0) out vec4 fragColor;
 layout(location = 1) out vec4 lineOutput;
 
 void main()
 {
+  /* Manual backface cullling.. Not ideal for performance
+   * but needed for view clarity in xray mode and support
+   * for inverted bone matrices. */
+  if ((inverted == 1) == gl_FrontFacing) {
+discard;
+  }
   fragColor = vec4(finalColor.rgb, alpha);
   lineOutput = vec4(0.0);
 }
diff --git 
a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl 
b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl
index 8284bd43adc..a6af7214de1 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl
@@ -7,6 +7,7 @@ in vec3 nor;
 in mat4 inst_obmat;
 
 out vec4 finalColor;
+flat out int inverted;
 
 void main()
 {
@@ -18,6 +19,8 @@ void main()
   mat3 normal_mat = transpose(inverse(mat3(model_mat)));
   vec3 normal = normalize(normal_world_to_view(normal_mat 

[Bf-blender-cvs] [88ffee6953c] blender-v2.82-release: Overlay: Armature: Improve bone outline z-bias in orthographic mode

2020-02-03 Thread Clément Foucault
Commit: 88ffee6953cc15a74ace6ef19a37b53cf10f08cd
Author: Clément Foucault
Date:   Mon Feb 3 13:46:38 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB88ffee6953cc15a74ace6ef19a37b53cf10f08cd

Overlay: Armature: Improve bone outline z-bias in orthographic mode

The bias was too big and cause interpenetration on geometry that was in
front of bones.

===

M   
source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl

===

diff --git 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
index db5975ea226..6398426952c 100644
--- 
a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
@@ -70,7 +70,7 @@ void main(void)
   /* Offset away from the center to avoid overlap with solid shape. */
   gl_Position.xy += (edge_dir - perp) * sizeViewportInv.xy * gl_Position.w;
   /* Improve AA bleeding inside bone silhouette. */
-  gl_Position.z -= 1e-4;
+  gl_Position.z -= (is_persp) ? 1e-4 : 1e-6;
   edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * 
sizeViewport.xy;
 #ifdef USE_WORLD_CLIP_PLANES
   world_clip_planes_set_clip_distance(gl_in[1].gl_ClipDistance);
@@ -81,7 +81,7 @@ void main(void)
   /* Offset away from the center to avoid overlap with solid shape. */
   gl_Position.xy += (edge_dir + perp) * sizeViewportInv.xy * gl_Position.w;
   /* Improve AA bleeding inside bone silhouette. */
-  gl_Position.z -= 1e-4;
+  gl_Position.z -= (is_persp) ? 1e-4 : 1e-6;
   edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * 
sizeViewport.xy;
 #ifdef USE_WORLD_CLIP_PLANES
   world_clip_planes_set_clip_distance(gl_in[2].gl_ClipDistance);

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


[Bf-blender-cvs] [ed8e110b5ab] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Bastien Montagne
Commit: ed8e110b5ab37bdb112bef2d6698d5f42eb2a0df
Author: Bastien Montagne
Date:   Mon Feb 3 14:32:45 2020 +0100
Branches: master
https://developer.blender.org/rBed8e110b5ab37bdb112bef2d6698d5f42eb2a0df

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [f13940e883c] blender-v2.82-release: Fix T73472: Crash in override code on dirty pose bone pointers.

2020-02-03 Thread Bastien Montagne
Commit: f13940e883cf7c64ee5d7dd1d05ac425db56d126
Author: Bastien Montagne
Date:   Mon Feb 3 14:29:18 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBf13940e883cf7c64ee5d7dd1d05ac425db56d126

Fix T73472: Crash in override code on dirty pose bone pointers.

Usual issue from those dear Bone pointers in pose data...

Note that this is more like minimal-risk, quick fix, it's nothing like
'nice to have' code. Think proper solution would be to refactor handling
of those kind of 'caches' to ensure they are valid/up-to-date in a much
easier way, at the very least.

Ideal solution being to get fully rid of those horrors, of course, but
let's not dream here. ;)

===

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

===

diff --git a/source/blender/blenkernel/intern/library_override.c 
b/source/blender/blenkernel/intern/library_override.c
index 2e958c8a578..a8cc37973f2 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -30,6 +30,8 @@
 #include "DNA_object_types.h"
 
 #include "DEG_depsgraph.h"
+
+#include "BKE_armature.h"
 #include "BKE_library.h"
 #include "BKE_library_override.h"
 #include "BKE_library_remap.h"
@@ -579,6 +581,17 @@ bool BKE_override_library_status_check_local(Main *bmain, 
ID *local)
 
   BLI_assert(GS(local->name) == GS(reference->name));
 
+  if (GS(local->name) == ID_OB) {
+/* Our beloved pose's bone cross-data pointers... Usually, depsgraph 
evaluation would ensure
+ * this is valid, but in some cases (like hidden collections etc.) this 
won't be the case, so
+ * we need to take care of this ourselves. */
+Object *ob_local = (Object *)local;
+if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && 
ob_local->pose != NULL &&
+ob_local->pose->flag & POSE_RECALC) {
+  BKE_pose_rebuild(bmain, ob_local, ob_local->data, true);
+}
+  }
+
   /* Note that reference is assumed always valid, caller has to ensure that 
itself. */
 
   PointerRNA rnaptr_local, rnaptr_reference;
@@ -633,6 +646,17 @@ bool BKE_override_library_status_check_reference(Main 
*bmain, ID *local)
 }
   }
 
+  if (GS(local->name) == ID_OB) {
+/* Our beloved pose's bone cross-data pointers... Usually, depsgraph 
evaluation would ensure
+ * this is valid, but in some cases (like hidden collections etc.) this 
won't be the case, so
+ * we need to take care of this ourselves. */
+Object *ob_local = (Object *)local;
+if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && 
ob_local->pose != NULL &&
+ob_local->pose->flag & POSE_RECALC) {
+  BKE_pose_rebuild(bmain, ob_local, ob_local->data, true);
+}
+  }
+
   PointerRNA rnaptr_local, rnaptr_reference;
   RNA_id_pointer_create(local, _local);
   RNA_id_pointer_create(reference, _reference);
@@ -678,6 +702,17 @@ bool BKE_override_library_operations_create(Main *bmain, 
ID *local, const bool f
   return ret;
 }
 
+if (GS(local->name) == ID_OB) {
+  /* Our beloved pose's bone cross-data pointers... Usually, depsgraph 
evaluation would ensure
+   * this is valid, but in some cases (like hidden collections etc.) this 
won't be the case, so
+   * we need to take care of this ourselves. */
+  Object *ob_local = (Object *)local;
+  if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && 
ob_local->pose != NULL &&
+  ob_local->pose->flag & POSE_RECALC) {
+BKE_pose_rebuild(bmain, ob_local, ob_local->data, true);
+  }
+}
+
 PointerRNA rnaptr_local, rnaptr_reference;
 RNA_id_pointer_create(local, _local);
 RNA_id_pointer_create(local->override_library->reference, 
_reference);

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


[Bf-blender-cvs] [bc3d7faab73] blender-v2.82-release: Buildbot: Specify path to macOS codesign

2020-02-03 Thread Sergey Sharybin
Commit: bc3d7faab73165de8a7a7a9f8b19dcdfc046a51b
Author: Sergey Sharybin
Date:   Mon Feb 3 14:07:21 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBbc3d7faab73165de8a7a7a9f8b19dcdfc046a51b

Buildbot: Specify path to macOS codesign

===

M   build_files/buildbot/codesign/config_builder.py

===

diff --git a/build_files/buildbot/codesign/config_builder.py 
b/build_files/buildbot/codesign/config_builder.py
index c023b4234da..e1e3913b99e 100644
--- a/build_files/buildbot/codesign/config_builder.py
+++ b/build_files/buildbot/codesign/config_builder.py
@@ -31,6 +31,8 @@ if sys.platform == 'linux':
 SHARED_STORAGE_DIR = Path('/data/codesign')
 elif sys.platform == 'win32':
 SHARED_STORAGE_DIR = Path('Z:\\codesign')
+elif sys.platform == 'darwin':
+SHARED_STORAGE_DIR = Path('/Volumes/codesign_macos/codesign')
 
 # 
https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
 LOGGING = {

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


[Bf-blender-cvs] [f037244e2cb] master: Merge branch 'blender-v2.82-release'

2020-02-03 Thread Sergey Sharybin
Commit: f037244e2cbd9dec7d423cdd1f966678156a374a
Author: Sergey Sharybin
Date:   Mon Feb 3 14:07:48 2020 +0100
Branches: master
https://developer.blender.org/rBf037244e2cbd9dec7d423cdd1f966678156a374a

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [aea125fe9d2] master: Cleanup: Rearrange ED_armature.h

2020-02-03 Thread mano-wii
Commit: aea125fe9d2db2eaff640e0fc42724f00413a49c
Author: mano-wii
Date:   Mon Feb 3 08:16:10 2020 -0300
Branches: master
https://developer.blender.org/rBaea125fe9d2db2eaff640e0fc42724f00413a49c

Cleanup: Rearrange ED_armature.h

===

M   source/blender/editors/armature/armature_naming.c
M   source/blender/editors/include/ED_armature.h

===

diff --git a/source/blender/editors/armature/armature_naming.c 
b/source/blender/editors/armature/armature_naming.c
index 9a1582679a4..4162e92cfea 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -79,6 +79,7 @@ static bool editbone_unique_check(void *arg, const char *name)
   return dupli && dupli != data->bone;
 }
 
+/* If bone is already in list, pass it as param to ignore it. */
 void ED_armature_ebone_unique_name(ListBase *edbo, char *name, EditBone *bone)
 {
   struct {
diff --git a/source/blender/editors/include/ED_armature.h 
b/source/blender/editors/include/ED_armature.h
index 7ac42967dda..40f5cade0d5 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -140,56 +140,45 @@ typedef struct EditBone {
   (CHECK_TYPE_INLINE(ebone, EditBone *), \
(((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & 
BONE_EDITMODE_LOCKED)))
 
-/* used in armature_select_hierarchy_exec() */
+/* used in armature_select.c and pose_select.c */
 #define BONE_SELECT_PARENT 0
 #define BONE_SELECT_CHILD 1
 
+/* armature_add.c */
+EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name);
+EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm,
+  float length,
+  bool view_aligned);
+
+/* armature_edit.c */
+float ED_armature_ebone_roll_to_vector(const EditBone *bone,
+   const float new_up_axis[3],
+   const bool axis_only);
+void ED_armature_origin_set(
+struct Main *bmain, struct Object *ob, const float cursor[3], int 
centermode, int around);
+void ED_armature_edit_transform(struct bArmature *arm, const float mat[4][4], 
const bool do_props);
+void ED_armature_transform(struct bArmature *arm, const float mat[4][4], const 
bool do_props);
+
+/* armature_naming.c */
+void ED_armature_ebone_unique_name(struct ListBase *ebones, char *name, 
EditBone *bone);
+void ED_armature_bone_rename(struct Main *bmain,
+ struct bArmature *arm,
+ const char *oldnamep,
+ const char *newnamep);
+void ED_armature_bones_flip_names(struct Main *bmain,
+  struct bArmature *arm,
+  struct ListBase *bones_names,
+  const bool do_strip_numbers);
+
 /* armature_ops.c */
 void ED_operatortypes_armature(void);
 void ED_operatormacros_armature(void);
 void ED_keymap_armature(struct wmKeyConfig *keyconf);
 
-/* editarmature.c */
-void ED_armature_from_edit(struct Main *bmain, struct bArmature *arm);
-void ED_armature_to_edit(struct bArmature *arm);
-void ED_armature_edit_free(struct bArmature *arm);
-
-bool ED_armature_edit_deselect_all(struct Object *obedit);
-bool ED_armature_edit_deselect_all_visible(struct Object *obedit);
-
-bool ED_armature_edit_deselect_all_multi_ex(struct Base **bases, uint 
bases_len);
-bool ED_armature_edit_deselect_all_visible_multi_ex(struct Base **bases, uint 
bases_len);
-bool ED_armature_edit_deselect_all_visible_multi(struct bContext *C);
-
-bool ED_armature_pose_select_pick_with_buffer(struct ViewLayer *view_layer,
-  struct View3D *v3d,
-  struct Base *base,
-  const unsigned int *buffer,
-  short hits,
-  bool extend,
-  bool deselect,
-  bool toggle,
-  bool do_nearest);
-
-void ED_armature_pose_select_in_wpaint_mode(struct ViewLayer *view_layer,
-struct Base *base_select);
-
-bool ED_armature_edit_select_pick(
-struct bContext *C, const int mval[2], bool extend, bool deselect, bool 
toggle);
-
-bool ED_armature_edit_select_op_from_tagged(struct bArmature *arm, const int 
sel_op);
-
+/* armature_relations.c */
 int join_armature_exec(struct bContext *C, struct wmOperator *op);
-float ED_armature_ebone_roll_to_vector(const EditBone *bone,
-   const float new_up_axis[3],
-   const bool axis_only);

[Bf-blender-cvs] [808fa22a7ad] master: Warp Modifier add invert vgroup option

2020-02-03 Thread Cody Winchester
Commit: 808fa22a7ad8f954bda35dd07776154a24b884fe
Author: Cody Winchester
Date:   Mon Feb 3 12:01:13 2020 +0100
Branches: master
https://developer.blender.org/rB808fa22a7ad8f954bda35dd07776154a24b884fe

Warp Modifier add invert vgroup option

Adds the invert vertex weights option to the Warp Modifier. Setup in the same 
way as the other modifiers.

Uses the existing flag char that is labeled unused.

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

===

M   release/scripts/startup/bl_ui/properties_data_modifier.py
M   source/blender/makesdna/DNA_modifier_types.h
M   source/blender/makesrna/intern/rna_modifier.c
M   source/blender/modifiers/intern/MOD_warp.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py 
b/release/scripts/startup/bl_ui/properties_data_modifier.py
index ae450f17e09..021a4600a73 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1139,7 +1139,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 col = split.column()
 col.label(text="To:")
 col.prop(md, "object_to", text="")
-col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+row = col.row(align=True)
+row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
 
 col = layout.column()
 
diff --git a/source/blender/makesdna/DNA_modifier_types.h 
b/source/blender/makesdna/DNA_modifier_types.h
index a203e77ab26..39efe838bab 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1300,7 +1300,6 @@ typedef struct WarpModifierData {
   char defgrp_name[64];
   float strength;
   float falloff_radius;
-  /** Not used yet. */
   char flag;
   char falloff_type;
   char _pad[6];
@@ -1308,6 +1307,11 @@ typedef struct WarpModifierData {
 
 #define MOD_WARP_VOLUME_PRESERVE 1
 
+/* WarpModifierData->flag */
+enum {
+  MOD_WARP_INVERT_VGROUP = (1 << 0),
+};
+
 typedef enum {
   eWarp_Falloff_None = 0,
   eWarp_Falloff_Curve = 1,
diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index 394f74f3675..6f2f12ebf98 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1838,6 +1838,11 @@ static void rna_def_modifier_warp(BlenderRNA *brna)
   RNA_def_property_string_funcs(prop, NULL, NULL, 
"rna_WarpModifier_defgrp_name_set");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
+  prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WARP_INVERT_VGROUP);
+  RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
   rna_def_modifier_generic_map_info(srna);
 }
 
diff --git a/source/blender/modifiers/intern/MOD_warp.c 
b/source/blender/modifiers/intern/MOD_warp.c
index 7155498c942..ba017577004 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -175,7 +175,7 @@ static void warpModifier_do(WarpModifierData *wmd,
   int i;
   int defgrp_index;
   MDeformVert *dvert, *dv = NULL;
-
+  const bool invert_vgroup = (wmd->flag & MOD_WARP_INVERT_VGROUP) != 0;
   float(*tex_co)[3] = NULL;
 
   if (!(wmd->object_from && wmd->object_to)) {
@@ -235,7 +235,8 @@ static void warpModifier_do(WarpModifierData *wmd,
   /* skip if no vert group found */
   if (defgrp_index != -1) {
 dv = [i];
-weight = defvert_find_weight(dv, defgrp_index) * strength;
+weight = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) 
* strength :
+ defvert_find_weight(dv, defgrp_index) * 
strength;
 if (weight <= 0.0f) {
   continue;
 }

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


[Bf-blender-cvs] [a8ea1ea1b7d] master: Fix: Broken tweak select-transform in Dopesheet

2020-02-03 Thread Julian Eisel
Commit: a8ea1ea1b7d5817bf37387f6804bbaad1adb2cba
Author: Julian Eisel
Date:   Mon Feb 3 11:51:50 2020 +0100
Branches: master
https://developer.blender.org/rBa8ea1ea1b7d5817bf37387f6804bbaad1adb2cba

Fix: Broken tweak select-transform in Dopesheet

Clicking and dragging (aka tweaking) an unselected item should select
it, deselect others and translate. After rB395dfff103e1, it would not
deselect others anymore.

===

M   source/blender/editors/space_action/action_select.c

===

diff --git a/source/blender/editors/space_action/action_select.c 
b/source/blender/editors/space_action/action_select.c
index 09a0c297d35..095b30aa57b 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -1718,7 +1718,9 @@ static int mouse_action_keys(bAnimContext *ac,
 /* reset selection mode for next steps */
 select_mode = SELECT_ADD;
 
-if (wait_to_deselect_others) {
+/* Rather than deselecting others, users may want to drag to box-select 
(drag from empty space)
+ * or tweak-translate an already selected item. If these cases may apply, 
delay deselection. */
+if (wait_to_deselect_others && (!found || is_selected)) {
   ret_value = OPERATOR_RUNNING_MODAL;
 }
 else {

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


[Bf-blender-cvs] [7bbbb9ba8a1] master: Displace Modifier add invert vgroup option

2020-02-03 Thread Cody Winchester
Commit: 79ba8a139b96fe9484e05d3db43fb5ad0a18
Author: Cody Winchester
Date:   Mon Feb 3 11:55:29 2020 +0100
Branches: master
https://developer.blender.org/rB79ba8a139b96fe9484e05d3db43fb5ad0a18

Displace Modifier add invert vgroup option

Adds the invert vertex weights option to the Displace modifier.

Adds a flag and char padding to the Displace modifier DNA for the invert group 
boolean.

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

===

M   release/scripts/startup/bl_ui/properties_data_modifier.py
M   source/blender/makesdna/DNA_modifier_types.h
M   source/blender/makesrna/intern/rna_modifier.c
M   source/blender/modifiers/intern/MOD_displace.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py 
b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 197566f16f3..ae450f17e09 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -381,7 +381,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 col.label(text="Space:")
 col.prop(md, "space", text="")
 col.label(text="Vertex Group:")
-col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+row = col.row(align=True)
+row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
 
 col = split.column(align=True)
 col.active = has_texture
diff --git a/source/blender/makesdna/DNA_modifier_types.h 
b/source/blender/makesdna/DNA_modifier_types.h
index 62817c3b563..a203e77ab26 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -492,8 +492,15 @@ typedef struct DisplaceModifierData {
   char defgrp_name[64];
   float midlevel;
   int space;
+  short flag;
+  char _pad[6];
 } DisplaceModifierData;
 
+/* DisplaceModifierData->flag */
+enum {
+  MOD_DISP_INVERT_VGROUP = (1 << 0),
+};
+
 /* DisplaceModifierData->direction */
 enum {
   MOD_DISP_DIR_X = 0,
diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index 8117085974c..394f74f3675 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2889,6 +2889,11 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Space", "");
   RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
 
+  prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DISP_INVERT_VGROUP);
+  RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
   rna_def_modifier_generic_map_info(srna);
 }
 
diff --git a/source/blender/modifiers/intern/MOD_displace.c 
b/source/blender/modifiers/intern/MOD_displace.c
index 9cb694be88b..7f65b3bb5ae 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -174,6 +174,7 @@ static void displaceModifier_do_task(void *__restrict 
userdata,
   DisplaceUserdata *data = (DisplaceUserdata *)userdata;
   DisplaceModifierData *dmd = data->dmd;
   MDeformVert *dvert = data->dvert;
+  const bool invert_vgroup = (dmd->flag & MOD_DISP_INVERT_VGROUP) != 0;
   float weight = data->weight;
   int defgrp_index = data->defgrp_index;
   int direction = data->direction;
@@ -192,7 +193,8 @@ static void displaceModifier_do_task(void *__restrict 
userdata,
   float local_vec[3];
 
   if (dvert) {
-weight = defvert_find_weight(dvert + iter, defgrp_index);
+weight = invert_vgroup ? 1.0f - defvert_find_weight(dvert + iter, 
defgrp_index) :
+ defvert_find_weight(dvert + iter, defgrp_index);
 if (weight == 0.0f) {
   return;
 }

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


[Bf-blender-cvs] [6d95baf67ad] blender-v2.82-release: Fix T73364: crash calling particle_sytem.co_hair() on disabled particles

2020-02-03 Thread Brecht Van Lommel
Commit: 6d95baf67ad3cbf8b65bc6e04059c822d8d097b9
Author: Brecht Van Lommel
Date:   Mon Feb 3 11:31:05 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB6d95baf67ad3cbf8b65bc6e04059c822d8d097b9

Fix T73364: crash calling particle_sytem.co_hair() on disabled particles

===

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

===

diff --git a/source/blender/makesrna/intern/rna_particle.c 
b/source/blender/makesrna/intern/rna_particle.c
index 431f2c71e3f..36320be9270 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -385,11 +385,11 @@ static void rna_ParticleSystem_co_hair(
 totchild = 0;
   }
 
-  if (particle_no < totpart) {
+  if (particle_no < totpart && particlesystem->pathcache) {
 cache = particlesystem->pathcache[particle_no];
 max_k = (int)cache->segments;
   }
-  else if (particle_no < totpart + totchild) {
+  else if (particle_no < totpart + totchild && particlesystem->childcache) {
 cache = particlesystem->childcache[particle_no - totpart];
 
 if (cache->segments < 0) {
@@ -400,6 +400,7 @@ static void rna_ParticleSystem_co_hair(
 }
   }
   else {
+zero_v3(n_co);
 return;
   }
 
@@ -409,6 +410,9 @@ static void rna_ParticleSystem_co_hair(
 mul_m4_v3(particlesystem->imat, n_co);
 mul_m4_v3(object->obmat, n_co);
   }
+  else {
+zero_v3(n_co);
+  }
 }
 
 static const EnumPropertyItem *rna_Particle_Material_itemf(bContext *C,

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


[Bf-blender-cvs] [d237681cada] blender-v2.82-release: Fix T73559: UDIM Crash Fill Tile

2020-02-03 Thread Jeroen Bakker
Commit: d237681cada6696487876f710a1eb2372572b16f
Author: Jeroen Bakker
Date:   Mon Feb 3 08:58:01 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd237681cada6696487876f710a1eb2372572b16f

Fix T73559: UDIM Crash Fill Tile

The function `gpu_texture_create_tile_array` checked for a valid
tile ibuf when determining the packing location. During the actual packaging it 
didn't.

As the tiles are already ignored when selecting the packing location, we
can also ignore it when copying it to the glTexture. Therefore this
patch removes the existing BLI_assert and replaces it with a NULL check.

Reviewed By: Brecht van Lommel

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

===

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

===

diff --git a/source/blender/gpu/intern/gpu_draw.c 
b/source/blender/gpu/intern/gpu_draw.c
index cfeb7f6bedb..cac3ba37b0a 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -363,86 +363,86 @@ static uint gpu_texture_create_tile_array(Image *ima, 
ImBuf *main_ibuf)
 BKE_imageuser_default();
 iuser.tile = tile->tile_number;
 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, , NULL);
-BLI_assert(ibuf != NULL);
 
-bool needs_scale = (ibuf->x != tilesize[0] || ibuf->y != tilesize[1]);
-
-ImBuf *scale_ibuf = NULL;
-if (ibuf->rect_float) {
-  float *rect_float = ibuf->rect_float;
+if (ibuf) {
+  bool needs_scale = (ibuf->x != tilesize[0] || ibuf->y != tilesize[1]);
 
-  const bool store_premultiplied = ima->alpha_mode != IMA_ALPHA_STRAIGHT;
-  if (ibuf->channels != 4 || !store_premultiplied) {
-rect_float = MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, 
__func__);
-IMB_colormanagement_imbuf_to_float_texture(
-rect_float, 0, 0, ibuf->x, ibuf->y, ibuf, store_premultiplied);
-  }
+  ImBuf *scale_ibuf = NULL;
+  if (ibuf->rect_float) {
+float *rect_float = ibuf->rect_float;
 
-  float *pixeldata = rect_float;
-  if (needs_scale) {
-scale_ibuf = IMB_allocFromBuffer(NULL, rect_float, ibuf->x, ibuf->y, 
4);
-IMB_scaleImBuf(scale_ibuf, tilesize[0], tilesize[1]);
-pixeldata = scale_ibuf->rect_float;
-  }
+const bool store_premultiplied = ima->alpha_mode != IMA_ALPHA_STRAIGHT;
+if (ibuf->channels != 4 || !store_premultiplied) {
+  rect_float = MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, 
__func__);
+  IMB_colormanagement_imbuf_to_float_texture(
+  rect_float, 0, 0, ibuf->x, ibuf->y, ibuf, store_premultiplied);
+}
 
-  glTexSubImage3D(GL_TEXTURE_2D_ARRAY,
-  0,
-  tileoffset[0],
-  tileoffset[1],
-  tilelayer,
-  tilesize[0],
-  tilesize[1],
-  1,
-  GL_RGBA,
-  GL_FLOAT,
-  pixeldata);
+float *pixeldata = rect_float;
+if (needs_scale) {
+  scale_ibuf = IMB_allocFromBuffer(NULL, rect_float, ibuf->x, ibuf->y, 
4);
+  IMB_scaleImBuf(scale_ibuf, tilesize[0], tilesize[1]);
+  pixeldata = scale_ibuf->rect_float;
+}
 
-  if (rect_float != ibuf->rect_float) {
-MEM_freeN(rect_float);
-  }
-}
-else {
-  unsigned int *rect = ibuf->rect;
-
-  if (!IMB_colormanagement_space_is_data(ibuf->rect_colorspace)) {
-rect = MEM_mallocN(sizeof(uchar) * 4 * ibuf->x * ibuf->y, __func__);
-IMB_colormanagement_imbuf_to_byte_texture((uchar *)rect,
-  0,
-  0,
-  ibuf->x,
-  ibuf->y,
-  ibuf,
-  internal_format == 
GL_SRGB8_ALPHA8,
-  ima->alpha_mode == 
IMA_ALPHA_PREMUL);
+glTexSubImage3D(GL_TEXTURE_2D_ARRAY,
+0,
+tileoffset[0],
+tileoffset[1],
+tilelayer,
+tilesize[0],
+tilesize[1],
+1,
+GL_RGBA,
+GL_FLOAT,
+pixeldata);
+
+if (rect_float != ibuf->rect_float) {
+  MEM_freeN(rect_float);
+}
   }
+  else {
+unsigned int *rect = ibuf->rect;
+
+if (!IMB_colormanagement_space_is_data(ibuf->rect_colorspace)) {
+  rect = MEM_mallocN(sizeof(uchar) * 4 * ibuf->x * ibuf->y, __func__);
+  

[Bf-blender-cvs] [273068f6da7] greasepencil-refactor: GPencil: Cleanup duplicated context function call

2020-02-03 Thread Antonio Vazquez
Commit: 273068f6da795c1352e07ece8c2c400891b4f8a6
Author: Antonio Vazquez
Date:   Mon Feb 3 10:37:13 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB273068f6da795c1352e07ece8c2c400891b4f8a6

GPencil: Cleanup duplicated context function call

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index a64641db7b9..46c5b15a6e6 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -85,7 +85,7 @@
 /* Context for brush operators */
 typedef struct tGP_BrushEditData {
   /* Current editor/region/etc. */
-  /* NOTE: This stuff is mainly needed to handle 3D view projection stuff... */
+  Depsgraph *depsgraph;
   Main *bmain;
   Scene *scene;
   Object *object;
@@ -993,9 +993,9 @@ static void gp_brush_clone_add(bContext *C, 
tGP_BrushEditData *gso)
 {
   tGPSB_CloneBrushData *data = gso->customdata;
 
-  Object *ob = CTX_data_active_object(C);
+  Object *ob = gso->object;
   bGPdata *gpd = (bGPdata *)ob->data;
-  Scene *scene = CTX_data_scene(C);
+  Scene *scene = gso->scene;
   bGPDstroke *gps;
 
   float delta[3];
@@ -1147,7 +1147,7 @@ static void gpsculpt_brush_header_set(bContext *C, 
tGP_BrushEditData *gso)
 static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
 {
   Scene *scene = CTX_data_scene(C);
-  ToolSettings *ts = CTX_data_tool_settings(C);
+  ToolSettings *ts = scene->toolsettings;
   Object *ob = CTX_data_active_object(C);
 
   /* set the brush using the tool */
@@ -1157,6 +1157,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator 
*op)
   gso = MEM_callocN(sizeof(tGP_BrushEditData), "tGP_BrushEditData");
   op->customdata = gso;
 
+  gso->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
   gso->bmain = CTX_data_main(C);
   /* store state */
   gso->settings = gpsculpt_get_settings(scene);
@@ -1571,7 +1572,7 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 const float diff_mat[4][4])
 {
   bool changed = false;
-  Object *ob = CTX_data_active_object(C);
+  Object *ob = gso->object;
   char tool = gso->brush->gpencil_sculpt_tool;
 
   LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
@@ -1679,8 +1680,8 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 /* Perform two-pass brushes which modify the existing strokes */
 static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso)
 {
-  ToolSettings *ts = CTX_data_tool_settings(C);
-  Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+  ToolSettings *ts = gso->scene->toolsettings;
+  Depsgraph *depsgraph = gso->depsgraph;
   Object *obact = gso->object;
   bool changed = false;

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


[Bf-blender-cvs] [694107bd498] greasepencil-refactor: GPencil: Cleanup 2D code in sculpt

2020-02-03 Thread Antonio Vazquez
Commit: 694107bd498cad864a9b793eb81bef25e94606bd
Author: Antonio Vazquez
Date:   Mon Feb 3 10:19:51 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB694107bd498cad864a9b793eb81bef25e94606bd

GPencil: Cleanup 2D code in sculpt

This operator can be used in 3D space only.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 9213afd6fca..a64641db7b9 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -175,10 +175,6 @@ static void gpsculpt_compute_lock_axis(tGP_BrushEditData 
*gso,
bGPDspoint *pt,
const float save_pt[3])
 {
-  if (gso->sa->spacetype != SPACE_VIEW3D) {
-return;
-  }
-
   const ToolSettings *ts = gso->scene->toolsettings;
   const View3DCursor *cursor = >scene->cursor;
   const int axis = ts->gp_sculpt.lock_axis;
@@ -523,38 +519,27 @@ static bool gp_brush_grab_store_points(tGP_BrushEditData 
*gso,
 static void gp_brush_grab_calc_dvec(tGP_BrushEditData *gso)
 {
   /* Convert mouse-movements to movement vector */
-  // TODO: incorporate pressure into this?
-  // XXX: screen-space strokes in 3D space will suffer!
-  if (gso->sa->spacetype == SPACE_VIEW3D) {
-RegionView3D *rv3d = gso->ar->regiondata;
-float *rvec = gso->object->loc;
-float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
-
-float mval_f[2];
-
-/* convert from 2D screenspace to 3D... */
-mval_f[0] = (float)(gso->mval[0] - gso->mval_prev[0]);
-mval_f[1] = (float)(gso->mval[1] - gso->mval_prev[1]);
-
-/* apply evaluated data transformation */
-if (gso->rot_eval != 0.0f) {
-  const float cval = cos(gso->rot_eval);
-  const float sval = sin(gso->rot_eval);
-  float r[2];
-  r[0] = (mval_f[0] * cval) - (mval_f[1] * sval);
-  r[1] = (mval_f[0] * sval) + (mval_f[1] * cval);
-  copy_v2_v2(mval_f, r);
-}
+  RegionView3D *rv3d = gso->ar->regiondata;
+  float *rvec = gso->object->loc;
+  float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
 
-ED_view3d_win_to_delta(gso->ar, mval_f, gso->dvec, zfac);
-  }
-  else {
-/* 2D - just copy */
-// XXX: view2d?
-gso->dvec[0] = (float)(gso->mval[0] - gso->mval_prev[0]);
-gso->dvec[1] = (float)(gso->mval[1] - gso->mval_prev[1]);
-gso->dvec[2] = 0.0f; /* unused */
+  float mval_f[2];
+
+  /* convert from 2D screenspace to 3D... */
+  mval_f[0] = (float)(gso->mval[0] - gso->mval_prev[0]);
+  mval_f[1] = (float)(gso->mval[1] - gso->mval_prev[1]);
+
+  /* apply evaluated data transformation */
+  if (gso->rot_eval != 0.0f) {
+const float cval = cos(gso->rot_eval);
+const float sval = sin(gso->rot_eval);
+float r[2];
+r[0] = (mval_f[0] * cval) - (mval_f[1] * sval);
+r[1] = (mval_f[0] * sval) + (mval_f[1] * cval);
+copy_v2_v2(mval_f, r);
   }
+
+  ED_view3d_win_to_delta(gso->ar, mval_f, gso->dvec, zfac);
 }
 
 /* Apply grab transform to all relevant points of the affected strokes */
@@ -647,35 +632,26 @@ static bool gp_brush_push_apply(tGP_BrushEditData *gso,
 /* Compute reference midpoint for the brush - this is what we'll be moving 
towards */
 static void gp_brush_calc_midpoint(tGP_BrushEditData *gso)
 {
-  if (gso->sa->spacetype == SPACE_VIEW3D) {
-/* Convert mouse position to 3D space
- * See: gpencil_paint.c :: gp_stroke_convertcoords()
- */
-RegionView3D *rv3d = gso->ar->regiondata;
-const float *rvec = gso->object->loc;
-float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
-
-float mval_f[2];
-copy_v2_v2(mval_f, gso->mval);
-float mval_prj[2];
-float dvec[3];
-
-if (ED_view3d_project_float_global(gso->ar, rvec, mval_prj, 
V3D_PROJ_TEST_NOP) ==
-V3D_PROJ_RET_OK) {
-  sub_v2_v2v2(mval_f, mval_prj, mval_f);
-  ED_view3d_win_to_delta(gso->ar, mval_f, dvec, zfac);
-  sub_v3_v3v3(gso->dvec, rvec, dvec);
-}
-else {
-  zero_v3(gso->dvec);
-}
+  /* Convert mouse position to 3D space
+   * See: gpencil_paint.c :: gp_stroke_convertcoords()
+   */
+  RegionView3D *rv3d = gso->ar->regiondata;
+  const float *rvec = gso->object->loc;
+  float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
+
+  float mval_f[2];
+  copy_v2_v2(mval_f, gso->mval);
+  float mval_prj[2];
+  float dvec[3];
+
+  if (ED_view3d_project_float_global(gso->ar, rvec, mval_prj, 
V3D_PROJ_TEST_NOP) ==
+  V3D_PROJ_RET_OK) {
+sub_v2_v2v2(mval_f, mval_prj, mval_f);
+ED_view3d_win_to_delta(gso->ar, mval_f, dvec, zfac);
+sub_v3_v3v3(gso->dvec, rvec, dvec);
   }
   else {
-/* Just 2D coordinates */
-// XXX: fix View2D offsets later
-gso->dvec[0] = (float)gso->mval[0];
-gso->dvec[1] 

[Bf-blender-cvs] [7536ff1b38e] new-object-types: Fix various build issues

2020-02-03 Thread Brecht Van Lommel
Commit: 7536ff1b38e3506e316648bdcc53500da93764c3
Author: Brecht Van Lommel
Date:   Sun Feb 2 22:40:21 2020 +0100
Branches: new-object-types
https://developer.blender.org/rB7536ff1b38e3506e316648bdcc53500da93764c3

Fix various build issues

===

M   intern/cycles/blender/blender_curves.cpp
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/volume.cc
M   source/blender/makesrna/intern/rna_volume.c

===

diff --git a/intern/cycles/blender/blender_curves.cpp 
b/intern/cycles/blender/blender_curves.cpp
index 57c99cbf032..b1a26c2da43 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -1207,7 +1207,7 @@ static void export_hair_curves(Scene *scene, Mesh *mesh, 
BL::Hair b_hair)
 const int first_point_index = b_curve.first_point_index();
 const int num_points = b_curve.num_points();
 
-float3 prev_co;
+float3 prev_co = make_float3(0.0f, 0.0f, 0.0f);
 float length = 0.0f;
 if (attr_intercept) {
   points_length.clear();
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index f522ad0f702..e29e53391da 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -647,6 +647,18 @@ if(WITH_OPENVDB)
   -DWITH_OPENVDB_BLOSC
 )
   endif()
+
+  if(WIN32)
+add_definitions(
+  -DOPENVDB_STATICLIB
+)
+  endif()
+
+  if(WITH_OPENVDB_3_ABI_COMPATIBLE)
+add_definitions(
+  -DOPENVDB_3_ABI_COMPATIBLE
+)
+  endif()
 endif()
 
 if(WITH_QUADRIFLOW)
diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index 0b4ba44ba83..efb8bfc9d6b 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -553,6 +553,8 @@ VolumeGridType BKE_volume_grid_type(const VolumeGrid 
*volume_grid)
   else if (grid->isType()) {
 return VOLUME_GRID_MASK;
   }
+#else
+  UNUSED_VARS(volume_grid);
 #endif
 
   return VOLUME_GRID_UNKNOWN;
@@ -664,6 +666,8 @@ bool BKE_volume_grid_dense_bounds(const VolumeGrid 
*volume_grid, size_t min[3],
 max[2] = bbox.max().z() + 1;
 return true;
   }
+#else
+  UNUSED_VARS(volume_grid);
 #endif
 
   min[0] = 0;
diff --git a/source/blender/makesrna/intern/rna_volume.c 
b/source/blender/makesrna/intern/rna_volume.c
index 7c9b558fd73..7b974ac0eed 100644
--- a/source/blender/makesrna/intern/rna_volume.c
+++ b/source/blender/makesrna/intern/rna_volume.c
@@ -210,6 +210,7 @@ static void rna_def_volume_grid(BlenderRNA *brna)
   {VOLUME_GRID_VECTOR_DOUBLE, "VECTOR_DOUBLE", 0, "Double Vector", "3D 
double vector"},
   {VOLUME_GRID_VECTOR_INT, "VECTOR_INT", 0, "Integer Vector", "3D integer 
vector"},
   {VOLUME_GRID_UNKNOWN, "UNKNOWN", 0, "Unknown", "Unsupported data type"},
+  {0, NULL, 0, NULL, NULL},
   };
 
   prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);

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


[Bf-blender-cvs] [c65d96d56b3] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

2020-02-03 Thread Antonio Vazquez
Commit: c65d96d56b35b2114b0f50d64c4bae710af6e331
Author: Antonio Vazquez
Date:   Mon Feb 3 09:10:59 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBc65d96d56b35b2114b0f50d64c4bae710af6e331

Merge branch 'greasepencil-object' into greasepencil-refactor

===



===



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


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

2020-02-03 Thread Antonio Vazquez
Commit: ad4b41063e56e07e6bcb11e8f6e965175a35bc4c
Author: Antonio Vazquez
Date:   Mon Feb 3 09:10:09 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBad4b41063e56e07e6bcb11e8f6e965175a35bc4c

Merge branch 'master' into greasepencil-object

===



===



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


[Bf-blender-cvs] [71fc909601d] greasepencil-refactor: GPencil: Optimize triangulation calc in sculpt

2020-02-03 Thread Antonio Vazquez
Commit: 71fc909601d60848dba2073d49203fec05e3271f
Author: Antonio Vazquez
Date:   Mon Feb 3 09:06:08 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB71fc909601d60848dba2073d49203fec05e3271f

GPencil: Optimize triangulation calc in sculpt

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 68b0d06736c..9213afd6fca 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1700,11 +1700,17 @@ static bool gpsculpt_brush_do_frame(bContext *C,
 if (changed) {
   bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig 
: gps;
   if (gpl->actframe == gpf) {
-BKE_gpencil_stroke_geometry_update(gps_active);
-gps->flag &= ~GP_STROKE_TAG;
+MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, 
gps->mat_nr + 1);
+/* Update active frame now, only if material has fill. */
+if (gp_style->flag & GP_MATERIAL_FILL_SHOW) {
+  BKE_gpencil_stroke_geometry_update(gps_active);
+}
+else {
+  gpencil_recalc_geometry_tag(gps_active);
+}
   }
   else {
-/* Delay calculation for non active frames. */
+/* Delay a full recalculation for other frames. */
 gpencil_recalc_geometry_tag(gps_active);
   }
 }

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