[Bf-blender-cvs] [16c18c5bfb6] soc-2019-outliner: Outliner: Comments cleanup

2019-08-13 Thread Nathan Craddock
Commit: 16c18c5bfb61cf7e6e1bf6c048446e257c7b2cad
Author: Nathan Craddock
Date:   Tue Aug 13 21:50:34 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB16c18c5bfb61cf7e6e1bf6c048446e257c7b2cad

Outliner: Comments cleanup

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index f96a78b1fc1..6f5a5de0da7 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -253,9 +253,7 @@ static eOLDrawState active_viewlayer(bContext *C,
 }
 
 /**
- * Select object tree:
- * ALT+LMB: Select/Deselect object and all children.
- * CTRL+ALT+LMB: Add/Remove object and all children.
+ * Select object tree
  */
 static void do_outliner_object_select_recursive(ViewLayer *view_layer,
 Object *ob_parent,

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


[Bf-blender-cvs] [ec3cd8d400e] soc-2019-outliner: Outliner: Fix selection syncing for edit bones

2019-08-13 Thread Nathan Craddock
Commit: ec3cd8d400e0c270ceccd740b9d137b8ca850e25
Author: Nathan Craddock
Date:   Tue Aug 13 21:19:46 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBec3cd8d400e0c270ceccd740b9d137b8ca850e25

Outliner: Fix selection syncing for edit bones

Fixes selection syncing from outliner for edit bones not tagging
for updates.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index 3f9988af3f7..bae19aa751c 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -258,13 +258,16 @@ static void outliner_select_sync_to_object(ViewLayer 
*view_layer,
   }
 }
 
