[Bf-blender-cvs] [effc0487106] master: T90371: Asset: Drop Material Tooltip.

2021-08-03 Thread Jeroen Bakker
Commit: effc0487106bc74590acf35a61541597b1149daa
Author: Jeroen Bakker
Date:   Wed Aug 4 08:58:19 2021 +0200
Branches: master
https://developer.blender.org/rBeffc0487106bc74590acf35a61541597b1149daa

T90371: Asset: Drop Material Tooltip.

This patch changes the drop named material tooltip to give feedback to
the user what is going to happen when they invoke the change.

There are 3 states:
* "": Operator will be canceled as not all data is present (dropping on
  background.)
* "Drop  on  (slot , replacing
  ).
* "Drop  on  (slot https://developer.blender.org/D12106

===

M   source/blender/editors/include/ED_object.h
M   source/blender/editors/object/object_relations.c
M   source/blender/editors/space_outliner/outliner_dragdrop.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/blender/windowmanager/WM_types.h
M   source/blender/windowmanager/intern/wm_dragdrop.c

===

diff --git a/source/blender/editors/include/ED_object.h 
b/source/blender/editors/include/ED_object.h
index 888dcd9d428..3141c8f707b 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -53,6 +53,7 @@ struct uiLayout;
 struct wmKeyConfig;
 struct wmOperator;
 struct wmOperatorType;
+struct wmEvent;
 
 /* object_edit.c */
 /* context.object */
@@ -199,6 +200,9 @@ void ED_object_parent(struct Object *ob,
   struct Object *parent,
   const int type,
   const char *substr);