-static void outliner_select_sync_to_edit_bone(TreeElement *te,
+static void outliner_select_sync_to_edit_bone(ViewLayer *view_layer,
+  TreeElement *te,
   TreeStoreElem *tselem,
   ListBase *selected_ebones)
 {
   bArmature *arm = (bArmature *)tselem->id;
   EditBone *ebone = (EditBone *)te->directdata;
 
+  short bone_flag = ebone->flag;
+
   if (EBONE_SELECTABLE(arm, ebone)) {
 if (tselem->flag & TSE_SELECTED) {
   ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
@@ -275,6 +278,13 @@ static void outliner_select_sync_to_edit_bone(TreeElement 
*te,
   ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
 }
   }
+
+  /* Tag if selection changed */
+  if (bone_flag != ebone->flag) {
+Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
+DEG_id_tag_update(>id, ID_RECALC_SELECT);
+WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, obedit);
+  }
 }
 
 static void outliner_select_sync_to_pose_bone(TreeElement *te,
@@ -339,7 +349,7 @@ static void outliner_sync_selection_from_outliner(Scene 
*scene,
 }
 else if (tselem->type == TSE_EBONE) {
   if (sync_types->edit_bone) {
-outliner_select_sync_to_edit_bone(te, tselem, 
selected_items->edit_bones);
+outliner_select_sync_to_edit_bone(view_layer, te, tselem, 
selected_items->edit_bones);
   }
 }
 else if (tselem->type == TSE_POSE_CHANNEL) {

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


[Bf-blender-cvs] [919d1b53aed] soc-2019-outliner: Outliner: Fix selection syncing of linked items

2019-08-13 Thread Nathan Craddock
Commit: 919d1b53aedf5a153df0c074c1266427220ebec5
Author: Nathan Craddock
Date:   Tue Aug 13 21:04:17 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB919d1b53aedf5a153df0c074c1266427220ebec5

Outliner: Fix selection syncing of linked items

When an item was linked to multiple collections, an outliner select
would sync the selection state of the last instance, deselecting
even if a previous element was selected.

Selection syncing from the outliner now maintains lists of selected
objects and bones to prevent syncing errors.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index 6d1346a56fa..3f9988af3f7 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -23,13 +23,18 @@
 
 #include 
 
+#include "MEM_guardedalloc.h"
+
 #include "DNA_armature_types.h"
 #include "DNA_layer_types.h"
+#include "DNA_listBase.h"
 #include "DNA_outliner_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
 #include "DNA_space_types.h"
 
+#include "BLI_listbase.h"
+
 #include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_layer.h"
@@ -154,9 +159,88 @@ static void 
outliner_sync_select_to_outliner_set_types(const bContext *C,
  (soops->sync_select_dirty & 
WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE);
 }
 
+/**
+ * Stores items selected from a sync from the outliner. Prevents syncing the 
selection
+ * state of the last instance of an object linked in multiple collections.
+ */
+typedef struct SelectedItems {
+  ListBase *objects;
+  ListBase *edit_bones;
+  ListBase *pose_bones;
+} SelectedItems;
+
+static void selected_items_init(SelectedItems *selected_items)
+{
+  selected_items->objects = MEM_callocN(sizeof(ListBase), "selected_objects");
+  selected_items->edit_bones = MEM_callocN(sizeof(ListBase), 
"selected_ebones");
+  selected_items->pose_bones = MEM_callocN(sizeof(ListBase), 
"selected_pbones");
+}
+
+static void selected_items_free(SelectedItems *selected_items)
+{
+  BLI_freelistN(selected_items->objects);
+  MEM_freeN(selected_items->objects);
+  BLI_freelistN(selected_items->edit_bones);
+  MEM_freeN(selected_items->edit_bones);
+  BLI_freelistN(selected_items->pose_bones);
+  MEM_freeN(selected_items->pose_bones);
+}
+
+/* Check if an instance of this object been selected by the sync */
+static bool is_object_selected(ListBase *selected_objects, Base *base)
+{
+  for (LinkData *item = selected_objects->first; item; item = item->next) {
+Base *selected_base = (Base *)item->data;
+
+if (base == selected_base) {
+  return true;
+}
+  }
+
+  return false;
+}
+
+/* Check if an instance of this edit bone been selected by the sync */
+static bool is_edit_bone_selected(ListBase *selected_ebones, EditBone *ebone)
+{
+  for (LinkData *item = selected_ebones->first; item; item = item->next) {
+EditBone *selected_ebone = (EditBone *)item->data;
+
+if (ebone == selected_ebone) {
+  return true;
+}
+  }
+
+  return false;
+}
+
+/* Check if an instance of this pose bone been selected by the sync */
+static bool is_pose_bone_selected(ListBase *selected_pbones, bPoseChannel 
*pchan)
+{
+  for (LinkData *item = selected_pbones->first; item; item = item->next) {
+bPoseChannel *selected_pchan = (bPoseChannel *)item->data;
+
+if (pchan == selected_pchan) {
+  return true;
+}
+  }
+
+  return false;
+}
+
+/* Add element's data to selected item list */
+static void add_selected_item(ListBase *selected_list, void *data)
+{
+  LinkData *link = MEM_callocN(sizeof(LinkData), "selected_item");
+  link->data = data;
+
+  BLI_addtail(selected_list, link);
+}
+
 static void outliner_select_sync_to_object(ViewLayer *view_layer,
TreeElement *te,
-   TreeStoreElem *tselem)
+   TreeStoreElem *tselem,
+   ListBase *selected_objects)
 {
   Object *ob = (Object *)tselem->id;
   Base *base = (te->directdata) ? (Base *)te->directdata :
@@ -165,14 +249,18 @@ static void outliner_select_sync_to_object(ViewLayer 
*view_layer,
   if (base && (base->flag & BASE_SELECTABLE)) {
 if (tselem->flag & TSE_SELECTED) {
   ED_object_base_select(base, BA_SELECT);
+
+  add_selected_item(selected_objects, base);
 }
-else {
+else if (!is_object_selected(selected_objects, base)) {
   ED_object_base_select(base, BA_DESELECT);
 }
   }
 }
 
-static void outliner_select_sync_to_edit_bone(TreeElement *te, TreeStoreElem 
*tselem)
+static void outliner_select_sync_to_edit_bone(TreeElement *te,
+   

[Bf-blender-cvs] [dbed7dba223] soc-2019-outliner: Outliner: Use interaction mode to restrict syncing

2019-08-13 Thread Nathan Craddock
Commit: dbed7dba223f0cd3c18529217396fb661c3a9fa7
Author: Nathan Craddock
Date:   Sat Aug 10 22:25:36 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBdbed7dba223f0cd3c18529217396fb661c3a9fa7

Outliner: Use interaction mode to restrict syncing

Use the current interation mode to prevent syncing from getting out
of sync. Because the bone elements shown in object mode are not the
same elemens as in pose or edit mode, it is necessary to only sync
bones in bone edit or pose mode.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index e4087c9d821..6d1346a56fa 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -112,15 +112,22 @@ typedef struct SyncSelectTypes {
   bool sequence;
 } SyncSelectTypes;
 
-/** Set which types of data to sync when syncing selection from the outliner. 
*/
-static void outliner_sync_select_from_outliner_set_types(SpaceOutliner *soops,
+/**
+ * Set which types of data to sync when syncing selection from the outliner 
based on object
+ * interaction mode and outliner display mode
+ */
+static void outliner_sync_select_from_outliner_set_types(bContext *C,
+ SpaceOutliner *soops,
  SyncSelectTypes 
*sync_types)
 {
+  Object *obact = CTX_data_active_object(C);
+  Object *obedit = CTX_data_edit_object(C);
+
   const bool sequence_view = soops->outlinevis == SO_SEQUENCE;
 
-  sync_types->object = !sequence_view;
-  sync_types->edit_bone = !sequence_view;
-  sync_types->pose_bone = !sequence_view;
+  sync_types->object = !sequence_view && (obact && obact->mode == 
OB_MODE_OBJECT);
+  sync_types->edit_bone = !sequence_view && (obedit && obedit->type == 
OB_ARMATURE);
+  sync_types->pose_bone = !sequence_view && (obact && obact->mode == 
OB_MODE_POSE);
   sync_types->sequence = sequence_view;
 }
 
@@ -128,16 +135,20 @@ static void 
outliner_sync_select_from_outliner_set_types(SpaceOutliner *soops,
  * Current dirty flags and outliner display mode determine which type of 
syncing should occur.
  * This is to ensure sync flag data is not lost on sync in the wrong display 
mode.
  */
-static void outliner_sync_select_to_outliner_set_types(SpaceOutliner *soops,
+static void outliner_sync_select_to_outliner_set_types(const bContext *C,
+   SpaceOutliner *soops,
SyncSelectTypes 
*sync_types)
 {
+  Object *obact = CTX_data_active_object(C);
+  Object *obedit = CTX_data_edit_object(C);
+
   const bool sequence_view = soops->outlinevis == SO_SEQUENCE;
 
-  sync_types->object = !sequence_view &&
+  sync_types->object = !sequence_view && (obact && obact->mode == 
OB_MODE_OBJECT) &&
(soops->sync_select_dirty & 
WM_OUTLINER_SYNC_SELECT_FROM_OBJECT);
-  sync_types->edit_bone = !sequence_view &&
+  sync_types->edit_bone = !sequence_view && (obedit && obedit->type == 
OB_ARMATURE) &&
   (soops->sync_select_dirty & 
WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE);
-  sync_types->pose_bone = !sequence_view &&
+  sync_types->pose_bone = !sequence_view && (obact && obact->mode == 
OB_MODE_POSE) &&
   (soops->sync_select_dirty & 
WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE);
   sync_types->sequence = sequence_view &&
  (soops->sync_select_dirty & 
WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE);
@@ -263,7 +274,7 @@ void ED_outliner_select_sync_from_outliner(bContext *C, 
SpaceOutliner *soops)
   ViewLayer *view_layer = CTX_data_view_layer(C);
 
   SyncSelectTypes sync_types;
-  outliner_sync_select_from_outliner_set_types(soops, _types);
+  outliner_sync_select_from_outliner_set_types(C, soops, _types);
 
   outliner_sync_selection_from_outliner(scene, view_layer, >tree, 
_types);
 
@@ -438,7 +449,7 @@ void outliner_sync_selection(const bContext *C, 
SpaceOutliner *soops)
 
 /* Set which types of data to sync from sync dirty flag and outliner 
display mode */
 SyncSelectTypes sync_types;
-outliner_sync_select_to_outliner_set_types(soops, _types);
+outliner_sync_select_to_outliner_set_types(C, soops, _types);
 
 /* Store active object, bones, and sequence */
 SyncSelectActiveData active_data;

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


[Bf-blender-cvs] [b3c3c835609] master: cleanup: fix python related build error on windows.

2019-08-13 Thread Lazydodo
Commit: b3c3c835609ef4f73d8131483d178a35287bf1eb
Author: Lazydodo
Date:   Tue Aug 13 19:55:33 2019 -0600
Branches: master
https://developer.blender.org/rBb3c3c835609ef4f73d8131483d178a35287bf1eb

cleanup: fix python related build error on windows.

Recent python changes caused issues on some systems.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 339b4f9ff26..f74fd57252d 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -734,13 +734,13 @@ elseif(WIN32)
 
   install(
 FILES 
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python${_PYTHON_VERSION_NO_DOTS}.dll
-FILES ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python.exe
+  ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python.exe
 DESTINATION ${BLENDER_VERSION}/python/bin
 CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
   )
   install(
 FILES 
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python${_PYTHON_VERSION_NO_DOTS}_d.dll
-FILES ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python_d.exe
+  ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python_d.exe
 DESTINATION ${BLENDER_VERSION}/python/bin
 CONFIGURATIONS Debug
   )

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


[Bf-blender-cvs] [54013d541c3] master: build_environment/python: Bump versions of our site-packages

2019-08-13 Thread Lazydodo
Commit: 54013d541c3a51d2aed1589170bb4ddb59785ff6
Author: Lazydodo
Date:   Tue Aug 13 16:58:26 2019 -0600
Branches: master
https://developer.blender.org/rB54013d541c3a51d2aed1589170bb4ddb59785ff6

build_environment/python: Bump versions of our site-packages

IDNA 2.8
CHARDET  3.0.4
URLLIB3  1.25.3
CERTIFI  2019.6.16
REQUESTS 2.22.0
NUMPY1.17.0

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 1d3da863898..3ee6a4920ed 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -157,16 +157,16 @@ set(OPENVDB_VERSION 5.1.0)
 set(OPENVDB_URI 
https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
 set(OPENVDB_HASH 5310101f874dcfd2165f9cee68c22624)
 
-set(IDNA_VERSION 2.7)
+set(IDNA_VERSION 2.8)
 set(CHARDET_VERSION 3.0.4)
-set(URLLIB3_VERSION 1.23)
-set(CERTIFI_VERSION 2018.8.13)
-set(REQUESTS_VERSION 2.19.1)
-
-set(NUMPY_VERSION v1.15.0)
-set(NUMPY_SHORT_VERSION 1.15)
-set(NUMPY_URI 
https://files.pythonhosted.org/packages/3a/20/c81632328b1a4e1db65f45c0a1350a9c5341fd4bbb8ea66cdd98da56fe2e/numpy-1.15.0.zip)
-set(NUMPY_HASH 20e1318508906a98e11c9bf8aa07)
+set(URLLIB3_VERSION 1.25.3)
+set(CERTIFI_VERSION 2019.6.16)
+set(REQUESTS_VERSION 2.22.0)
+
+set(NUMPY_VERSION v1.17.0)
+set(NUMPY_SHORT_VERSION 1.17)
+set(NUMPY_URI 
https://files.pythonhosted.org/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip)
+set(NUMPY_HASH aed49b31bcb44ec73b8155be78566135)
 
 set(LAME_VERSION 3.100)
 set(LAME_URI 
http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz)

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


[Bf-blender-cvs] [fc0f47e3493] master: make.bat: Support running python from lib folder for make format

2019-08-13 Thread Lazydodo
Commit: fc0f47e3493ceb3d04117a665353de48df04c32f
Author: Lazydodo
Date:   Tue Aug 13 17:03:09 2019 -0600
Branches: master
https://developer.blender.org/rBfc0f47e3493ceb3d04117a665353de48df04c32f

make.bat: Support running python from lib folder for make format

We are no longer depended on a system python being installed.

===

M   build_files/windows/format.cmd

===

diff --git a/build_files/windows/format.cmd b/build_files/windows/format.cmd
index c291dc581ae..f036257e220 100644
--- a/build_files/windows/format.cmd
+++ b/build_files/windows/format.cmd
@@ -9,8 +9,17 @@ exit /b 1
 :detect_done
 echo found clang-format in %CF_PATH%
 
-REM TODO(sergey): Switch to Python from libraries when available.
-set PYTHON="python.exe"
+if EXIST %BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe (
+set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe
+goto detect_python_done
+)
+
+echo python not found in lib folder
+exit /b 1
+
+:detect_python_done
+echo found python (%PYTHON%)
+
 set 
FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
 
 REM The formatting script expects clang-format to be in the current PATH.

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


[Bf-blender-cvs] [c538903558d] master: deps: python 3.7.4 for windows.

2019-08-13 Thread Lazydodo
Commit: c538903558d8c648817f5921e6f7acd284645214
Author: Lazydodo
Date:   Tue Aug 13 17:02:19 2019 -0600
Branches: master
https://developer.blender.org/rBc538903558d8c648817f5921e6f7acd284645214

deps: python 3.7.4 for windows.

This also updates to a new packaging method where python is runnable
from the library folder rather than having tarballs in the release
folder.

===

M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/numpy.cmake
A   build_files/build_environment/cmake/package_python.cmake
M   build_files/build_environment/cmake/python.cmake
M   build_files/build_environment/cmake/python_site_packages.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index e4fe7d90176..0dbd3b572cf 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -90,6 +90,7 @@ include(cmake/tbb.cmake)
 include(cmake/openvdb.cmake)
 include(cmake/python.cmake)
 include(cmake/python_site_packages.cmake)
+include(cmake/package_python.cmake)
 include(cmake/numpy.cmake)
 if(UNIX AND NOT APPLE)
   # Rely on PugiXML compiled with OpenImageIO
diff --git a/build_files/build_environment/cmake/numpy.cmake 
b/build_files/build_environment/cmake/numpy.cmake
index 1a6ffa95ad6..abf2464e88c 100644
--- a/build_files/build_environment/cmake/numpy.cmake
+++ b/build_files/build_environment/cmake/numpy.cmake
@@ -17,6 +17,7 @@
 # * END GPL LICENSE BLOCK *
 
 if(MSVC)
+  message("BIN >${PYTHON_BINARY}<")
   if(BUILD_MODE STREQUAL Debug)
 set(NUMPY_DIR_POSTFIX -pydebug)
 set(NUMPY_ARCHIVE_POSTFIX d)
@@ -30,17 +31,6 @@ endif()
 
 set(NUMPY_POSTFIX)
 
-if(WIN32)
-  set(NUMPY_INSTALL
-${CMAKE_COMMAND} -E copy_directory 
"${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy"
 "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
-${CMAKE_COMMAND} -E chdir 
"${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
-${CMAKE_COMMAND} -E tar "cfvz" 
"${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz"
 "."
-  )
-else()
-  set(NUMPY_INSTALL echo .)
-  set(NUMPY_PATCH echo .)
-endif()
-
 ExternalProject_Add(external_numpy
   URL ${NUMPY_URI}
   DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -50,17 +40,10 @@ ExternalProject_Add(external_numpy
   CONFIGURE_COMMAND ""
   LOG_BUILD 1
   BUILD_COMMAND ${PYTHON_BINARY} 
${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} 
install --old-and-unmanageable
-  INSTALL_COMMAND ${NUMPY_INSTALL}
+  INSTALL_COMMAND ""
 )
 
-if(WIN32)
-  ExternalProject_Add_Step(external_numpy after_install
-  COMMAND ${CMAKE_COMMAND} -E copy 
${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz
 
${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz
-  DEPENDEES install
-)
-endif()
-
 add_dependencies(
   external_numpy
-  Make_Python_Environment
+  external_python
 )
diff --git a/build_files/build_environment/cmake/package_python.cmake 
b/build_files/build_environment/cmake/package_python.cmake
new file mode 100644
index 000..e2eda66a4e0
--- /dev/null
+++ b/build_files/build_environment/cmake/package_python.cmake
@@ -0,0 +1,58 @@
+# * 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 *
+
+if(MSVC)
+  set(PYTARGET ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS})
+  set(PYSRC ${LIBDIR}/python/)
+
+  if(BUILD_MODE STREQUAL Release)
+add_custom_command(
+  OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
+  COMMAND echo packaging python
+  COMMAND echo this should ouput at 
${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
+  COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs
+  COMMAND ${CMAKE_COMMAND} -E copy 

[Bf-blender-cvs] [87d3685e935] master: deps/cleanup: remove partial boost-python support.

2019-08-13 Thread Lazydodo
Commit: 87d3685e9352a11dec3d093a3473ac1e5b8121d2
Author: Lazydodo
Date:   Tue Aug 13 17:00:23 2019 -0600
Branches: master
https://developer.blender.org/rB87d3685e9352a11dec3d093a3473ac1e5b8121d2

deps/cleanup: remove partial boost-python support.

boost python was not required by any dependency nor was it ever properly 
supported.

===

M   build_files/build_environment/cmake/boost.cmake

===

diff --git a/build_files/build_environment/cmake/boost.cmake 
b/build_files/build_environment/cmake/boost.cmake
index 7fcd7e754ae..fabc055ce29 100644
--- a/build_files/build_environment/cmake/boost.cmake
+++ b/build_files/build_environment/cmake/boost.cmake
@@ -33,19 +33,9 @@ if(WIN32)
 set(BOOST_TOOLSET toolset=msvc-14.0)
 set(BOOST_COMPILER_STRING -vc140)
   endif()
-  set(JAM_FILE ${BUILD_DIR}/boost/src/external_boost/user-config.jam)
-  set(semi_path "${PATCH_DIR}/semi.txt")
-  FILE(TO_NATIVE_PATH ${semi_path} semi_path)
-  set(BOOST_CONFIGURE_COMMAND bootstrap.bat &&
-echo using python : ${PYTHON_OUTPUTDIR}\\python.exe > 
"${JAM_FILE}" &&
-echo.   : ${BUILD_DIR}/python/src/external_python/include 
${BUILD_DIR}/python/src/external_python/pc >> "${JAM_FILE}" &&
-echo.   : ${BUILD_DIR}/python/src/external_python/pcbuild >> 
"${JAM_FILE}" &&
-type ${semi_path} >> "${JAM_FILE}"
-  )
+  set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
   set(BOOST_BUILD_COMMAND bjam)
-  #--user-config=user-config.jam
   set(BOOST_BUILD_OPTIONS runtime-link=static )
-  #set(BOOST_WITH_PYTHON --with-python)
   set(BOOST_HARVEST_CMD   ${CMAKE_COMMAND} -E copy_directory 
${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
   if(BUILD_MODE STREQUAL Release)
 set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E 
copy_directory ${LIBDIR}/boost/include/boost-1_68/ 
${HARVEST_TARGET}/boost/include/)
@@ -82,7 +72,6 @@ set(BOOST_OPTIONS
   --with-serialization
   --with-program_options
   --with-iostreams
-  ${BOOST_WITH_PYTHON}
   ${BOOST_TOOLSET}
 )
 
@@ -100,10 +89,3 @@ ExternalProject_Add(external_boost
   BUILD_IN_SOURCE 1
   INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
 )
-
-if(WIN32)
-  add_dependencies(
-external_boost
-Make_Python_Environment
-  )
-endif()

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


[Bf-blender-cvs] [0a3e04b13bb] greasepencil-object: GPencil: Add new Simplify parameter for Brush

2019-08-13 Thread Antonio Vazquez
Commit: 0a3e04b13bbc509568932f6e5557af3b349b95d0
Author: Antonio Vazquez
Date:   Tue Aug 13 22:51:46 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0a3e04b13bbc509568932f6e5557af3b349b95d0

GPencil: Add new Simplify parameter for Brush

This option is to test new types of brushes.

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/makesdna/DNA_brush_types.h
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 1378615b8a0..55a5c6d95b1 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1891,6 +1891,9 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
 col.prop(gp_settings, "pen_subdivision_steps")
 col.prop(gp_settings, "random_subdiv", text="Randomness", slider=True)
 
+col = layout.column(align=True)
+col.prop(gp_settings, "simplify_factor")
+
 col = layout.column(align=True)
 col.prop(gp_settings, "trim")
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 894fb6eced4..b386a1ca751 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1224,6 +1224,12 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   }
 }
 
+/* Simplify adaptive */
+if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
+(brush->gpencil_settings->simplify_f > 0.0f)) {
+  BKE_gpencil_simplify_stroke(gps, brush->gpencil_settings->simplify_f);
+}
+
 /* reproject to plane (only in 3d space) */
 gp_reproject_toplane(p, gps);
 /* change position relative to parent object */
diff --git a/source/blender/makesdna/DNA_brush_types.h 
b/source/blender/makesdna/DNA_brush_types.h
index 93ce3d9769b..4327c28ba69 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -113,7 +113,8 @@ typedef struct BrushGpencilSettings {
   float gradient_f;
   /** factor xy of shape for dots gradients */
   float gradient_s[2];
-  char _pad_2[4];
+  /** Simplify adaptive factor */
+  float simplify_f;
 
   struct CurveMapping *curve_sensitivity;
   struct CurveMapping *curve_strength;
@@ -485,7 +486,7 @@ typedef enum eBrushUVSculptTool {
 SCULPT_TOOL_THUMB, \
 SCULPT_TOOL_LAYER, \
 \
-/* These brushes could handle dynamic topology, \
+/* These brushes could handle dynamic topology, \ \
  * but user feedback indicates it's better not to */ \
 SCULPT_TOOL_SMOOTH, \
 SCULPT_TOOL_MASK) == 0)
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index 713ddfa0067..ee439147956 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1184,6 +1184,14 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
+  /* Simplify factor */
+  prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_FACTOR);
+  RNA_def_property_float_sdna(prop, NULL, "simplify_f");
+  RNA_def_property_range(prop, 0, 100.0);
+  RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
+  RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using 
adaptive algorithm");
+  RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+
   /* Curves for pressure */
   prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");

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


[Bf-blender-cvs] [dd370cbf895] greasepencil-object: GPencil: Increase number of input samples to 50

2019-08-13 Thread Antonioya
Commit: dd370cbf8956d5d1cde0c5e42251c9dbf93d16d8
Author: Antonioya
Date:   Tue Aug 13 22:51:37 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBdd370cbf8956d5d1cde0c5e42251c9dbf93d16d8

GPencil: Increase number of input samples to 50

For testing new brushes.

===

M   source/blender/makesdna/DNA_gpencil_types.h

===

diff --git a/source/blender/makesdna/DNA_gpencil_types.h 
b/source/blender/makesdna/DNA_gpencil_types.h
index 0de7d8bdd16..3edd529eb68 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -36,7 +36,7 @@ struct MDeformVert;
 
 #define GP_DEFAULT_PIX_FACTOR 1.0f
 #define GP_DEFAULT_GRID_LINES 4
-#define GP_MAX_INPUT_SAMPLES 10
+#define GP_MAX_INPUT_SAMPLES 50
 
 /* * */
 /* GP Stroke Points */

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


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

2019-08-13 Thread Antonio Vazquez
Commit: 0e72dbafd2987fb85469ac4e913105eb3b2a6a89
Author: Antonio Vazquez
Date:   Tue Aug 13 22:34:34 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0e72dbafd2987fb85469ac4e913105eb3b2a6a89

Merge branch 'master' into greasepencil-object

===



===



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


[Bf-blender-cvs] [313b7892897] master: Shading: Add Clamp node to Cycles and EEVEE.

2019-08-13 Thread OmarSquircleArt
Commit: 313b78928970a82ab547b07f21f04fc032491ca1
Author: OmarSquircleArt
Date:   Tue Aug 13 22:22:15 2019 +0200
Branches: master
https://developer.blender.org/rB313b78928970a82ab547b07f21f04fc032491ca1

Shading: Add Clamp node to Cycles and EEVEE.

This patch adds a new node that clamps a value between a maximum and
a minimum values.

Reviewers: brecht

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

===

M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/kernel/shaders/CMakeLists.txt
A   intern/cycles/kernel/shaders/node_clamp.osl
M   intern/cycles/kernel/svm/svm.h
A   intern/cycles/kernel/svm/svm_clamp.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_shader.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/shader/nodes/node_shader_clamp.c
M   source/blender/nodes/shader/nodes/node_shader_math.c

===

diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index dc0563c3bb8..b1c61c2fa8c 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -318,6 +318,9 @@ static ShaderNode *add_node(Scene *scene,
   else if (b_node.is_a(_ShaderNodeMapRange)) {
 node = new MapRangeNode();
   }
+  else if (b_node.is_a(_ShaderNodeClamp)) {
+node = new ClampNode();
+  }
   else if (b_node.is_a(_ShaderNodeMath)) {
 BL::ShaderNodeMath b_math_node(b_node);
 MathNode *math = new MathNode();
diff --git a/intern/cycles/kernel/CMakeLists.txt 
b/intern/cycles/kernel/CMakeLists.txt
index 2078b1a8f4e..ab05d6ee1e9 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -179,6 +179,7 @@ set(SRC_SVM_HEADERS
   svm/svm_blackbody.h
   svm/svm_bump.h
   svm/svm_camera.h
+  svm/svm_clamp.h
   svm/svm_closure.h
   svm/svm_convert.h
   svm/svm_checker.h
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt 
b/intern/cycles/kernel/shaders/CMakeLists.txt
index 2a84d89f9be..63cef6e841b 100644
--- a/intern/cycles/kernel/shaders/CMakeLists.txt
+++ b/intern/cycles/kernel/shaders/CMakeLists.txt
@@ -13,6 +13,7 @@ set(SRC_OSL
   node_bump.osl
   node_camera.osl
   node_checker_texture.osl
+  node_clamp.osl
   node_combine_rgb.osl
   node_combine_hsv.osl
   node_combine_xyz.osl
diff --git a/intern/cycles/kernel/shaders/node_clamp.osl 
b/intern/cycles/kernel/shaders/node_clamp.osl
new file mode 100644
index 000..43b0fe88172
--- /dev/null
+++ b/intern/cycles/kernel/shaders/node_clamp.osl
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2011-2013 Blender Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "stdosl.h"
+
+shader node_clamp(float Value = 1.0, float Min = 0.0, float Max = 1.0,
+  output float Result = 0.0)
+{
+Result = clamp(Value, Min, Max);
+}
diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h
index e0c2c8b56dc..0d731d62e94 100644
--- a/intern/cycles/kernel/svm/svm.h
+++ b/intern/cycles/kernel/svm/svm.h
@@ -193,6 +193,7 @@ CCL_NAMESPACE_END
 #include "kernel/svm/svm_voxel.h"
 #include "kernel/svm/svm_bump.h"
 #include "kernel/svm/svm_map_range.h"
+#include "kernel/svm/svm_clamp.h"
 
 #ifdef __SHADER_RAYTRACE__
 #  include "kernel/svm/svm_ao.h"
@@ -490,6 +491,9 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg,
   case NODE_MAP_RANGE:
 svm_node_map_range(kg, sd, stack, node.y, node.z, node.w, );
 break;
+  case NODE_CLAMP:
+svm_node_clamp(kg, sd, stack, node.y, node.z, node.w, );
+break;
 #  endif /* __EXTRA_NODES__ */
 #  if NODES_FEATURE(NODE_FEATURE_VOLUME)
   case NODE_TEX_VOXEL:
diff --git a/intern/cycles/kernel/svm/svm_clamp.h 
b/intern/cycles/kernel/svm/svm_clamp.h
new file mode 100644
index 000..5ff4a599028
--- /dev/null
+++ b/intern/cycles/kernel/svm/svm_clamp.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2011-2013 Blender Foundation
+ *
+ * Licensed under the Apache 

[Bf-blender-cvs] [4befee9e620] filebrowser_redesign: UI: File Browser Use Friendly Relative Dates

2019-08-13 Thread Harley Acheson
Commit: 4befee9e620f3c0b17711b56cc19bdebd7d401f5
Author: Harley Acheson
Date:   Tue Aug 13 10:52:10 2019 -0700
Branches: filebrowser_redesign
https://developer.blender.org/rB4befee9e620f3c0b17711b56cc19bdebd7d401f5

UI: File Browser Use Friendly Relative Dates

Show 'Today' or 'Yesterday' in file list

===

M   release/datafiles/locale
M   release/scripts/addons
M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/intern/BLI_filelist.c
M   source/blender/editors/space_file/file_draw.c

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 963e29bd16e..7327a198a42 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 963e29bd16e49c9bf227538c1042cf5c86cd9b28
+Subproject commit 7327a198a4221814d478dddb23088d54c96b4865
diff --git a/release/scripts/addons b/release/scripts/addons
index 2fa8a6214fc..d96b6d38d28 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 2fa8a6214fc8c07cbaa4f07d134bf1cb5957210f
+Subproject commit d96b6d38d28fa2ec3d2ba4d186d9e0a105e83d18
diff --git a/source/blender/blenlib/BLI_fileops.h 
b/source/blender/blenlib/BLI_fileops.h
index d8daa81b58d..6f1dd1ff5fc 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -100,7 +100,7 @@ void BLI_filelist_entry_mode_to_string(
 const struct stat *st, const bool compact, char r_mode1[], char r_mode2[], 
char r_mode3[]);
 void BLI_filelist_entry_owner_to_string(const struct stat *st, const bool 
compact, char r_owner[]);
 void BLI_filelist_entry_datetime_to_string(
-const struct stat *st, const int64_t ts, const bool compact, char 
r_time[], char r_date[]);
+const struct stat *st, const int64_t ts, const bool compact, char 
r_time[], char r_date[], const bool use_relative_str);
 
 /* Files */
 
diff --git a/source/blender/blenlib/intern/BLI_filelist.c 
b/source/blender/blenlib/intern/BLI_filelist.c
index 33baba1e8a4..d10cef16b41 100644
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@ -352,9 +352,28 @@ void BLI_filelist_entry_datetime_to_string(const struct 
stat *st,
const int64_t ts,
const bool compact,
char 
r_time[FILELIST_DIRENTRY_TIME_LEN],
-   char 
r_date[FILELIST_DIRENTRY_DATE_LEN])
+   char 
r_date[FILELIST_DIRENTRY_DATE_LEN],
+   const bool use_relative_str
+  )
 {
-  time_t ts_mtime = ts;
+  int today_year = 0;
+  int today_yday = 0;
+  int yesterday_year = 0;
+  int yesterday_yday = 0;
+  if (use_relative_str) {
+/* Localtime() has only one buffer so need to get data out before called 
again. */
+const time_t ts_now = time(NULL);
+struct tm *today = localtime(_now);
+today_year = today->tm_year;
+today_yday = today->tm_yday;
+/* Handle a yesterday that spans a year */
+today->tm_mday--;
+mktime(today);
+yesterday_year = today->tm_year;
+yesterday_yday = today->tm_yday;
+  }
+
+  const time_t ts_mtime = ts;
   const struct tm *tm = localtime(st ? >st_mtime : _mtime);
   const time_t zero = 0;
 
@@ -367,10 +386,19 @@ void BLI_filelist_entry_datetime_to_string(const struct 
stat *st,
 strftime(r_time, sizeof(*r_time) * FILELIST_DIRENTRY_TIME_LEN, "%H:%M", 
tm);
   }
   if (r_date) {
-strftime(r_date,
- sizeof(*r_date) * FILELIST_DIRENTRY_DATE_LEN,
- compact ? "%d/%m/%y" : "%d %b %Y",
- tm);
+if (use_relative_str && (tm->tm_year == today_year) && (tm->tm_yday == 
today_yday)) {
+  BLI_strncpy(r_date, "Today", sizeof(*r_date) * 
FILELIST_DIRENTRY_DATE_LEN);
+}
+else if (use_relative_str && (tm->tm_year == yesterday_year) &&
+ (tm->tm_yday == yesterday_yday)) {
+  BLI_strncpy(r_date, "Yesterday", sizeof(*r_date) * 
FILELIST_DIRENTRY_DATE_LEN);
+}
+else {
+  strftime(r_date,
+   sizeof(*r_date) * FILELIST_DIRENTRY_DATE_LEN,
+   compact ? "%d/%m/%y" : "%d %b %Y",
+   tm);
+}
   }
 }
 
diff --git a/source/blender/editors/space_file/file_draw.c 
b/source/blender/editors/space_file/file_draw.c
index ea66069a01e..30dc62aff63 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -543,9 +543,9 @@ static const char 
*filelist_get_details_column_string(FileListColumns column,
   if (!(file->typeflag & FILE_TYPE_BLENDERLIB) && 
!FILENAME_IS_CURRPAR(file->relpath)) {
 if ((file->entry->datetime_str[0] == '\0') || update_stat_strings) {
   char date[16], time[8];
-  

[Bf-blender-cvs] [42798a5ca16] master: Fix T67516 VSE: Animation evaluated incorrectly when scene strip present

2019-08-13 Thread Sybren A. Stüvel
Commit: 42798a5ca16154c9ecaf5a2359bd0b4fbe9dec94
Author: Sybren A. Stüvel
Date:   Thu Aug 1 14:10:04 2019 +0200
Branches: master
https://developer.blender.org/rB42798a5ca16154c9ecaf5a2359bd0b4fbe9dec94

Fix T67516 VSE: Animation evaluated incorrectly when scene strip present

The calls to `BKE_animsys_evaluate_all_animation()` and
`BKE_mask_evaluate_all_masks()` used the wrong timecode to evaluate the
animation system. This happened:

- Sequencer in scene A was rendered at frame X.
- Scene strip for scene B which should be evaluated at frame Y.
- BKE_animsys_evaluate_all_animation() was called with frame Y, which
  also re-evaluated the animation data in scene A.
- Other sequencer strips with animated values were then evaluated for
  frame Y and not frame X.

Since the depsgraph for rendering the scene strip is already OK and does
its job, it's no longer necessary to re-evaluate all the animation in
this way.

Removed `BKE_mask_evaluate_all_masks()` because it's no longer used.

Reviewers: sergey, brecht, iss

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

===

M   source/blender/blenkernel/BKE_mask.h
M   source/blender/blenkernel/intern/mask.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/source/blender/blenkernel/BKE_mask.h 
b/source/blender/blenkernel/BKE_mask.h
index bfdeadc7f60..f87c73e35a2 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -171,7 +171,6 @@ void BKE_mask_coord_to_image(struct Image *image,
 
 /* parenting */
 
-void BKE_mask_evaluate_all_masks(struct Main *bmain, float ctime, const bool 
do_newframe);
 void BKE_mask_evaluate(struct Mask *mask, const float ctime, const bool 
do_newframe);
 void BKE_mask_layer_evaluate(struct MaskLayer *masklay, const float ctime, 
const bool do_newframe);
 void BKE_mask_parent_init(struct MaskParent *parent);
diff --git a/source/blender/blenkernel/intern/mask.c 
b/source/blender/blenkernel/intern/mask.c
index bb93d068bef..8f8150b6a64 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1469,15 +1469,6 @@ void BKE_mask_evaluate(Mask *mask, const float ctime, 
const bool do_newframe)
   }
 }
 
-void BKE_mask_evaluate_all_masks(Main *bmain, float ctime, const bool 
do_newframe)
-{
-  Mask *mask;
-
-  for (mask = bmain->masks.first; mask; mask = mask->id.next) {
-BKE_mask_evaluate(mask, ctime, do_newframe);
-  }
-}
-
 void BKE_mask_parent_init(MaskParent *parent)
 {
   parent->id_type = ID_MC;
diff --git a/source/blender/render/intern/source/pipeline.c 
b/source/blender/render/intern/source/pipeline.c
index d620cd38b76..6284fa2d119 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1680,7 +1680,6 @@ static void do_render_all_options(Render *re)
 {
   Object *camera;
   bool render_seq = false;
-  int cfra = re->r.cfra;
 
   re->current_scene_update(re->suh, re->scene);
 
@@ -1692,16 +1691,6 @@ static void do_render_all_options(Render *re)
   BKE_image_all_free_anim_ibufs(re->main, re->r.cfra);
   BKE_sequencer_all_free_anim_ibufs(re->scene, re->r.cfra);
 
-  /* Update for sequencer and compositing animation.
-   * TODO: ideally we would create a depsgraph with a copy of the scene
-   * like the render engine, but sequencer and compositing do not (yet?)
-   * work with copy-on-write. */
-  BKE_animsys_evaluate_all_animation(re->main, NULL, re->scene, (float)cfra);
-
-  /* Update for masks
-   * (these do not use animsys but own lighter weight structure to define 
animation). */
-  BKE_mask_evaluate_all_masks(re->main, (float)cfra, true);
-
   if (RE_engine_render(re, 1)) {
 /* in this case external render overrides all */
   }

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


[Bf-blender-cvs] [71641ab56d0] master: Shading: Add Map Range node to Cycles and EEVEE.

2019-08-13 Thread OmarSquircleArt
Commit: 71641ab56d0f0cb52c301b83ff499699029fa032
Author: OmarSquircleArt
Date:   Tue Aug 13 16:29:32 2019 +0200
Branches: master
https://developer.blender.org/rB71641ab56d0f0cb52c301b83ff499699029fa032

Shading: Add Map Range node to Cycles and EEVEE.

This patch adds a new Map Range node that linearly remaps an input
value from a range to another. This node is similar to the compositor's
Map Range node.

Reviewers: brecht, JacquesLucke

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

===

M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/kernel/shaders/CMakeLists.txt
A   intern/cycles/kernel/shaders/node_map_range.osl
M   intern/cycles/kernel/svm/svm.h
A   intern/cycles/kernel/svm/svm_map_range.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_shader.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/shader/nodes/node_shader_map_range.c

===

diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index f952b3025f0..dc0563c3bb8 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -315,6 +315,9 @@ static ShaderNode *add_node(Scene *scene,
   else if (b_node.is_a(_ShaderNodeRGBToBW)) {
 node = new RGBToBWNode();
   }
+  else if (b_node.is_a(_ShaderNodeMapRange)) {
+node = new MapRangeNode();
+  }
   else if (b_node.is_a(_ShaderNodeMath)) {
 BL::ShaderNodeMath b_math_node(b_node);
 MathNode *math = new MathNode();
diff --git a/intern/cycles/kernel/CMakeLists.txt 
b/intern/cycles/kernel/CMakeLists.txt
index a8b5b077ece..2078b1a8f4e 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -198,6 +198,7 @@ set(SRC_SVM_HEADERS
   svm/svm_invert.h
   svm/svm_light_path.h
   svm/svm_magic.h
+  svm/svm_map_range.h
   svm/svm_mapping.h
   svm/svm_math.h
   svm/svm_math_util.h
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt 
b/intern/cycles/kernel/shaders/CMakeLists.txt
index b42b9b2fe64..2a84d89f9be 100644
--- a/intern/cycles/kernel/shaders/CMakeLists.txt
+++ b/intern/cycles/kernel/shaders/CMakeLists.txt
@@ -46,6 +46,7 @@ set(SRC_OSL
   node_light_falloff.osl
   node_light_path.osl
   node_magic_texture.osl
+  node_map_range.osl
   node_mapping.osl
   node_math.osl
   node_mix.osl
diff --git a/intern/cycles/kernel/shaders/node_map_range.osl 
b/intern/cycles/kernel/shaders/node_map_range.osl
new file mode 100644
index 000..417d2ae50a8
--- /dev/null
+++ b/intern/cycles/kernel/shaders/node_map_range.osl
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011-2013 Blender Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "stdosl.h"
+
+shader node_map_range(float Value = 1.0, float FromMin = 0.0, float FromMax = 
1.0,
+  float ToMin = 0.0, float ToMax = 1.0, output float 
Result = 0.0)
+{
+  if (FromMax != FromMin) {
+Result = ToMin + ((Value - FromMin) / (FromMax - FromMin)) * (ToMax - 
ToMin);
+  }
+}
diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h
index 4a386afa5de..e0c2c8b56dc 100644
--- a/intern/cycles/kernel/svm/svm.h
+++ b/intern/cycles/kernel/svm/svm.h
@@ -192,6 +192,7 @@ CCL_NAMESPACE_END
 #include "kernel/svm/svm_vector_transform.h"
 #include "kernel/svm/svm_voxel.h"
 #include "kernel/svm/svm_bump.h"
+#include "kernel/svm/svm_map_range.h"
 
 #ifdef __SHADER_RAYTRACE__
 #  include "kernel/svm/svm_ao.h"
@@ -486,6 +487,9 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg,
   case NODE_BLACKBODY:
 svm_node_blackbody(kg, sd, stack, node.y, node.z);
 break;
+  case NODE_MAP_RANGE:
+svm_node_map_range(kg, sd, stack, node.y, node.z, node.w, );
+break;
 #  endif /* __EXTRA_NODES__ */
 #  if NODES_FEATURE(NODE_FEATURE_VOLUME)
   case NODE_TEX_VOXEL:
diff --git a/intern/cycles/kernel/svm/svm_map_range.h 
b/intern/cycles/kernel/svm/svm_map_range.h

[Bf-blender-cvs] [aef08fda3ad] master: Custom Properties: officially support int and float arrays in the UI.

2019-08-13 Thread Alexander Gavrilov
Commit: aef08fda3ade2d0223b77d4c9c0dd5e9fcabe7b2
Author: Alexander Gavrilov
Date:   Sat Aug 10 14:42:14 2019 +0300
Branches: master
https://developer.blender.org/rBaef08fda3ade2d0223b77d4c9c0dd5e9fcabe7b2

Custom Properties: officially support int and float arrays in the UI.

In some rare cases it is convenient to store a short array value
as a custom property, e.g. a vector or color. For example, it may
be helpful when importing/exporting certain formats that support
custom or nonstandard attributes on objects.

The custom property storage already can handle arrays in order to
support properties defined via python. The only thing missing is
UI support (and some bugs), and this patch fixes that:

- Allow editing short array properties via Custom Properties panel.
- Fix a UI layout sizing bug triggered by the previous item.
- Fix a dependency graph bug with drivers using such properties.
- Make RNA_*_get_default_array code robust in case of size mismatch.
- Support custom default values for array properties, allowing
  both an array and a scalar value.

Reviewers: campbellbarton

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

===

M   release/scripts/modules/rna_prop_ui.py
M   release/scripts/startup/bl_operators/wm.py
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/editors/interface/interface_layout.c
M   source/blender/makesrna/intern/rna_access.c

===

diff --git a/release/scripts/modules/rna_prop_ui.py 
b/release/scripts/modules/rna_prop_ui.py
index 9d1ba035b3e..b568f9835a0 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -20,6 +20,15 @@
 
 import bpy
 
+from mathutils import Vector
+from idprop.types import IDPropertyArray, IDPropertyGroup
+
+ARRAY_TYPES = (list, tuple, IDPropertyArray, Vector)
+
+# Maximum length of an array property for which a multi-line
+# edit field will be displayed in the Custom Properties panel.
+MAX_DISPLAY_ROWS = 4
+
 
 def rna_idprop_ui_get(item, create=True):
 try:
@@ -101,23 +110,47 @@ def rna_idprop_has_properties(rna_item):
 return (nbr_props > 1) or (nbr_props and '_RNA_UI' not in keys)
 
 
+def rna_idprop_value_to_python(value):
+if isinstance(value, IDPropertyArray):
+return value.to_list()
+elif isinstance(value, IDPropertyGroup):
+return value.to_dict()
+else:
+return value
+
+
+def rna_idprop_value_item_type(value):
+is_array = isinstance(value, ARRAY_TYPES) and len(value) > 0
+item_value = value[0] if is_array else value
+return type(item_value), is_array
+
+
 def rna_idprop_ui_prop_default_set(item, prop, value):
 defvalue = None
 try:
-prop_type = type(item[prop])
+prop_type, is_array = rna_idprop_value_item_type(item[prop])
 
 if prop_type in {int, float}:
-defvalue = prop_type(value)
+if is_array and isinstance(value, ARRAY_TYPES):
+value = [prop_type(item) for item in value]
+if any(value):
+defvalue = value
+else:
+defvalue = prop_type(value)
 except KeyError:
 pass
+except ValueError:
+pass
 
 if defvalue:
 rna_ui = rna_idprop_ui_prop_get(item, prop, True)
 rna_ui["default"] = defvalue
 else:
 rna_ui = rna_idprop_ui_prop_get(item, prop)
-if rna_ui and "default" in rna_ui:
-del rna_ui["default"]
+if rna_ui:
+rna_ui.pop("default", None)
+
+return defvalue
 
 
 def rna_idprop_ui_create(
@@ -129,7 +162,7 @@ def rna_idprop_ui_create(
 ):
 """Create and initialize a custom property with limits, defaults and other 
settings."""
 
-proptype = type(default)
+proptype, is_array = rna_idprop_value_item_type(default)
 
 # Sanitize limits
 if proptype is bool:
@@ -159,7 +192,7 @@ def rna_idprop_ui_create(
 rna_ui["max"] = proptype(max)
 rna_ui["soft_max"] = proptype(soft_max)
 
-if default:
+if default and (not is_array or any(default)):
 rna_ui["default"] = default
 
 # Assign other settings
@@ -252,7 +285,11 @@ def draw(layout, context, context_member, property_type, 
use_edit=True):
 row.label(text=key, translate=False)
 
 # explicit exception for arrays.
-if to_dict or to_list:
+show_array_ui = to_list and not is_rna and 0 < len(val) <= 
MAX_DISPLAY_ROWS
+
+if show_array_ui and isinstance(val[0], (int, float)):
+row.prop(rna_item, '["%s"]' % escape_identifier(key), text="")
+elif to_dict or to_list:
 row.label(text=val_draw, translate=False)
 else:
 if is_rna:
diff --git 

[Bf-blender-cvs] [6e7ea807e1e] master: UI: Fix wrong properties being grayed out

2019-08-13 Thread Jacques Lucke
Commit: 6e7ea807e1e8aa0791a3c1d8875e74d64481973c
Author: Jacques Lucke
Date:   Tue Aug 13 15:45:54 2019 +0200
Branches: master
https://developer.blender.org/rB6e7ea807e1e8aa0791a3c1d8875e74d64481973c

UI: Fix wrong properties being grayed out

This has been mentioned in T68610.

===

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

===

diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py 
b/release/scripts/startup/bl_ui/properties_data_bone.py
index f739cd66699..8b691ddcc2a 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -147,13 +147,13 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
 
 layout.prop(bone, "bbone_segments", text="Segments")
 
-topcol = layout.column()
-topcol.active = bone.bbone_segments > 1
-
-col = topcol.column(align=True)
+col = layout.column(align=True)
 col.prop(bone, "bbone_x", text="Display Size X")
 col.prop(bone, "bbone_z", text="Z")
 
+topcol = layout.column()
+topcol.active = bone.bbone_segments > 1
+
 col = topcol.column(align=True)
 col.prop(bbone, "bbone_curveinx", text="Curve In X")
 col.prop(bbone, "bbone_curveiny", text="In Y")

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


[Bf-blender-cvs] [03bf84db86b] master: Fix T66373: Strange translation text behaviour.

2019-08-13 Thread Bastien Montagne
Commit: 03bf84db86bc023cfad501b1b4764cecb6435422
Author: Bastien Montagne
Date:   Tue Aug 13 12:56:27 2019 +0200
Branches: master
https://developer.blender.org/rB03bf84db86bc023cfad501b1b4764cecb6435422

Fix T66373: Strange translation text behaviour.

i18n code does not work from threads on some plaforms, so it is disabled
in Blender when called from non-main thread.

Means that we have to go to a slightly different approach, with dirty
tag and generating string on request for UI.

Note: Also had to update the `info` string size, to fit with expensive
asiatic scripts in utf-8... Using mem for that kind of runtime data is
not really nice, but for now it will have to do.

===

M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/makesdna/DNA_object_force_types.h
M   source/blender/makesrna/intern/rna_object_force.c

===

diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index 90ae512074d..2d42406520d 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3337,7 +3337,7 @@ int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
 cache->cached_frames[cfra - cache->startframe] = 1;
   }
 
-  BKE_ptcache_update_info(pid);
+  cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
 
   return !error;
 }
@@ -3500,8 +3500,9 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, 
unsigned int cfra)
   break;
   }
 
-  BKE_ptcache_update_info(pid);
+  pid->cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
 }
+
 int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
 {
   if (!pid->cache) {
@@ -4288,7 +4289,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
 
   BKE_ptcache_id_time(pid, NULL, 0.0f, NULL, NULL, NULL);
 
-  BKE_ptcache_update_info(pid);
+  cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
 
   if ((cache->flag & PTCACHE_DISK_CACHE) == 0) {
 if (cache->index) {
@@ -4461,7 +4462,8 @@ void BKE_ptcache_load_external(PTCacheID *pid)
 cache->cached_frames = NULL;
 cache->cached_frames_len = 0;
   }
-  BKE_ptcache_update_info(pid);
+
+  cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
 }
 
 void BKE_ptcache_update_info(PTCacheID *pid)
@@ -4469,7 +4471,9 @@ void BKE_ptcache_update_info(PTCacheID *pid)
   PointCache *cache = pid->cache;
   PTCacheExtra *extra = NULL;
   int totframes = 0;
-  char mem_info[64];
+  char mem_info[sizeof(((PointCache *)0)->info) / sizeof(*(((PointCache 
*)0)->info))];
+
+  cache->flag &= ~PTCACHE_FLAG_INFO_DIRTY;
 
   if (cache->flag & PTCACHE_EXTERNAL) {
 int cfra = cache->startframe;
diff --git a/source/blender/makesdna/DNA_object_force_types.h 
b/source/blender/makesdna/DNA_object_force_types.h
index 2207e08558d..34a1b6d3e0b 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -271,7 +271,7 @@ typedef struct PointCache {
 
   char name[64];
   char prev_name[64];
-  char info[64];
+  char info[128];
   /** File path, 1024 = FILE_MAX. */
   char path[1024];
 
@@ -497,6 +497,8 @@ typedef struct SoftBody {
 #define PTCACHE_FAKE_SMOKE (1 << 12)
 #define PTCACHE_IGNORE_CLEAR (1 << 13)
 
+#define PTCACHE_FLAG_INFO_DIRTY (1 << 14)
+
 /* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */
 #define PTCACHE_REDO_NEEDED 258
 
diff --git a/source/blender/makesrna/intern/rna_object_force.c 
b/source/blender/makesrna/intern/rna_object_force.c
index ab6cffe615d..066e350ab3e 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -140,7 +140,7 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene 
*UNUSED(scene), PointerR
 if (pid.type == PTCACHE_TYPE_SMOKE_DOMAIN) {
   cache->step = 1;
 }
-BKE_ptcache_update_info();
+cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
   }
 }
 
@@ -292,6 +292,24 @@ static void rna_PointCache_frame_step_range(
   }
 }
 
+int rna_Cache_info_length(PointerRNA *ptr)
+{
+  PointCache *cache = (PointCache *)ptr->data;
+  Object *ob = (Object *)ptr->id.data;
+
+  if (!ob) {
+return 0;
+  }
+
+  PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache);
+
+  if (cache->flag & PTCACHE_FLAG_INFO_DIRTY) {
+BKE_ptcache_update_info();
+  }
+
+  return (int)strlen(cache->info);
+}
+
 static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr))
 {
   /* both methods work ok, but return the shorter path */
@@ -870,6 +888,11 @@ static void rna_def_pointcache_common(StructRNA *srna)
   prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
   RNA_def_property_string_sdna(prop, NULL, "info");
   RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+  /* Note that we do not actually need a getter here, `rna_Cache_info_length` 
will upate the info
+   * string just as well. */
+  RNA_def_property_string_funcs(prop, NULL, "rna_Cache_info_length", NULL);
+  

[Bf-blender-cvs] [6f9cbbc8ec4] master: Add mathutils.geometry.delaunay_2d_cdt() function to Python API.

2019-08-13 Thread Howard Trickey
Commit: 6f9cbbc8ec4f42131f46d3d25e7608112bcb7eab
Author: Howard Trickey
Date:   Tue Aug 13 07:31:14 2019 -0400
Branches: master
https://developer.blender.org/rB6f9cbbc8ec4f42131f46d3d25e7608112bcb7eab

Add mathutils.geometry.delaunay_2d_cdt() function to Python API.

Provides Python API access to recently added Constrained Delaunay
Triangulation routine.
Reviewed in D5467.

===

M   source/blender/python/mathutils/mathutils.c
M   source/blender/python/mathutils/mathutils.h
M   source/blender/python/mathutils/mathutils_geometry.c

===

diff --git a/source/blender/python/mathutils/mathutils.c 
b/source/blender/python/mathutils/mathutils.c
index befa6532e97..2b1ddbbb03a 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -25,6 +25,7 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
+#include "../generic/py_capi_utils.h"
 #include "../generic/python_utildefines.h"
 
 #ifndef MATH_STANDALONE
@@ -328,6 +329,153 @@ int mathutils_array_parse_alloc_v(float **array,
   return size;
 }
 
+/* Parse an sequence array_dim integers into array. */
+int mathutils_int_array_parse(int *array, int array_dim, PyObject *value, 
const char *error_prefix)
+{
+  int size, i;
+  PyObject *value_fast, **value_fast_items, *item;
+
+  if (!(value_fast = PySequence_Fast(value, error_prefix))) {
+/* PySequence_Fast sets the error */
+return -1;
+  }
+
+  if ((size = PySequence_Fast_GET_SIZE(value_fast)) != array_dim) {
+PyErr_Format(PyExc_ValueError,
+ "%.200s: sequence size is %d, expected %d",
+ error_prefix,
+ size,
+ array_dim);
+Py_DECREF(value_fast);
+return -1;
+  }
+
+  value_fast_items = PySequence_Fast_ITEMS(value_fast);
+  i = size;
+  while (i > 0) {
+i--;
+if (((array[i] = PyC_Long_AsI32((item = value_fast_items[i]))) == -1) && 
PyErr_Occurred()) {
+  PyErr_Format(PyExc_TypeError, "%.200s: sequence index %d expected an 
int", error_prefix, i);
+  size = -1;
+  break;
+}
+  }
+  Py_DECREF(value_fast);
+
+  return size;
+}
+
+/* Parse sequence of array_dim sequences of integers and return allocated 
result. */
+int mathutils_array_parse_alloc_vi(int **array,
+   int array_dim,
+   PyObject *value,
+   const char *error_prefix)
+{
+  PyObject *value_fast;
+  int i, size;
+
+  if (!(value_fast = PySequence_Fast(value, error_prefix))) {
+/* PySequence_Fast sets the error */
+return -1;
+  }
+
+  size = PySequence_Fast_GET_SIZE(value_fast);
+
+  if (size != 0) {
+PyObject **value_fast_items = PySequence_Fast_ITEMS(value_fast);
+int *ip;
+
+ip = *array = PyMem_Malloc(size * array_dim * sizeof(int));
+
+for (i = 0; i < size; i++, ip += array_dim) {
+  PyObject *item = value_fast_items[i];
+
+  if (mathutils_int_array_parse(ip, array_dim, item, error_prefix) == -1) {
+PyMem_Free(*array);
+*array = NULL;
+size = -1;
+break;
+  }
+}
+  }
+
+  Py_DECREF(value_fast);
+  return size;
+}
+
+/* Parse sequence of variable-length sequences of int and return allocated
+ * triple of arrays to represent the result:
+ * The flattened sequences are put into *array.
+ * The start index of each sequence goes into start_table.
+ * The length of each index goes into len_table.
+ */
+int mathutils_array_parse_alloc_viseq(
+int **array, int **start_table, int **len_table, PyObject *value, const 
char *error_prefix)
+{
+  PyObject *value_fast, *subseq;
+  int i, size, start, subseq_len;
+  int *ip;
+
+  *array = NULL;
+  *start_table = NULL;
+  *len_table = NULL;
+  if (!(value_fast = PySequence_Fast(value, error_prefix))) {
+/* PySequence_Fast sets the error */
+return -1;
+  }
+
+  size = PySequence_Fast_GET_SIZE(value_fast);
+
+  if (size != 0) {
+PyObject **value_fast_items = PySequence_Fast_ITEMS(value_fast);
+
+*start_table = PyMem_Malloc(size * sizeof(int));
+*len_table = PyMem_Malloc(size * sizeof(int));
+
+/* First pass to set starts and len, and calculate size of array needed */
+start = 0;
+for (i = 0; i < size; i++) {
+  subseq = value_fast_items[i];
+  if ((subseq_len = (int)PySequence_Size(subseq)) == -1) {
+PyErr_Format(
+PyExc_ValueError, "%.200s: sequence expected to have 
subsequences", error_prefix);
+PyMem_Free(*start_table);
+PyMem_Free(*len_table);
+Py_DECREF(value_fast);
+*start_table = NULL;
+*len_table = NULL;
+return -1;
+  }
+  (*start_table)[i] = start;
+  (*len_table)[i] = subseq_len;
+  start += subseq_len;
+}
+
+ip = *array = PyMem_Malloc(start * sizeof(int));
+
+/* Second pass to parse the subsequences into 

[Bf-blender-cvs] [8b0706a6c1d] functions: fix compile error

2019-08-13 Thread Jacques Lucke
Commit: 8b0706a6c1db98f42b8230d3231b16fbfe517fc0
Author: Jacques Lucke
Date:   Tue Aug 13 13:27:43 2019 +0200
Branches: functions
https://developer.blender.org/rB8b0706a6c1db98f42b8230d3231b16fbfe517fc0

fix compile error

===

M   source/blender/blenlib/BLI_monotonic_allocator.hpp

===

diff --git a/source/blender/blenlib/BLI_monotonic_allocator.hpp 
b/source/blender/blenlib/BLI_monotonic_allocator.hpp
index 90637fdbe18..e67573dab03 100644
--- a/source/blender/blenlib/BLI_monotonic_allocator.hpp
+++ b/source/blender/blenlib/BLI_monotonic_allocator.hpp
@@ -68,7 +68,7 @@ class MonotonicAllocator {
   void *allocate_aligned(uint size, uint alignment)
   {
 BLI_assert(is_power_of_2_i(alignment));
-uint64_t space = size + alignment - 1;
+size_t space = size + alignment - 1;
 void *ptr = this->allocate(space);
 void *aligned_ptr = std::align(alignment, size, ptr, space);
 BLI_assert(aligned_ptr != nullptr);

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


[Bf-blender-cvs] [180d46c76ed] functions: remove copy to clipboard

2019-08-13 Thread Jacques Lucke
Commit: 180d46c76ed51cdf2c76904234f606c805458c9b
Author: Jacques Lucke
Date:   Tue Aug 13 11:43:20 2019 +0200
Branches: functions
https://developer.blender.org/rB180d46c76ed51cdf2c76904234f606c805458c9b

remove copy to clipboard

===

M   source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp

===

diff --git 
a/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp 
b/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
index ab42daa68f1..55d1081915d 100644
--- a/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
@@ -94,8 +94,6 @@ ValueOrError generate_graph(VirtualNodeTree 
,
 return BLI_ERROR_CREATE("error inserting unlinked inputs");
   }
 
-  builder.to_dot__clipboard();
-
   return builder.build();
 }

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


[Bf-blender-cvs] [a1fef730754] functions: Merge branch 'master' into functions

2019-08-13 Thread Jacques Lucke
Commit: a1fef7307540ed56c4e97295a0e56c674e3eed7d
Author: Jacques Lucke
Date:   Tue Aug 13 11:28:49 2019 +0200
Branches: functions
https://developer.blender.org/rBa1fef7307540ed56c4e97295a0e56c674e3eed7d

Merge branch 'master' into functions

===



===



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


[Bf-blender-cvs] [918150a0b96] master: Fix T65670: bone envelope head radius missing from transform panel

2019-08-13 Thread Campbell Barton
Commit: 918150a0b96deec4a413d5689383ee43d7ff4df9
Author: Campbell Barton
Date:   Tue Aug 13 18:15:43 2019 +1000
Branches: master
https://developer.blender.org/rB918150a0b96deec4a413d5689383ee43d7ff4df9

Fix T65670: bone envelope head radius missing from transform panel

Make the transforms section of the properties panel consistent with
the transforms section of the side-bar, and to expose some currently
hidden BBone properties in the Bendy Bone section.

- Object transformations were not consistent with Pose Bone
  transformations in that they did not use single-column layout.

- Even in Pose Bone transformations,
  the rotation mode option was after Scale.

- Edit Bone Transforms panel included "Tail Radius" and
  "Envelope Deform Distance", neither of which belong there. See T65670.

- Expose bbone_x and bbone_z.

D5454 by @Mets

===

M   release/scripts/startup/bl_ui/properties_data_bone.py
M   release/scripts/startup/bl_ui/properties_object.py
M   source/blender/makesrna/intern/rna_armature.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py 
b/release/scripts/startup/bl_ui/properties_data_bone.py
index 707b1ca3f1a..f739cd66699 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -73,36 +73,44 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
 pchan = ob.pose.bones[bone.name]
 col.active = not (bone.parent and bone.use_connect)
 
-sub = col.row(align=True)
-sub.prop(pchan, "location")
-sub.prop(pchan, "lock_location", text="")
+row = col.row(align=True)
+row.prop(pchan, "location")
+row.use_property_decorate = False
+row.prop(pchan, "lock_location", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
 
-col = layout.column()
 rotation_mode = pchan.rotation_mode
 if rotation_mode == 'QUATERNION':
-sub = col.row(align=True)
-sub.prop(pchan, "rotation_quaternion", text="Rotation")
-subsub = sub.column(align=True)
-subsub.prop(pchan, "lock_rotation_w", text="")
-subsub.prop(pchan, "lock_rotation", text="")
+col = layout.column()
+row = col.row(align=True)
+row.prop(pchan, "rotation_quaternion", text="Rotation")
+sub = row.column(align=True)
+sub.use_property_decorate = False
+sub.prop(pchan, "lock_rotation_w", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
+sub.prop(pchan, "lock_rotation", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
 elif rotation_mode == 'AXIS_ANGLE':
-sub = col.row(align=True)
-sub.prop(pchan, "rotation_axis_angle", text="Rotation")
-subsub = sub.column(align=True)
-subsub.prop(pchan, "lock_rotation_w", text="")
-subsub.prop(pchan, "lock_rotation", text="")
-else:
-sub = col.row(align=True)
-sub.prop(pchan, "rotation_euler", text="Rotation")
-sub.prop(pchan, "lock_rotation", text="")
+col = layout.column()
+row = col.row(align=True)
+row.prop(pchan, "rotation_axis_angle", text="Rotation")
 
-col = layout.column()
-sub = col.row(align=True)
-sub.prop(pchan, "scale")
-sub.prop(pchan, "lock_scale", text="")
+sub = row.column(align=True)
+sub.use_property_decorate = False
+sub.prop(pchan, "lock_rotation_w", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
+sub.prop(pchan, "lock_rotation", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
+else:
+col = layout.column()
+row = col.row(align=True)
+row.prop(pchan, "rotation_euler", text="Rotation")
+row.use_property_decorate = False
+row.prop(pchan, "lock_rotation", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
+row = layout.row(align=True)
+row.prop(pchan, "rotation_mode", text='Mode')
+row.label(text="", icon='BLANK1')
 
 col = layout.column()
-col.prop(pchan, "rotation_mode")
+row = col.row(align=True)
+row.prop(pchan, "scale")
+row.use_property_decorate = False
+row.prop(pchan, "lock_scale", text="", emboss=False, 
icon='DECORATE_UNLOCKED')
 
 elif context.edit_bone:
 bone = context.edit_bone
@@ -114,10 +122,6 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
 col.prop(bone, "roll")
 col.prop(bone, "lock")
 
-