+char *ED_object_ot_drop_named_material_tooltip(struct bContext *C,
+   struct PointerRNA *properties,
+   const struct wmEvent *event);
 
 /* bitflags for enter/exit editmode */
 enum {
diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index f576c0c8517..92d0deb49d0 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2723,6 +2723,35 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
 /** \name Drop Named Material on Object Operator
  * \{ */
 
+char *ED_object_ot_drop_named_material_tooltip(bContext *C,
+   PointerRNA *properties,
+   const wmEvent *event)
+{
+  Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
+
+  char name[MAX_ID_NAME - 2];
+  RNA_string_get(properties, "name", name);
+
+  if (base == NULL) {
+return BLI_strdup("");
+  }
+
+  Object *ob = base->object;
+  int active_mat_slot = max_ii(ob->actcol, 1);
+  Material *prev_mat = BKE_object_material_get(ob, active_mat_slot);
+
+  char *result;
+  if (prev_mat) {
+const char *tooltip = TIP_("Drop %s on %s (slot %d, replacing %s).");
+result = BLI_sprintfN(tooltip, name, ob->id.name + 2, active_mat_slot, 
prev_mat->id.name + 2);
+  }
+  else {
+const char *tooltip = TIP_("Drop %s on %s (slot %d).");
+result = BLI_sprintfN(tooltip, name, ob->id.name + 2, active_mat_slot);
+  }
+  return result;
+}
+
 static int drop_named_material_invoke(bContext *C, wmOperator *op, const 
wmEvent *event)
 {
   Main *bmain = CTX_data_main(C);
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c 
b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 36b2966dc43..11ad3abcd54 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -868,7 +868,8 @@ static bool datastack_drop_poll(bContext *C, wmDrag *drag, 
const wmEvent *event)
 
 static char *datastack_drop_tooltip(bContext *UNUSED(C),
 wmDrag *drag,
-const wmEvent *UNUSED(event))
+const wmEvent *UNUSED(event),
+struct wmDropBox *UNUSED(drop))
 {
   StackDropData *drop_data = drag->poin;
   switch (drop_data->drop_action) {
@@ -1191,7 +1192,10 @@ static bool collection_drop_poll(bContext *C, wmDrag 
*drag, const wmEvent *event
   return false;
 }
 
-static char *collection_drop_tooltip(bContext *C, wmDrag *drag, const wmEvent 
*event)
+static char *collection_drop_tooltip(bContext *C,
+ wmDrag *drag,
+ const wmEvent *event,
+ wmDropBox *UNUSED(drop))
 {
   CollectionDrop data;
   if (!event->shift && collection_drop_init(C, drag, event, &data)) {
diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index a2564469c16..0803b4c4776 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d

[Bf-blender-cvs] [3985822f48d] tmp_openmpfix: Change rpath to `@loader_path/../Resources/${BLENDER_VERSION}/lib`

2021-08-03 Thread Ankit Meel
Commit: 3985822f48d3c48f5bc9ddfa1bedf620f8df4895
Author: Ankit Meel
Date:   Wed Aug 4 10:00:28 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB3985822f48d3c48f5bc9ddfa1bedf620f8df4895

Change rpath to `@loader_path/../Resources/${BLENDER_VERSION}/lib`

Check if that fixes the codesign error.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a130d265dff..422886b5551 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -509,8 +509,5 @@ set(CMAKE_SKIP_BUILD_RPATH FALSE)
 list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
-list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 
-if(WITH_PYTHON_MODULE)
-  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
-endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 345ee75e6da..b3da63ff72c 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,13 +345,10 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
-# Dylibs folder for bpy.so.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is an rpath.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
   endif()
+  set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install
   set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cd92b2350fc] master: Cleanup: use C comments for descriptive text

2021-08-03 Thread Campbell Barton
Commit: cd92b2350fc20f6c91128881b5fd20dd173d2308
Author: Campbell Barton
Date:   Wed Aug 4 13:26:47 2021 +1000
Branches: master
https://developer.blender.org/rBcd92b2350fc20f6c91128881b5fd20dd173d2308

Cleanup: use C comments for descriptive text

===

M   intern/ghost/intern/GHOST_ContextGLX.cpp
M   intern/ghost/intern/GHOST_SystemX11.cpp
M   intern/ghost/intern/GHOST_WindowX11.cpp
M   source/blender/blenkernel/intern/armature_test.cc
M   source/blender/blenkernel/intern/softbody.c
M   source/blender/blenkernel/intern/text.c
M   source/blender/blenlib/BLI_winstuff.h
M   source/blender/blenlib/intern/path_util.c
M   source/blender/blenloader/intern/versioning_290.c
M   source/blender/compositor/nodes/COM_MaskNode.cc
M   source/blender/compositor/nodes/COM_MovieClipNode.cc
M   source/blender/compositor/operations/COM_DilateErodeOperation.cc
M   source/blender/compositor/operations/COM_OutputFileOperation.cc
M   source/blender/compositor/operations/COM_WrapOperation.cc
M   source/blender/depsgraph/DEG_depsgraph.h
M   source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl
M   source/blender/imbuf/intern/dds/ColorBlock.h
M   source/blender/imbuf/intern/openexr/openexr_api.cpp
M   source/blender/windowmanager/intern/wm_window.c

===

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp 
b/intern/ghost/intern/GHOST_ContextGLX.cpp
index eb49dc4f98b..78c7201ff5f 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -295,8 +295,8 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
 
 glXMakeCurrent(m_display, m_window, m_context);
 
-// Seems that this has to be called after MakeCurrent,
-// which means we cannot use glX extensions until after we create a context
+/* Seems that this has to be called after #glXMakeCurrent,
+ * which means we cannot use `glX` extensions until after we create a 
context. */
 initContextGLXEW();
 
 if (m_window) {
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp 
b/intern/ghost/intern/GHOST_SystemX11.cpp
index 9fcad8aabf7..9422d15692d 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -802,8 +802,7 @@ static bool checkTabletProximity(Display *display, XDevice 
*device)
 
   if (state) {
 XInputClass *cls = state->data;
-// printf("%d class%s :\n", state->num_classes,
-//   (state->num_classes > 1) ? "es" : "");
+// printf("%d class%s :\n", state->num_classes, (state->num_classes > 1) ? 
"es" : "");
 for (int loop = 0; loop < state->num_classes; loop++) {
   switch (cls->c_class) {
 case ValuatorClass:
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp 
b/intern/ghost/intern/GHOST_WindowX11.cpp
index 185d12717e7..de389951613 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1275,15 +1275,15 @@ GHOST_Context 
*GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
 {
   if (type == GHOST_kDrawingContextTypeOpenGL) {
 
-// During development:
-//   try 4.x compatibility profile
-//   try 3.3 compatibility profile
-//   fall back to 3.0 if needed
-//
-// Final Blender 2.8:
-//   try 4.x core profile
-//   try 3.3 core profile
-//   no fallbacks
+/* During development:
+ * - Try 4.x compatibility profile.
+ * - Try 3.3 compatibility profile.
+ * - Fall back to 3.0 if needed.
+ *
+ * Final Blender 2.8:
+ * - Try 4.x core profile
+ * - Try 3.3 core profile
+ * - No fall-backs. */
 
 #if defined(WITH_GL_PROFILE_CORE)
 {
diff --git a/source/blender/blenkernel/intern/armature_test.cc 
b/source/blender/blenkernel/intern/armature_test.cc
index 47853deec3e..99eb064d061 100644
--- a/source/blender/blenkernel/intern/armature_test.cc
+++ b/source/blender/blenkernel/intern/armature_test.cc
@@ -180,7 +180,7 @@ class BKE_armature_find_selected_bones_test : public 
testing::Test {
 BLI_addtail(&arm.bonebase, &bone2); // bone2 is root bone
 BLI_addtail(&bone2.childbase, &bone3);  // bone3 has bone2 as parent
 
-// Make sure the armature & its bones are visible, to make them selectable.
+/* Make sure the armature & its bones are visible, to make them 
selectable. */
 arm.layer = bone1.layer = bone2.layer = bone3.layer = 1;
   }
 };
@@ -200,8 +200,8 @@ TEST_F(BKE_armature_find_selected_bones_test, 
some_bones_selected)
   EXPECT_EQ(seen_bones[0], &bone1);
   EXPECT_EQ(seen_bones[1], &bone3);
 
-  EXPECT_FALSE(result.all_bones_selected);  // Bone 2 was not selected.
-  EXPECT_FALSE(result.no_bones_selected);   // Bones 1 and 3 were selected.
+  EXPECT_FALSE(result.all_bones_selected); /* Bone 2 was not selected. */
+  EXPECT_FALSE(result.no_bones_sele

[Bf-blender-cvs] [10464843dd3] master: Cleanup: add comment to fix for T90417

2021-08-03 Thread Campbell Barton
Commit: 10464843dd3b175c0841f8d9a3f26751c12c8579
Author: Campbell Barton
Date:   Wed Aug 4 13:13:02 2021 +1000
Branches: master
https://developer.blender.org/rB10464843dd3b175c0841f8d9a3f26751c12c8579

Cleanup: add comment to fix for T90417

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_300.c 
b/source/blender/blenloader/intern/versioning_300.c
index 7b5f95408ea..f1f7f2edd35 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -691,6 +691,7 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 
+  /* Font names were copied directly into ID names, see: T90417. */
   if (!MAIN_VERSION_ATLEAST(bmain, 300, 16)) {
 ListBase *lb = which_libbase(bmain, ID_VF);
 BKE_main_id_repair_duplicate_names_listbase(lb);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0f455765907] master: Geometry Nodes: Curve Set Spline Type

2021-08-03 Thread Johnny Matthews
Commit: 0f455765907528ea9d6c15e9d224d81d507e51ad
Author: Johnny Matthews
Date:   Tue Aug 3 23:14:03 2021 -0400
Branches: master
https://developer.blender.org/rB0f455765907528ea9d6c15e9d224d81d507e51ad

Geometry Nodes: Curve Set Spline Type

This node sets the selected (or all) splines in curve to a chosen target
spline type. Poly, Bezier, and NURB splines can be converted to any of
the other types. This is meant to be a building block node, useful in
many procedural situations.

In the future the node could be optimized with multi-threading, or by
avoiding copying in many cases, either by retrieving the curve for write
access or by passing the raw vectors to the new splines where possible.

With edits from Hans Goudey (@HooglyBoogly)

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

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 09820291222..03859b04c50 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -510,6 +510,7 @@ geometry_node_categories = [
 NodeItem("GeometryNodeCurveTrim"),
 NodeItem("GeometryNodeCurveLength"),
 NodeItem("GeometryNodeCurveReverse"),
+NodeItem("GeometryNodeCurveSplineType"),
 NodeItem("GeometryNodeCurveSetHandles"),
 ]),
 GeometryNodeCategory("GEO_PRIMITIVES_CURVE", "Curve Primitives", items=[
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index a1bc6fa505b..084ec20c172 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1475,6 +1475,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070
 #define GEO_NODE_CURVE_TRIM 1071
 #define GEO_NODE_CURVE_SET_HANDLES 1072
+#define GEO_NODE_CURVE_SPLINE_TYPE 1073
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 9888e23a7bd..54bcdf4c92a 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -5149,6 +5149,7 @@ static void registerGeometryNodes()
   register_node_type_geo_curve_resample();
   register_node_type_geo_curve_reverse();
   register_node_type_geo_curve_set_handles();
+  register_node_type_geo_curve_spline_type();
   register_node_type_geo_curve_subdivide();
   register_node_type_geo_curve_to_mesh();
   register_node_type_geo_curve_to_points();
diff --git a/source/blender/makesdna/DNA_node_types.h 
b/source/blender/makesdna/DNA_node_types.h
index 5152098f57a..4b08aeb2008 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1355,6 +1355,11 @@ typedef struct NodeSwitch {
   uint8_t input_type;
 } NodeSwitch;
 
+typedef struct NodeGeometryCurveSplineType {
+  /* GeometryNodeSplineType. */
+  uint8_t spline_type;
+} NodeGeometryCurveSplineType;
+
 typedef struct NodeGeometryCurveSetHandles {
   /* GeometryNodeCurveHandleType. */
   uint8_t handle_type;
@@ -1828,6 +1833,12 @@ typedef enum GeometryNodeBooleanOperation {
   GEO_NODE_BOOLEAN_DIFFERENCE = 2,
 } GeometryNodeBooleanOperation;
 
+typedef enum GeometryNodeSplineType {
+  GEO_NODE_SPLINE_TYPE_BEZIER = 0,
+  GEO_NODE_SPLINE_TYPE_NURBS = 1,
+  GEO_NODE_SPLINE_TYPE_POLY = 2,
+} GeometryNodeSplineType;
+
 typedef enum GeometryNodeCurvePrimitiveCircleMode {
   GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_POINTS = 0,
   GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_RADIUS = 1
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index 3d4256db335..cd7cbbf76d3 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9441,6 +9441,23 @@ static void def_geo_attribute_vector_rotate(StructRNA 
*srna)
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 }
 
+static void def_geo_curve_spline_type(StructRNA *srna)
+{
+  static const EnumPropertyItem type_items[] = {
+  {GEO_NODE_SPLINE_TYPE_BEZIER, "BEZIER", ICON_NONE, "Bezier", "Set the 
splines to Bezier"},
+  {GEO_NODE_SPLINE_TYPE_NURBS, "NURBS", ICON_NONE, "NURBS", "Set the 
splines to NURBS"},
+  {GEO_NODE_SPLINE_TYPE_POLY, "POLY", ICON_NONE, "Poly", "Set the splines 
to Poly"},
+  {0, NULL, 0, NULL, NULL}};
+
+  PropertyRNA *pr

[Bf-blender-cvs] [26f1a5e2c8d] master: Fix T90417: font loading creates duplicate ID names

2021-08-03 Thread Campbell Barton
Commit: 26f1a5e2c8d705443ab51a608b5721b8f0178de3
Author: Campbell Barton
Date:   Wed Aug 4 12:57:20 2021 +1000
Branches: master
https://developer.blender.org/rB26f1a5e2c8d705443ab51a608b5721b8f0178de3

Fix T90417: font loading creates duplicate ID names

Also repair any errors in existing files.

Error from e0dd3fe5872ba37ff188e292b80b46fcf8df413c.

===

M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenkernel/intern/font.c
M   source/blender/blenloader/intern/versioning_300.c

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index e76e3ed8fe0..0d5835a5eed 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 15
+#define BLENDER_FILE_SUBVERSION 16
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the 
file
diff --git a/source/blender/blenkernel/intern/font.c 
b/source/blender/blenkernel/intern/font.c
index d0b9aeefa55..37fc14911fe 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -337,13 +337,9 @@ VFont *BKE_vfont_load(Main *bmain, const char *filepath)
 
 vfd = BLI_vfontdata_from_freetypefont(pf);
 if (vfd) {
-  vfont = BKE_libblock_alloc(bmain, ID_VF, filename, 0);
+  /* If there's a font name, use it for the ID name. */
+  vfont = BKE_libblock_alloc(bmain, ID_VF, vfd->name[0] ? vfd->name : 
filename, 0);
   vfont->data = vfd;
-
-  /* if there's a font name, use it for the ID name */
-  if (vfd->name[0] != '\0') {
-BLI_strncpy(vfont->id.name + 2, vfd->name, sizeof(vfont->id.name) - 2);
-  }
   BLI_strncpy(vfont->filepath, filepath, sizeof(vfont->filepath));
 
   /* if autopack is on store the packedfile in de font structure */
diff --git a/source/blender/blenloader/intern/versioning_300.c 
b/source/blender/blenloader/intern/versioning_300.c
index 9aec18ea279..7b5f95408ea 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -691,6 +691,11 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 
+  if (!MAIN_VERSION_ATLEAST(bmain, 300, 16)) {
+ListBase *lb = which_libbase(bmain, ID_VF);
+BKE_main_id_repair_duplicate_names_listbase(lb);
+  }
+
   /**
* Versioning code until next subversion bump goes here.
*

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5950b3ab739] master: Cleanup: de-duplicate ID renaming utility for versioning

2021-08-03 Thread Campbell Barton
Commit: 5950b3ab739f0d57cdac44c57d4448c0a5dbebb2
Author: Campbell Barton
Date:   Wed Aug 4 12:43:07 2021 +1000
Branches: master
https://developer.blender.org/rB5950b3ab739f0d57cdac44c57d4448c0a5dbebb2

Cleanup: de-duplicate ID renaming utility for versioning

===

M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/versioning_common.cc
M   source/blender/blenloader/intern/versioning_common.h
M   source/blender/blenloader/intern/versioning_defaults.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index af05c4b902f..93959237f29 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -111,40 +111,13 @@
 #include "BLO_readfile.h"
 #include "readfile.h"
 
+#include "versioning_common.h"
+
 #include "MEM_guardedalloc.h"
 
 /* Make preferences read-only, use versioning_userdef.c. */
 #define U (*((const UserDef *)&U))
 
-/**
- * Rename if the ID doesn't exist.
- */
-static ID *rename_id_for_versioning(Main *bmain,
-const short id_type,
-const char *name_src,
-const char *name_dst)
-{
-  /* We can ignore libraries */
-  ListBase *lb = which_libbase(bmain, id_type);
-  ID *id = NULL;
-  LISTBASE_FOREACH (ID *, idtest, lb) {
-if (idtest->lib == NULL) {
-  if (STREQ(idtest->name + 2, name_src)) {
-id = idtest;
-  }
-  if (STREQ(idtest->name + 2, name_dst)) {
-return NULL;
-  }
-}
-  }
-  if (id != NULL) {
-BLI_strncpy(id->name + 2, name_dst, sizeof(id->name) - 2);
-/* We know it's unique, this just sorts. */
-BLI_libblock_ensure_unique_name(bmain, id->name);
-  }
-  return id;
-}
-
 static bScreen *screen_parent_find(const bScreen *screen)
 {
   /* Can avoid lookup if screen state isn't maximized/full
@@ -1679,32 +1652,32 @@ void do_versions_after_linking_280(Main *bmain, 
ReportList *UNUSED(reports))
 Brush *brush;
 Material *ma;
 /* Pen Soft brush. */
-brush = (Brush *)rename_id_for_versioning(bmain, ID_BR, "Draw Soft", 
"Pencil Soft");
+brush = (Brush *)do_versions_rename_id(bmain, ID_BR, "Draw Soft", "Pencil 
Soft");
 if (brush) {
   brush->gpencil_settings->icon_id = GP_BRUSH_ICON_PEN;
 }
-rename_id_for_versioning(bmain, ID_BR, "Draw Pencil", "Pencil");
-rename_id_for_versioning(bmain, ID_BR, "Draw Pen", "Pen");
-rename_id_for_versioning(bmain, ID_BR, "Draw Ink", "Ink Pen");
-rename_id_for_versioning(bmain, ID_BR, "Draw Noise", "Ink Pen Rough");
-rename_id_for_versioning(bmain, ID_BR, "Draw Marker", "Marker Bold");
-rename_id_for_versioning(bmain, ID_BR, "Draw Block", "Marker Chisel");
+do_versions_rename_id(bmain, ID_BR, "Draw Pencil", "Pencil");
+do_versions_rename_id(bmain, ID_BR, "Draw Pen", "Pen");
+do_versions_rename_id(bmain, ID_BR, "Draw Ink", "Ink Pen");
+do_versions_rename_id(bmain, ID_BR, "Draw Noise", "Ink Pen Rough");
+do_versions_rename_id(bmain, ID_BR, "Draw Marker", "Marker Bold");
+do_versions_rename_id(bmain, ID_BR, "Draw Block", "Marker Chisel");
 
 ma = BLI_findstring(&bmain->materials, "Black", offsetof(ID, name) + 2);
 if (ma && ma->gp_style) {
-  rename_id_for_versioning(bmain, ID_MA, "Black", "Solid Stroke");
+  do_versions_rename_id(bmain, ID_MA, "Black", "Solid Stroke");
 }
 ma = BLI_findstring(&bmain->materials, "Red", offsetof(ID, name) + 2);
 if (ma && ma->gp_style) {
-  rename_id_for_versioning(bmain, ID_MA, "Red", "Squares Stroke");
+  do_versions_rename_id(bmain, ID_MA, "Red", "Squares Stroke");
 }
 ma = BLI_findstring(&bmain->materials, "Grey", offsetof(ID, name) + 2);
 if (ma && ma->gp_style) {
-  rename_id_for_versioning(bmain, ID_MA, "Grey", "Solid Fill");
+  do_versions_rename_id(bmain, ID_MA, "Grey", "Solid Fill");
 }
 ma = BLI_findstring(&bmain->materials, "Black Dots", offsetof(ID, name) + 
2);
 if (ma && ma->gp_style) {
-  rename_id_for_versioning(bmain, ID_MA, "Black Dots", "Dots Stroke");
+  do_versions_rename_id(bmain, ID_MA, "Black Dots", "Dots Stroke");
 }
 
 brush = BLI_findstring(&bmain->brushes, "Pencil", offsetof(ID, name) + 2);
diff --git a/source/blender/blenloader/intern/versioning_common.cc 
b/source/blender/blenloader/intern/versioning_common.cc
index f5083b8e259..208c02b60d1 100644
--- a/source/blender/blenloader/intern/versioning_common.cc
+++ b/source/blender/blenloader/intern/versioning_common.cc
@@ -20,9 +20,15 @@
 /* allow readfile to use deprecated functionality */
 #define DNA_DEPRECATED_ALLOW
 
+#include 
+
 #include "DNA_screen_types.h"
 
 #include "BLI_listbase.h"
+#include "BLI_string.h"
+
+#include "BKE_lib_id

[Bf-blender-cvs] [71dc134f890] master: Icons: add license headers to utilities

2021-08-03 Thread Campbell Barton
Commit: 71dc134f8908cda02a3e5e5800bb9da966c10ad2
Author: Campbell Barton
Date:   Wed Aug 4 11:43:56 2021 +1000
Branches: master
https://developer.blender.org/rB71dc134f8908cda02a3e5e5800bb9da966c10ad2

Icons: add license headers to utilities

===

M   release/datafiles/alert_icons_update.py
M   release/datafiles/blender_icons_geom_update.py
M   release/datafiles/blender_icons_update.py
M   release/datafiles/ctodata.py
M   release/datafiles/prvicons_update.py

===

diff --git a/release/datafiles/alert_icons_update.py 
b/release/datafiles/alert_icons_update.py
index a3951c114ae..34a2798a18c 100755
--- a/release/datafiles/alert_icons_update.py
+++ b/release/datafiles/alert_icons_update.py
@@ -1,5 +1,25 @@
 #!/usr/bin/env python3
 
+# # BEGIN GPL LICENSE BLOCK #
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# # END GPL LICENSE BLOCK #
+
+# 
+
 # This script updates icons from the SVG file
 import os
 import subprocess
diff --git a/release/datafiles/blender_icons_geom_update.py 
b/release/datafiles/blender_icons_geom_update.py
index d5373d6b2e9..df4683809db 100755
--- a/release/datafiles/blender_icons_geom_update.py
+++ b/release/datafiles/blender_icons_geom_update.py
@@ -1,5 +1,25 @@
 #!/usr/bin/env python3
 
+# # BEGIN GPL LICENSE BLOCK #
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# # END GPL LICENSE BLOCK #
+
+# 
+
 # This script updates icons from the BLEND file
 import os
 import subprocess
diff --git a/release/datafiles/blender_icons_update.py 
b/release/datafiles/blender_icons_update.py
index ead74aac759..dab3cd76a87 100755
--- a/release/datafiles/blender_icons_update.py
+++ b/release/datafiles/blender_icons_update.py
@@ -1,5 +1,25 @@
 #!/usr/bin/env python3
 
+# # BEGIN GPL LICENSE BLOCK #
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# # END GPL LICENSE BLOCK #
+
+# 
+
 # This script updates icons from the SVG file
 import os
 import subprocess
diff --git a/release/datafiles/ctodata.py b/release/datafiles/ctodata.py
index 0471faad565..20f119c4264 100755
--- a/release/datafiles/ctodata.py
+++ b/release/datafiles/ctodata.py
@@ -1,27 +1,25 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 
-# * BEGIN GPL LICENSE BLOCK *
+# # BEGIN GPL LICENSE BLOCK #
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
 #
-# This

[Bf-blender-cvs] [8a1c1279b3d] master: Icons: update alert icon script

2021-08-03 Thread Campbell Barton
Commit: 8a1c1279b3d9c5478d7e94c4875c141db750fbcb
Author: Campbell Barton
Date:   Wed Aug 4 11:03:23 2021 +1000
Branches: master
https://developer.blender.org/rB8a1c1279b3d9c5478d7e94c4875c141db750fbcb

Icons: update alert icon script

Missed from c549d736cff0d5013f05fb5240ef07671c5aa5ce.

===

M   release/datafiles/alert_icons_update.py

===

diff --git a/release/datafiles/alert_icons_update.py 
b/release/datafiles/alert_icons_update.py
index dba96c2126a..95e4ee7afbb 100644
--- a/release/datafiles/alert_icons_update.py
+++ b/release/datafiles/alert_icons_update.py
@@ -10,7 +10,7 @@ BASEDIR = os.path.abspath(os.path.dirname(__file__))
 inkscape_path = 'inkscape'
 
 if sys.platform == 'darwin':
-inkscape_app_path = '/Applications/Inkscape.app/Contents/Resources/script'
+inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
 if os.path.exists(inkscape_app_path):
 inkscape_path = inkscape_app_path
 
@@ -19,7 +19,7 @@ cmd = (
 os.path.join(BASEDIR, "alert_icons.svg"),
 "--export-width=1280",
 "--export-height=256",
-"--without-gui",
-"--export-png=" + os.path.join(BASEDIR, "alert_icons.png"),
+"--export-type=png",
+"--export-filename=" + os.path.join(BASEDIR, "alert_icons.png"),
 )
 subprocess.check_call(cmd)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7389fd9a35a] master: Icons: resolve various issues for generating icons

2021-08-03 Thread Campbell Barton
Commit: 7389fd9a35a3c8911f2d502ea2c745d574a2de21
Author: Campbell Barton
Date:   Wed Aug 4 11:31:28 2021 +1000
Branches: master
https://developer.blender.org/rB7389fd9a35a3c8911f2d502ea2c745d574a2de21

Icons: resolve various issues for generating icons

- INKSCAPE_BIN environment variable was ignored by
  alert_icons_update & prvicons_update.
- `make icons` wasn't regenerating alert icons.
- Updating SVG icons failed using blender built with ASAN.

===

M   GNUmakefile
M   release/datafiles/alert_icons_update.py
M   release/datafiles/blender_icons_geom_update.py
M   release/datafiles/blender_icons_update.py
M   release/datafiles/prvicons_update.py

===

diff --git a/GNUmakefile b/GNUmakefile
index 7df561ed34f..635cc321d03 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -528,8 +528,10 @@ INKSCAPE_BIN?="inkscape"
 icons: .FORCE
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
-   BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
+   INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
+   INKSCAPE_BIN=$(INKSCAPE_BIN) \
+   "$(BLENDER_DIR)/release/datafiles/alert_icons_update.py"
 
 icons_geom: .FORCE
BLENDER_BIN=$(BLENDER_BIN) \
diff --git a/release/datafiles/alert_icons_update.py 
b/release/datafiles/alert_icons_update.py
old mode 100644
new mode 100755
index 95e4ee7afbb..a3951c114ae
--- a/release/datafiles/alert_icons_update.py
+++ b/release/datafiles/alert_icons_update.py
@@ -7,15 +7,15 @@ import sys
 
 BASEDIR = os.path.abspath(os.path.dirname(__file__))
 
-inkscape_path = 'inkscape'
+inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
 
 if sys.platform == 'darwin':
 inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
 if os.path.exists(inkscape_app_path):
-inkscape_path = inkscape_app_path
+inkscape_bin = inkscape_app_path
 
 cmd = (
-inkscape_path,
+inkscape_bin,
 os.path.join(BASEDIR, "alert_icons.svg"),
 "--export-width=1280",
 "--export-height=256",
diff --git a/release/datafiles/blender_icons_geom_update.py 
b/release/datafiles/blender_icons_geom_update.py
index 5b95961ae6b..d5373d6b2e9 100755
--- a/release/datafiles/blender_icons_geom_update.py
+++ b/release/datafiles/blender_icons_geom_update.py
@@ -6,10 +6,9 @@ import subprocess
 import sys
 
 
-def run(cmd):
+def run(cmd, *, env=None):
 print("   ", " ".join(cmd))
-# Don't use check_call because asan causes nonzero exitcode :S
-subprocess.call(cmd)
+subprocess.check_call(cmd, env=env)
 
 
 def edit_text_file(filename, marker_begin, marker_end, content):
@@ -73,7 +72,12 @@ for blend in icons_blend:
 "--group", "Export",
 "--output-dir", output_dir,
 )
-run(cmd)
+
+env = {}
+# Developers may have ASAN enabled, avoid non-zero exit codes.
+env["ASAN_OPTIONS"] = "exitcode=0:" + os.environ.get("ASAN_OPTIONS", "")
+
+run(cmd, env=env)
 files_new = set(names_and_time_from_path(output_dir))
 
 icon_files.extend([
diff --git a/release/datafiles/blender_icons_update.py 
b/release/datafiles/blender_icons_update.py
index 8167b8b25e6..ead74aac759 100755
--- a/release/datafiles/blender_icons_update.py
+++ b/release/datafiles/blender_icons_update.py
@@ -6,13 +6,17 @@ import subprocess
 import sys
 
 
-def run(cmd):
+def run(cmd, *, env=None):
 print("   ", " ".join(cmd))
-subprocess.check_call(cmd)
+subprocess.check_call(cmd, env=env)
 
 
 BASEDIR = os.path.abspath(os.path.dirname(__file__))
 
+env = {}
+# Developers may have ASAN enabled, avoid non-zero exit codes.
+env["ASAN_OPTIONS"] = "exitcode=0:" + os.environ.get("ASAN_OPTIONS", "")
+
 inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
 blender_bin = os.environ.get("BLENDER_BIN", "blender")
 
@@ -32,7 +36,7 @@ cmd = (
 "--export-type=png",
 "--export-filename=" + os.path.join(BASEDIR, "blender_icons16.png"),
 )
-run(cmd)
+run(cmd, env=env)
 
 cmd = (
 inkscape_bin,
@@ -42,7 +46,7 @@ cmd = (
 "--export-type=png",
 "--export-filename=" + os.path.join(BASEDIR, "blender_icons32.png"),
 )
-run(cmd)
+run(cmd, env=env)
 
 
 # For testing it can be good to clear all old
@@ -64,7 +68,7 @@ cmd = (
 "--minx_icon", "2", "--maxx_icon", "2", "--miny_icon", "2", "--maxy_icon", 
"2",
 "--spacex_icon", "1", "--spacey_icon", "1",
 )
-run(cmd)
+run(cmd, env=env)
 
 cmd = (
 blender_bin, "--background", "--factory-startup", "-noaudio",
@@ -78,7 +82,7 @@ cmd = (
 "--minx_icon", "4", "--maxx_icon", "4", "--miny_icon", "4", "--maxy_icon", 
"4",
 "--spacex_icon", "2", "--spacey_icon", "2",
 )
-run(cmd)
+run(cmd, env=env)
 
 os.remove(os.path.join(BASEDIR, "blender_icons16.png"))
 os.remove(os.path.join(BASEDIR, "blen

[Bf-blender-cvs] [9974edc8570] soc-2021-uv-editor-improvements: Merge branch 'master' into soc-2021-uv-editor-improvements

2021-08-03 Thread Siddhartha Jejurkar
Commit: 9974edc8570097141ceb94638771127d829e9787
Author: Siddhartha Jejurkar
Date:   Wed Aug 4 06:13:00 2021 +0530
Branches: soc-2021-uv-editor-improvements
https://developer.blender.org/rB9974edc8570097141ceb94638771127d829e9787

Merge branch 'master' into soc-2021-uv-editor-improvements

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0d2589d08c6] master: Cleanup: spelling

2021-08-03 Thread Campbell Barton
Commit: 0d2589d08c615d1bc07e5156b41b9ffda6c3ba27
Author: Campbell Barton
Date:   Wed Aug 4 10:03:07 2021 +1000
Branches: master
https://developer.blender.org/rB0d2589d08c615d1bc07e5156b41b9ffda6c3ba27

Cleanup: spelling

===

M   source/blender/blenlib/BLI_array.h
M   source/blender/blenlib/intern/polyfill_2d_beautify.c
M   source/blender/bmesh/tools/bmesh_decimate_collapse.c
M   source/blender/compositor/operations/COM_GlareBaseOperation.h
M   source/blender/editors/animation/time_scrub_ui.c
M   source/blender/editors/mask/mask_select.c
M   source/blender/editors/uvedit/uvedit_smart_stitch.c
M   source/blender/io/usd/intern/usd_capi_import.cc
M   source/blender/io/usd/intern/usd_reader_material.h
M   source/blender/io/usd/intern/usd_reader_mesh.cc

===

diff --git a/source/blender/blenlib/BLI_array.h 
b/source/blender/blenlib/BLI_array.h
index 6bf29a6168f..084f573e8c7 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -156,7 +156,7 @@ void _bli_array_grow_func(void **arr_p,
  * \{ */
 
 /**
- * not part of the 'API' but handy funcs,
+ * Not part of the 'API' but handy functions,
  * same purpose as #BLI_array_staticdeclare()
  * but use when the max size is known ahead of time */
 #define BLI_array_fixedstack_declare(arr, maxstatic, realsize, allocstr) \
diff --git a/source/blender/blenlib/intern/polyfill_2d_beautify.c 
b/source/blender/blenlib/intern/polyfill_2d_beautify.c
index 7781e3a0f6f..ed07b002e32 100644
--- a/source/blender/blenlib/intern/polyfill_2d_beautify.c
+++ b/source/blender/blenlib/intern/polyfill_2d_beautify.c
@@ -25,7 +25,7 @@
  * on a simple polygon representation where we _know_:
  *
  * - The polygon is primitive with no holes with a continuous boundary.
- * - Tris have consistent winding.
+ * - Triangles have consistent winding.
  * - 2d (saves some hassles projecting face pairs on an axis for every 
edge-rotation)
  *   also saves us having to store all previous edge-states (see #EdRotState 
in bmesh_beautify.c)
  *
diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c 
b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 20b6903b239..97fccbe01fd 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -935,9 +935,9 @@ static bool bm_edge_collapse_is_degenerate_topology(BMEdge 
*e_first)
 }
 
 /**
- * special, highly limited edge collapse function
+ * Special, highly limited edge collapse function
  * intended for speed over flexibility.
- * can only collapse edges connected to (1, 2) tris.
+ * can only collapse edges connected to (1, 2) triangles.
  *
  * Important - don't add vert/edge/face data on collapsing!
  *
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.h 
b/source/blender/compositor/operations/COM_GlareBaseOperation.h
index 50db4e02940..6dac6f5ecc7 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.h
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.h
@@ -23,8 +23,8 @@
 
 namespace blender::compositor {
 
-/* utility functions used by glare, tonemap and lens distortion */
-/* soms macros for color handling */
+/* Utility functions used by glare, tone-map and lens distortion. */
+/* Some macros for color handling. */
 typedef float fRGB[4];
 
 /* TODO: replace with BLI_math_vector. */
diff --git a/source/blender/editors/animation/time_scrub_ui.c 
b/source/blender/editors/animation/time_scrub_ui.c
index 182e61e53b6..8aeb6a57124 100644
--- a/source/blender/editors/animation/time_scrub_ui.c
+++ b/source/blender/editors/animation/time_scrub_ui.c
@@ -244,8 +244,8 @@ void ED_time_scrub_channel_search_draw(const bContext *C, 
ARegion *region, bDope
   UI_block_align_end(block);
   UI_block_layout_resolve(block, NULL, NULL);
 
-  /* Make sure the events are consumed from the search and dont reach other UI 
blocks since this is
-   * drawn on top of animchannels. */
+  /* Make sure the events are consumed from the search and don't reach other 
UI blocks since this
+   * is drawn on top of animation-channels. */
   UI_block_flag_enable(block, UI_BLOCK_CLIP_EVENTS);
   UI_block_bounds_set_normal(block, 0);
   UI_block_end(C, block);
diff --git a/source/blender/editors/mask/mask_select.c 
b/source/blender/editors/mask/mask_select.c
index 3bb05a27c54..8ddc3758e4e 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -164,8 +164,8 @@ void ED_mask_select_flush_all(Mask *mask)
 LISTBASE_FOREACH (MaskSpline *, spline, &mask_layer->splines) {
   spline->flag &= ~SELECT;
 
-  /* intentionally _dont_ do this in the mask layer loop
-   * so we clear flags on all splines */
+  /* Intentionally *don't* do this in the mask layer loop
+   * so we clear flags on all s

[Bf-blender-cvs] [0a619b0c59c] tmp_openmpfix: Merge branch 'master' into tmp_openmpfix

2021-08-03 Thread Ankit Meel
Commit: 0a619b0c59ceb74238e30dfc6e3338f23e370aba
Author: Ankit Meel
Date:   Wed Aug 4 03:04:45 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB0a619b0c59ceb74238e30dfc6e3338f23e370aba

Merge branch 'master' into tmp_openmpfix

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4088d7f6b67] tmp_openmpfix: Comment logging

2021-08-03 Thread Ankit Meel
Commit: 4088d7f6b6711c26310ae389daaf01f6a43518fb
Author: Ankit Meel
Date:   Wed Aug 4 03:05:48 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB4088d7f6b6711c26310ae389daaf01f6a43518fb

Comment logging

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 936d58dc085..345ee75e6da 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1056,8 +1056,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
-  install(CODE "execute_process(COMMAND otool -l \"$\")")
+  # install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  # install(CODE "execute_process(COMMAND otool -l 
\"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b1c98ad8ee9] temp-geometry-nodes-fields-prototype: Fix compile warning

2021-08-03 Thread Hans Goudey
Commit: b1c98ad8ee936660f72edb4c2910102a18a1aec0
Author: Hans Goudey
Date:   Tue Aug 3 16:51:01 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBb1c98ad8ee936660f72edb4c2910102a18a1aec0

Fix compile warning

===

M   source/blender/blenkernel/BKE_field.hh

===

diff --git a/source/blender/blenkernel/BKE_field.hh 
b/source/blender/blenkernel/BKE_field.hh
index 6ba166b111c..1fceeeadf08 100644
--- a/source/blender/blenkernel/BKE_field.hh
+++ b/source/blender/blenkernel/BKE_field.hh
@@ -353,7 +353,7 @@ class MultiFunctionField : public Field {
 }
   }
 
-  FieldOutput evaluate(IndexMask mask, const FieldInputs &inputs) const
+  FieldOutput evaluate(IndexMask mask, const FieldInputs &inputs) const final
   {
 fn::MFParamsBuilder params{*fn_, mask.min_array_size()};
 fn::MFContextBuilder context;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fb87d236edb] master: Fix calculation of 'projmat_dimensions'

2021-08-03 Thread Germano Cavalcante
Commit: fb87d236edb7e98c5fc526b9829e6bc6b8916828
Author: Germano Cavalcante
Date:   Tue Aug 3 17:34:14 2021 -0300
Branches: master
https://developer.blender.org/rBfb87d236edb7e98c5fc526b9829e6bc6b8916828

Fix calculation of 'projmat_dimensions'

`r_left`, `r_right`, `r_bottom` and `r_top` were ignoring `clip_near` value
when in perspective view.

Also rename `projmat` to `winmat` in these cases.

===

M   source/blender/blenlib/BLI_math_geom.h
M   source/blender/blenlib/intern/math_geom.c

===

diff --git a/source/blender/blenlib/BLI_math_geom.h 
b/source/blender/blenlib/BLI_math_geom.h
index 9ac14a6edfe..bcda25ca533 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -682,14 +682,14 @@ void planes_from_projmat(const float mat[4][4],
  float near[4],
  float far[4]);
 
-void projmat_dimensions(const float projmat[4][4],
+void projmat_dimensions(const float winmat[4][4],
 float *r_left,
 float *r_right,
 float *r_bottom,
 float *r_top,
 float *r_near,
 float *r_far);
-void projmat_dimensions_db(const float projmat[4][4],
+void projmat_dimensions_db(const float winmat[4][4],
double *r_left,
double *r_right,
double *r_bottom,
diff --git a/source/blender/blenlib/intern/math_geom.c 
b/source/blender/blenlib/intern/math_geom.c
index 803291e4a3b..823e72a91e5 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -4962,7 +4962,7 @@ void planes_from_projmat(const float mat[4][4],
   }
 }
 
-void projmat_dimensions(const float projmat[4][4],
+void projmat_dimensions(const float winmat[4][4],
 float *r_left,
 float *r_right,
 float *r_bottom,
@@ -4970,27 +4970,27 @@ void projmat_dimensions(const float projmat[4][4],
 float *r_near,
 float *r_far)
 {
-  bool is_persp = projmat[3][3] == 0.0f;
-
+  const bool is_persp = winmat[3][3] == 0.0f;
   if (is_persp) {
-*r_left = (projmat[2][0] - 1.0f) / projmat[0][0];
-*r_right = (projmat[2][0] + 1.0f) / projmat[0][0];
-*r_bottom = (projmat[2][1] - 1.0f) / projmat[1][1];
-*r_top = (projmat[2][1] + 1.0f) / projmat[1][1];
-*r_near = projmat[3][2] / (projmat[2][2] - 1.0f);
-*r_far = projmat[3][2] / (projmat[2][2] + 1.0f);
+const float near = winmat[3][2] / (winmat[2][2] - 1.0f);
+*r_left = near * ((winmat[2][0] - 1.0f) / winmat[0][0]);
+*r_right = near * ((winmat[2][0] + 1.0f) / winmat[0][0]);
+*r_bottom = near * ((winmat[2][1] - 1.0f) / winmat[1][1]);
+*r_top = near * ((winmat[2][1] + 1.0f) / winmat[1][1]);
+*r_near = near;
+*r_far = winmat[3][2] / (winmat[2][2] + 1.0f);
   }
   else {
-*r_left = (-projmat[3][0] - 1.0f) / projmat[0][0];
-*r_right = (-projmat[3][0] + 1.0f) / projmat[0][0];
-*r_bottom = (-projmat[3][1] - 1.0f) / projmat[1][1];
-*r_top = (-projmat[3][1] + 1.0f) / projmat[1][1];
-*r_near = (projmat[3][2] + 1.0f) / projmat[2][2];
-*r_far = (projmat[3][2] - 1.0f) / projmat[2][2];
+*r_left = (-winmat[3][0] - 1.0f) / winmat[0][0];
+*r_right = (-winmat[3][0] + 1.0f) / winmat[0][0];
+*r_bottom = (-winmat[3][1] - 1.0f) / winmat[1][1];
+*r_top = (-winmat[3][1] + 1.0f) / winmat[1][1];
+*r_near = (winmat[3][2] + 1.0f) / winmat[2][2];
+*r_far = (winmat[3][2] - 1.0f) / winmat[2][2];
   }
 }
 
-void projmat_dimensions_db(const float projmat_fl[4][4],
+void projmat_dimensions_db(const float winmat_fl[4][4],
double *r_left,
double *r_right,
double *r_bottom,
@@ -4998,26 +4998,26 @@ void projmat_dimensions_db(const float projmat_fl[4][4],
double *r_near,
double *r_far)
 {
-  double projmat[4][4];
-  copy_m4d_m4(projmat, projmat_fl);
-
-  bool is_persp = projmat[3][3] == 0.0f;
+  double winmat[4][4];
+  copy_m4d_m4(winmat, winmat_fl);
 
+  const bool is_persp = winmat[3][3] == 0.0f;
   if (is_persp) {
-*r_left = (projmat[2][0] - 1.0) / projmat[0][0];
-*r_right = (projmat[2][0] + 1.0) / projmat[0][0];
-*r_bottom = (projmat[2][1] - 1.0) / projmat[1][1];
-*r_top = (projmat[2][1] + 1.0) / projmat[1][1];
-*r_near = projmat[3][2] / (projmat[2][2] - 1.0);
-*r_far = projmat[3][2] / (projmat[2][2] + 1.0);
+const double near = winmat[3][2] / (winmat[2][2] - 1.0);
+*r_left = near * ((winmat[2][0] - 1.0) / winmat[0][0]);
+*r_right = near * ((winmat[2][0] + 1.0) / winmat[0][0]);
+*r_bottom = near * ((wi

[Bf-blender-cvs] [e9d95fddf94] temp-geometry-nodes-fields-prototype: Add tweaked mesh extrude node from Fabian

2021-08-03 Thread Hans Goudey
Commit: e9d95fddf94ebad8eacb084e3bbe7dd0537ca092
Author: Hans Goudey
Date:   Tue Aug 3 16:30:48 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBe9d95fddf94ebad8eacb084e3bbe7dd0537ca092

Add tweaked mesh extrude node from Fabian

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/bmesh/intern/bmesh_mesh.c
M   source/blender/bmesh/intern/bmesh_mesh.h
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/geometry/nodes/node_geo_extrude.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index c7d155afd83..758e9c14450 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -553,6 +553,7 @@ geometry_node_categories = [
 NodeItem("GeometryNodeEdgeSplit"),
 NodeItem("GeometryNodeSubdivisionSurface"),
 NodeItem("GeometryNodeMeshSubdivide"),
+NodeItem("GeometryNodeExtrude"),
 ]),
 GeometryNodeCategory("GEO_PRIMITIVES_MESH", "Mesh Primitives", items=[
 NodeItem("GeometryNodeMeshCircle"),
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index b98077b1d9c..7d23bf59909 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1477,6 +1477,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define GEO_NODE_CURVE_SET_HANDLES 1072
 #define GEO_NODE_ATTRIBUTE 1073
 #define GEO_NODE_INDEX 1074
+#define GEO_NODE_EXTRUDE 1075
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 213a1d3f64d..deccb081ecb 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -5115,6 +5115,8 @@ static void registerGeometryNodes()
 {
   register_node_type_geo_group();
 
+  register_node_type_geo_extrude();
+
   register_node_type_geo_attribute();
   register_node_type_geo_attribute_clamp();
   register_node_type_geo_attribute_color_ramp();
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c 
b/source/blender/bmesh/intern/bmesh_mesh.c
index b2958a9e744..ad8158e2e6f 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -1446,4 +1446,114 @@ void BM_mesh_vert_coords_apply_with_mat4(BMesh *bm,
   }
 }
 
+/**
+* Use to select  bmesh vertex data based on an array of bool.
+*/
+void BM_select_vertices(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMVert *v;
+  int i = 0;
+  BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(v, BM_ELEM_SELECT, true);
+}
+else {
+  BM_elem_flag_set(v, BM_ELEM_SELECT, false);
+}
+i++;
+  }
+}
+
+/**
+ * Use to select bmesh edge data based on an array of bool.
+ */
+void BM_select_edges(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMEdge *e;
+  int i = 0;
+  BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(e, BM_ELEM_SELECT, true);
+}
+else {
+  BM_elem_flag_set(e, BM_ELEM_SELECT, false);
+}
+i++;
+  }
+}
+
+/**
+ * Use to select bmesh face data based on an array of bool.
+ */
+void BM_select_faces(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMFace *f;
+  int i = 0;
+  BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(f, BM_ELEM_SELECT, true);
+}
+else {
+  BM_elem_flag_set(f, BM_ELEM_SELECT, false);
+}
+i++;
+  }
+}
+
+void BM_tag_vertices(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMVert *v;
+  int i = 0;
+  BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(v, BM_ELEM_TAG, true);
+}
+else {
+  BM_elem_flag_set(v, BM_ELEM_TAG, false);
+}
+i++;
+  }
+}
+
+/**
+ * Use to temporary tag bmesh edge data based on an array of bool.
+ */
+void BM_tag_edges(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMEdge *e;
+  int i = 0;
+  BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(e, BM_ELEM_TAG, true);
+}
+else {
+  BM_elem_flag_set(e, BM_ELEM_TAG, false);
+}
+i++;
+  }
+}
+
+/**
+ * Use to temporary tag bmesh face data based on an array of bool.
+ */
+void BM_tag_faces(BMesh *bm, const bool *mask)
+{
+  BMIter iter;
+  BMFace *f;
+  int i = 0;
+  BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
+if (mask[i]) {
+  BM_elem_flag_set(f, BM_ELEM_TAG, true);
+}
+else {
+  BM_elem_flag_set(f, BM_ELEM_TAG, false);
+}
+i++;
+  }
+}
 /** \} */
diff --git a/source/blend

[Bf-blender-cvs] [f43ede3b9da] tmp_openmpfix: Test if double slash is problematic.

2021-08-03 Thread Ankit Meel
Commit: f43ede3b9da7fdba33a624aca4d615214762d9f3
Author: Ankit Meel
Date:   Wed Aug 4 02:00:08 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBf43ede3b9da7fdba33a624aca4d615214762d9f3

Test if double slash is problematic.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index c18b2225f97..1a185a4dba1 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [68ae8f70c82] tmp_openmpfix: List contents of MacOS folder, and get otool output.

2021-08-03 Thread Ankit Meel
Commit: 68ae8f70c82c9651f9a7dda680dda737dcaaf3fa
Author: Ankit Meel
Date:   Wed Aug 4 00:37:09 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB68ae8f70c82c9651f9a7dda680dda737dcaaf3fa

List contents of MacOS folder, and get otool output.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 93b45f09a31..c18b2225f97 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -507,7 +507,7 @@ endif()
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 if(WITH_OPENMP)
-  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+  list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 endif()
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 23a747be521..a07b038e24b 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,9 +1044,6 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
-  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
-  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
 install(
   FILES "${OpenMP_LIBRARY}"
@@ -1060,6 +1057,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  install(CODE "execute_process(COMMAND otool -l \"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c63393e58ce] tmp_openmpfix: macOS: Fix for dylib loader issues.

2021-08-03 Thread Ankit Meel
Commit: c63393e58ce4e4b6bd2d574bff24fffacb349a2c
Author: Ankit Meel
Date:   Tue Aug 3 22:25:11 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBc63393e58ce4e4b6bd2d574bff24fffacb349a2c

macOS: Fix for dylib loader issues.

Also some logging for buildbot

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a85e9f23277 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,19 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+endif()
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..52e9e449642 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,12 +1044,16 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
+  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
+message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a446092beeb] tmp_openmpfix: Remove fatal error, extra slash.

2021-08-03 Thread Ankit Meel
Commit: a446092beeb53fe1f03513be4b1da04d976bd600
Author: Ankit Meel
Date:   Tue Aug 3 23:36:59 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBa446092beeb53fe1f03513be4b1da04d976bd600

Remove fatal error, extra slash.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a85e9f23277..93b45f09a31 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 52e9e449642..23a747be521 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1045,15 +1045,14 @@ elseif(APPLE)
   )
 
   message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
+  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
-message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [782d240a1b6] temp-geometry-nodes-fields-prototype: Fix crash in the Is Viewport node

2021-08-03 Thread Hans Goudey
Commit: 782d240a1b65906f435b1184c16b3888bc7d244e
Author: Hans Goudey
Date:   Tue Aug 3 16:12:18 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB782d240a1b65906f435b1184c16b3888bc7d244e

Fix crash in the Is Viewport node

===

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

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc 
b/source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc
index ec875b9f983..ae90af99ab6 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc
@@ -31,7 +31,8 @@ static void geo_node_is_viewport_exec(GeoNodeExecParams 
params)
   const eEvaluationMode mode = DEG_get_mode(depsgraph);
   const bool is_viewport = mode == DAG_EVAL_VIEWPORT;
 
-  params.set_output("Is Viewport", is_viewport);
+  /* This is a field just to avoid a crash, it doesn't seem like it should 
need to be a field. */
+  params.set_output("Is Viewport", bke::FieldRef(new 
bke::ConstantField(is_viewport)));
 }
 
 }  // namespace blender::nodes

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [36055ba366a] temp-geometry-nodes-fields-prototype: Remove density max socket from the point distribute node

2021-08-03 Thread Hans Goudey
Commit: 36055ba366a67fe2eb61888c5da217789f533a4b
Author: Hans Goudey
Date:   Tue Aug 3 16:05:10 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB36055ba366a67fe2eb61888c5da217789f533a4b

Remove density max socket from the point distribute node

===

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

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc 
b/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
index b60c5357f65..ccd6edc806a 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
@@ -42,8 +42,7 @@ using blender::bke::GeometryInstanceGroup;
 static bNodeSocketTemplate geo_node_point_distribute_in[] = {
 {SOCK_GEOMETRY, N_("Geometry")},
 {SOCK_FLOAT, N_("Distance Min"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 
PROP_DISTANCE},
-{SOCK_FLOAT, N_("Density Max"), 10.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 
PROP_NONE},
-{SOCK_FLOAT, N_("Density Factor"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 
10.0f, PROP_NONE},
+{SOCK_FLOAT, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 
PROP_NONE},
 {SOCK_INT, N_("Seed"), 0, 0, 0, 0, -1, 1},
 {-1, ""},
 };
@@ -586,8 +585,8 @@ static void 
geo_node_point_distribute_exec(GeoNodeExecParams params)
   static_cast(params.node().custom1);
 
   const int seed = params.get_input("Seed") * 5383843;
-  const float density_max = params.extract_input("Density Max");
-  bke::FieldRef density_field = params.get_input_field("Density 
Factor");
+  const float density_max = 1.0f;
+  bke::FieldRef density_field = 
params.get_input_field("Density");
 
   if (density_max <= 0.0f) {
 params.set_output("Geometry", GeometrySet());

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [18d900caca8] master: macOS: Fix OpenMP dynamic loader error.

2021-08-03 Thread Ankit Meel
Commit: 18d900caca8317d33216bbc778c07b9f6ce3da84
Author: Ankit Meel
Date:   Wed Aug 4 01:22:27 2021 +0530
Branches: master
https://developer.blender.org/rB18d900caca8317d33216bbc778c07b9f6ce3da84

macOS: Fix OpenMP dynamic loader error.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a130d265dff 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,17 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..e928be571a2 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -349,8 +349,7 @@ elseif(APPLE)
 set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is a default
-# rpath, so dropping libraries next to Blender is enough.
+# Dylibs folder for Blender executable. @executable_path is an rpath.
 set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
   endif()
   # Skip relinking on cpack / install

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [236576fc91d] temp-geometry-nodes-fields-prototype: Support anonymous attributes in the proximity node

2021-08-03 Thread Hans Goudey
Commit: 236576fc91d6e7490149f88bd9ebf95414062609
Author: Hans Goudey
Date:   Tue Aug 3 15:49:20 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB236576fc91d6e7490149f88bd9ebf95414062609

Support anonymous attributes in the proximity node

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
M   source/blender/nodes/geometry/nodes/node_geo_raycast.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 29a77df71a0..c7d155afd83 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -483,7 +483,6 @@ geometry_node_categories = [
 NodeItem("GeometryNodeAttributeCurveMap"),
 NodeItem("GeometryNodeAttributeFill"),
 NodeItem("GeometryNodeAttributeMix"),
-NodeItem("GeometryNodeAttributeProximity"),
 NodeItem("GeometryNodeAttributeColorRamp"),
 NodeItem("GeometryNodeAttributeVectorMath"),
 NodeItem("GeometryNodeAttributeVectorRotate"),
@@ -529,6 +528,7 @@ geometry_node_categories = [
 NodeItem("GeometryNodeJoinGeometry"),
 NodeItem("GeometryNodeSeparateComponents"),
 NodeItem("GeometryNodeRaycast"),
+NodeItem("GeometryNodeAttributeProximity"),
 ]),
 GeometryNodeCategory("GEO_INPUT", "Input", items=[
 NodeItem("GeometryNodeObjectInfo"),
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index 1bd66f9a4c0..ccca7819c4e 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -280,7 +280,7 @@ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_FILL, 
def_geo_attribute_fill, "ATTRIBUT
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MAP_RANGE, 
def_geo_attribute_map_range, "ATTRIBUTE_MAP_RANGE", AttributeMapRange, 
"Attribute Map Range", "")
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MATH, def_geo_attribute_math, 
"ATTRIBUTE_MATH", AttributeMath, "Attribute Math", "")
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MIX, def_geo_attribute_mix, 
"ATTRIBUTE_MIX", AttributeMix, "Attribute Mix", "")
-DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_PROXIMITY, 
def_geo_attribute_proximity, "ATTRIBUTE_PROXIMITY", AttributeProximity, 
"Attribute Proximity", "")
+DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_PROXIMITY, 
def_geo_attribute_proximity, "ATTRIBUTE_PROXIMITY", AttributeProximity, 
"Proximity", "")
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_RANDOMIZE, 
def_geo_attribute_randomize, "ATTRIBUTE_RANDOMIZE", AttributeRandomize, 
"Attribute Randomize", "")
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_REMOVE, 0, "ATTRIBUTE_REMOVE", 
AttributeRemove, "Attribute Remove", "")
 DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE, 0, 
"ATTRIBUTE_SAMPLE_TEXTURE", AttributeSampleTexture, "Attribute Sample Texture", 
"")
diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc 
b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
index d71cb09f1bd..cb253317eea 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
@@ -31,13 +31,13 @@
 static bNodeSocketTemplate geo_node_attribute_proximity_in[] = {
 {SOCK_GEOMETRY, N_("Geometry")},
 {SOCK_GEOMETRY, N_("Target")},
-{SOCK_STRING, N_("Distance")},
-{SOCK_STRING, N_("Position")},
 {-1, ""},
 };
 
 static bNodeSocketTemplate geo_node_attribute_proximity_out[] = {
 {SOCK_GEOMETRY, N_("Geometry")},
+{SOCK_FLOAT, N_("Distance")},
+{SOCK_VECTOR, N_("Position")},
 {-1, ""},
 };
 
@@ -66,9 +66,7 @@ static void proximity_calc(MutableSpan distance_span,
BVHTreeFromMesh &tree_data_mesh,
BVHTreeFromPointCloud &tree_data_pointcloud,
const bool bvh_mesh_success,
-   const bool bvh_pointcloud_success,
-   const bool store_distances,
-   const bool store_locations)
+   const bool bvh_pointcloud_success)
 {
   IndexRange range = positions.index_range();
   threading::parallel_for(range, 512, [&](IndexRange range) {
@@ -107,18 +105,18 @@ static void proximity_calc(MutableSpan 
distance_span,
   }
 
   if (nearest_from_pointcloud.dist_sq < nearest_from_mesh.dist_sq) {
-if (store_distances) {
+if (!distance_span.is_empty()) {
   distance_span[i] = sqrtf(nearest_from_pointcloud.dist_sq);
 }
-if (store_locations) {
+if (!location_span.is_empty()) {
   location_span[i] = nearest_from_pointcloud.co;
 }
   }

[Bf-blender-cvs] [e7d57e84bbf] temp-geometry-nodes-fields-prototype: Move "Align Rotation to Vector" to a function node without geometry

2021-08-03 Thread Hans Goudey
Commit: e7d57e84bbfb57e3eb81306c539060eecdc5d014
Author: Hans Goudey
Date:   Tue Aug 3 15:07:46 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBe7d57e84bbfb57e3eb81306c539060eecdc5d014

Move "Align Rotation to Vector" to a function node without geometry

The node is still slightly finnicky, I may have done something wrong here.
But it generally works.

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_function.h
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
D   source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 0df9f3f99d9..29a77df71a0 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -572,7 +572,6 @@ geometry_node_categories = [
 NodeItem("GeometryNodePointScale"),
 NodeItem("GeometryNodePointTranslate"),
 NodeItem("GeometryNodeRotatePoints"),
-NodeItem("GeometryNodeAlignRotationToVector"),
 ]),
 GeometryNodeCategory("GEO_UTILITIES", "Utilities", items=[
 NodeItem("ShaderNodeMapRange"),
@@ -590,6 +589,7 @@ geometry_node_categories = [
 NodeItem("ShaderNodeCombineXYZ"),
 NodeItem("ShaderNodeVectorMath"),
 NodeItem("ShaderNodeVectorRotate"),
+NodeItem("FunctionNodeAlignRotationToVector"),
 ]),
 GeometryNodeCategory("GEO_OUTPUT", "Output", items=[
 NodeItem("GeometryNodeViewer"),
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index acbbd110219..b98077b1d9c 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1420,7 +1420,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define GEO_NODE_ATTRIBUTE_COMPARE 1015
 #define GEO_NODE_POINT_ROTATE 1016
 #define GEO_NODE_ATTRIBUTE_VECTOR_MATH 1017
-#define GEO_NODE_ALIGN_ROTATION_TO_VECTOR 1018
+// #define GEO_NODE_ALIGN_ROTATION_TO_VECTOR 1018
 #define GEO_NODE_POINT_TRANSLATE 1019
 #define GEO_NODE_POINT_SCALE 1020
 #define GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE 1021
@@ -1490,6 +1490,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define FN_NODE_INPUT_VECTOR 1207
 #define FN_NODE_INPUT_STRING 1208
 #define FN_NODE_FLOAT_TO_INT 1209
+#define FN_NODE_ALIGN_ROTATION_TO_VECTOR 1210
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 39498ad0772..213a1d3f64d 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -5115,7 +5115,6 @@ static void registerGeometryNodes()
 {
   register_node_type_geo_group();
 
-  register_node_type_geo_align_rotation_to_vector();
   register_node_type_geo_attribute();
   register_node_type_geo_attribute_clamp();
   register_node_type_geo_attribute_color_ramp();
@@ -5199,6 +5198,7 @@ static void registerFunctionNodes()
   register_node_type_fn_float_to_int();
   register_node_type_fn_input_string();
   register_node_type_fn_input_vector();
+  register_node_type_fn_align_rotation_to_vector();
   register_node_type_fn_random_float();
 }
 
diff --git a/source/blender/makesdna/DNA_node_types.h 
b/source/blender/makesdna/DNA_node_types.h
index 75613de6d16..6d42e76abe0 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1252,16 +1252,12 @@ typedef struct NodeGeometryRotatePoints {
   char _pad[3];
 } NodeGeometryRotatePoints;
 
-typedef struct NodeGeometryAlignRotationToVector {
+typedef struct FunctionNodeAlignRotationToVector {
   /* GeometryNodeAlignRotationToVectorAxis */
   uint8_t axis;
   /* GeometryNodeAlignRotationToVectorPivotAxis */
   uint8_t pivot_axis;
-
-  /* GeometryNodeAttributeInputMode */
-  uint8_t input_type_factor;
-  uint8_t input_type_vector;
-} NodeGeometryAlignRotationToVector;
+} FunctionNodeAlignRotationToVector;
 
 typedef struct NodeGeometryPointScale {
   /* GeometryNodeAttributeInputMode */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index b7b2c19211b..53d34bf8f5e 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9627,7 +9627,7 @@ static void def_geo_point_rotate(StructRNA *srna)
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 }
 
-stat

[Bf-blender-cvs] [68ae8f70c82] tmp_openmpfix: List contents of MacOS folder, and get otool output.

2021-08-03 Thread Ankit Meel
Commit: 68ae8f70c82c9651f9a7dda680dda737dcaaf3fa
Author: Ankit Meel
Date:   Wed Aug 4 00:37:09 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB68ae8f70c82c9651f9a7dda680dda737dcaaf3fa

List contents of MacOS folder, and get otool output.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 93b45f09a31..c18b2225f97 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -507,7 +507,7 @@ endif()
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 if(WITH_OPENMP)
-  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+  list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 endif()
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 23a747be521..a07b038e24b 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,9 +1044,6 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
-  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
-  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
 install(
   FILES "${OpenMP_LIBRARY}"
@@ -1060,6 +1057,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  install(CODE "execute_process(COMMAND otool -l \"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a446092beeb] tmp_openmpfix: Remove fatal error, extra slash.

2021-08-03 Thread Ankit Meel
Commit: a446092beeb53fe1f03513be4b1da04d976bd600
Author: Ankit Meel
Date:   Tue Aug 3 23:36:59 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBa446092beeb53fe1f03513be4b1da04d976bd600

Remove fatal error, extra slash.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a85e9f23277..93b45f09a31 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 52e9e449642..23a747be521 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1045,15 +1045,14 @@ elseif(APPLE)
   )
 
   message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
+  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
-message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [41357d556f4] master: Fix broken logic in Windows directory query function

2021-08-03 Thread Julian Eisel
Commit: 41357d556f4e3b286ab4ecfaeb990cc40bf08333
Author: Julian Eisel
Date:   Tue Aug 3 19:37:34 2021 +0200
Branches: master
https://developer.blender.org/rB41357d556f4e3b286ab4ecfaeb990cc40bf08333

Fix broken logic in Windows directory query function

Mistake in a5bbdd6998ab

===

M   source/blender/blenlib/intern/storage.c

===

diff --git a/source/blender/blenlib/intern/storage.c 
b/source/blender/blenlib/intern/storage.c
index 19b925535e2..47bb2f0e8dd 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -114,7 +114,7 @@ double BLI_dir_free_space(const char *dir)
 
   tmp[0] = '\\';
   tmp[1] = 0; /* Just a fail-safe. */
-  if (ELEM(dir[0] == '/', '\\')) {
+  if (ELEM(dir[0], '/', '\\')) {
 tmp[0] = '\\';
 tmp[1] = 0;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bbd0dcec4c6] cycles-x: Fix missing space in debug logging

2021-08-03 Thread Brecht Van Lommel
Commit: bbd0dcec4c648cc7c7f48bed23cbeeb254cf0502
Author: Brecht Van Lommel
Date:   Tue Aug 3 16:45:56 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBbbd0dcec4c648cc7c7f48bed23cbeeb254cf0502

Fix missing space in debug logging

===

M   intern/cycles/render/scene.cpp

===

diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp
index a5c0931b188..b8a567715a3 100644
--- a/intern/cycles/render/scene.cpp
+++ b/intern/cycles/render/scene.cpp
@@ -620,32 +620,32 @@ void Scene::update_passes()
 static void log_kernel_features(const uint features)
 {
   VLOG(2) << "Requested features:\n";
-  VLOG(2) << "Use BSDF" << string_from_bool(features & 
KERNEL_FEATURE_NODE_BSDF) << "\n";
-  VLOG(2) << "Use Principled BSDF" << string_from_bool(features & 
KERNEL_FEATURE_PRINCIPLED)
+  VLOG(2) << "Use BSDF " << string_from_bool(features & 
KERNEL_FEATURE_NODE_BSDF) << "\n";
+  VLOG(2) << "Use Principled BSDF " << string_from_bool(features & 
KERNEL_FEATURE_PRINCIPLED)
   << "\n";
-  VLOG(2) << "Use Emission" << string_from_bool(features & 
KERNEL_FEATURE_NODE_EMISSION) << "\n";
-  VLOG(2) << "Use Volume" << string_from_bool(features & 
KERNEL_FEATURE_NODE_VOLUME) << "\n";
-  VLOG(2) << "Use Hair" << string_from_bool(features & 
KERNEL_FEATURE_NODE_HAIR) << "\n";
-  VLOG(2) << "Use Bump" << string_from_bool(features & 
KERNEL_FEATURE_NODE_BUMP) << "\n";
-  VLOG(2) << "Use Voronoi" << string_from_bool(features & 
KERNEL_FEATURE_NODE_VORONOI_EXTRA)
+  VLOG(2) << "Use Emission " << string_from_bool(features & 
KERNEL_FEATURE_NODE_EMISSION) << "\n";
+  VLOG(2) << "Use Volume " << string_from_bool(features & 
KERNEL_FEATURE_NODE_VOLUME) << "\n";
+  VLOG(2) << "Use Hair " << string_from_bool(features & 
KERNEL_FEATURE_NODE_HAIR) << "\n";
+  VLOG(2) << "Use Bump " << string_from_bool(features & 
KERNEL_FEATURE_NODE_BUMP) << "\n";
+  VLOG(2) << "Use Voronoi " << string_from_bool(features & 
KERNEL_FEATURE_NODE_VORONOI_EXTRA)
   << "\n";
-  VLOG(2) << "Use Shader Raytrace" << string_from_bool(features & 
KERNEL_FEATURE_NODE_RAYTRACE)
+  VLOG(2) << "Use Shader Raytrace " << string_from_bool(features & 
KERNEL_FEATURE_NODE_RAYTRACE)
   << "\n";
-  VLOG(2) << "Use Transparent" << string_from_bool(features & 
KERNEL_FEATURE_TRANSPARENT) << "\n";
-  VLOG(2) << "Use Denoising" << string_from_bool(features & 
KERNEL_FEATURE_DENOISING) << "\n";
-  VLOG(2) << "Use Path Tracing" << string_from_bool(features & 
KERNEL_FEATURE_PATH_TRACING)
+  VLOG(2) << "Use Transparent " << string_from_bool(features & 
KERNEL_FEATURE_TRANSPARENT) << "\n";
+  VLOG(2) << "Use Denoising " << string_from_bool(features & 
KERNEL_FEATURE_DENOISING) << "\n";
+  VLOG(2) << "Use Path Tracing " << string_from_bool(features & 
KERNEL_FEATURE_PATH_TRACING)
   << "\n";
-  VLOG(2) << "Use Hair" << string_from_bool(features & KERNEL_FEATURE_HAIR) << 
"\n";
-  VLOG(2) << "Use Object Motion" << string_from_bool(features & 
KERNEL_FEATURE_OBJECT_MOTION)
+  VLOG(2) << "Use Hair " << string_from_bool(features & KERNEL_FEATURE_HAIR) 
<< "\n";
+  VLOG(2) << "Use Object Motion " << string_from_bool(features & 
KERNEL_FEATURE_OBJECT_MOTION)
   << "\n";
-  VLOG(2) << "Use Camera Motion" << string_from_bool(features & 
KERNEL_FEATURE_CAMERA_MOTION)
+  VLOG(2) << "Use Camera Motion " << string_from_bool(features & 
KERNEL_FEATURE_CAMERA_MOTION)
   << "\n";
-  VLOG(2) << "Use Baking" << string_from_bool(features & 
KERNEL_FEATURE_BAKING) << "\n";
-  VLOG(2) << "Use Subsurface" << string_from_bool(features & 
KERNEL_FEATURE_SUBSURFACE) << "\n";
-  VLOG(2) << "Use Volume" << string_from_bool(features & 
KERNEL_FEATURE_VOLUME) << "\n";
-  VLOG(2) << "Use Patch Evaluation" << string_from_bool(features & 
KERNEL_FEATURE_PATCH_EVALUATION)
-  << "\n";
-  VLOG(2) << "Use Shadow Catcher" << string_from_bool(features & 
KERNEL_FEATURE_SHADOW_CATCHER)
+  VLOG(2) << "Use Baking " << string_from_bool(features & 
KERNEL_FEATURE_BAKING) << "\n";
+  VLOG(2) << "Use Subsurface " << string_from_bool(features & 
KERNEL_FEATURE_SUBSURFACE) << "\n";
+  VLOG(2) << "Use Volume " << string_from_bool(features & 
KERNEL_FEATURE_VOLUME) << "\n";
+  VLOG(2) << "Use Patch Evaluation "
+  << string_from_bool(features & KERNEL_FEATURE_PATCH_EVALUATION) << 
"\n";
+  VLOG(2) << "Use Shadow Catcher " << string_from_bool(features & 
KERNEL_FEATURE_SHADOW_CATCHER)
   << "\n";
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a0d6b5481e5] temp-cpp-file-system: Fix compile errors on Windows

2021-08-03 Thread Julian Eisel
Commit: a0d6b5481e5f346559f9c5c81e2ba11262b6ea4f
Author: Julian Eisel
Date:   Tue Aug 3 19:16:35 2021 +0200
Branches: temp-cpp-file-system
https://developer.blender.org/rBa0d6b5481e5f346559f9c5c81e2ba11262b6ea4f

Fix compile errors on Windows

===

M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/intern/storage.cc

===

diff --git a/source/blender/blenlib/BLI_fileops.h 
b/source/blender/blenlib/BLI_fileops.h
index feb4d27945f..b77c04f2d2a 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -96,7 +96,10 @@ typedef enum eFileAttributes {
   FILE_ATTR_JUNCTION_POINT = 1 << 13, /* Folder Symbolic-link. */
   FILE_ATTR_MOUNT_POINT = 1 << 14,/* Volume mounted as a folder. */
   FILE_ATTR_HARDLINK = 1 << 15,   /* Duplicated directory entry. */
+
+  FILE_ATTR_MAX
 } eFileAttributes;
+ENUM_OPERATORS(eFileAttributes, FILE_ATTR_MAX);
 
 #define FILE_ATTR_ANY_LINK \
   (FILE_ATTR_ALIAS | FILE_ATTR_REPARSE_POINT | FILE_ATTR_SYMLINK | 
FILE_ATTR_JUNCTION_POINT | \
diff --git a/source/blender/blenlib/intern/storage.cc 
b/source/blender/blenlib/intern/storage.cc
index e416e815e65..19d8d60dedd 100644
--- a/source/blender/blenlib/intern/storage.cc
+++ b/source/blender/blenlib/intern/storage.cc
@@ -248,7 +248,7 @@ size_t BLI_file_size(const char *path)
 #ifndef __APPLE__
 eFileAttributes BLI_file_attributes(const char *path)
 {
-  int ret = 0;
+  eFileAttributes ret = static_cast(0);
 
 #  ifdef WIN32
 
@@ -326,30 +326,30 @@ bool BLI_file_alias_target(const char *filepath,
 
   IShellLinkW *Shortcut = NULL;
   hr = CoCreateInstance(
-  &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (LPVOID 
*)&Shortcut);
+  CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLinkW, (LPVOID 
*)&Shortcut);
 
   bool success = false;
   if (SUCCEEDED(hr)) {
 IPersistFile *PersistFile;
-hr = Shortcut->lpVtbl->QueryInterface(Shortcut, &IID_IPersistFile, (LPVOID 
*)&PersistFile);
+hr = Shortcut->QueryInterface(&PersistFile);
 if (SUCCEEDED(hr)) {
   WCHAR path_utf16[FILE_MAXDIR] = {0};
   if (conv_utf_8_to_16(filepath, path_utf16, ARRAY_SIZE(path_utf16)) == 0) 
{
-hr = PersistFile->lpVtbl->Load(PersistFile, path_utf16, STGM_READ);
+hr = PersistFile->Load(path_utf16, STGM_READ);
 if (SUCCEEDED(hr)) {
-  hr = Shortcut->lpVtbl->Resolve(Shortcut, 0, SLR_NO_UI | SLR_UPDATE);
+  hr = Shortcut->Resolve(0, SLR_NO_UI | SLR_UPDATE);
   if (SUCCEEDED(hr)) {
 wchar_t target_utf16[FILE_MAXDIR] = {0};
-hr = Shortcut->lpVtbl->GetPath(Shortcut, target_utf16, 
FILE_MAXDIR, NULL, 0);
+hr = Shortcut->GetPath(target_utf16, FILE_MAXDIR, NULL, 0);
 if (SUCCEEDED(hr)) {
   success = (conv_utf_16_to_8(target_utf16, r_targetpath, 
FILE_MAXDIR) == 0);
 }
   }
-  PersistFile->lpVtbl->Release(PersistFile);
+  PersistFile->Release();
 }
   }
 }
-Shortcut->lpVtbl->Release(Shortcut);
+Shortcut->Release();
   }
 
   CoUninitialize();

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0921f46f67d] temp-cpp-file-system: Remove wrong changes

2021-08-03 Thread Julian Eisel
Commit: 0921f46f67d5236817aff8526105ab39724eb157
Author: Julian Eisel
Date:   Tue Aug 3 18:58:59 2021 +0200
Branches: temp-cpp-file-system
https://developer.blender.org/rB0921f46f67d5236817aff8526105ab39724eb157

Remove wrong changes

===

M   source/blender/blenlib/intern/storage.cc

===

diff --git a/source/blender/blenlib/intern/storage.cc 
b/source/blender/blenlib/intern/storage.cc
index 861de916e4f..e416e815e65 100644
--- a/source/blender/blenlib/intern/storage.cc
+++ b/source/blender/blenlib/intern/storage.cc
@@ -392,13 +392,13 @@ int BLI_file_mode(const char *path)
 
   free(tmp_16);
   if (res == -1) {
-return false;
+return 0;
   }
 #else
   struct stat st;
   BLI_assert(!BLI_path_is_rel(path));
   if (stat(path, &st)) {
-return false;
+return 0;
   }
 #endif

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c63393e58ce] tmp_openmpfix: macOS: Fix for dylib loader issues.

2021-08-03 Thread Ankit Meel
Commit: c63393e58ce4e4b6bd2d574bff24fffacb349a2c
Author: Ankit Meel
Date:   Tue Aug 3 22:25:11 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBc63393e58ce4e4b6bd2d574bff24fffacb349a2c

macOS: Fix for dylib loader issues.

Also some logging for buildbot

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a85e9f23277 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,19 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+endif()
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..52e9e449642 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,12 +1044,16 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
+  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
+message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3b2522650bd] temp-geometry-nodes-fields-prototype: Don't show face corner domain in the geometry delete node

2021-08-03 Thread Hans Goudey
Commit: 3b2522650bd318ad8a7a4dc7e670478b3cb8e7fb
Author: Hans Goudey
Date:   Tue Aug 3 12:56:26 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB3b2522650bd318ad8a7a4dc7e670478b3cb8e7fb

Don't show face corner domain in the geometry delete node

===

M   source/blender/makesrna/RNA_enum_types.h
M   source/blender/makesrna/intern/rna_attribute.c
M   source/blender/makesrna/intern/rna_nodetree.c

===

diff --git a/source/blender/makesrna/RNA_enum_types.h 
b/source/blender/makesrna/RNA_enum_types.h
index d544083a749..ddc83b7694c 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -241,6 +241,7 @@ extern const EnumPropertyItem 
rna_enum_attribute_type_items[];
 extern const EnumPropertyItem rna_enum_attribute_type_with_auto_items[];
 extern const EnumPropertyItem rna_enum_attribute_domain_items[];
 extern const EnumPropertyItem rna_enum_attribute_domain_with_auto_items[];
+extern const EnumPropertyItem rna_enum_attribute_domain_no_face_corner_items[];
 extern const EnumPropertyItem *rna_enum_attribute_domain_itemf(struct ID *id, 
bool *r_free);
 
 extern const EnumPropertyItem rna_enum_collection_color_items[];
diff --git a/source/blender/makesrna/intern/rna_attribute.c 
b/source/blender/makesrna/intern/rna_attribute.c
index b4ea70c33ab..6607bc594ce 100644
--- a/source/blender/makesrna/intern/rna_attribute.c
+++ b/source/blender/makesrna/intern/rna_attribute.c
@@ -75,6 +75,14 @@ const EnumPropertyItem rna_enum_attribute_domain_items[] = {
 {0, NULL, 0, NULL, NULL},
 };
 
+const EnumPropertyItem rna_enum_attribute_domain_no_face_corner_items[] = {
+{ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"},
+{ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"},
+{ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"},
+{ATTR_DOMAIN_CURVE, "CURVE", 0, "Spline", "Attribute on spline"},
+{0, NULL, 0, NULL, NULL},
+};
+
 const EnumPropertyItem rna_enum_attribute_domain_with_auto_items[] = {
 {ATTR_DOMAIN_AUTO, "AUTO", 0, "Auto", ""},
 {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"},
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index 11108619b55..b7b2c19211b 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9154,7 +9154,7 @@ static void def_geo_delete(StructRNA *srna)
 
   prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "custom1");
-  RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items);
+  RNA_def_property_enum_items(prop, 
rna_enum_attribute_domain_no_face_corner_items);
   RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT);
   RNA_def_property_ui_text(prop, "Domain", "");
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [eacc1f1ff45] temp-geometry-nodes-fields-prototype: Fix raycast and geometry delete node for multi-spline curves

2021-08-03 Thread Hans Goudey
Commit: eacc1f1ff45a9c49be01a47aedd9b30006010d81
Author: Hans Goudey
Date:   Tue Aug 3 12:51:13 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBeacc1f1ff45a9c49be01a47aedd9b30006010d81

Fix raycast and geometry delete node for multi-spline curves

===

M   source/blender/blenkernel/BKE_attribute_access.hh
M   source/blender/blenkernel/BKE_geometry_set.hh
M   source/blender/blenkernel/intern/attribute_access.cc
M   source/blender/blenkernel/intern/curve_eval.cc
M   source/blender/blenkernel/intern/geometry_component_curve.cc
M   source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
M   source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
M   source/blender/nodes/geometry/nodes/node_geo_raycast.cc

===

diff --git a/source/blender/blenkernel/BKE_attribute_access.hh 
b/source/blender/blenkernel/BKE_attribute_access.hh
index 4c9af9f8a5a..97cac30129e 100644
--- a/source/blender/blenkernel/BKE_attribute_access.hh
+++ b/source/blender/blenkernel/BKE_attribute_access.hh
@@ -356,6 +356,12 @@ class CustomDataAttributes {
   bool create_by_move(const blender::StringRef name, const CustomDataType 
data_type, void *buffer);
   bool remove(const blender::StringRef name);
 
+  bool create_anonymous(const AnonymousCustomDataLayerID &id, const 
CustomDataType data_type);
+  std::optional get_anonymous_for_read(
+  const AnonymousCustomDataLayerID &id) const;
+  std::optional get_anonymous_for_write(
+  const AnonymousCustomDataLayerID &id);
+
   bool foreach_attribute(const AttributeForeachCallback callback,
  const AttributeDomain domain) const;
 };
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh 
b/source/blender/blenkernel/BKE_geometry_set.hh
index 22bf4b34f98..4118a1013d4 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -136,6 +136,17 @@ class GeometryComponent {
   blender::bke::ReadAttributeLookup attribute_try_get_anonymous_for_read(
   const AnonymousCustomDataLayerID &layer_id) const;
 
+  blender::fn::GVArrayPtr attribute_try_get_anonymous_for_read(
+  const AnonymousCustomDataLayerID &id,
+  const AttributeDomain domain,
+  const CustomDataType data_type) const;
+
+  blender::fn::GVArrayPtr attribute_try_get_anonymous_for_read(
+  const AnonymousCustomDataLayerID &id,
+  const AttributeDomain domain,
+  const CustomDataType data_type,
+  const void *default_value) const;
+
   blender::bke::WriteAttributeLookup attribute_try_get_anonymous_for_write(
   const AnonymousCustomDataLayerID &layer_id);
 
@@ -150,8 +161,8 @@ class GeometryComponent {
   virtual bool is_empty() const;
 
   /* Get a virtual array to read the data of an attribute on the given domain 
and data type.
-   * Returns null when the attribute does not exist or cannot be converted to 
the requested domain
-   * and data type. */
+   * Returns null when the attribute does not exist or cannot be converted to 
the requested
+   * domain and data type. */
   std::unique_ptr attribute_try_get_for_read(
   const blender::StringRef attribute_name,
   const AttributeDomain domain,
@@ -192,14 +203,14 @@ class GeometryComponent {
   }
 
   /**
-   * Returns an "output attribute", which is essentially a mutable virtual 
array with some commonly
-   * used convince features. The returned output attribute might be empty if 
requested attribute
-   * cannot exist on the geometry.
+   * Returns an "output attribute", which is essentially a mutable virtual 
array with some
+   * commonly used convince features. The returned output attribute might be 
empty if requested
+   * attribute cannot exist on the geometry.
*
* The included convenience features are:
* - Implicit type conversion when writing to builtin attributes.
-   * - If the attribute name exists already, but has a different type/domain, 
a temporary attribute
-   *   is created that will overwrite the existing attribute in the end.
+   * - If the attribute name exists already, but has a different type/domain, 
a temporary
+   * attribute is created that will overwrite the existing attribute in the 
end.
*/
   blender::bke::OutputAttribute attribute_try_get_for_output(
   const blender::StringRef attribute_name,
@@ -208,8 +219,8 @@ class GeometryComponent {
   const void *default_value = nullptr);
 
   /* Same as attribute_try_get_for_output, but should be used when the 
original values in the
-   * attributes are not read, i.e. the attribute is used only for output. 
Since values are not read
-   * from this attribute, no default value is necessary. */
+   * attributes are not read, i.e. the attribute is used only for output. 
Since values are not
+   * read from this attribute, no default value is necessary. */

[Bf-blender-cvs] [9562a906324] temp-geometry-nodes-fields-prototype: Merge branch 'master' into temp-geometry-nodes-fields-prototype

2021-08-03 Thread Hans Goudey
Commit: 9562a906324da2d285b909b5f7e1768d263632a3
Author: Hans Goudey
Date:   Tue Aug 3 09:01:23 2021 -0400
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB9562a906324da2d285b909b5f7e1768d263632a3

Merge branch 'master' into temp-geometry-nodes-fields-prototype

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [39e914cee75] master: Fix select engine buffer having wrong vertex size

2021-08-03 Thread Germano Cavalcante
Commit: 39e914cee7573fea073b19e039cfa04779b35c72
Author: Germano Cavalcante
Date:   Tue Aug 3 13:32:18 2021 -0300
Branches: master
https://developer.blender.org/rB39e914cee7573fea073b19e039cfa04779b35c72

Fix select engine buffer having wrong vertex size

The theme used was wrong and the vertex size is twice as set in the theme.

===

M   source/blender/draw/engines/select/select_engine.c
M   source/blender/draw/intern/draw_manager.c

===

diff --git a/source/blender/draw/engines/select/select_engine.c 
b/source/blender/draw/engines/select/select_engine.c
index 86b4a0ac727..96ab8a28e09 100644
--- a/source/blender/draw/engines/select/select_engine.c
+++ b/source/blender/draw/engines/select/select_engine.c
@@ -193,7 +193,7 @@ static void select_cache_init(void *vedata)
 if (e_data.context.select_mode & SCE_SELECT_VERTEX) {
   DRW_PASS_CREATE(psl->select_id_vert_pass, state);
   pd->shgrp_vert = DRW_shgroup_create(sh->select_id_flat, 
psl->select_id_vert_pass);
-  DRW_shgroup_uniform_float_copy(pd->shgrp_vert, "sizeVertex", 
G_draw.block.sizeVertex);
+  DRW_shgroup_uniform_float_copy(pd->shgrp_vert, "sizeVertex", 2 * 
G_draw.block.sizeVertex);
 }
   }
 
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index 35072518b66..a8cbe7b18b5 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2682,6 +2682,7 @@ void DRW_draw_select_id(Depsgraph *depsgraph, ARegion 
*region, View3D *v3d, cons
   drw_viewport_var_init();
 
   /* Update UBO's */
+  UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
   DRW_globals_update();
 
   /* Init Select Engine */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2e5e7567854] temp-cpp-file-system: Windows: Undefine options for Windows.h after use

2021-08-03 Thread Julian Eisel
Commit: 2e5e75678544e4b95d57369eb3e8b5ced17cd9ab
Author: Julian Eisel
Date:   Tue Aug 3 18:23:19 2021 +0200
Branches: temp-cpp-file-system
https://developer.blender.org/rB2e5e75678544e4b95d57369eb3e8b5ced17cd9ab

Windows: Undefine options for Windows.h after use

===

M   source/blender/blenlib/BLI_filesystem.hh

===

diff --git a/source/blender/blenlib/BLI_filesystem.hh 
b/source/blender/blenlib/BLI_filesystem.hh
index 5469d97e327..22d74f82b9f 100644
--- a/source/blender/blenlib/BLI_filesystem.hh
+++ b/source/blender/blenlib/BLI_filesystem.hh
@@ -31,21 +31,44 @@
 #ifdef WIN32
 #  ifndef NOGDI
 #define NOGDI
+#define NOGDI_CLEANUP
 #  endif
 #  ifndef NOMINMAX
 #define NOMINMAX
+#define NOMINMAX_CLEANUP
 #  endif
 #  ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN_CLEANUP
 #  endif
 #  ifndef NOCOMM
 #define NOCOMM
+#define NOCOMM_CLEANUP
 #  endif
 #endif /* _WIN32 */
 
 /* Header for ghc::filesystem. */
 #include "filesystem.hpp"
 
+#ifdef WIN32
+#  ifdef NOGDI_CLEANUP
+#undef NOGDI
+#undef NOGDI_CLEANUP
+#  endif
+#  ifdef NOMINMAX_CLEANUP
+#undef NOMINMAX
+#undef NOMINMAX_CLEANUP
+#  endif
+#  ifdef WIN32_LEAN_AND_MEAN_CLEANUP
+#undef WIN32_LEAN_AND_MEAN
+#undef WIN32_LEAN_AND_MEAN_CLEANUP
+#  endif
+#  ifdef NOCOMM_CLEANUP
+#undef NOCOMM
+#undef NOCOMM_CLEANUP
+#  endif
+#endif
+
 namespace blender::bli {
 namespace filesystem = ghc::filesystem;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [998537e2136] temp-cpp-file-system: Fix compile errors with `USE_CPP_FILESYSTEM` disabled

2021-08-03 Thread Julian Eisel
Commit: 998537e21362c32a3845123dc8dcbd3e0a143305
Author: Julian Eisel
Date:   Tue Aug 3 18:07:54 2021 +0200
Branches: temp-cpp-file-system
https://developer.blender.org/rB998537e21362c32a3845123dc8dcbd3e0a143305

Fix compile errors with `USE_CPP_FILESYSTEM` disabled

===

M   source/blender/blenlib/intern/storage.cc

===

diff --git a/source/blender/blenlib/intern/storage.cc 
b/source/blender/blenlib/intern/storage.cc
index 31338fbff6d..861de916e4f 100644
--- a/source/blender/blenlib/intern/storage.cc
+++ b/source/blender/blenlib/intern/storage.cc
@@ -87,7 +87,9 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#ifdef USE_CPP_FILESYSTEM
 using namespace blender::bli;
+#endif
 
 /**
  * Copies the current working directory into *dir (max size maxncpy), and
@@ -468,7 +470,7 @@ bool BLI_is_dir(const char *file)
   std::error_code error;
   return filesystem::is_directory(file, error);
 #else
-  return S_ISDIR(BLI_file_mode(file))
+  return S_ISDIR(BLI_file_mode(file));
 #endif
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3ea64350692] temp-cpp-file-system: Initial work for std::filesystem transition

2021-08-03 Thread Julian Eisel
Commit: 3ea6435069221b1bc4f7becce780291a04afe8a7
Author: Julian Eisel
Date:   Tue Aug 3 17:24:42 2021 +0200
Branches: temp-cpp-file-system
https://developer.blender.org/rB3ea6435069221b1bc4f7becce780291a04afe8a7

Initial work for std::filesystem transition

* Add ghc::filesystem as platform compatible replacement for
  std::filesystem
* Add Windows specific code to avoid issues with including Windows.h
* Port storage.cc to C++
* Port some functions from storage.cc to use ghc::filesystem internally.
* General cleanup related to the changes.
* Add USE_CPP_FILESYSTEM compile option to storage.cc, to keep legacy
  code around for testing.

===

A   extern/ghc_filesystem/README.blender
A   extern/ghc_filesystem/filesystem.hpp
M   source/blender/blenlib/BLI_fileops.h
A   source/blender/blenlib/BLI_filesystem.hh
M   source/blender/blenlib/CMakeLists.txt
M   source/blender/blenlib/intern/path_util.c
R087source/blender/blenlib/intern/storage.c 
source/blender/blenlib/intern/storage.cc
M   source/blender/sequencer/intern/image_cache.c

===

diff --git a/extern/ghc_filesystem/README.blender 
b/extern/ghc_filesystem/README.blender
new file mode 100644
index 000..c48dbe9a35b
--- /dev/null
+++ b/extern/ghc_filesystem/README.blender
@@ -0,0 +1,5 @@
+Project: ghc::filesystem
+URL: https://github.com/gulrak/filesystem
+License: MIT
+Upstream version: 1d3d5f5
+Local modifications: None
diff --git a/extern/ghc_filesystem/filesystem.hpp 
b/extern/ghc_filesystem/filesystem.hpp
new file mode 100644
index 000..0705cf7f93b
--- /dev/null
+++ b/extern/ghc_filesystem/filesystem.hpp
@@ -0,0 +1,5944 @@
+//---
+//
+// ghc::filesystem - A C++17-like filesystem implementation for 
C++11/C++14/C++17/C++20
+//
+//---
+//
+// Copyright (c) 2018, Steffen Schümann 
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+//---
+//
+// To dynamically select std::filesystem where available on most platforms,
+// you could use:
+//
+// #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || 
(defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include)
+// #if __has_include() && 
(!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED 
>= 101500)
+// #define GHC_USE_STD_FS
+// #include 
+// namespace fs = std::filesystem;
+// #endif
+// #endif
+// #ifndef GHC_USE_STD_FS
+// #include 
+// namespace fs = ghc::filesystem;
+// #endif
+//
+//---
+#ifndef GHC_FILESYSTEM_H
+#define GHC_FILESYSTEM_H
+
+// #define BSD manifest constant only in
+// sys/param.h
+#ifndef _WIN32
+#include 
+#endif
+
+#ifndef GHC_OS_DETECTED
+#if defined(__APPLE__) && defined(__MACH__)
+#define GHC_OS_MACOS
+#elif defined(__linux__)
+#define GHC_OS_LINUX
+#if defined(__ANDROID__)
+#define GHC_OS_ANDROID
+#endif
+#elif defined(_WIN64)
+#define GHC_OS_WINDOWS
+#define GHC_OS_WIN64
+#elif defined(_WIN32)
+#define GHC_OS_WINDOWS
+#define GHC_OS_WIN32
+#elif defined(__CYGWIN__)
+#define GHC_OS_CYGWIN
+#elif defined(__svr4__)
+#define GHC_OS_SYS5R4
+#elif defined(BSD)
+#define GHC_OS_BSD
+#elif defined(__EMSCRIPTEN__)
+#define GHC_OS_WEB
+#include 
+#elif defined(__QNX__)
+#define GHC_OS_QNX
+#define GHC_NO_DIRENT_D_TYPE
+#else
+#error "Operating system currently not supported!"
+#endif
+#define GHC_OS_DETECTED
+#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if _MSVC_LANG == 201703L
+#define GHC_FILESYSTEM_RUNNING_CPP17
+#else
+#define GHC_FILESYSTEM_RUNNING_CPP20
+#endif
+#elif (defined(__cplusplus) && __cplusplus

[Bf-blender-cvs] [57281b73c45] master: Install_deps: Always re-create shortcuts to installed lib paths.

2021-08-03 Thread Bastien Montagne
Commit: 57281b73c45197ccf78476b73ed85a3ea30699e9
Author: Bastien Montagne
Date:   Tue Aug 3 17:20:25 2021 +0200
Branches: master
https://developer.blender.org/rB57281b73c45197ccf78476b73ed85a3ea30699e9

Install_deps: Always re-create shortcuts to installed lib paths.

For some reasons looks like those shortcuts could get out of sync, which
created weird hard to understand building errors.

So for sake of simplicity and security, just re-create them all the
time, just like we update ld paths.

===

M   build_files/build_environment/install_deps.sh

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index 26281887e1f..ff4aad79bb6 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -1447,9 +1447,7 @@ compile_Python() {
 make -j$THREADS && make install
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -1465,6 +1463,9 @@ compile_Python() {
 INFO "If you want to force rebuild of this lib, use the --force-python 
option."
   fi
 
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "python-$PYTHON_VERSION_SHORT"
 
   # Extra step: install required modules with pip.
@@ -1558,9 +1559,7 @@ compile_Boost() {
  --prefix=$_inst --disable-icu boost.locale.icu=off install
 ./b2 --clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -1574,7 +1573,9 @@ compile_Boost() {
 INFO "If you want to force rebuild of this lib, use the --force-boost 
option."
   fi
 
-  # Just always run it, much simpler this way!
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "boost"
 }
 
@@ -1687,9 +1688,7 @@ compile_TBB() {
 
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "TBB-$TBB_VERSION$TBB_VERSION_UPDATE failed to compile, exiting"
   exit 1
 fi
@@ -1703,6 +1702,9 @@ compile_TBB() {
 INFO "If you want to force rebuild of this lib, use the --force-tbb 
option."
   fi
 
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "tbb"
 }
 
@@ -1822,9 +1824,7 @@ compile_OCIO() {
 
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -1838,6 +1838,9 @@ compile_OCIO() {
 INFO "If you want to force rebuild of this lib, use the --force-ocio 
option."
   fi
 
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "ocio"
 }
 
@@ -1953,9 +1956,7 @@ compile_OPENEXR() {
 
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -1971,7 +1972,9 @@ compile_OPENEXR() {
 
   _with_built_openexr=true
 
-  # Just always run it, much simpler this way!
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "openexr"
 }
 
@@ -2112,9 +2115,7 @@ compile_OIIO() {
 make -j$THREADS && make install
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -2128,7 +2129,9 @@ compile_OIIO() {
 INFO "If you want to force rebuild of this lib, use the --force-oiio 
option."
   fi
 
-  # Just always run it, much simpler this way!
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
   run_ldconfig "oiio"
 }
 
@@ -2237,9 +2240,7 @@ compile_LLVM() {
 make -j$THREADS && make install
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -2252,6 +2253,10 @@ compile_LLVM() {
 INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to 
do!"
 INFO "If you want to force rebuild of this lib, use the --force-llvm 
option."
   fi
+
+  if [ -d $_inst ]; then
+_create_inst_shortcut
+  fi
 }
 
 # 
@@ -2390,9 +2395,7 @@ compile_OSL() {
 make -j$THREADS && make install
 make clean
 
-if [ -d $_inst ]; then
-  _create_inst_shortcut
-else
+if [ ! -d $_inst ]; then
   ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
   exit 1
 fi
@@ -2406,6 +2409,9 @@ compile_OSL() {
   

[Bf-blender-cvs] [652fbc20050] master: macOS: Portable builds with dynamic libraries.

2021-08-03 Thread Ankit Meel
Commit: 652fbc200500497a67bd11d18b786587ba34e3d9
Author: Ankit Meel
Date:   Tue Aug 3 20:49:40 2021 +0530
Branches: master
https://developer.blender.org/rB652fbc200500497a67bd11d18b786587ba34e3d9

macOS: Portable builds with dynamic libraries.

For Blender.app: dropping libomp.dylib next to Blender executable is
enough for it getting picked up since `@executable_path` is an rpath.

For non-distributed binaries datatoc, makesdna, tests etc, code for
copying libomp.dylib to build folder is removed and replaced by
CMake's rpath option for *build* tree.

For bpy.so, the post build rpath change has also been replaced by CMake
rpath option for *install* tree.

Since -id has been changed in D11748, remove the
`install_name_tool -change ...` command.

Any dylib can just be dropped at `MAC_BLENDER_TARGET_DYLIBS_DIR`
hereafter. Appending dylib path to `CMAKE_BUILD_RPATH` will be needed
for datatoc etc if linked against one (instead of copying the
dylibs around).

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D11997

===

M   CMakeLists.txt
M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c6408bee2c..b7dfb56ff02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,10 @@ if(POLICY CMP0074)
   cmake_policy(SET CMP0074 NEW)
 endif()
 
+# Install CODE|SCRIPT allow the use of generator expressions.
+if(POLICY CMP0087)
+  cmake_policy(SET CMP0087 NEW)
+endif()
 #-
 # Load some macros.
 include(build_files/cmake/macros.cmake)
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 70973eeda99..529c01db009 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,25 +411,9 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LINKER_FLAGS "-L'${LIBDIR}/openmp/lib' -lomp")
-
-# Copy libomp.dylib to allow executables like datatoc and tests to work.
-# `@executable_path/../Resources/lib/` `LC_ID_DYLIB` is added by the deps 
builder.
-# For single config generator datatoc, tests etc.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
-)
-# For multi-config generator datatoc, etc.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
-)
-# For multi-config generator tests.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
-)
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
+set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
 endif()
 
@@ -511,3 +495,19 @@ if(WITH_COMPILER_CCACHE)
 endif()
   endif()
 endif()
+
+# For binaries that are built but not installed (also not distributed) 
(datatoc,
+# makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
+# CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
+#
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
+# needs no changes since it already looks for dylibs next to the executable by
+# default (@executable_path).
+#
+# For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
+# dylib in an adjacent folder.
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_PYTHON_MODULE)
+  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
+endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index c3aeffe8fda..f7179dfb7e9 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,8 +345,13 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
+# Dylibs folder for bpy.so.
+set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
+# Dylibs folder for Blender executable. @executable_path is a default
+# rpath, so dropping libraries next to Blender is enough.
+set(MAC_BLENDER_TARGET_DY

[Bf-blender-cvs] [38c199ab3ef] soc-2021-curve-fillet: Removed redundant code in curve fillet node

2021-08-03 Thread dilithjay
Commit: 38c199ab3ef3b4249b53b7661f5cbd842d5e3555
Author: dilithjay
Date:   Tue Aug 3 20:11:55 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB38c199ab3ef3b4249b53b7661f5cbd842d5e3555

Removed redundant code in curve fillet node

===

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

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
index db57c3533dd..e6522953734 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
@@ -610,23 +610,11 @@ static std::unique_ptr fillet_curve(const 
CurveEval &input_curve,
 spline_indices[i] = spline_indices[i - 1] + input_splines[i]->size();
   }
 
-  if (mode_param.radius_mode == GEO_NODE_CURVE_FILLET_RADIUS_ATTRIBUTE) {
-threading::parallel_for(input_splines.index_range(), 128, [&](IndexRange 
range) {
-  for (const int i : range) {
-const Spline &spline = *input_splines[i];
-std::string radii_name = mode_param.radii_dist.value();
-GVArray_Typed radii_dist = 
spline.attributes.get_for_read(radii_name, 1.0f);
-output_splines[i] = fillet_spline(spline, mode_param, 
spline_indices[i]);
-  }
-});
-  }
-  else {
-threading::parallel_for(input_splines.index_range(), 128, [&](IndexRange 
range) {
-  for (const int i : range) {
-output_splines[i] = fillet_spline(*input_splines[i], mode_param, 
spline_indices[i]);
-  }
-});
-  }
+  threading::parallel_for(input_splines.index_range(), 128, [&](IndexRange 
range) {
+for (const int i : range) {
+  output_splines[i] = fillet_spline(*input_splines[i], mode_param, 
spline_indices[i]);
+}
+  });
 
   return output_curve;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9212e59ffe8] soc-2021-curve-fillet: Fixed bug with multiple spline curve fillet

2021-08-03 Thread dilithjay
Commit: 9212e59ffe8ba773f1fbe4328cf1e6989e52e5b3
Author: dilithjay
Date:   Tue Aug 3 20:10:57 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB9212e59ffe8ba773f1fbe4328cf1e6989e52e5b3

Fixed bug with multiple spline curve fillet

===

M   release/scripts/addons
M   release/scripts/addons_contrib
M   source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc

===

diff --git a/release/scripts/addons b/release/scripts/addons
index 6fb64557179..2aa81ec3365 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 6fb64557179b3783fffae5bf704ad2ab8f7046a6
+Subproject commit 2aa81ec3365c5ed2478f9783f78a38e77c0ef6c1
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 32040a4a0ca..98f6085e9d7 16
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 32040a4a0ca1537057612590194b54ed511462c8
+Subproject commit 98f6085e9d71ba35d41e5aafbcb7981bd7c48275
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
index 8f8a7a12b04..db57c3533dd 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
@@ -239,7 +239,8 @@ static void limit_radii(Array &fds,
 static Array calculate_fillet_data(const SplinePtr &spline,
const FilletModeParam 
&mode_param,
int &added_count,
-   Array &point_counts)
+   Array &point_counts,
+   const int spline_index)
 {
   Span positions = spline->positions();
   int fillet_count, start = 0, size = spline->size();
@@ -276,12 +277,7 @@ static Array calculate_fillet_data(const 
SplinePtr &spline,
   radius = mode_param.radius.value();
 }
 else if (mode_param.radius_mode == GEO_NODE_CURVE_FILLET_RADIUS_ATTRIBUTE) 
{
-  if (mode_param.radii->size() != size) {
-radius = 0;
-  }
-  else {
-radius = (*mode_param.radii)[start + i];
-  }
+  radius = (*mode_param.radii)[spline_index + start + i];
 }
 
 /* Calculate fillet data for the vertex. */
@@ -530,7 +526,9 @@ static void 
update_poly_or_NURBS_positions(Array &fds,
 }
 
 /* Function to fillet a spline. */
-static SplinePtr fillet_spline(const Spline &spline, const FilletModeParam 
&mode_param)
+static SplinePtr fillet_spline(const Spline &spline,
+   const FilletModeParam &mode_param,
+   const int spline_index)
 {
   int fillet_count, start = 0, size = spline.size();
   bool cyclic = spline.is_cyclic();
@@ -555,7 +553,7 @@ static SplinePtr fillet_spline(const Spline &spline, const 
FilletModeParam &mode
   int added_count = 0;
   /* Update point_counts array and added_count. */
   Array fds = calculate_fillet_data(
-  src_spline_ptr, mode_param, added_count, point_counts);
+  src_spline_ptr, mode_param, added_count, point_counts, spline_index);
   if (mode_param.limit_radius) {
 limit_radii(fds, spline.positions(), spline.size(), cyclic);
   }
@@ -602,23 +600,30 @@ static std::unique_ptr fillet_curve(const 
CurveEval &input_curve,
   Span input_splines = input_curve.splines();
 
   std::unique_ptr output_curve = std::make_unique();
-  output_curve->resize(input_splines.size());
+  int num_splines = input_splines.size();
+  output_curve->resize(num_splines);
   MutableSpan output_splines = output_curve->splines();
 
+  Array spline_indices(input_splines.size());
+  spline_indices[0] = 0;
+  for (const int i : IndexRange(1, num_splines - 1)) {
+spline_indices[i] = spline_indices[i - 1] + input_splines[i]->size();
+  }
+
   if (mode_param.radius_mode == GEO_NODE_CURVE_FILLET_RADIUS_ATTRIBUTE) {
 threading::parallel_for(input_splines.index_range(), 128, [&](IndexRange 
range) {
   for (const int i : range) {
 const Spline &spline = *input_splines[i];
 std::string radii_name = mode_param.radii_dist.value();
 GVArray_Typed radii_dist = 
spline.attributes.get_for_read(radii_name, 1.0f);
-output_splines[i] = fillet_spline(spline, mode_param);
+output_splines[i] = fillet_spline(spline, mode_param, 
spline_indices[i]);
   }
 });
   }
   else {
 threading::parallel_for(input_splines.index_range(), 128, [&](IndexRange 
range) {
   for (const int i : range) {
-output_splines[i] = fillet_spline(*input_splines[i], mode_param);
+output_splines[i] = fillet_spline(*input_splines[i], mode_param, 
spline_indices[i]);
   }
 });
   }
@@ -661,8 +666,10 @@ static void geo_node_fillet_exec(Ge

[Bf-blender-cvs] [ef6db37b1fe] soc-2021-curve-fillet: Merge branch 'soc-2021-curve-fillet' of git.blender.org:blender into soc-2021-curve-fillet

2021-08-03 Thread dilithjay
Commit: ef6db37b1febdea158cd963cf943102359cdae51
Author: dilithjay
Date:   Tue Aug 3 20:08:15 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rBef6db37b1febdea158cd963cf943102359cdae51

Merge branch 'soc-2021-curve-fillet' of git.blender.org:blender into 
soc-2021-curve-fillet

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [320d158c31f] soc-2021-curve-fillet: Basoc Curve Fillet node implementation

2021-08-03 Thread dilithjay
Commit: 320d158c31fe2cd8f296c63be54d605de7f64441
Author: dilithjay
Date:   Tue Aug 3 17:26:25 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB320d158c31fe2cd8f296c63be54d605de7f64441

Basoc Curve Fillet node implementation

Basic Curve Fillet node implementation

Merge branch 'soc-2021-curve-fillet' of git.blender.org:blender into 
soc-2021-curve-fillet

Fixed issue with incorrect radius for fillet

Radius can now accept builtin attributes as well

Cleanup: Refactored fillet code

Added support for multiple resolution curve fillet segments

Added curve fillet support for Poly Splines

Fixed error with accessing empty optional variable

Merge branch 'master' into soc-2021-curve-fillet

Fixed two warnings on curve fillet code

Merge branch 'master' into soc-2021-curve-fillet

Cleanup: Commenting and minor refactoring

Specified function arguments as const

Curve fillet support for non-vector handles

Cleanup: Comment formatting fix

Merge branch 'master' into soc-2021-curve-fillet

Added curve fillet support for NURBS curves (temp)

Cleanup: Renoved redundant spline type check.

Merge branch 'master' into soc-2021-curve-fillet

Added option to avoid overlap of curve fillet

Merge branch 'master' into soc-2021-curve-fillet

Improved limit radius algorithm in curve fillet

Improved limit radius behavior in curve fillet

Merge branch 'master' into soc-2021-curve-fillet

Merge branch 'master' into soc-2021-curve-fillet

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

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4e1a1821e04] master: Fix T90313: Align to Transform Orientation Axis Property Doesn't Work

2021-08-03 Thread Germano Cavalcante
Commit: 4e1a1821e04aa54d536f49018156e0f9cf95cf7e
Author: Germano Cavalcante
Date:   Tue Aug 3 11:29:28 2021 -0300
Branches: master
https://developer.blender.org/rB4e1a1821e04aa54d536f49018156e0f9cf95cf7e

Fix T90313: Align to Transform Orientation Axis Property Doesn't Work

`Orientation Axis` is a property incompatible with `Align` mode and
should not be visible.

===

M   source/blender/editors/transform/transform_ops.c

===

diff --git a/source/blender/editors/transform/transform_ops.c 
b/source/blender/editors/transform/transform_ops.c
index 2c424d8ace3..45c077b8a07 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -371,25 +371,24 @@ static void transformops_exit(bContext *C, wmOperator *op)
   G.moving = 0;
 }
 
+static int transformops_mode(wmOperator *op)
+{
+  for (TransformModeItem *tmode = transform_modes; tmode->idname; tmode++) {
+if (op->type->idname == tmode->idname) {
+  return tmode->mode;
+}
+  }
+
+  return RNA_enum_get(op->ptr, "mode");
+}
+
 static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
 {
   int retval = 1;
   if (op->customdata == NULL) {
 TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data2");
-TransformModeItem *tmode;
-int mode = -1;
-
-for (tmode = transform_modes; tmode->idname; tmode++) {
-  if (op->type->idname == tmode->idname) {
-mode = tmode->mode;
-break;
-  }
-}
-
-if (mode == -1) {
-  mode = RNA_enum_get(op->ptr, "mode");
-}
 
+int mode = transformops_mode(op);
 retval = initTransform(C, t, op, event, mode);
 
 /* store data */
@@ -556,6 +555,16 @@ static bool transform_poll_property(const bContext 
*UNUSED(C),
 }
   }
 
+  /* Orientation Axis. */
+  {
+if (STREQ(prop_id, "orient_axis")) {
+  eTfmMode mode = (eTfmMode)transformops_mode(op);
+  if (mode == TFM_ALIGN) {
+return false;
+  }
+}
+  }
+
   /* Proportional Editing. */
   {
 PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, 
"use_proportional_edit");

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [391af6bea25] master: Cleanup: Replace int with bool for pointcache function

2021-08-03 Thread Julian Eisel
Commit: 391af6bea256e11cbc599ac8b15278e2f956ea01
Author: Julian Eisel
Date:   Tue Aug 3 15:48:54 2021 +0200
Branches: master
https://developer.blender.org/rB391af6bea256e11cbc599ac8b15278e2f956ea01

Cleanup: Replace int with bool for pointcache function

Was using an int for boolean return value.

===

M   source/blender/blenkernel/BKE_pointcache.h
M   source/blender/blenkernel/intern/pointcache.c

===

diff --git a/source/blender/blenkernel/BKE_pointcache.h 
b/source/blender/blenkernel/BKE_pointcache.h
index 3f99a0dc793..c83fca767a1 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -302,7 +302,7 @@ void BKE_ptcache_remove(void);
 
 / ID specific functions /
 void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
-int BKE_ptcache_id_exist(PTCacheID *id, int cfra);
+bool BKE_ptcache_id_exist(PTCacheID *id, int cfra);
 int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode);
 void BKE_ptcache_id_time(PTCacheID *pid,
  struct Scene *scene,
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index 9ed5b0230e6..a6adff35a7f 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2753,18 +2753,18 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, 
unsigned int cfra)
   pid->cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
 }
 
-int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
+bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
 {
   if (!pid->cache) {
-return 0;
+return false;
   }
 
   if (cfra < pid->cache->startframe || cfra > pid->cache->endframe) {
-return 0;
+return false;
   }
 
   if (pid->cache->cached_frames && pid->cache->cached_frames[cfra - 
pid->cache->startframe] == 0) {
-return 0;
+return false;
   }
 
   if (pid->cache->flag & PTCACHE_DISK_CACHE) {
@@ -2779,10 +2779,10 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
 
   for (; pm; pm = pm->next) {
 if (pm->frame == cfra) {
-  return 1;
+  return true;
 }
   }
-  return 0;
+  return false;
 }
 void BKE_ptcache_id_time(
 PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, 
float *timescale)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7724251af81] master: WM: don't store selection properties typically set in the key-map

2021-08-03 Thread Campbell Barton
Commit: 7724251af81f7222fa552815525ed256fbbb2e95
Author: Campbell Barton
Date:   Tue Aug 3 23:24:18 2021 +1000
Branches: master
https://developer.blender.org/rB7724251af81f7222fa552815525ed256fbbb2e95

WM: don't store selection properties typically set in the key-map

While this was already the case for the most part
some selection operators stored common settings for reuse such as
"toggle", "extend" & "deselect".

Disabling storing these settings for later execution
as it means failure to set these options in the key-map re-uses
the value of the shortcut that was last called.

Skip saving these settings since this is a case where reusing them
isn't helpful.

Resolves T90275.

===

M   source/blender/editors/mesh/editmesh_select.c
M   source/blender/editors/space_node/node_select.cc
M   source/blender/editors/space_outliner/outliner_select.c
M   source/blender/editors/space_sequencer/sequencer_select.c
M   source/blender/editors/space_view3d/view3d_select.c
M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index 830c9abb41e..8e38d41f971 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1860,10 +1860,16 @@ void MESH_OT_loop_select(wmOperatorType *ot)
   ot->flag = OPTYPE_UNDO;
 
   /* properties */
-  RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "Extend the 
selection");
-  RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from the 
selection");
-  RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Select", "Toggle the 
selection");
-  RNA_def_boolean(ot->srna, "ring", 0, "Select Ring", "Select ring");
+  PropertyRNA *prop;
+
+  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "Extend the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Select", "Toggle the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "ring", 0, "Select Ring", "Select ring");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 void MESH_OT_edgering_select(wmOperatorType *ot)
@@ -1880,10 +1886,16 @@ void MESH_OT_edgering_select(wmOperatorType *ot)
   /* flags */
   ot->flag = OPTYPE_UNDO;
 
-  RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
-  RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from the 
selection");
-  RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Select", "Toggle the 
selection");
-  RNA_def_boolean(ot->srna, "ring", 1, "Select Ring", "Select ring");
+  /* Properties. */
+  PropertyRNA *prop;
+  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Select", "Toggle the 
selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+  prop = RNA_def_boolean(ot->srna, "ring", 1, "Select Ring", "Select ring");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /** \} */
diff --git a/source/blender/editors/space_node/node_select.cc 
b/source/blender/editors/space_node/node_select.cc
index 6c07c41f451..a1068f29624 100644
--- a/source/blender/editors/space_node/node_select.cc
+++ b/source/blender/editors/space_node/node_select.cc
@@ -664,7 +664,8 @@ void NODE_OT_select(wmOperatorType *ot)
 
   /* properties */
   WM_operator_properties_generic_select(ot);
-  RNA_def_boolean(ot->srna, "extend", false, "Extend", "");
+  prop = RNA_def_boolean(ot->srna, "extend", false, "Extend", "");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
   RNA_def_boolean(ot->srna, "socket_select", false, "Socket Select", "");
   prop = RNA_def_boolean(ot->srna,
  "deselect_all",
diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index aaa52f6b649..898e66e7a39 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1682,7 +1682,8 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
   ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
 
   PropertyRNA *prop;
-  RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection for 
activation");
+  prop = RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection 
for activation");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
   prop = RNA_def_boolean(
   ot->srna, "extend_range", false, 

[Bf-blender-cvs] [d3dd735fead] master: UI: building without Python again

2021-08-03 Thread Campbell Barton
Commit: d3dd735fead26fdd9c645237597635b7cb6b135f
Author: Campbell Barton
Date:   Tue Aug 3 22:45:37 2021 +1000
Branches: master
https://developer.blender.org/rBd3dd735fead26fdd9c645237597635b7cb6b135f

UI: building without Python again

Also quiet some warnings.

===

M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/util/numinput.c

===

diff --git a/source/blender/editors/interface/interface.c 
b/source/blender/editors/interface/interface.c
index a2b25aed582..d3a3df98d99 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -4017,9 +4017,11 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
   UNUSED_VARS_NDEBUG(found_layout);
   ui_button_group_replace_but_ptr(uiLayoutGetBlock(but->layout), 
old_but_ptr, but);
 }
+#ifdef WITH_PYTHON
 if (UI_editsource_enable_check()) {
   UI_editsource_but_replace(old_but_ptr, but);
 }
+#endif
   }
 
   return but;
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index 0ffc5659191..6755eded05c 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -2425,6 +2425,7 @@ void UI_icon_draw_ex(float x,
 ImBuf *UI_icon_alert_imbuf_get(eAlertIcon icon)
 {
 #ifdef WITH_HEADLESS
+  UNUSED_VARS(icon);
   return NULL;
 #else
   const int ALERT_IMG_SIZE = 256;
diff --git a/source/blender/editors/util/numinput.c 
b/source/blender/editors/util/numinput.c
index 15d672dea56..823837e2a42 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -309,7 +309,7 @@ bool user_string_to_number(bContext *C,
   return success;
 
 #else
-  UNUSED_VARS(C, unit, type);
+  UNUSED_VARS(C, unit, type, use_single_line_error, r_error);
   *r_value = atof(str);
   return true;
 #endif

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ab1b587119d] soc-2021-knife-tools: Cleanup: Added clarifying comment

2021-08-03 Thread Cian Jinks
Commit: ab1b587119d0865e01781fe8ecbab88559d8b594
Author: Cian Jinks
Date:   Tue Aug 3 14:23:22 2021 +0100
Branches: soc-2021-knife-tools
https://developer.blender.org/rBab1b587119d0865e01781fe8ecbab88559d8b594

Cleanup: Added clarifying comment

===

M   source/blender/editors/mesh/editmesh_knife.c

===

diff --git a/source/blender/editors/mesh/editmesh_knife.c 
b/source/blender/editors/mesh/editmesh_knife.c
index 26d627cf0b6..6d89063491f 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -438,6 +438,7 @@ static void knifetool_draw_orientation_locking(const 
KnifeTool_OpData *kcd)
   if (!compare_v3v3(kcd->prev.cage, kcd->curr.cage, KNIFE_FLT_EPSBIG)) {
 float v1[3], v2[3];
 
+/* This is causing buggyness when prev.cage and curr.cage are too close 
together. */
 knifetool_raycast_planes(kcd, v1, v2);
 
 uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 
3, GPU_FETCH_FLOAT);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6056d6192f0] cycles-x: Merge branch 'master' into cycles-x

2021-08-03 Thread Sergey Sharybin
Commit: 6056d6192f0f33b2074b58e63c8e452b7590769d
Author: Sergey Sharybin
Date:   Tue Aug 3 14:50:44 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB6056d6192f0f33b2074b58e63c8e452b7590769d

Merge branch 'master' into cycles-x

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [df115dec055] temp-geometry-nodes-expandable-geometry-socket-prototype: show domain dropdown in socket

2021-08-03 Thread Jacques Lucke
Commit: df115dec055535ba3b48929054ccc9e1669b9ce0
Author: Jacques Lucke
Date:   Tue Aug 3 14:47:19 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rBdf115dec055535ba3b48929054ccc9e1669b9ce0

show domain dropdown in socket

===

M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/source/blender/makesdna/DNA_node_types.h 
b/source/blender/makesdna/DNA_node_types.h
index 22906bc7229..89f33e04867 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1433,7 +1433,7 @@ typedef struct GeometryExpanderOutput {
 
 typedef struct NodeGeometryGeometryExpander {
   ListBase outputs;
-} NodeGeometryExpander;
+} NodeGeometryGeometryExpander;
 
 /* script node mode */
 #define NODE_SCRIPT_INTERNAL 0
diff --git a/source/blender/makesrna/RNA_access.h 
b/source/blender/makesrna/RNA_access.h
index 97615016016..e45d93d162a 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -283,6 +283,7 @@ extern StructRNA RNA_FreestyleModuleSettings;
 extern StructRNA RNA_FreestyleSettings;
 extern StructRNA RNA_Function;
 extern StructRNA RNA_FunctionNode;
+extern StructRNA RNA_GeometryExpanderOutput;
 extern StructRNA RNA_GPencilFrame;
 extern StructRNA RNA_GPencilInterpolateSettings;
 extern StructRNA RNA_GPencilLayer;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index 3d4256db335..1cd95f37bff 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -10192,6 +10192,33 @@ static void def_geo_raycast(StructRNA *srna)
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 }
 
+static void def_geo_geometry_expander_output(BlenderRNA *brna)
+{
+  StructRNA *srna;
+  PropertyRNA *prop;
+
+  srna = RNA_def_struct(brna, "GeometryExpanderOutput", NULL);
+
+  prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE);
+  RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items);
+  RNA_def_property_ui_text(prop, "Domain", "");
+  /* TODO: Update callback. */
+  RNA_def_property_update(prop, NC_NODE | NA_EDITED, NULL);
+}
+
+static void def_geo_geometry_expander(StructRNA *srna)
+{
+  PropertyRNA *prop;
+
+  RNA_def_struct_sdna_from(srna, "NodeGeometryGeometryExpander", "storage");
+
+  prop = RNA_def_property(srna, "outputs", PROP_COLLECTION, PROP_NONE);
+  RNA_def_property_collection_sdna(prop, NULL, "outputs", NULL);
+  RNA_def_property_struct_type(prop, "GeometryExpanderOutput");
+  RNA_def_property_ui_text(prop, "Expander Outputs", "");
+  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+}
+
 /* -- 
*/
 
 static void rna_def_shader_node(BlenderRNA *brna)
@@ -10239,6 +10266,8 @@ static void rna_def_geometry_node(BlenderRNA *brna)
   RNA_def_struct_ui_text(srna, "Geometry Node", "");
   RNA_def_struct_sdna(srna, "bNode");
   RNA_def_struct_register_funcs(srna, "rna_GeometryNode_register", 
"rna_Node_unregister", NULL);
+
+  def_geo_geometry_expander_output(brna);
 }
 
 static void rna_def_function_node(BlenderRNA *brna)
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index 630e9be1528..9d78e729f0b 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -309,7 +309,7 @@ DefNode(GeometryNode, GEO_NODE_CURVE_TO_POINTS, 
def_geo_curve_to_points, "CURVE_
 DefNode(GeometryNode, GEO_NODE_CURVE_TRIM, def_geo_curve_trim, "CURVE_TRIM", 
CurveTrim, "Curve Trim", "")
 DefNode(GeometryNode, GEO_NODE_DELETE_GEOMETRY, 0, "DELETE_GEOMETRY", 
DeleteGeometry, "Delete Geometry", "")
 DefNode(GeometryNode, GEO_NODE_EDGE_SPLIT, 0, "EDGE_SPLIT", EdgeSplit, "Edge 
Split", "")
-DefNode(GeometryNode, GEO_NODE_GEOMETRY_EXPANDER, 0, "GEOMETRY_EXPANDER", 
GeometryExpander, "Geometry Expander", "")
+DefNode(GeometryNode, GEO_NODE_GEOMETRY_EXPANDER, def_geo_geometry_expander, 
"GEOMETRY_EXPANDER", GeometryExpander, "Geometry Expander", "")
 DefNode(GeometryNode, GEO_NODE_INPUT_MATERIAL, def_geo_input_material, 
"INPUT_MATERIAL", InputMaterial, "Material", "")
 DefNode(GeometryNode, GEO_NODE_IS_VIEWPORT, 0, "IS_VIEWPORT", IsViewport, "Is 
Viewport", "")
 DefNode(GeometryNode, GEO_NODE_JOIN_GEOMETRY, 0, "JOIN_GEOMETRY", 
JoinGeometry, "Join Geometry", "")
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index 5d08e9d9b82..16d4c0bef0f 100644
--- a/sou

[Bf-blender-cvs] [2aca184623b] soc-2021-curve-fillet: Merge branch 'master' into soc-2021-curve-fillet

2021-08-03 Thread dilithjay
Commit: 2aca184623b1ab6637ec5afe8218483d626acc51
Author: dilithjay
Date:   Tue Aug 3 17:26:25 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB2aca184623b1ab6637ec5afe8218483d626acc51

Merge branch 'master' into soc-2021-curve-fillet

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8615da0e77e] soc-2021-curve-fillet: Merge branch 'master' into soc-2021-curve-fillet

2021-08-03 Thread dilithjay
Commit: 8615da0e77e7d14a4f5b71f4d8fddf23c8bc40d0
Author: dilithjay
Date:   Tue Aug 3 17:24:58 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB8615da0e77e7d14a4f5b71f4d8fddf23c8bc40d0

Merge branch 'master' into soc-2021-curve-fillet

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cec103d5a90] master: Silenced clang-tidy warnings.

2021-08-03 Thread Jeroen Bakker
Commit: cec103d5a905b8236a2196464f4e7d7728eb65c5
Author: Jeroen Bakker
Date:   Tue Aug 3 13:55:57 2021 +0200
Branches: master
https://developer.blender.org/rBcec103d5a905b8236a2196464f4e7d7728eb65c5

Silenced clang-tidy warnings.

===

M   source/blender/editors/include/ED_keyframes_keylist.h

===

diff --git a/source/blender/editors/include/ED_keyframes_keylist.h 
b/source/blender/editors/include/ED_keyframes_keylist.h
index 92b57b89cf8..e7d1b5d4363 100644
--- a/source/blender/editors/include/ED_keyframes_keylist.h
+++ b/source/blender/editors/include/ED_keyframes_keylist.h
@@ -153,44 +153,44 @@ bool ED_keylist_frame_range(const struct AnimKeylist 
*keylist, struct Range2f *r
 /* F-Curve */
 void fcurve_to_keylist(struct AnimData *adt,
struct FCurve *fcu,
-   struct AnimKeylist *keys,
+   struct AnimKeylist *keylist,
int saction_flag);
 /* Action Group */
 void agroup_to_keylist(struct AnimData *adt,
struct bActionGroup *agrp,
-   struct AnimKeylist *keys,
+   struct AnimKeylist *keylist,
int saction_flag);
 /* Action */
 void action_to_keylist(struct AnimData *adt,
struct bAction *act,
-   struct AnimKeylist *keys,
+   struct AnimKeylist *keylist,
int saction_flag);
 /* Object */
 void ob_to_keylist(struct bDopeSheet *ads,
struct Object *ob,
-   struct AnimKeylist *keys,
+   struct AnimKeylist *keylist,
int saction_flag);
 /* Cache File */
 void cachefile_to_keylist(struct bDopeSheet *ads,
   struct CacheFile *cache_file,
-  struct AnimKeylist *keys,
+  struct AnimKeylist *keylist,
   int saction_flag);
 /* Scene */
 void scene_to_keylist(struct bDopeSheet *ads,
   struct Scene *sce,
-  struct AnimKeylist *keys,
+  struct AnimKeylist *keylist,
   int saction_flag);
 /* DopeSheet Summary */
-void summary_to_keylist(struct bAnimContext *ac, struct AnimKeylist *keys, int 
saction_flag);
+void summary_to_keylist(struct bAnimContext *ac, struct AnimKeylist *keylist, 
int saction_flag);
 /* Grease Pencil datablock summary */
 void gpencil_to_keylist(struct bDopeSheet *ads,
 struct bGPdata *gpd,
-struct AnimKeylist *keys,
+struct AnimKeylist *keylist,
 const bool active);
 /* Grease Pencil Layer */
-void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct 
AnimKeylist *keys);
+void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct 
AnimKeylist *keylist);
 /* Mask */
-void mask_to_keylist(struct bDopeSheet *ads, struct MaskLayer *masklay, struct 
AnimKeylist *keys);
+void mask_to_keylist(struct bDopeSheet *ads, struct MaskLayer *masklay, struct 
AnimKeylist *keylist);
 
 /* ActKeyColumn API  */
 /* Comparator callback used for ActKeyColumns and cframe float-value pointer */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [22d2a747fb6] soc-2021-knife-tools: Knife: Added new knife modal keymaps to industry compatible

2021-08-03 Thread Cian Jinks
Commit: 22d2a747fb6d8d94e69c93c5e5656770794ea3c3
Author: Cian Jinks
Date:   Tue Aug 3 12:56:28 2021 +0100
Branches: soc-2021-knife-tools
https://developer.blender.org/rB22d2a747fb6d8d94e69c93c5e5656770794ea3c3

Knife: Added new knife modal keymaps to industry compatible

===

M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py

===

diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 714126903d8..36704afb08d 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -3861,7 +3861,8 @@ def km_knife_tool_modal_map(_params):
 ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, 
None),
 ("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', 
"any": True}, None),
 ("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
-("NEW_CUT", {"type": 'E', "value": 'PRESS'}, None),
+("UNDO", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
+("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
 ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS'}, None),
 ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE'}, 
None),
 ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS'}, None),
@@ -3870,11 +3871,12 @@ def km_knife_tool_modal_map(_params):
 ("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": 
True}, None),
 ("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": 
True}, None),
 ("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": 
True}, None),
-("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
-("CUT_THROUGH_TOGGLE", {"type": 'X', "value": 'PRESS'}, None),
+("ANGLE_SNAP_TOGGLE", {"type": 'A', "value": 'PRESS'}, None),
+("CUT_THROUGH_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
 ("PANNING", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, 
None),
 ("PANNING", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, 
None),
-("CONFIRM", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
+("SHOW_DISTANCE_ANGLE_TOGGLE", {"type": 'D', "value": 'PRESS'}, None),
+("DEPTH_TEST_TOGGLE", {"type": 'V', "value": 'PRESS'}, None),
 ])
 
 return keymap

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3f1603a8f84] temp-geometry-nodes-expandable-geometry-socket-prototype: initial socket draw override

2021-08-03 Thread Jacques Lucke
Commit: 3f1603a8f84660db7a654050fedf32c8940e1b57
Author: Jacques Lucke
Date:   Tue Aug 3 13:41:53 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB3f1603a8f84660db7a654050fedf32c8940e1b57

initial socket draw override

===

M   source/blender/blenkernel/BKE_node.h
M   source/blender/editors/space_node/node_draw.cc
M   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index c2e091b5c0e..d34b3ca26d5 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -223,6 +223,11 @@ typedef int (*NodeGPUExecFunction)(struct GPUMaterial *mat,
struct bNodeExecData *execdata,
struct GPUNodeStack *in,
struct GPUNodeStack *out);
+typedef bool (*NodeDrawSocketFunction)(const struct bContext *C,
+   struct uiLayout *layout,
+   struct bNodeTree *ntree,
+   struct bNode *node,
+   struct bNodeSocket *socket);
 
 /**
  * \brief Defines a node type.
@@ -339,6 +344,10 @@ typedef struct bNodeType {
   NodeGeometryExecFunction geometry_node_execute;
   bool geometry_node_execute_supports_laziness;
 
+  /* Draws a socket in a way specific to this node. If false is returned, the 
socket will be drawn
+   * as usual. */
+  NodeDrawSocketFunction draw_socket;
+
   /* RNA integration */
   ExtensionRNA rna_ext;
 } bNodeType;
diff --git a/source/blender/editors/space_node/node_draw.cc 
b/source/blender/editors/space_node/node_draw.cc
index ad7f1f708f1..ec257f428ca 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -353,6 +353,27 @@ void node_from_view(const bNode *node, float x, float y, 
float *rx, float *ry)
   nodeFromView(node, x, y, rx, ry);
 }
 
+static void draw_socket_layout(
+const bContext *C, uiLayout *layout, bNodeTree *ntree, bNode *node, 
bNodeSocket *socket)
+{
+  if (node->typeinfo->draw_socket) {
+if (node->typeinfo->draw_socket(C, layout, ntree, node, socket)) {
+  return;
+}
+  }
+  uiLayout *row = uiLayoutRow(layout, true);
+  if (socket->in_out == SOCK_OUT) {
+uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT);
+  }
+
+  PointerRNA nodeptr;
+  RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr);
+  PointerRNA sockptr;
+  RNA_pointer_create(&ntree->id, &RNA_NodeSocket, socket, &sockptr);
+  const char *socket_label = nodeSocketLabel(socket);
+  socket->typeinfo->draw((bContext *)C, row, &sockptr, &nodeptr, 
IFACE_(socket_label));
+}
+
 /**
  * Based on settings and sockets in node, set drawing rect info.
  */
@@ -404,11 +425,7 @@ static void node_update_basis(const bContext *C, bNodeTree 
*ntree, bNode *node)
 uiLayoutSetContextPointer(layout, "node", &nodeptr);
 uiLayoutSetContextPointer(layout, "socket", &sockptr);
 
-/* Align output buttons to the right. */
-uiLayout *row = uiLayoutRow(layout, true);
-uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT);
-const char *socket_label = nodeSocketLabel(nsock);
-nsock->typeinfo->draw((bContext *)C, row, &sockptr, &nodeptr, 
IFACE_(socket_label));
+draw_socket_layout(C, layout, ntree, node, nsock);
 
 UI_block_align_end(node->block);
 UI_block_layout_resolve(node->block, nullptr, &buty);
@@ -541,10 +558,7 @@ static void node_update_basis(const bContext *C, bNodeTree 
*ntree, bNode *node)
 uiLayoutSetContextPointer(layout, "node", &nodeptr);
 uiLayoutSetContextPointer(layout, "socket", &sockptr);
 
-uiLayout *row = uiLayoutRow(layout, true);
-
-const char *socket_label = nodeSocketLabel(nsock);
-nsock->typeinfo->draw((bContext *)C, row, &sockptr, &nodeptr, 
IFACE_(socket_label));
+draw_socket_layout(C, layout, ntree, node, nsock);
 
 UI_block_align_end(node->block);
 UI_block_layout_resolve(node->block, nullptr, &buty);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index d6903b0a085..5d08e9d9b82 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
@@ -38,6 +38,13 @@ static void geo_node_geometry_expander_layout(uiLayout 
*layout,
   uiItemO(layout, "Add", ICON_ADD, "node.geometry_expander_output_add");
 }
 
+static bool geo_node_geometry_expande_socket_layout(
+const bContext *C, uiLayout *layout, bNodeTree *ntree, bNode *node, 
bNodeSocket *socket)
+{
+  uiItemL(layout, "Hello World", ICON_NONE);
+  return true;
+}
+
 static

[Bf-blender-cvs] [f8a23fb05ac] temp-geometry-nodes-expandable-geometry-socket-prototype: fix passing values from modifier

2021-08-03 Thread Jacques Lucke
Commit: f8a23fb05acfebc3ae64a4927617e21d4ff894fc
Author: Jacques Lucke
Date:   Tue Aug 3 13:45:34 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rBf8a23fb05acfebc3ae64a4927617e21d4ff894fc

fix passing values from modifier

===

M   source/blender/modifiers/intern/MOD_nodes.cc

===

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc 
b/source/blender/modifiers/intern/MOD_nodes.cc
index 3853b345c14..b67cdbb1cb0 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -86,6 +86,7 @@
 #include "NOD_geometry_nodes_eval_log.hh"
 #include "NOD_node_tree_multi_function.hh"
 
+using blender::Array;
 using blender::destruct_ptr;
 using blender::float3;
 using blender::FunctionRef;
@@ -401,12 +402,14 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket &bso
   },
   [](const IDProperty &property) { return ELEM(property.type, 
IDP_FLOAT, IDP_DOUBLE); },
   [](const IDProperty &property, void *r_value) {
+float value;
 if (property.type == IDP_FLOAT) {
-  *(float *)r_value = IDP_Float(&property);
+  value = IDP_Float(&property);
 }
 else if (property.type == IDP_DOUBLE) {
-  *(float *)r_value = (float)IDP_Double(&property);
+  value = (float)IDP_Double(&property);
 }
+new (r_value) Array({value});
   },
   };
   return &float_type;
@@ -441,7 +444,10 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket &bso
 return (PropertyType)((bNodeSocketValueInt 
*)socket.default_value)->subtype;
   },
   [](const IDProperty &property) { return property.type == IDP_INT; },
-  [](const IDProperty &property, void *r_value) { *(int *)r_value = 
IDP_Int(&property); },
+  [](const IDProperty &property, void *r_value) {
+int value = IDP_Int(&property);
+new (r_value) Array({value});
+  },
   };
   return &int_type;
 }
@@ -485,7 +491,9 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket &bso
property.len == 3;
   },
   [](const IDProperty &property, void *r_value) {
-copy_v3_v3((float *)r_value, (const float *)IDP_Array(&property));
+float3 value;
+copy_v3_v3(value, (const float *)IDP_Array(&property));
+new (r_value) Array({value});
   },
   };
   return &vector_type;
@@ -517,8 +525,10 @@ static const SocketPropertyType 
*get_socket_property_type(const bNodeSocket &bso
   nullptr,
   [](const IDProperty &property) { return property.type == IDP_INT; },
   [](const IDProperty &property, void *r_value) {
-*(bool *)r_value = IDP_Int(&property) != 0;
+bool value = IDP_Int(&property) != 0;
+new (r_value) Array({value});
   },
+
   };
   return &boolean_type;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5d0409c25cd] temp-geometry-nodes-expandable-geometry-socket-prototype: initial array output

2021-08-03 Thread Jacques Lucke
Commit: 5d0409c25cd4e5bc1c3bc4a0101559574a08d0ad
Author: Jacques Lucke
Date:   Tue Aug 3 13:12:18 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB5d0409c25cd4e5bc1c3bc4a0101559574a08d0ad

initial array output

===

M   source/blender/editors/space_node/node_edit.cc
M   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/source/blender/editors/space_node/node_edit.cc 
b/source/blender/editors/space_node/node_edit.cc
index 184dc1d5e85..ac291b7bb83 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -36,6 +36,7 @@
 #include "BLI_math.h"
 
 #include "BKE_context.h"
+#include "BKE_geometry_set.hh"
 #include "BKE_global.h"
 #include "BKE_image.h"
 #include "BKE_lib_id.h"
@@ -3022,6 +3023,8 @@ static int 
node_geometry_expander_output_add_exec(bContext *C, wmOperator *op)
   expander_output->data_identifier = BLI_strdup("position");
   expander_output->socket_identifier = BLI_strdup(identifier.c_str());
   expander_output->socket_type = SOCK_FLOAT;
+  expander_output->component_type = (int)GEO_COMPONENT_TYPE_MESH;
+  expander_output->domain = ATTR_DOMAIN_POINT;
   BLI_addtail(&storage->outputs, expander_output);
 
   nodeUpdate(ntree, node);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index dac908268fc..d6903b0a085 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
@@ -43,8 +43,20 @@ static void 
geo_node_geometry_expander_exec(GeoNodeExecParams params)
   const bNode &bnode = params.node();
   const NodeGeometryGeometryExpander *storage = (const 
NodeGeometryGeometryExpander *)
 bnode.storage;
+  GeometrySet geometry_set = params.extract_input("Geometry");
   LISTBASE_FOREACH (GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
-params.set_output(expander_output->socket_identifier, 0.0f);
+const GeometryComponent *component = geometry_set.get_component_for_read(
+(GeometryComponentType)expander_output->component_type);
+if (component == nullptr) {
+  params.set_output(expander_output->socket_identifier, Array());
+  continue;
+}
+
+GVArray_Typed attribute = component->attribute_get_for_read(
+expander_output->data_identifier, 
(AttributeDomain)expander_output->domain, 0.0f);
+Array values(attribute.size());
+attribute->materialize(values);
+params.set_output(expander_output->socket_identifier, std::move(values));
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dbd34a5acb3] master: Fix T90364: buttons (partially) behind animchannel search block search

2021-08-03 Thread Philipp Oeser
Commit: dbd34a5acb3d0be2bdbad54a427153de49e47f8e
Author: Philipp Oeser
Date:   Mon Aug 2 14:12:44 2021 +0200
Branches: master
https://developer.blender.org/rBdbd34a5acb3d0be2bdbad54a427153de49e47f8e

Fix T90364: buttons (partially) behind animchannel search block search

When channels are scrolled to be (partially) behind the search bar,
their widget buttons would still be interactive, preventing the seach
buttons to be usable.

We have to make sure the events are consumed from the search and dont
reach other UI blocks.
We can do so by flagging the block `UI_BLOCK_CLIP_EVENTS` -- but also
have to make sure the bounds are calculated correctly (otherwise the
check relating `UI_BLOCK_CLIP_EVENTS` in `ui_but_find_mouse_over_ex` wont
trigger properly.

Maniphest Tasks: T90364

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

===

M   source/blender/editors/animation/time_scrub_ui.c

===

diff --git a/source/blender/editors/animation/time_scrub_ui.c 
b/source/blender/editors/animation/time_scrub_ui.c
index 6af033f3cf2..182e61e53b6 100644
--- a/source/blender/editors/animation/time_scrub_ui.c
+++ b/source/blender/editors/animation/time_scrub_ui.c
@@ -244,6 +244,10 @@ void ED_time_scrub_channel_search_draw(const bContext *C, 
ARegion *region, bDope
   UI_block_align_end(block);
   UI_block_layout_resolve(block, NULL, NULL);
 
+  /* Make sure the events are consumed from the search and dont reach other UI 
blocks since this is
+   * drawn on top of animchannels. */
+  UI_block_flag_enable(block, UI_BLOCK_CLIP_EVENTS);
+  UI_block_bounds_set_normal(block, 0);
   UI_block_end(C, block);
   UI_block_draw(C, block);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b35a96e195b] master: Fix T90346: particle force field self effect amount off by one

2021-08-03 Thread Philipp Oeser
Commit: b35a96e195b100dbad68721065f431b168b7945b
Author: Philipp Oeser
Date:   Tue Aug 3 12:36:59 2021 +0200
Branches: master
https://developer.blender.org/rBb35a96e195b100dbad68721065f431b168b7945b

Fix T90346: particle force field self effect amount off by one

When calculating the particle step in `get_effector_tot`, we have to
round up (otherwise we might get an extra round in the for-loop in
`BKE_effectors_apply` for certain cases).

Example from the report:
- 10.000 particles, Effector Amount 3
- was rounding the step down to 
- going into the for-loop for 0, ,  and  (4 times)
- now rounding the step up to 3334
- going into the for-loop for 0, 3334 and 6668 (3 times as desired)

Maniphest Tasks: T90346

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

===

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

===

diff --git a/source/blender/blenkernel/intern/effect.c 
b/source/blender/blenkernel/intern/effect.c
index fc1721eaf3a..334118ddf3f 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -861,7 +861,7 @@ static void get_effector_tot(
   int totpart = eff->psys->totpart;
   int amount = eff->psys->part->effector_amount;
 
-  *step = (totpart > amount) ? totpart / amount : 1;
+  *step = (totpart > amount) ? (int)ceil((float)totpart / (float)amount) : 
1;
 }
   }
   else {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [20d5d7b8ece] master: Blender Readfile: Fix annoying useless Object reading error messages.

2021-08-03 Thread Bastien Montagne
Commit: 20d5d7b8ece6f5e24f75a486e24922e943131dde
Author: Bastien Montagne
Date:   Tue Aug 3 12:54:05 2021 +0200
Branches: master
https://developer.blender.org/rB20d5d7b8ece6f5e24f75a486e24922e943131dde

Blender Readfile: Fix annoying useless Object reading error messages.

Extend the 'reading error' container to produce the generic short
message in the popup directly visible by the user, and move all detailed
info the `INFO` reports that only show up in the console and Info
editor.

===

M   source/blender/blenkernel/intern/object.c
M   source/blender/blenloader/BLO_readfile.h
M   source/blender/windowmanager/intern/wm_files.c

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index a6796d0513c..6a309e040c0 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -144,6 +144,7 @@
 #include "DRW_engine.h"
 
 #include "BLO_read_write.h"
+#include "BLO_readfile.h"
 
 #include "SEQ_sequencer.h"
 
@@ -833,7 +834,7 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
 {
   Object *ob = (Object *)id;
 
-  bool warn = false;
+  BlendFileReadReport *reports = BLO_read_lib_reports(reader);
 
   /* XXX deprecated - old animation system <<< */
   BLO_read_id_address(reader, ob->id.lib, &ob->ipo);
@@ -851,8 +852,8 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
   else {
 if (ob->instance_collection != NULL) {
   ID *new_id = BLO_read_get_new_id_address(reader, ob->id.lib, 
&ob->instance_collection->id);
-  BLO_reportf_wrap(BLO_read_lib_reports(reader),
-   RPT_WARNING,
+  BLO_reportf_wrap(reports,
+   RPT_INFO,
TIP_("Non-Empty object '%s' cannot duplicate collection 
'%s' "
 "anymore in Blender 2.80, removed instancing"),
ob->id.name + 2,
@@ -870,11 +871,17 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
   ob->proxy = NULL;
 
   if (ob->id.lib) {
-printf("Proxy lost from  object %s lib %s\n", ob->id.name + 2, 
ob->id.lib->filepath);
+BLO_reportf_wrap(reports,
+ RPT_INFO,
+ TIP_("Proxy lost from  object %s lib %s\n"),
+ ob->id.name + 2,
+ ob->id.lib->filepath);
   }
   else {
-printf("Proxy lost from  object %s lib \n", ob->id.name + 2);
+BLO_reportf_wrap(
+reports, RPT_INFO, TIP_("Proxy lost from  object %s lib 
\n"), ob->id.name + 2);
   }
+  reports->count.missing_obproxies++;
 }
 else {
   /* this triggers object_update to always use a copy */
@@ -887,15 +894,7 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
   BLO_read_id_address(reader, ob->id.lib, &ob->data);
 
   if (ob->data == NULL && poin != NULL) {
-if (ob->id.lib) {
-  printf("Can't find obdata of %s lib %s\n", ob->id.name + 2, 
ob->id.lib->filepath);
-}
-else {
-  printf("Object %s lost data.\n", ob->id.name + 2);
-}
-
 ob->type = OB_EMPTY;
-warn = true;
 
 if (ob->pose) {
   /* we can't call #BKE_pose_free() here because of library linking
@@ -911,6 +910,18 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
   ob->pose = NULL;
   ob->mode &= ~OB_MODE_POSE;
 }
+
+if (ob->id.lib) {
+  BLO_reportf_wrap(reports,
+   RPT_INFO,
+   TIP_("Can't find obdata of %s lib %s\n"),
+   ob->id.name + 2,
+   ob->id.lib->filepath);
+}
+else {
+  BLO_reportf_wrap(reports, RPT_INFO, TIP_("Object %s lost data\n"), 
ob->id.name + 2);
+}
+reports->count.missing_obdata++;
   }
   for (int a = 0; a < ob->totcol; a++) {
 BLO_read_id_address(reader, ob->id.lib, &ob->mat[a]);
@@ -992,10 +1003,6 @@ static void object_blend_read_lib(BlendLibReader *reader, 
ID *id)
 BLO_read_id_address(reader, ob->id.lib, &ob->rigidbody_constraint->ob1);
 BLO_read_id_address(reader, ob->id.lib, &ob->rigidbody_constraint->ob2);
   }
-
-  if (warn) {
-BLO_reportf_wrap(BLO_read_lib_reports(reader), RPT_WARNING, "Warning in 
console");
-  }
 }
 
 /* XXX deprecated - old animation system */
diff --git a/source/blender/blenloader/BLO_readfile.h 
b/source/blender/blenloader/BLO_readfile.h
index 04e13fbd1d6..c3a33115613 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -108,6 +108,9 @@ typedef struct BlendFileReadReport {
  * during this file read. */
 int missing_libraries;
 int missing_linked_id;
+/* Some sub-categories of the above `missing_linked_id` counter. */
+int missing_obdata;
+int missing_obproxies;
 /

[Bf-blender-cvs] [b78014af978] temp-geometry-nodes-expandable-geometry-socket-prototype: initial search when adding expander output

2021-08-03 Thread Jacques Lucke
Commit: b78014af97874b48524e9fe30827937e85faccb7
Author: Jacques Lucke
Date:   Tue Aug 3 12:39:45 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rBb78014af97874b48524e9fe30827937e85faccb7

initial search when adding expander output

===

M   source/blender/editors/space_node/node_edit.cc

===

diff --git a/source/blender/editors/space_node/node_edit.cc 
b/source/blender/editors/space_node/node_edit.cc
index 70f41d979bc..184dc1d5e85 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -2980,12 +2980,33 @@ void NODE_OT_cryptomatte_layer_remove(wmOperatorType 
*ot)
 
 /* ** Geometry Expander Add Output  *** */
 
-static int node_geometry_expander_output_add_exec(bContext *C, wmOperator 
*UNUSED(op))
+static const EnumPropertyItem 
*node_geometry_expander_output_add_items(bContext *UNUSED(C),
+   
PointerRNA *UNUSED(ptr),
+   
PropertyRNA *UNUSED(prop),
+   bool 
*r_free)
+{
+  EnumPropertyItem *items = NULL;
+  int totitem = 0;
+  EnumPropertyItem item = {0};
+  item.identifier = "HELLO";
+  item.name = "Hello";
+
+  RNA_enum_item_add(&items, &totitem, &item);
+  RNA_enum_item_end(&items, &totitem);
+  *r_free = true;
+  return items;
+}
+
+static int node_geometry_expander_output_add_exec(bContext *C, wmOperator *op)
 {
   SpaceNode *snode = CTX_wm_space_node(C);
-  PointerRNA ptr = CTX_data_pointer_get(C, "node");
-  bNode *node = (bNode *)ptr.data;
-  bNodeTree *ntree = (bNodeTree *)ptr.owner_id;
+  bNodeTree *ntree = snode->edittree;
+  char *node_name = RNA_string_get_alloc(op->ptr, "node_name", nullptr, 0);
+  bNode *node = nodeFindNodebyName(ntree, node_name);
+  MEM_freeN(node_name);
+  if (node == nullptr) {
+return OPERATOR_CANCELLED;
+  }
   NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)node->storage;
 
   auto to_identifier = [](int id) { return "out_" + std::to_string(id); };
@@ -3012,6 +3033,16 @@ static int 
node_geometry_expander_output_add_exec(bContext *C, wmOperator *UNUSE
   return OPERATOR_FINISHED;
 }
 
+static int node_geometry_expander_output_add_invoke(bContext *C,
+wmOperator *op,
+const wmEvent *event)
+{
+  PointerRNA ptr = CTX_data_pointer_get(C, "node");
+  bNode *node = (bNode *)ptr.data;
+  RNA_string_set(op->ptr, "node_name", node->name);
+  return WM_enum_search_invoke(C, op, event);
+}
+
 void NODE_OT_geometry_expander_output_add(wmOperatorType *ot)
 {
   /* identifiers */
@@ -3020,9 +3051,18 @@ void NODE_OT_geometry_expander_output_add(wmOperatorType 
*ot)
   ot->idname = "NODE_OT_geometry_expander_output_add";
 
   /* callbacks */
+  ot->invoke = node_geometry_expander_output_add_invoke;
   ot->exec = node_geometry_expander_output_add_exec;
   ot->poll = ED_operator_node_editable;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+  PropertyRNA *prop;
+
+  prop = RNA_def_string(ot->srna, "node_name", nullptr, 0, "Node Name", "Node 
name");
+
+  prop = RNA_def_enum(ot->srna, "item", DummyRNA_NULL_items, 0, "Item", "");
+  RNA_def_enum_funcs(prop, node_geometry_expander_output_add_items);
+  ot->prop = prop;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ea54cbe1b42] master: USD: add USD importer

2021-08-03 Thread Michael Kowalski
Commit: ea54cbe1b42efb3107285c89685f555c06997062
Author: Michael Kowalski
Date:   Tue Aug 3 11:55:53 2021 +0200
Branches: master
https://developer.blender.org/rBea54cbe1b42efb3107285c89685f555c06997062

USD: add USD importer

This is an initial implementation of a USD importer.

This work is comprised of Tangent Animation's open source USD importer,
combined with features @makowalski had implemented.

The design is very similar to the approach taken in the Alembic
importer. The core functionality resides in a collection of "reader"
classes, each of which is responsible for converting an instance of a
USD prim to the corresponding Blender Object representation.

The flow of control for the conversion can be followed in the
`import_startjob()` and `import_endjob()` functions in `usd_capi.cc`.
The `USDStageReader` class is responsible for traversing the USD stage
and instantiating the appropriate readers.

Reviewed By: sybren, HooglyBoogly

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

===

M   release/scripts/startup/bl_ui/space_topbar.py
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/editors/io/io_ops.c
M   source/blender/editors/io/io_usd.c
M   source/blender/editors/io/io_usd.h
M   source/blender/io/alembic/ABC_alembic.h
M   source/blender/io/alembic/intern/abc_util.h
M   source/blender/io/alembic/intern/alembic_capi.cc
M   source/blender/io/common/CMakeLists.txt
A   source/blender/io/common/IO_types.h
M   source/blender/io/usd/CMakeLists.txt
R092source/blender/io/usd/intern/usd_capi.cc
source/blender/io/usd/intern/usd_capi_export.cc
A   source/blender/io/usd/intern/usd_capi_import.cc
A   source/blender/io/usd/intern/usd_common.cc
A   source/blender/io/usd/intern/usd_common.h
A   source/blender/io/usd/intern/usd_reader_camera.cc
A   source/blender/io/usd/intern/usd_reader_camera.h
A   source/blender/io/usd/intern/usd_reader_curve.cc
A   source/blender/io/usd/intern/usd_reader_curve.h
A   source/blender/io/usd/intern/usd_reader_geom.cc
A   source/blender/io/usd/intern/usd_reader_geom.h
A   source/blender/io/usd/intern/usd_reader_instance.cc
A   source/blender/io/usd/intern/usd_reader_instance.h
A   source/blender/io/usd/intern/usd_reader_light.cc
A   source/blender/io/usd/intern/usd_reader_light.h
A   source/blender/io/usd/intern/usd_reader_material.cc
A   source/blender/io/usd/intern/usd_reader_material.h
A   source/blender/io/usd/intern/usd_reader_mesh.cc
A   source/blender/io/usd/intern/usd_reader_mesh.h
A   source/blender/io/usd/intern/usd_reader_nurbs.cc
A   source/blender/io/usd/intern/usd_reader_nurbs.h
A   source/blender/io/usd/intern/usd_reader_prim.cc
A   source/blender/io/usd/intern/usd_reader_prim.h
A   source/blender/io/usd/intern/usd_reader_stage.cc
A   source/blender/io/usd/intern/usd_reader_stage.h
A   source/blender/io/usd/intern/usd_reader_volume.cc
A   source/blender/io/usd/intern/usd_reader_volume.h
A   source/blender/io/usd/intern/usd_reader_xform.cc
A   source/blender/io/usd/intern/usd_reader_xform.h
M   source/blender/io/usd/usd.h
M   source/blender/makesdna/DNA_cachefile_defaults.h
M   source/blender/makesdna/DNA_cachefile_types.h
M   source/blender/makesrna/intern/rna_cachefile.c
M   source/blender/modifiers/CMakeLists.txt
M   source/blender/modifiers/intern/MOD_meshsequencecache.c

===

diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index 5e68896a2a7..bcf579208a0 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -468,6 +468,9 @@ class TOPBAR_MT_file_import(Menu):
  text="Collada (Default) (.dae)")
 if bpy.app.build_options.alembic:
 self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
+if bpy.app.build_options.usd:
+self.layout.operator(
+"wm.usd_import", text="Universal Scene Description (.usd, 
.usdc, .usda)")
 
 self.layout.operator("wm.gpencil_import_svg", text="SVG as Grease 
Pencil")
 
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 78bfe8c9afb..adaef22d5bc 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -698,6 +698,13 @@ if(WITH_ALEMBIC)
   add_definitions(-DWITH_ALEMBIC)
 endif()
 
+if(WITH_USD)
+  list(APPEND INC
+../io/usd
+  )
+  add_definitions(-DWITH_USD)
+endif()
+
 if(WITH_OPENSUBDIV)
   list(APPEND INC_SYS
 ${OPENSUBDIV_INCLUDE_DIRS}
diff --git a/source/blender/blenkernel/

[Bf-blender-cvs] [28b9dd7b1f0] master: Cleanup: Remove redundant checks in File Browser UI script

2021-08-03 Thread Julian Eisel
Commit: 28b9dd7b1f0a8d4ae56eafca188796936a6e3723
Author: Julian Eisel
Date:   Tue Aug 3 12:24:48 2021 +0200
Branches: master
https://developer.blender.org/rB28b9dd7b1f0a8d4ae56eafca188796936a6e3723

Cleanup: Remove redundant checks in File Browser UI script

Was already checking these preconditions in the poll method.

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py 
b/release/scripts/startup/bl_ui/space_filebrowser.py
index 3189efeb939..9f70d26c71b 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -384,19 +384,17 @@ class FILEBROWSER_PT_advanced_filter(Panel):
 space = context.space_data
 params = space.params
 
-if params and params.use_library_browsing:
-layout.prop(params, "use_filter_blendid")
-if params.use_filter_blendid:
-layout.separator()
-col = layout.column(align=True)
+layout.prop(params, "use_filter_blendid")
+if params.use_filter_blendid:
+layout.separator()
+col = layout.column(align=True)
 
-if context.preferences.experimental.use_asset_browser:
-col.prop(params, "use_filter_asset_only")
+col.prop(params, "use_filter_asset_only")
 
-filter_id = params.filter_id
-for identifier in dir(filter_id):
-if identifier.startswith("filter_"):
-col.prop(filter_id, identifier, toggle=True)
+filter_id = params.filter_id
+for identifier in dir(filter_id):
+if identifier.startswith("filter_"):
+col.prop(filter_id, identifier, toggle=True)
 
 
 def is_option_region_visible(context, space):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c0900a64cee] master: Fix T90341: Crash opening 2.4 file with File Browser editor open

2021-08-03 Thread Julian Eisel
Commit: c0900a64ceeaa46a1dfd1fa19d5b57449fb7788a
Author: Julian Eisel
Date:   Tue Aug 3 12:10:26 2021 +0200
Branches: master
https://developer.blender.org/rBc0900a64ceeaa46a1dfd1fa19d5b57449fb7788a

Fix T90341: Crash opening 2.4 file with File Browser editor open

The file selection parameters (e.g. `context.space_data.params`) are
expected to be unset in certain cases. Reading 2.4 files seems to be one
of them. Hence, code using it should check it's set first. Also added an
assert to a File Browser UI template printing a message when the
parameters are unset, to help debugging the issue.

===

M   release/scripts/startup/bl_ui/space_filebrowser.py
M   source/blender/editors/space_file/file_draw.c

===

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py 
b/release/scripts/startup/bl_ui/space_filebrowser.py
index 44631e368a3..3189efeb939 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -373,6 +373,7 @@ class FILEBROWSER_PT_advanced_filter(Panel):
 def poll(cls, context):
 # only useful in append/link (library) context currently...
 return (
+context.space_data.params and
 context.space_data.params.use_library_browsing and
 panel_poll_is_upper_region(context.region) and
 not panel_poll_is_asset_browsing(context)
@@ -423,6 +424,10 @@ class FILEBROWSER_PT_directory_path(Panel):
 
 return True
 
+@classmethod
+def poll(cls, context):
+return context.space_data.params
+
 def draw(self, context):
 layout = self.layout
 space = context.space_data
diff --git a/source/blender/editors/space_file/file_draw.c 
b/source/blender/editors/space_file/file_draw.c
index 37a56816677..7d9b8583838 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -82,6 +82,9 @@ void ED_file_path_button(bScreen *screen,
   PointerRNA params_rna_ptr;
   uiBut *but;
 
+  BLI_assert_msg(params != NULL,
+ "File select parameters not set. The caller is expected to 
check this.");
+
   RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params, 
¶ms_rna_ptr);
 
   /* callbacks for operator check functions */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4bc27fcdf0f] temp-geometry-nodes-expandable-geometry-socket-prototype: initial support for adding geometry expander outputs

2021-08-03 Thread Jacques Lucke
Commit: 4bc27fcdf0fa48a7cb824721a2a2d54c533223b9
Author: Jacques Lucke
Date:   Tue Aug 3 11:48:51 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB4bc27fcdf0fa48a7cb824721a2a2d54c533223b9

initial support for adding geometry expander outputs

===

M   source/blender/editors/space_node/node_edit.cc
M   source/blender/editors/space_node/node_intern.h
M   source/blender/editors/space_node/node_ops.c
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/source/blender/editors/space_node/node_edit.cc 
b/source/blender/editors/space_node/node_edit.cc
index cbf03f553f6..70f41d979bc 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -22,6 +22,7 @@
  */
 
 #include 
+#include 
 
 #include "MEM_guardedalloc.h"
 
@@ -2976,3 +2977,52 @@ void NODE_OT_cryptomatte_layer_remove(wmOperatorType *ot)
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
+
+/* ** Geometry Expander Add Output  *** */
+
+static int node_geometry_expander_output_add_exec(bContext *C, wmOperator 
*UNUSED(op))
+{
+  SpaceNode *snode = CTX_wm_space_node(C);
+  PointerRNA ptr = CTX_data_pointer_get(C, "node");
+  bNode *node = (bNode *)ptr.data;
+  bNodeTree *ntree = (bNodeTree *)ptr.owner_id;
+  NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)node->storage;
+
+  auto to_identifier = [](int id) { return "out_" + std::to_string(id); };
+
+  int id = 0;
+  while (nodeFindSocket(node, SOCK_OUT, to_identifier(id).c_str()) != nullptr) 
{
+id++;
+  }
+  const std::string identifier = to_identifier(id);
+
+  GeometryExpanderOutput *expander_output = (GeometryExpanderOutput 
*)MEM_callocN(
+  sizeof(GeometryExpanderOutput), __func__);
+  expander_output->data_identifier = BLI_strdup("position");
+  expander_output->socket_identifier = BLI_strdup(identifier.c_str());
+  expander_output->socket_type = SOCK_FLOAT;
+  BLI_addtail(&storage->outputs, expander_output);
+
+  nodeUpdate(ntree, node);
+  ntreeUpdateTree(CTX_data_main(C), ntree);
+
+  snode_notify(C, snode);
+  snode_dag_update(C, snode);
+
+  return OPERATOR_FINISHED;
+}
+
+void NODE_OT_geometry_expander_output_add(wmOperatorType *ot)
+{
+  /* identifiers */
+  ot->name = "Add Geometry Expander Output";
+  ot->description = "Add geometry expander output";
+  ot->idname = "NODE_OT_geometry_expander_output_add";
+
+  /* callbacks */
+  ot->exec = node_geometry_expander_output_add_exec;
+  ot->poll = ED_operator_node_editable;
+
+  /* flags */
+  ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
diff --git a/source/blender/editors/space_node/node_intern.h 
b/source/blender/editors/space_node/node_intern.h
index df20420e472..73520bf3262 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -312,6 +312,8 @@ void NODE_GGT_backdrop_corner_pin(struct wmGizmoGroupType 
*gzgt);
 void NODE_OT_cryptomatte_layer_add(struct wmOperatorType *ot);
 void NODE_OT_cryptomatte_layer_remove(struct wmOperatorType *ot);
 
+void NODE_OT_geometry_expander_output_add(struct wmOperatorType *ot);
+
 /* node_geometry_attribute_search.cc */
 void node_geometry_add_attribute_search_button(const struct bContext *C,
const struct bNodeTree 
*node_tree,
diff --git a/source/blender/editors/space_node/node_ops.c 
b/source/blender/editors/space_node/node_ops.c
index 610c2889e7a..ffe8e9469da 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -124,6 +124,8 @@ void node_operatortypes(void)
 
   WM_operatortype_append(NODE_OT_cryptomatte_layer_add);
   WM_operatortype_append(NODE_OT_cryptomatte_layer_remove);
+
+  WM_operatortype_append(NODE_OT_geometry_expander_output_add);
 }
 
 void ED_operatormacros_node(void)
diff --git a/source/blender/makesdna/DNA_node_types.h 
b/source/blender/makesdna/DNA_node_types.h
index d2bc3d3eb06..22906bc7229 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1419,9 +1419,14 @@ typedef struct NodeGeometryRaycast {
 } NodeGeometryRaycast;
 
 typedef struct GeometryExpanderOutput {
+  struct GeometryExpanderOutput *next, *prev;
+  /* AttributeDomain. */
   int8_t domain;
+  /* GeometryComponentType. */
   int8_t component_type;
-  char _pad[6];
+  /* eNodeSocketDatatype. */
+  int8_t socket_type;
+  char _pad[5];
   char *data_identifier;
   char *socket_identifier;
 } GeometryExpanderOutput;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index d9a048ae218..3298f4b4f95 100644

[Bf-blender-cvs] [ef611546d6b] temp-geometry-nodes-expandable-geometry-socket-prototype: keep already existing links when adding new sockets

2021-08-03 Thread Jacques Lucke
Commit: ef611546d6b9d3479840042fcae570fcd815c0ac
Author: Jacques Lucke
Date:   Tue Aug 3 12:08:23 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rBef611546d6b9d3479840042fcae570fcd815c0ac

keep already existing links when adding new sockets

===

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

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index 3298f4b4f95..dac908268fc 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
@@ -40,8 +40,12 @@ static void geo_node_geometry_expander_layout(uiLayout 
*layout,
 
 static void geo_node_geometry_expander_exec(GeoNodeExecParams params)
 {
-  NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)params.node().storage;
-  UNUSED_VARS(storage);
+  const bNode &bnode = params.node();
+  const NodeGeometryGeometryExpander *storage = (const 
NodeGeometryGeometryExpander *)
+bnode.storage;
+  LISTBASE_FOREACH (GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
+params.set_output(expander_output->socket_identifier, 0.0f);
+  }
 }
 
 static void geo_node_geometry_expander_init(bNodeTree *UNUSED(ntree), bNode 
*node)
@@ -54,19 +58,35 @@ static void geo_node_geometry_expander_init(bNodeTree 
*UNUSED(ntree), bNode *nod
 static void geo_node_geometry_expander_update(bNodeTree *ntree, bNode *node)
 {
   NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)node->storage;
-  LISTBASE_FOREACH_MUTABLE (bNodeSocket *, socket, &node->outputs) {
-nodeRemoveSocket(ntree, node, socket);
+
+  Map old_outputs;
+
+  LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
+old_outputs.add(socket->identifier, socket);
   }
+  VectorSet new_sockets;
   LISTBASE_FOREACH (GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
-const char *idname = nodeStaticSocketType(expander_output->socket_type, 
PROP_NONE);
-nodeAddSocket(ntree,
-  node,
-  SOCK_OUT,
-  idname,
-  expander_output->socket_identifier,
-  expander_output->data_identifier);
+bNodeSocket *socket = 
old_outputs.lookup_default(expander_output->socket_identifier, nullptr);
+if (socket == nullptr) {
+  const char *idname = nodeStaticSocketType(expander_output->socket_type, 
PROP_NONE);
+  socket = nodeAddSocket(ntree,
+ node,
+ SOCK_OUT,
+ idname,
+ expander_output->socket_identifier,
+ expander_output->data_identifier);
+}
+new_sockets.add_new(socket);
+  }
+  LISTBASE_FOREACH_MUTABLE (bNodeSocket *, socket, &node->outputs) {
+if (!new_sockets.contains(socket)) {
+  nodeRemoveSocket(ntree, node, socket);
+}
+  }
+  BLI_listbase_clear(&node->outputs);
+  for (bNodeSocket *socket : new_sockets) {
+BLI_addtail(&node->outputs, socket);
   }
-  // nodeAddSocket(ntree, node, SOCK_OUT, "NodeSocketFloat", "")
 }
 
 static void geo_node_geometry_expander_storage_free(bNode *node)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2cdfb4b9f68] asset-greasepencil: GPencil: Fix problems after merge

2021-08-03 Thread Antonio Vazquez
Commit: 2cdfb4b9f68dd5d5010dcdd15a595ce2f99bb5da
Author: Antonio Vazquez
Date:   Tue Aug 3 11:12:36 2021 +0200
Branches: asset-greasepencil
https://developer.blender.org/rB2cdfb4b9f68dd5d5010dcdd15a595ce2f99bb5da

GPencil: Fix problems after merge

The operator was not executed because the general poll for data import was true 
and always was executed instead of GPencil import operator.

===

M   source/blender/editors/space_view3d/space_view3d.c

===

diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index 889d338e4f0..6f4c81f861e 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -531,12 +531,17 @@ static bool view3d_mat_drop_poll(bContext *C, wmDrag 
*drag, const wmEvent *event
 static bool view3d_object_data_drop_poll(bContext *C, wmDrag *drag, const 
wmEvent *event)
 {
   ID_Type id_type = view3d_drop_id_in_main_region_poll_get_id_type(C, drag, 
event);
-  if (id_type && OB_DATA_SUPPORT_ID(id_type)) {
+  if (id_type && OB_DATA_SUPPORT_ID(id_type) && (id_type != ID_GD)) {
 return true;
   }
   return false;
 }
 
+static bool view3d_gpencil_drop_poll(bContext *C, wmDrag *drag, const wmEvent 
*event)
+{
+  return view3d_drop_id_in_main_region_poll(C, drag, event, ID_GD);
+}
+
 static char *view3d_object_data_drop_tooltip(bContext *UNUSED(C),
  wmDrag *UNUSED(drag),
  const wmEvent *UNUSED(event))
@@ -720,10 +725,11 @@ static void view3d_dropboxes(void)
  view3d_id_drop_copy_with_type,
  WM_drag_free_imported_drag_ID,
  view3d_object_data_drop_tooltip);
+
+  /* TODO(@antoniov): Change to use a temp copy using BLO_library_temp_load_id 
(). */
   WM_dropbox_add(lb,
  "GPENCIL_OT_asset_import",
- view3d_gpencil_data_drop_poll,
- // TODO: Change to use a temp copy using 
BLO_library_temp_load_id ()
+ view3d_gpencil_drop_poll,
  view3d_id_drop_copy_with_type,
  WM_drag_free_imported_drag_ID,
  view3d_object_data_drop_tooltip);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fcad13b5964] asset-greasepencil: Merge branch 'master' into asset-greasepencil

2021-08-03 Thread Antonio Vazquez
Commit: fcad13b5964d0e6f4783e886c8a712c2ea499de0
Author: Antonio Vazquez
Date:   Tue Aug 3 10:39:30 2021 +0200
Branches: asset-greasepencil
https://developer.blender.org/rBfcad13b5964d0e6f4783e886c8a712c2ea499de0

Merge branch 'master' into asset-greasepencil

 Conflicts:
source/blender/editors/space_view3d/space_view3d.c

===



===

diff --cc source/blender/editors/space_view3d/space_view3d.c
index c672bdc8656,a2564469c16..889d338e4f0
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@@ -738,13 -718,8 +718,15 @@@ static void view3d_dropboxes(void
   "OBJECT_OT_data_instance_add",
   view3d_object_data_drop_poll,
   view3d_id_drop_copy_with_type,
-  WM_drag_free_imported_drag_ID);
+  WM_drag_free_imported_drag_ID,
+  view3d_object_data_drop_tooltip);
 +  WM_dropbox_add(lb,
 + "GPENCIL_OT_asset_import",
 + view3d_gpencil_data_drop_poll,
 + // TODO: Change to use a temp copy using 
BLO_library_temp_load_id ()
 + view3d_id_drop_copy_with_type,
-  WM_drag_free_imported_drag_ID);
++ WM_drag_free_imported_drag_ID,
++ view3d_object_data_drop_tooltip);
  }
  
  static void view3d_widgets(void)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4e8935c7b7b] temp-geometry-nodes-expandable-geometry-socket-prototype: Merge branch 'master' into temp-geometry-nodes-expandable-geometry-socket-prototype

2021-08-03 Thread Jacques Lucke
Commit: 4e8935c7b7bc4e2334f759609abbbe3a1c437f1b
Author: Jacques Lucke
Date:   Tue Aug 3 10:47:36 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB4e8935c7b7bc4e2334f759609abbbe3a1c437f1b

Merge branch 'master' into 
temp-geometry-nodes-expandable-geometry-socket-prototype

===



===

diff --cc source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index 8754aaed814,1391587fa7d..c405286f0df
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@@ -1430,17 -1374,29 +1405,48 @@@ class GeometryNodesEvaluator 
  if (type == required_type) {
return {type, buffer};
  }
- if (conversions_.is_convertible(type, required_type)) {
-   /* Convert the loaded value to the required type if possible. */
-   void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
-   conversions_.convert_to_uninitialized(type, required_type, buffer, 
converted_buffer);
-   type.destruct(buffer);
-   return {required_type, converted_buffer};
+ void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
+ this->convert_value(type, required_type, buffer, converted_buffer);
+ return {required_type, converted_buffer};
+   }
+ 
+   void convert_value(const CPPType &from_type,
+  const CPPType &to_type,
+  const void *from_value,
+  void *to_value)
+   {
+ if (from_type == to_type) {
+   from_type.copy_construct(from_value, to_value);
+   return;
+ }
+ 
 -if (conversions_.is_convertible(from_type, to_type)) {
++const ArrayCPPType *from_array_type = dynamic_cast(&from_type);
++const ArrayCPPType *to_array_type = dynamic_cast(&to_type);
++
++if (from_array_type != nullptr && to_array_type != nullptr &&
++conversions_.is_convertible(from_array_type->element_type(),
++to_array_type->element_type())) {
++  const MultiFunction &fn = *conversions_.get_conversion_multi_function(
++  MFDataType::ForSingle(from_array_type->element_type()),
++  MFDataType::ForSingle(to_array_type->element_type()));
++  GSpan from_span = from_array_type->array_span(from_value);
++  const int array_size = from_span.size();
++  GMutableSpan to_span = 
to_array_type->array_construct_uninitialized(to_value, array_size);
++
++  MFParamsBuilder params{fn, array_size};
++  params.add_readonly_single_input(from_span);
++  params.add_uninitialized_single_output(to_span);
++  MFContextBuilder context;
++  fn.call(IndexRange(array_size), params, context);
++}
++else if (conversions_.is_convertible(from_type, to_type)) {
+   /* Do the conversion if possible. */
+   conversions_.convert_to_uninitialized(from_type, to_type, from_value, 
to_value);
+ }
+ else {
+   /* Cannot convert, use default value instead. */
+   to_type.copy_construct(to_type.default_value(), to_value);
  }
- /* Use a default fallback value when the loaded type is not compatible. */
- void *default_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
- required_type.copy_construct(required_type.default_value(), 
default_buffer);
- return {required_type, default_buffer};
}
  
NodeState &get_node_state(const DNode node)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5a5f5a1350d] temp-geometry-nodes-expandable-geometry-socket-prototype: initial geometry expander node storage

2021-08-03 Thread Jacques Lucke
Commit: 5a5f5a1350dcfe24f22ec1a7869ab9b82d192596
Author: Jacques Lucke
Date:   Mon Aug 2 16:37:22 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB5a5f5a1350dcfe24f22ec1a7869ab9b82d192596

initial geometry expander node storage

===

M   source/blender/blenkernel/intern/node.cc
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 1a79ef41a7e..9840a30dd07 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -572,6 +572,15 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree)
 }
 BLO_write_struct_by_name(writer, node->typeinfo->storagename, storage);
   }
+  else if (node->type == GEO_NODE_GEOMETRY_EXPANDER) {
+NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)node->storage;
+BLO_write_struct(writer, NodeGeometryGeometryExpander, storage);
+BLO_write_struct_list(writer, GeometryExpanderOutput, 
&storage->outputs);
+LISTBASE_FOREACH (const GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
+  BLO_write_string(writer, expander_output->data_identifier);
+  BLO_write_string(writer, expander_output->socket_identifier);
+}
+  }
   else if (node->typeinfo != &NodeTypeUndefined) {
 BLO_write_struct_by_name(writer, node->typeinfo->storagename, 
node->storage);
   }
@@ -751,6 +760,15 @@ void ntreeBlendReadData(BlendDataReader *reader, bNodeTree 
*ntree)
   BLO_read_data_address(reader, &storage->string);
   break;
 }
+case GEO_NODE_GEOMETRY_EXPANDER: {
+  NodeGeometryGeometryExpander *storage = 
(NodeGeometryGeometryExpander *)node->storage;
+  BLO_read_list(reader, &storage->outputs);
+  LISTBASE_FOREACH (GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
+BLO_read_data_address(reader, &expander_output->socket_identifier);
+BLO_read_data_address(reader, &expander_output->data_identifier);
+  }
+  break;
+}
 default:
   break;
   }
diff --git a/source/blender/makesdna/DNA_node_types.h 
b/source/blender/makesdna/DNA_node_types.h
index 5152098f57a..d2bc3d3eb06 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1418,6 +1418,18 @@ typedef struct NodeGeometryRaycast {
   char _pad[1];
 } NodeGeometryRaycast;
 
+typedef struct GeometryExpanderOutput {
+  int8_t domain;
+  int8_t component_type;
+  char _pad[6];
+  char *data_identifier;
+  char *socket_identifier;
+} GeometryExpanderOutput;
+
+typedef struct NodeGeometryGeometryExpander {
+  ListBase outputs;
+} NodeGeometryExpander;
+
 /* script node mode */
 #define NODE_SCRIPT_INTERNAL 0
 #define NODE_SCRIPT_EXTERNAL 1
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
index 588b6d0a75c..d9a048ae218 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
@@ -31,9 +31,52 @@ static bNodeSocketTemplate geo_node_geometry_expander_in[] = 
{
 
 namespace blender::nodes {
 
+static void geo_node_geometry_expander_layout(uiLayout *UNUSED(layout),
+  bContext *UNUSED(C),
+  PointerRNA *UNUSED(ptr))
+{
+}
+
 static void geo_node_geometry_expander_exec(GeoNodeExecParams params)
 {
-  UNUSED_VARS(params);
+  NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)params.node().storage;
+  UNUSED_VARS(storage);
+}
+
+static void geo_node_geometry_expander_init(bNodeTree *UNUSED(ntree), bNode 
*node)
+{
+  NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)MEM_callocN(
+  sizeof(NodeGeometryGeometryExpander), __func__);
+  node->storage = storage;
+}
+
+static void geo_node_geometry_expander_storage_free(bNode *node)
+{
+  NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander 
*)node->storage;
+  LISTBASE_FOREACH_MUTABLE (GeometryExpanderOutput *, expander_output, 
&storage->outputs) {
+MEM_freeN(expander_output->data_identifier);
+MEM_freeN(expander_output->socket_identifier);
+MEM_freeN(expander_output);
+  }
+  MEM_freeN(storage);
+}
+
+static void geo_node_geometry_expander_storage_copy(bNodeTree 
*UNUSED(dest_ntree),
+bNode *dst_node,
+const bNode *src_node)
+{
+  NodeGeometryGeometryEx

[Bf-blender-cvs] [60adfd93afc] temp-geometry-nodes-expandable-geometry-socket-prototype: initial geometry expander node

2021-08-03 Thread Jacques Lucke
Commit: 60adfd93afc473eba5f5bf0a8030ade9ae4153bd
Author: Jacques Lucke
Date:   Mon Aug 2 15:59:58 2021 +0200
Branches: temp-geometry-nodes-expandable-geometry-socket-prototype
https://developer.blender.org/rB60adfd93afc473eba5f5bf0a8030ade9ae4153bd

initial geometry expander node

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 09820291222..b84275a7ae8 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -529,6 +529,7 @@ geometry_node_categories = [
 NodeItem("GeometryNodeJoinGeometry"),
 NodeItem("GeometryNodeSeparateComponents"),
 NodeItem("GeometryNodeRaycast"),
+NodeItem("GeometryNodeGeometryExpander"),
 ]),
 GeometryNodeCategory("GEO_INPUT", "Input", items=[
 NodeItem("GeometryNodeObjectInfo"),
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index a1bc6fa505b..c2e091b5c0e 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1475,6 +1475,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070
 #define GEO_NODE_CURVE_TRIM 1071
 #define GEO_NODE_CURVE_SET_HANDLES 1072
+#define GEO_NODE_GEOMETRY_EXPANDER 1073
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 9888e23a7bd..1a79ef41a7e 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -5155,6 +5155,7 @@ static void registerGeometryNodes()
   register_node_type_geo_curve_trim();
   register_node_type_geo_delete_geometry();
   register_node_type_geo_edge_split();
+  register_node_type_geo_geometry_expander();
   register_node_type_geo_input_material();
   register_node_type_geo_is_viewport();
   register_node_type_geo_join_geometry();
diff --git a/source/blender/nodes/CMakeLists.txt 
b/source/blender/nodes/CMakeLists.txt
index 36e5be6a292..a927568315a 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -182,6 +182,7 @@ set(SRC
   geometry/nodes/node_geo_curve_trim.cc
   geometry/nodes/node_geo_delete_geometry.cc
   geometry/nodes/node_geo_edge_split.cc
+  geometry/nodes/node_geo_geometry_expander.cc
   geometry/nodes/node_geo_input_material.cc
   geometry/nodes/node_geo_is_viewport.cc
   geometry/nodes/node_geo_join_geometry.cc
diff --git a/source/blender/nodes/NOD_geometry.h 
b/source/blender/nodes/NOD_geometry.h
index 868fcbb33af..b45748c87bb 100644
--- a/source/blender/nodes/NOD_geometry.h
+++ b/source/blender/nodes/NOD_geometry.h
@@ -69,6 +69,7 @@ void register_node_type_geo_curve_to_points(void);
 void register_node_type_geo_curve_trim(void);
 void register_node_type_geo_delete_geometry(void);
 void register_node_type_geo_edge_split(void);
+void register_node_type_geo_geometry_expander(void);
 void register_node_type_geo_input_material(void);
 void register_node_type_geo_is_viewport(void);
 void register_node_type_geo_join_geometry(void);
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index a091f28f3a0..630e9be1528 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -309,6 +309,7 @@ DefNode(GeometryNode, GEO_NODE_CURVE_TO_POINTS, 
def_geo_curve_to_points, "CURVE_
 DefNode(GeometryNode, GEO_NODE_CURVE_TRIM, def_geo_curve_trim, "CURVE_TRIM", 
CurveTrim, "Curve Trim", "")
 DefNode(GeometryNode, GEO_NODE_DELETE_GEOMETRY, 0, "DELETE_GEOMETRY", 
DeleteGeometry, "Delete Geometry", "")
 DefNode(GeometryNode, GEO_NODE_EDGE_SPLIT, 0, "EDGE_SPLIT", EdgeSplit, "Edge 
Split", "")
+DefNode(GeometryNode, GEO_NODE_GEOMETRY_EXPANDER, 0, "GEOMETRY_EXPANDER", 
GeometryExpander, "Geometry Expander", "")
 DefNode(GeometryNode, GEO_NODE_INPUT_MATERIAL, def_geo_input_material, 
"INPUT_MATERIAL", InputMaterial, "Material", "")
 DefNode(GeometryNode, GEO_NODE_IS_VIEWPORT, 0, "IS_VIEWPORT", IsViewport, "Is 
Viewport", "")
 DefNode(GeometryNode, GEO_NODE_JOIN_GEOMETRY, 0, "JOIN_GEOMETRY", 
JoinGeometry, "Join Geometry", "")
diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc 
b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
new file mode 100644
index 000..588b6d0a75c
--- /dev/null
+++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc
@@ -0,0 +1,50 @@
+/*
+ * Thi

[Bf-blender-cvs] [2ceeaf95a1a] temp-geometry-nodes-fields-prototype: Merge branch 'master' into temp-geometry-nodes-fields-prototype

2021-08-03 Thread Jacques Lucke
Commit: 2ceeaf95a1a4ac15a9e217e9d81c19473accc2c2
Author: Jacques Lucke
Date:   Tue Aug 3 10:44:41 2021 +0200
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB2ceeaf95a1a4ac15a9e217e9d81c19473accc2c2

Merge branch 'master' into temp-geometry-nodes-fields-prototype

===



===

diff --cc source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index 38f0188eeb9,1391587fa7d..188cce694ea
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@@ -1439,17 -1374,29 +1419,43 @@@ class GeometryNodesEvaluator 
  if (type == required_type) {
return {type, buffer};
  }
- if (conversions_.is_convertible(type, required_type)) {
-   /* Convert the loaded value to the required type if possible. */
-   void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
-   conversions_.convert_to_uninitialized(type, required_type, buffer, 
converted_buffer);
-   type.destruct(buffer);
-   return {required_type, converted_buffer};
+ void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
+ this->convert_value(type, required_type, buffer, converted_buffer);
+ return {required_type, converted_buffer};
+   }
+ 
+   void convert_value(const CPPType &from_type,
+  const CPPType &to_type,
+  const void *from_value,
+  void *to_value)
+   {
+ if (from_type == to_type) {
+   from_type.copy_construct(from_value, to_value);
+   return;
+ }
+ 
 -if (conversions_.is_convertible(from_type, to_type)) {
++const bke::FieldRefCPPType *from_field_type = dynamic_cast(
++&from_type);
++const bke::FieldRefCPPType *to_field_type = dynamic_cast(
++&to_type);
++
++if (from_field_type != nullptr && to_field_type != nullptr &&
++conversions_.is_convertible(from_field_type->field_type(), 
to_field_type->field_type())) {
++  const MultiFunction &fn = *conversions_.get_conversion_multi_function(
++  MFDataType::ForSingle(from_field_type->field_type()),
++  MFDataType::ForSingle(to_field_type->field_type()));
++  FieldPtr old_field = from_field_type->get_field(from_value);
++  FieldPtr new_field = new bke::MultiFunctionField({old_field}, fn, 1);
++  to_field_type->construct(to_value, std::move(new_field));
++}
++else if (conversions_.is_convertible(from_type, to_type)) {
+   /* Do the conversion if possible. */
+   conversions_.convert_to_uninitialized(from_type, to_type, from_value, 
to_value);
+ }
+ else {
+   /* Cannot convert, use default value instead. */
+   to_type.copy_construct(to_type.default_value(), to_value);
  }
- /* Use a default fallback value when the loaded type is not compatible. */
- void *default_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
- required_type.copy_construct(required_type.default_value(), 
default_buffer);
- return {required_type, default_buffer};
}
  
NodeState &get_node_state(const DNode node)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b1a607ce04f] master: Cleanup: deduplicate type conversion logic

2021-08-03 Thread Jacques Lucke
Commit: b1a607ce04fecae7af4474f7b087993ec2cf8e5b
Author: Jacques Lucke
Date:   Tue Aug 3 10:38:12 2021 +0200
Branches: master
https://developer.blender.org/rBb1a607ce04fecae7af4474f7b087993ec2cf8e5b

Cleanup: deduplicate type conversion logic

===

M   source/blender/modifiers/intern/MOD_nodes_evaluator.cc

===

diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc 
b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index 2157092d639..1391587fa7d 100644
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@ -1245,14 +1245,8 @@ class GeometryNodesEvaluator {
 void *buffer = allocator.allocate(to_type.size(), to_type.alignment());
 GMutablePointer value{to_type, buffer};
 
-if (conversions_.is_convertible(from_type, to_type)) {
-  /* Do the conversion if possible. */
-  conversions_.convert_to_uninitialized(from_type, to_type, 
value_to_forward.get(), buffer);
-}
-else {
-  /* Cannot convert, use default value instead. */
-  to_type.copy_construct(to_type.default_value(), buffer);
-}
+this->convert_value(from_type, to_type, value_to_forward.get(), buffer);
+
 /* Multi input socket values are logged once all values are available. */
 if (!to_socket->is_multi_input_socket()) {
   this->log_socket_value({to_socket}, value);
@@ -1380,17 +1374,29 @@ class GeometryNodesEvaluator {
 if (type == required_type) {
   return {type, buffer};
 }
-if (conversions_.is_convertible(type, required_type)) {
-  /* Convert the loaded value to the required type if possible. */
-  void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
-  conversions_.convert_to_uninitialized(type, required_type, buffer, 
converted_buffer);
-  type.destruct(buffer);
-  return {required_type, converted_buffer};
+void *converted_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
+this->convert_value(type, required_type, buffer, converted_buffer);
+return {required_type, converted_buffer};
+  }
+
+  void convert_value(const CPPType &from_type,
+ const CPPType &to_type,
+ const void *from_value,
+ void *to_value)
+  {
+if (from_type == to_type) {
+  from_type.copy_construct(from_value, to_value);
+  return;
+}
+
+if (conversions_.is_convertible(from_type, to_type)) {
+  /* Do the conversion if possible. */
+  conversions_.convert_to_uninitialized(from_type, to_type, from_value, 
to_value);
+}
+else {
+  /* Cannot convert, use default value instead. */
+  to_type.copy_construct(to_type.default_value(), to_value);
 }
-/* Use a default fallback value when the loaded type is not compatible. */
-void *default_buffer = allocator.allocate(required_type.size(), 
required_type.alignment());
-required_type.copy_construct(required_type.default_value(), 
default_buffer);
-return {required_type, default_buffer};
   }
 
   NodeState &get_node_state(const DNode node)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5955d7ffd52] asset-greasepencil: GPencil: Split tags

2021-08-03 Thread Antonio Vazquez
Commit: 5955d7ffd52d8986812b8dadf11be4aa8ec52c5e
Author: Antonio Vazquez
Date:   Tue Aug 3 10:36:28 2021 +0200
Branches: asset-greasepencil
https://developer.blender.org/rB5955d7ffd52d8986812b8dadf11be4aa8ec52c5e

GPencil: Split tags

Add Animation tag separated of Grease Pencil Tag

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_asset.c 
b/source/blender/editors/gpencil/gpencil_asset.c
index d678bd4a8d1..b5257fbe478 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -361,10 +361,12 @@ static bool gpencil_asset_create(const bContext *C,
 
   /* Mark as asset. */
   if (ED_asset_mark_id(C, &gpd->id)) {
-const char *tags[] = {"Grease Pencil Strokes", "Grease Pencil Animation"};
-/* Add tag to asset. */
-int index = (is_animation) ? 1 : 0;
-BKE_asset_metadata_tag_ensure(gpd->id.asset_data, tags[index]);
+const char *tags[] = {"Grease Pencil", "Animation"};
+/* Add tags to asset. */
+BKE_asset_metadata_tag_ensure(gpd->id.asset_data, tags[0]);
+if (is_animation) {
+  BKE_asset_metadata_tag_ensure(gpd->id.asset_data, tags[1]);
+}
 
 /* Retime frame number to start by 1. Must be done after generate the 
render preview. */
 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d6e97a53abf] master: Correct task ID in 00b57136e4167ef5a303b1215574bb52a22e9194

2021-08-03 Thread Campbell Barton
Commit: d6e97a53abfbf1ba28c6c30a4bb3faa8561ebd47
Author: Campbell Barton
Date:   Tue Aug 3 18:06:42 2021 +1000
Branches: master
https://developer.blender.org/rBd6e97a53abfbf1ba28c6c30a4bb3faa8561ebd47

Correct task ID in 00b57136e4167ef5a303b1215574bb52a22e9194

===

M   source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c

===

diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c 
b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
index d01331bd497..1af489b60ce 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
@@ -469,7 +469,7 @@ void MESH_GGT_spin(struct wmGizmoGroupType *gzgt)
   gzgt->poll = ED_gizmo_poll_or_unlink_delayed_from_tool;
   gzgt->setup = gizmo_mesh_spin_init_setup;
   /* This works well with right click selection but overrides left-mouse 
selection
-   * when clicking which is needed to create a full 360 degree revolution, 
see: T86030. */
+   * when clicking which is needed to create a full 360 degree revolution, 
see: T89912. */
   // gzgt->setup_keymap = WM_gizmogroup_setup_keymap_generic_maybe_drag;
   gzgt->refresh = gizmo_mesh_spin_init_refresh;
   gzgt->message_subscribe = gizmo_mesh_spin_init_message_subscribe;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f8abc3fb2fd] master: Fix T85436: Separate by loose parts doesn't show new objects

2021-08-03 Thread Campbell Barton
Commit: f8abc3fb2fd3ec883a13ff5e692550b38479f81f
Author: Campbell Barton
Date:   Tue Aug 3 18:08:10 2021 +1000
Branches: master
https://developer.blender.org/rBf8abc3fb2fd3ec883a13ff5e692550b38479f81f

Fix T85436: Separate by loose parts doesn't show new objects

Only the "changed" state from the last edit-object was used,
this meant the operator would not perform the necessary update
with multi-object edit-mode.

Use "changed" & "changed_multi" naming convention.

===

M   source/blender/editors/mesh/editmesh_tools.c

===

diff --git a/source/blender/editors/mesh/editmesh_tools.c 
b/source/blender/editors/mesh/editmesh_tools.c
index 7e94383390e..215ce0185f1 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -4666,7 +4666,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
   Scene *scene = CTX_data_scene(C);
   ViewLayer *view_layer = CTX_data_view_layer(C);
   const int type = RNA_enum_get(op->ptr, "type");
-  int retval = 0;
+  bool changed_multi = false;
 
   if (ED_operator_editmesh(C)) {
 uint bases_len = 0;
@@ -4676,6 +4676,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
 for (uint bs_index = 0; bs_index < bases_len; bs_index++) {
   Base *base = bases[bs_index];
   BMEditMesh *em = BKE_editmesh_from_object(base->object);
+  bool changed = false;
 
   if (type == 0) {
 if ((em->bm->totvertsel == 0) && (em->bm->totedgesel == 0) && 
(em->bm->totfacesel == 0)) {
@@ -4690,20 +4691,20 @@ static int edbm_separate_exec(bContext *C, wmOperator 
*op)
   /* editmode separate */
   switch (type) {
 case MESH_SEPARATE_SELECTED:
-  retval = mesh_separate_selected(bmain, scene, view_layer, base, 
em->bm);
+  changed = mesh_separate_selected(bmain, scene, view_layer, base, 
em->bm);
   break;
 case MESH_SEPARATE_MATERIAL:
-  retval = mesh_separate_material(bmain, scene, view_layer, base, 
em->bm);
+  changed = mesh_separate_material(bmain, scene, view_layer, base, 
em->bm);
   break;
 case MESH_SEPARATE_LOOSE:
-  retval = mesh_separate_loose(bmain, scene, view_layer, base, em->bm);
+  changed = mesh_separate_loose(bmain, scene, view_layer, base, 
em->bm);
   break;
 default:
   BLI_assert(0);
   break;
   }
 
-  if (retval) {
+  if (changed) {
 EDBM_update(base->object->data,
 &(const struct EDBMUpdate_Params){
 .calc_looptri = true,
@@ -4711,6 +4712,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
 .is_destructive = true,
 });
   }
+  changed_multi |= changed;
 }
 MEM_freeN(bases);
   }
@@ -4727,7 +4729,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
 Mesh *me = ob->data;
 if (!ID_IS_LINKED(me)) {
   BMesh *bm_old = NULL;
-  int retval_iter = 0;
+  bool changed = false;
 
   bm_old = BM_mesh_create(&bm_mesh_allocsize_default,
   &((struct BMeshCreateParams){
@@ -4738,17 +4740,17 @@ static int edbm_separate_exec(bContext *C, wmOperator 
*op)
 
   switch (type) {
 case MESH_SEPARATE_MATERIAL:
-  retval_iter = mesh_separate_material(bmain, scene, view_layer, 
base_iter, bm_old);
+  changed = mesh_separate_material(bmain, scene, view_layer, 
base_iter, bm_old);
   break;
 case MESH_SEPARATE_LOOSE:
-  retval_iter = mesh_separate_loose(bmain, scene, view_layer, 
base_iter, bm_old);
+  changed = mesh_separate_loose(bmain, scene, view_layer, 
base_iter, bm_old);
   break;
 default:
   BLI_assert(0);
   break;
   }
 
-  if (retval_iter) {
+  if (changed) {
 BM_mesh_bm_to_me(bmain,
  bm_old,
  me,
@@ -4762,14 +4764,14 @@ static int edbm_separate_exec(bContext *C, wmOperator 
*op)
 
   BM_mesh_free(bm_old);
 
-  retval |= retval_iter;
+  changed_multi |= changed;
 }
   }
 }
 CTX_DATA_END;
   }
 
-  if (retval) {
+  if (changed_multi) {
 /* delay depsgraph recalc until all objects are duplicated */
 DEG_relations_tag_update(bmain);
 WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b54e741a8b5] master: UI: Add light count to viewport statistics

2021-08-03 Thread Falk David
Commit: b54e741a8b5655208ae53639885afe15c5e8
Author: Falk David
Date:   Tue Aug 3 09:41:08 2021 +0200
Branches: master
https://developer.blender.org/rBb54e741a8b5655208ae53639885afe15c5e8

UI: Add light count to viewport statistics

Even though lights were part of `SceneStats`, they were not used when
rBfd10ac9acaa0 was committed.

This patch adds the light count back into the statistics. When a light is
the active object, it will display the total number of lights in the
scene, as well as how many lights are currently selected.

{F10141354}

Reviewed By: #user_interface, Severin, Blendify, harley

Maniphest Tasks: T88512

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

===

M   source/blender/editors/space_info/info_stats.c

===

diff --git a/source/blender/editors/space_info/info_stats.c 
b/source/blender/editors/space_info/info_stats.c
index d7671a372c6..983e04127e0 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -764,6 +764,7 @@ void ED_info_draw_stats(
 FRAMES,
 STROKES,
 POINTS,
+LIGHTS,
 MAX_LABELS_COUNT
   };
   char labels[MAX_LABELS_COUNT][64];
@@ -779,6 +780,7 @@ void ED_info_draw_stats(
   STRNCPY(labels[FRAMES], IFACE_("Frames"));
   STRNCPY(labels[STROKES], IFACE_("Strokes"));
   STRNCPY(labels[POINTS], IFACE_("Points"));
+  STRNCPY(labels[LIGHTS], IFACE_("Lights"));
 
   int longest_label = 0;
   int i;
@@ -832,6 +834,9 @@ void ED_info_draw_stats(
   stats_row(col1, labels[FACES], col2, stats_fmt.totfacesculpt, 
stats_fmt.totface, y, height);
 }
   }
+  else if ((ob) && (ob->type == OB_LAMP)) {
+stats_row(col1, labels[LIGHTS], col2, stats_fmt.totlampsel, 
stats_fmt.totlamp, y, height);
+  }
   else {
 stats_row(col1, labels[VERTS], col2, stats_fmt.totvert, NULL, y, height);
 stats_row(col1, labels[EDGES], col2, stats_fmt.totedge, NULL, y, height);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs