[Bf-blender-cvs] [9fe9cf82610] blender2.8: fix omission from previous commit

2017-04-21 Thread Mike Erwin
Commit: 9fe9cf826107ca5c2169e0f2b04defff81b455fa
Author: Mike Erwin
Date:   Sat Apr 22 00:58:42 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB9fe9cf826107ca5c2169e0f2b04defff81b455fa

fix omission from previous commit

Missed one old call on Linux/X11.
Follow-up to ef640ecf1004f7af9cfde09f5ce1cde2fb70747f

===

M   intern/ghost/intern/GHOST_ContextGLX.cpp

===

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp 
b/intern/ghost/intern/GHOST_ContextGLX.cpp
index a89b23fe486..0a9dc900aed 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -84,8 +84,6 @@ GHOST_ContextGLX::GHOST_ContextGLX(
 GHOST_ContextGLX::~GHOST_ContextGLX()
 {
if (m_display != NULL) {
-   activateGLXEW();
-
if (m_context != None) {
if (m_window != 0 && m_context == 
::glXGetCurrentContext())
::glXMakeCurrent(m_display, None, NULL);

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


[Bf-blender-cvs] [ef640ecf100] blender2.8: OpenGL: remove use of GLEW MX

2017-04-21 Thread Mike Erwin
Commit: ef640ecf1004f7af9cfde09f5ce1cde2fb70747f
Author: Mike Erwin
Date:   Sat Apr 22 00:35:04 2017 -0400
Branches: blender2.8
https://developer.blender.org/rBef640ecf1004f7af9cfde09f5ce1cde2fb70747f

OpenGL: remove use of GLEW MX

MX (Multiple conteXt) support was dropped from the GLEW 2.0 library to make 
core profile support cleaner.

Our WITH_GLEW_MX build option was OFF by default already; this commit removes 
the inactive code paths.

I'm working on a plan for multiple GPUs, contexts, resource sharing, etc. This 
commit gives us a cleaner starting point for that upcoming work.

Tested on Mac, will test on Linux & Windows immediately after pushing.

===

M   CMakeLists.txt
M   build_files/cmake/Modules/FindGLEW.cmake
M   extern/glew-es/CMakeLists.txt
M   extern/glew/CMakeLists.txt
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/util/util_opengl.h
M   intern/cycles/util/util_view.cpp
M   intern/ghost/intern/GHOST_Context.cpp
M   intern/ghost/intern/GHOST_Context.h
M   intern/ghost/intern/GHOST_ContextCGL.h
M   intern/ghost/intern/GHOST_ContextCGL.mm
M   intern/ghost/intern/GHOST_ContextEGL.cpp
M   intern/ghost/intern/GHOST_ContextEGL.h
M   intern/ghost/intern/GHOST_ContextGLX.cpp
M   intern/ghost/intern/GHOST_ContextGLX.h
M   intern/ghost/intern/GHOST_ContextSDL.cpp
M   intern/ghost/intern/GHOST_ContextWGL.cpp
M   intern/ghost/intern/GHOST_ContextWGL.h
M   intern/glew-mx/glew-mx.h
M   intern/glew-mx/intern/glew-mx.c
M   source/blender/gpu/intern/gpu_debug.c

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13171ac2780..c7209ed4819 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -466,7 +466,6 @@ endif()
 
 # OpenGL
 
-option(WITH_GLEW_MX "Support multiple GLEW contexts 
(experimental)" 
OFF )
 option(WITH_GLEW_ES "Switches to experimental copy of GLEW that 
has support for OpenGL ES. (temporary option for development purposes)" OFF)
 option(WITH_GL_EGL  "Use the EGL OpenGL system library instead of 
the platform specific OpenGL system library (CGL, glX, or WGL)"   OFF)
 option(WITH_GL_PROFILE_COMPAT   "Support using the OpenGL 'compatibility' 
profile. (deprecated)"ON )
@@ -474,7 +473,6 @@ option(WITH_GL_PROFILE_CORE "Support using the OpenGL 
3.3+ 'core' profile."
 option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL 
or the AGL/WGL/XGL 'es20' profile)"  OFF)
 
 mark_as_advanced(
-   WITH_GLEW_MX
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_COMPAT
@@ -1224,10 +1222,6 @@ endif()
 #-
 # Configure GLEW
 
-if(WITH_GLEW_MX)
-   list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
-endif()
-
 if(WITH_SYSTEM_GLEW)
find_package(GLEW)
 
@@ -1237,11 +1231,7 @@ if(WITH_SYSTEM_GLEW)
message(FATAL_ERROR "GLEW is required to build Blender. Install 
it or disable WITH_SYSTEM_GLEW.")
endif()
 
-   if(WITH_GLEW_MX)
-   set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
-   else()
-   set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
-   endif()
+   set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
 else()
if(WITH_GLEW_ES)
set(GLEW_INCLUDE_PATH 
"${CMAKE_SOURCE_DIR}/extern/glew-es/include")
diff --git a/build_files/cmake/Modules/FindGLEW.cmake 
b/build_files/cmake/Modules/FindGLEW.cmake
index 2f098d5d9a4..3057237f3c6 100644
--- a/build_files/cmake/Modules/FindGLEW.cmake
+++ b/build_files/cmake/Modules/FindGLEW.cmake
@@ -9,7 +9,6 @@
 #
 # also defined,
 #  GLEW_LIBRARY, where to find the Glew library.
-#  GLEW_MX_LIBRARY, where to find the GlewMX library.
 
 #=
 # Copyright 2014 Blender Foundation.
@@ -50,16 +49,6 @@ FIND_LIBRARY(GLEW_LIBRARY
 lib64 lib
   )
 
-
-FIND_LIBRARY(GLEW_MX_LIBRARY
-  NAMES
-GLEWmx
-  HINTS
-${_glew_SEARCH_DIRS}
-  PATH_SUFFIXES
-lib64 lib
-  )
-
 # handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if 
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
@@ -73,7 +62,6 @@ ENDIF(GLEW_FOUND)
 MARK_AS_ADVANCED(
   GLEW_INCLUDE_DIR
   GLEW_LIBRARY
-  GLEW_MX_LIBRARY
 )
 
 UNSET(_glew_SEARCH_DIRS)
diff --git a/extern/glew-es/CMakeLists.txt b/extern/glew-es/CMakeLists.txt
index ba80d3f6120..ea25425df81 100644
--- a/extern/glew-es/CMakeLists.txt
+++ b/extern/glew-es/CMakeLists.txt
@@ -49,9 +49,4 @@ set(SRC
 
 add_definitions(${GL_DEFINITIONS})
 
-if(WITH_GLEW_MX)
-   add_definitions(-DGLEW_MX)
-endif()
-
-
 blender_add_lib(extern_glew_es "${SRC}" 

[Bf-blender-cvs] [dcda9b41365] blender2.8: Eevee/OpenGL: fix shader for core profile

2017-04-21 Thread Mike Erwin
Commit: dcda9b41365eea4b725d941f34179b4e1da3bb8d
Author: Mike Erwin
Date:   Fri Apr 21 15:48:56 2017 -0400
Branches: blender2.8
https://developer.blender.org/rBdcda9b41365eea4b725d941f34179b4e1da3bb8d

Eevee/OpenGL: fix shader for core profile

===

M   source/blender/draw/engines/eevee/shaders/probe_frag.glsl

===

diff --git a/source/blender/draw/engines/eevee/shaders/probe_frag.glsl 
b/source/blender/draw/engines/eevee/shaders/probe_frag.glsl
index 1a2d2f48989..9afdb33b583 100644
--- a/source/blender/draw/engines/eevee/shaders/probe_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/probe_frag.glsl
@@ -13,7 +13,7 @@ void node_tex_environment_equirectangular(vec3 co, sampler2D 
ima, out vec4 color
float u = -atan(nco.y, nco.x) / (2.0 * 3.1415) + 0.5;
float v = atan(nco.z, hypot(nco.x, nco.y)) / 3.1415 + 0.5;
 
-   color = texture2D(ima, vec2(u, v));
+   color = texture(ima, vec2(u, v));
 }
 
 void main() {
@@ -23,4 +23,4 @@ void main() {
dist = (dist > 0.99) ? 1e1 : 0.0;
FragColor = vec4(dist,dist,dist, 1.0);
node_tex_environment_equirectangular(L, probeLatLong, FragColor);
-}
\ No newline at end of file
+}

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


[Bf-blender-cvs] [12261aa047f] blender2.8: fix unitizialized use warning

2017-04-21 Thread Mike Erwin
Commit: 12261aa047f41eb7f0d29c3ba25d933c3f67e7fc
Author: Mike Erwin
Date:   Fri Apr 21 15:51:08 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB12261aa047f41eb7f0d29c3ba25d933c3f67e7fc

fix unitizialized use warning

The code would only use 'type' uninitialized in error conditions, but it's 
still better to avoid that.

caught by clang

===

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

===

diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index 1f0bf0cf79c..66e44edc63d 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1319,6 +1319,7 @@ void DRW_framebuffer_read_data(int x, int y, int w, int 
h, int channels, int slo
case 4: type = GL_RGBA; break;
default:
BLI_assert(false && "wrong number of read channels");
+   return;
}
glReadBuffer(GL_COLOR_ATTACHMENT0 + slot);
glReadPixels(x, y, w, h, type, GL_FLOAT, data);

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


[Bf-blender-cvs] [1beed61b761] blender2.8: OpenGL/GHOST: don't request accum buffer on Mac

2017-04-21 Thread Mike Erwin
Commit: 1beed61b761d3f964f57f99235c479ff1ddfe26f
Author: Mike Erwin
Date:   Fri Apr 21 16:04:03 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB1beed61b761d3f964f57f99235c479ff1ddfe26f

OpenGL/GHOST: don't request accum buffer on Mac

This was blocking core context setup on Mac, since accumulation buffers are 
obsolete. With this (and appropriate CMake options) I now get

renderer:   'Intel HD Graphics 4000 OpenGL Engine'
vendor: 'Intel Inc.'
version:'4.1 INTEL-10.24.45'

in system-info.txt intead of 

version:'2.1 INTEL-10.24.45'

===

M   intern/ghost/intern/GHOST_ContextCGL.mm

===

diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm 
b/intern/ghost/intern/GHOST_ContextCGL.mm
index 64db70197bb..f6adb362470 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -216,9 +216,6 @@ static void makeAttribList(
attribs.push_back(NSOpenGLPFADepthSize);
attribs.push_back((NSOpenGLPixelFormatAttribute) 32);
 
-   attribs.push_back(NSOpenGLPFAAccumSize);
-   attribs.push_back((NSOpenGLPixelFormatAttribute) 32);
-
if (stereoVisual)
attribs.push_back(NSOpenGLPFAStereo);

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


[Bf-blender-cvs] [dc5bd2784f3] master: [cmake] Fix Alembic build errors with msvc

2017-04-21 Thread lazydodo
Commit: dc5bd2784f320a5aa017565930291f08b0e1bbd4
Author: lazydodo
Date:   Fri Apr 21 12:18:19 2017 -0600
Branches: master
https://developer.blender.org/rBdc5bd2784f320a5aa017565930291f08b0e1bbd4

[cmake] Fix Alembic build errors with msvc

===

M   build_files/cmake/platform/platform_win32_msvc.cmake

===

diff --git a/build_files/cmake/platform/platform_win32_msvc.cmake 
b/build_files/cmake/platform/platform_win32_msvc.cmake
index 3ea93a96290..6447559f62c 100644
--- a/build_files/cmake/platform/platform_win32_msvc.cmake
+++ b/build_files/cmake/platform/platform_win32_msvc.cmake
@@ -37,6 +37,12 @@ macro(windows_find_package package_name
endif(WITH_WINDOWS_FIND_MODULES)
 endmacro()
 
+macro(find_package_wrapper)
+   if(WITH_WINDOWS_FIND_MODULES)
+   find_package(${ARGV})
+   endif()
+endmacro()
+
 add_definitions(-DWIN32)
 # Minimum MSVC Version
 if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
@@ -432,6 +438,7 @@ if(WITH_ALEMBIC)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES optimized alembic debug alembic_d)
+   set(ALEMBIC_FOUND 1)
 endif()
 
 if(WITH_MOD_CLOTH_ELTOPO)

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


[Bf-blender-cvs] [8ac1f03f411] blender2.8: Eevee: Cascaded Shadow Maps, follow up.

2017-04-21 Thread Clément Foucault
Commit: 8ac1f03f411c98efe4ca4d568a2b231ff59b2505
Author: Clément Foucault
Date:   Fri Apr 21 16:43:14 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB8ac1f03f411c98efe4ca4d568a2b231ff59b2505

Eevee: Cascaded Shadow Maps, follow up.

- Compute coarse bounding box of split frustum. Can be improved
- Make use of 4 cascade.
- View dependant glitches are fixed.
- Optimized shader code.

===

M   source/blender/draw/engines/eevee/eevee_lights.c
M   source/blender/draw/engines/eevee/eevee_private.h
M   source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
M   source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl

===

diff --git a/source/blender/draw/engines/eevee/eevee_lights.c 
b/source/blender/draw/engines/eevee/eevee_lights.c
index 7c4a5523ecd..cb4032f198c 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -295,14 +295,65 @@ static void eevee_shadow_map_setup(Object *ob, 
EEVEE_LampsInfo *linfo, EEVEE_Lam
 
 #define LERP(t, a, b) ((a) + (t) * ((b) - (a)))
 
+static void frustum_min_bounding_sphere(const float corners[8][4], float 
r_center[3], float *r_radius)
+{
+#if 0 /* Simple solution but waist too much space. */
+   float minvec[3], maxvec[3];
+
+   /* compute the bounding box */
+   INIT_MINMAX(minvec, maxvec);
+   for (int i = 0; i < 8; ++i) {
+   minmax_v3v3_v3(minvec, maxvec, corners[i]);
+   }
+
+   /* compute the bounding sphere of this box */
+   r_radius = len_v3v3(minvec, maxvec) * 0.5f;
+   add_v3_v3v3(r_center, minvec, maxvec);
+   mul_v3_fl(r_center, 0.5f);
+#else
+   /* Make the bouding sphere always centered on the front diagonal */
+   add_v3_v3v3(r_center, corners[4], corners[7]);
+   mul_v3_fl(r_center, 0.5f);
+   *r_radius = len_v3v3(corners[0], r_center);
+
+   /* Search the largest distance between the sphere center
+* and the front plane corners. */
+   for (int i = 0; i < 4; ++i) {
+   float rad = len_v3v3(corners[4+i], r_center);
+   if (rad > *r_radius) {
+   *r_radius = rad;
+   }
+   }
+#endif
+}
+
 static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, 
EEVEE_LampEngineData *led)
 {
/* Camera Matrices */
float persmat[4][4], persinv[4][4];
+   float viewprojmat[4][4], projinv[4][4];
+   float near, far;
+   float near_v[4] = {0.0f, 0.0f, -1.0f, 1.0f};
+   float far_v[4] = {0.0f, 0.0f,  1.0f, 1.0f};
+   bool is_persp = DRW_viewport_is_persp_get();
+   DRW_viewport_matrix_get(persmat, DRW_MAT_PERS);
+   invert_m4_m4(persinv, persmat);
+   /* FIXME : Get near / far from Draw manager? */
+   DRW_viewport_matrix_get(viewprojmat, DRW_MAT_WIN);
+   invert_m4_m4(projinv, viewprojmat);
+   mul_m4_v4(projinv, near_v);
+   mul_m4_v4(projinv, far_v);
+   near = near_v[2];
+   far = far_v[2]; /* TODO: Should be a shadow parameter */
+   if (is_persp) {
+   near /= near_v[3];
+   far /= far_v[3];
+   }
+
/* Lamps Matrices */
float viewmat[4][4], projmat[4][4];
-   float minvec[3], maxvec[3];
int cascade_ct = MAX_CASCADE_NUM;
+   float shadow_res = 512.0f; /* TODO parameter */
 
EEVEE_ShadowCascadeData *evscp = (EEVEE_ShadowCascadeData *)led->sto;
EEVEE_Light *evli = linfo->light_data + evscp->light_id;
@@ -313,28 +364,56 @@ static void eevee_shadow_cascade_setup(Object *ob, 
EEVEE_LampsInfo *linfo, EEVEE
 * the view frustum into several sub-frustum
 * that are individually receiving one shadow map */
 
+   /* init near/far */
+   for (int c = 0; c < MAX_CASCADE_NUM; ++c) {
+   evsh->split[c] = far;
+   }
+
+   /* Compute split planes */
+   float splits_ndc[MAX_CASCADE_NUM + 1];
+   splits_ndc[0] = -1.0f;
+   splits_ndc[cascade_ct] = 1.0f;
+   for (int c = 1; c < cascade_ct; ++c) {
+   const float lambda = 0.8f; /* TODO : Parameter */
+
+   /* View Space */
+   float linear_split = LERP(((float)(c) / (float)cascade_ct), 
near, far);
+   float exp_split = near * powf(far / near, (float)(c) / 
(float)cascade_ct);
+
+   if (is_persp) {
+   evsh->split[c-1] = LERP(lambda, linear_split, 
exp_split);
+   }
+   else {
+   evsh->split[c-1] = linear_split;
+   }
+
+   /* NDC Space */
+   float p[4] = {1.0f, 1.0f, evsh->split[c-1], 1.0f};
+   mul_m4_v4(viewprojmat, p);
+   splits_ndc[c] = p[2];
+
+   if (is_persp) {
+   splits_ndc[c] /= p[3];
+   }
+   }
+
 

[Bf-blender-cvs] [cc2d5016425] blender2.8: Merge branch 'master' into blender2.8

2017-04-21 Thread Sybren A. Stüvel
Commit: cc2d501642555616f3e8808bdbaa72f9c752e1a1
Author: Sybren A. Stüvel
Date:   Fri Apr 21 16:30:24 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBcc2d501642555616f3e8808bdbaa72f9c752e1a1

Merge branch 'master' into blender2.8

===



===



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


[Bf-blender-cvs] [e6f073fe412] blender2.8: Re-enabling Alembic test

2017-04-21 Thread Dalai Felinto
Commit: e6f073fe412b80eedd9dd090315bd6eaeb68cb09
Author: Dalai Felinto
Date:   Fri Apr 21 15:58:14 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe6f073fe412b80eedd9dd090315bd6eaeb68cb09

Re-enabling Alembic test

(disabled because of bug fixed on 19548040d91dedc2a63444f3277e4365837931e1)

===

M   tests/python/bl_alembic_import_test.py

===

diff --git a/tests/python/bl_alembic_import_test.py 
b/tests/python/bl_alembic_import_test.py
index 7c0f0254973..e036157e59c 100644
--- a/tests/python/bl_alembic_import_test.py
+++ b/tests/python/bl_alembic_import_test.py
@@ -63,9 +63,7 @@ class SimpleImportTest(unittest.TestCase):
 self.assertEqual(objects['Cube_003'], objects['Cube_005'].parent)
 self.assertEqual(objects['Cube_003'], objects['Cube_006'].parent)
 
-def DISABLED_test_select_after_import(self):
-self.fail('FIXME: Disabled until https://developer.blender.org/T51261 
is fixed')
-
+def test_select_after_import(self):
 # Add a sphere, so that there is something in the scene, selected, and 
active,
 # before we do the Alembic import.
 bpy.ops.mesh.primitive_uv_sphere_add()

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


[Bf-blender-cvs] [111a53f74cc] blender2.8: Fix crash when duplicating objects by tagging depsgraph

2017-04-21 Thread Dalai Felinto
Commit: 111a53f74ccf2cd53e41d7597dfecbab041858a3
Author: Dalai Felinto
Date:   Fri Apr 21 15:52:16 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB111a53f74ccf2cd53e41d7597dfecbab041858a3

Fix crash when duplicating objects by tagging depsgraph

This may change once depsgraph becomes aware of workspaces.
For now this is the best we can do.

===

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

===

diff --git a/source/blender/editors/object/object_add.c 
b/source/blender/editors/object/object_add.c
index d860ce3d5e9..68332004e54 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2286,6 +2286,8 @@ static int duplicate_exec(bContext *C, wmOperator *op)
BKE_main_id_clear_newpoins(bmain);
 
DAG_relations_tag_update(bmain);
+   /* TODO(sergey): Use proper flag for tagging here. */
+   DAG_id_tag_update(_data_scene(C)->id, 0);
 
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);

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


[Bf-blender-cvs] [e6ee3fd9240] master: Alembic unit tests: don't depend on ALEMBIC_ROOT_DIR being defined by user

2017-04-21 Thread Sybren A. Stüvel
Commit: e6ee3fd9240b96a558988d443af6f6f52073e0b4
Author: Sybren A. Stüvel
Date:   Fri Apr 21 16:20:01 2017 +0200
Branches: master
https://developer.blender.org/rBe6ee3fd9240b96a558988d443af6f6f52073e0b4

Alembic unit tests: don't depend on ALEMBIC_ROOT_DIR being defined by user

By mistake, the code relied on ALEMBIC_ROOT_DIR being defined by the user
running the tests. Now CMake macros are used to correctly find the Alembic
root directory.

===

M   tests/python/CMakeLists.txt

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 30d593bd8d6..da795c8c020 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -444,6 +444,13 @@ if(WITH_CYCLES)
 endif()
 
 if(WITH_ALEMBIC)
+   find_package_wrapper(Alembic)
+   if(NOT ALEMBIC_FOUND)
+   message(FATAL_ERROR "Alembic is enabled but cannot be found")
+   endif()
+   get_filename_component(real_include_dir ${ALEMBIC_INCLUDE_DIR} REALPATH)
+   get_filename_component(ALEMBIC_ROOT_DIR ${real_include_dir} DIRECTORY)
+
add_test(script_alembic_import ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_import_test.py
--

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


[Bf-blender-cvs] [7e977470f3e] master: Alembic unit tests: Removed trailing spaces

2017-04-21 Thread Sybren A. Stüvel
Commit: 7e977470f3e3e082082debe8a8b266ffea8dada6
Author: Sybren A. Stüvel
Date:   Fri Apr 21 16:20:35 2017 +0200
Branches: master
https://developer.blender.org/rB7e977470f3e3e082082debe8a8b266ffea8dada6

Alembic unit tests: Removed trailing spaces

===

M   tests/python/CMakeLists.txt

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index da795c8c020..dca85dbf770 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -18,7 +18,7 @@
 #
 # * END GPL LICENSE BLOCK *
 
-# --env-system-scripts allows to run without the install target. 
+# --env-system-scripts allows to run without the install target.
 
 # Use '--write-blend=/tmp/test.blend' to view output
 
@@ -47,7 +47,7 @@ else()
set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender)
 endif()
 
-# for testing with valgrind prefix: valgrind --track-origins=yes 
--error-limit=no 
+# for testing with valgrind prefix: valgrind --track-origins=yes 
--error-limit=no
 set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE})
 set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio 
--factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)

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


[349cafac524] master: Matrix.decompose(): changed terminology, "location" → "translation"

2017-04-21 Thread Sybren A. Stüvel
Commit: 349cafac5243e1958f211cf67ee803cd3421a830
Author: Sybren A. Stüvel
Date:   Fri Apr 21 15:48:53 2017 +0200
Branches: master
https://developer.blender.org/rB349cafac5243e1958f211cf67ee803cd3421a830

Matrix.decompose(): changed terminology, "location" → "translation"

Matrix.decompose() should either return "location, orientation, size" or
"translation, rotation, scale". Since there are constructors for the former,
I've replaced "location" in the documentation with "translation".

The code is still the same, I just changed the documentation.

===

M   source/blender/python/mathutils/mathutils_Matrix.c

===

diff --git a/source/blender/python/mathutils/mathutils_Matrix.c 
b/source/blender/python/mathutils/mathutils_Matrix.c
index bd44e77e7c6..10f428ba355 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -1641,9 +1641,9 @@ static PyObject *Matrix_rotate(MatrixObject *self, 
PyObject *value)
 PyDoc_STRVAR(Matrix_decompose_doc,
 ".. method:: decompose()\n"
 "\n"
-"   Return the location, rotation and scale components of this matrix.\n"
+"   Return the translation, rotation and scale components of this matrix.\n"
 "\n"
-"   :return: loc, rot, scale triple.\n"
+"   :return: trans, rot, scale triple.\n"
 "   :rtype: (:class:`Vector`, :class:`Quaternion`, :class:`Vector`)"
 );
 static PyObject *Matrix_decompose(MatrixObject *self)

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


[Bf-blender-cvs] [2f506b94588] blender2.8: Fix objects visibility evaluation bug

2017-04-21 Thread Dalai Felinto
Commit: 2f506b94588b9003d9f422ce3c5a0e9dc05f6610
Author: Dalai Felinto
Date:   Fri Apr 21 15:26:53 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB2f506b94588b9003d9f422ce3c5a0e9dc05f6610

Fix objects visibility evaluation bug

This was introduced on 4b77fb30759d1b62224033fc92c55eef7f3e414a no idea how I 
left this in, shame on me

===

M   source/blender/depsgraph/intern/depsgraph_query.cc

===

diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 2fe10766bba..952a4af0208 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -136,7 +136,7 @@ void DAG_objects_iterator_next(Iterator *iter)
Base *base = data->base->next;
 
while (base) {
-   if ((base->flag & data->flag) != BASE_VISIBLED) {
+   if ((base->flag & BASE_VISIBLED) != 0) {
Object *ob = DAG_get_object(data->graph, base->object);
iter->current = ob;

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


[Bf-blender-cvs] [19548040d91] blender2.8: Fix T51261: New objects aren't selected

2017-04-21 Thread Dalai Felinto
Commit: 19548040d91dedc2a63444f3277e4365837931e1
Author: Dalai Felinto
Date:   Fri Apr 21 14:53:19 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB19548040d91dedc2a63444f3277e4365837931e1

Fix T51261: New objects aren't selected

The original code was failing because the base to object flushing was
only happening as part of the depsgraph. However we can use the
evaluated values to set the initial values of the base.

In this particular case, we couldn't set the new object visible because
its selectability flag was not set yet.

===

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

===

diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index 0fb945b64ea..4b9b77e7b82 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -267,7 +267,7 @@ static Base *object_base_add(SceneLayer *sl, Object *ob)
if (base == NULL) {
base = MEM_callocN(sizeof(Base), "Object Base");
 
-   /* do not bump user count, leave it for SceneCollections */
+   /* Do not bump user count, leave it for SceneCollections. */
base->object = ob;
BLI_addtail(>object_bases, base);
 
@@ -775,13 +775,24 @@ static void layer_collection_object_add(SceneLayer *sl, 
LayerCollection *lc, Obj
 {
Base *base = object_base_add(sl, ob);
 
-   /* only add an object once - prevent SceneCollection->objects and
-* SceneCollection->filter_objects to add the same object */
+   /* Only add an object once - prevent SceneCollection->objects and
+* SceneCollection->filter_objects to add the same object. */
 
if (BLI_findptr(>object_bases, base, offsetof(LinkData, data))) {
return;
}
 
+   bool is_visible = (lc->flag & COLLECTION_VISIBLE) != 0;
+   bool is_selectable = is_visible && ((lc->flag & COLLECTION_SELECTABLE) 
!= 0);
+
+   if (is_visible) {
+   base->flag |= BASE_VISIBLED;
+   }
+
+   if (is_selectable) {
+   base->flag |= BASE_SELECTABLED;
+   }
+
BLI_addtail(>object_bases, BLI_genericNodeN(base));
 }

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


[Bf-blender-cvs] [9781139590d] master: Cycles: Solve speed regression of classroom scene after principled commit

2017-04-21 Thread Sergey Sharybin
Commit: 9781139590dbbeb6d246d4fbafa8ab1a4696c7fb
Author: Sergey Sharybin
Date:   Fri Apr 21 12:56:54 2017 +0200
Branches: master
https://developer.blender.org/rB9781139590dbbeb6d246d4fbafa8ab1a4696c7fb

Cycles: Solve speed regression of classroom scene after principled commit

This way we can skip it from compiling into OpenCL kernels by making
this shader compile-time feature.

===

M   intern/cycles/device/device.cpp
M   intern/cycles/device/device.h
M   intern/cycles/kernel/closure/bsdf.h
M   intern/cycles/kernel/closure/bssrdf.h
M   intern/cycles/kernel/kernel_subsurface.h
M   intern/cycles/kernel/kernel_types.h
M   intern/cycles/kernel/svm/svm_closure.h
M   intern/cycles/render/shader.cpp

===

diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index 968af447e29..c024021b4b3 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -66,6 +66,8 @@ std::ostream& operator <<(std::ostream ,
   << string_from_bool(requested_features.use_patch_evaluation) << 
std::endl;
os << "Use Transparent Shadows: "
   << string_from_bool(requested_features.use_transparent) << std::endl;
+   os << "Use Principled BSDF: "
+  << string_from_bool(requested_features.use_principled) << std::endl;
return os;
 }
 
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index ac06e561795..6051dd8b3eb 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -124,6 +124,9 @@ public:
/* Use various shadow tricks, such as shadow catcher. */
bool use_shadow_tricks;
 
+   /* Per-uber shader usage flags. */
+   bool use_principled;
+
DeviceRequestedFeatures()
{
/* TODO(sergey): Find more meaningful defaults. */
@@ -141,6 +144,7 @@ public:
use_patch_evaluation = false;
use_transparent = false;
use_shadow_tricks = false;
+   use_principled = false;
}
 
bool modified(const DeviceRequestedFeatures& requested_features)
@@ -158,7 +162,8 @@ public:
 use_integrator_branched == 
requested_features.use_integrator_branched &&
 use_patch_evaluation == 
requested_features.use_patch_evaluation &&
 use_transparent == requested_features.use_transparent 
&&
-use_shadow_tricks == 
requested_features.use_shadow_tricks);
+use_shadow_tricks == 
requested_features.use_shadow_tricks &&
+use_principled == requested_features.use_principled);
}
 
/* Convert the requested features structure to a build options,
@@ -205,6 +210,9 @@ public:
if(!use_shadow_tricks) {
build_options += " -D__NO_SHADOW_TRICKS__";
}
+   if(!use_principled) {
+   build_options += " -D__NO_PRINCIPLED__";
+   }
return build_options;
}
 };
diff --git a/intern/cycles/kernel/closure/bsdf.h 
b/intern/cycles/kernel/closure/bsdf.h
index 0302fa9b43e..a6bba8bf74d 100644
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@ -137,6 +137,7 @@ ccl_device_forceinline int bsdf_sample(KernelGlobals *kg,
label = bsdf_hair_transmission_sample(sc, sd->Ng, 
sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
eval, omega_in, _in->dx, _in->dy, 
pdf);
break;
+#ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID:
case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID:
label = bsdf_principled_diffuse_sample(sc, sd->Ng, 
sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
@@ -146,6 +147,7 @@ ccl_device_forceinline int bsdf_sample(KernelGlobals *kg,
label = bsdf_principled_sheen_sample(sc, sd->Ng, sd->I, 
sd->dI.dx, sd->dI.dy, randu, randv,
eval, omega_in, _in->dx, _in->dy, 
pdf);
break;
+#endif  /* __PRINCIPLED__ */
 #endif
 #ifdef __VOLUME__
case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID:
@@ -243,6 +245,7 @@ float3 bsdf_eval(KernelGlobals *kg,
case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
eval = bsdf_hair_transmission_eval_reflect(sc, 
sd->I, omega_in, pdf);
break;
+#ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID:
case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID:
eval = bsdf_principled_diffuse_eval_reflect(sc, 
sd->I, omega_in, pdf);
@@ -250,6 +253,7 @@ float3 bsdf_eval(KernelGlobals *kg,

[Bf-blender-cvs] [b6da2a6a86f] master: Cycles: Make it a generic base class for all types of closure nodes

2017-04-21 Thread Sergey Sharybin
Commit: b6da2a6a86fb948f11f9147c5ed722a064673e6d
Author: Sergey Sharybin
Date:   Fri Apr 21 12:50:04 2017 +0200
Branches: master
https://developer.blender.org/rBb6da2a6a86fb948f11f9147c5ed722a064673e6d

Cycles: Make it a generic base class for all types of closure nodes

The idea is to have osme geenric BSDF node which is subclassed by
"regular" BSDF nodes and uber shaders.

This way we can access special type and closure type for making
decisions somewhere else.

===

M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h

===

diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 3f56690d0c1..f9679d52235 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1791,12 +1791,19 @@ void ConvertNode::compile(OSLCompiler& compiler)
assert(0);
 }
 
+/* Base type for all closure-type nodes */
+
+BsdfBaseNode::BsdfBaseNode(const NodeType *node_type)
+: ShaderNode(node_type)
+{
+   special_type = SHADER_SPECIAL_TYPE_CLOSURE;
+}
+
 /* BSDF Closure */
 
 BsdfNode::BsdfNode(const NodeType *node_type)
-: ShaderNode(node_type)
+: BsdfBaseNode(node_type)
 {
-   special_type = SHADER_SPECIAL_TYPE_CLOSURE;
 }
 
 void BsdfNode::compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput 
*param2, ShaderInput *param3, ShaderInput *param4)
@@ -2323,9 +2330,8 @@ NODE_DEFINE(PrincipledBsdfNode)
 }
 
 PrincipledBsdfNode::PrincipledBsdfNode()
-   : ShaderNode(node_type)
+   : BsdfBaseNode(node_type)
 {
-   special_type = SHADER_SPECIAL_TYPE_CLOSURE;
closure = CLOSURE_BSDF_PRINCIPLED_ID;
distribution = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID;
distribution_orig = NBUILTIN_CLOSURES;
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index bc488161e3b..a56313bd5d4 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -321,7 +321,14 @@ private:
static bool initialized;
 };
 
-class BsdfNode : public ShaderNode {
+class BsdfBaseNode : public ShaderNode {
+public:
+   BsdfBaseNode(const NodeType *node_type);
+
+   ClosureType closure;
+};
+
+class BsdfNode : public BsdfBaseNode {
 public:
explicit BsdfNode(const NodeType *node_type);
SHADER_NODE_BASE_CLASS(BsdfNode)
@@ -333,7 +340,6 @@ public:
float3 color;
float3 normal;
float surface_mix_weight;
-   ClosureType closure;
 
virtual bool equals(const ShaderNode& /*other*/)
{
@@ -362,7 +368,7 @@ public:
 };
 
 /* Disney principled BRDF */
-class PrincipledBsdfNode : public ShaderNode {
+class PrincipledBsdfNode : public BsdfBaseNode {
 public:
SHADER_NODE_CLASS(PrincipledBsdfNode)
 
@@ -381,7 +387,7 @@ public:
anisotropic_rotation, refraction_roughness;
float3 normal, clearcoat_normal, tangent;
float surface_mix_weight;
-   ClosureType closure, distribution, distribution_orig;
+   ClosureType distribution, distribution_orig;
 
virtual bool equals(const ShaderNode * /*other*/)
{

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


[Bf-blender-cvs] [cc8f1040982] blender2.8: Tag depsgraph update when hide and hide_select are changed

2017-04-21 Thread Dalai Felinto
Commit: cc8f1040982b6747815f94999136971af6c5a0f2
Author: Dalai Felinto
Date:   Fri Apr 21 14:31:38 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBcc8f1040982b6747815f94999136971af6c5a0f2

Tag depsgraph update when hide and hide_select are changed

We were not updating depsgraph when collection just "became" selectable,
but although this doesn't change object selection, it change its
selectability.

===

M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/editors/space_outliner/outliner_draw.c 
b/source/blender/editors/space_outliner/outliner_draw.c
index 82fdee675b9..1755370a5d6 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -245,10 +245,9 @@ static void restrictbutton_gp_layer_flag_cb(bContext *C, 
void *UNUSED(poin), voi
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 }
 
-static void restrictbutton_collection_hide_cb(bContext *C, void *poin, void 
*UNUSED(poin2))
+static void restrictbutton_collection_flag_cb(bContext *C, void *poin, void 
*UNUSED(poin2))
 {
Scene *scene = poin;
-
/* hide and deselect bases that are directly influenced by this 
LayerCollection */
/* TODO(sergey): Use proper flag for tagging here. */
DAG_id_tag_update(>id, 0);
@@ -256,20 +255,6 @@ static void restrictbutton_collection_hide_cb(bContext *C, 
void *poin, void *UNU
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, NULL);
 }
 
-static void restrictbutton_collection_hide_select_cb(bContext *C, void *poin, 
void *poin2)
-{
-   Scene *scene = poin;
-   LayerCollection *collection = poin2;
-
-   if ((collection->flag & COLLECTION_SELECTABLE) == 0) {
-   /* deselect bases that are directly influenced by this 
LayerCollection */
-   /* TODO(sergey): Use proper flag for tagging here. */
-   DAG_id_tag_update(>id, 0);
-   WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, 
CTX_data_scene(C));
-   }
-   WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, NULL);
-}
-
 static void restrictbutton_id_user_toggle(bContext *UNUSED(C), void *poin, 
void *UNUSED(poin2))
 {
ID *id = (ID *)poin;
@@ -579,14 +564,14 @@ static void outliner_draw_restrictbuts(uiBlock *block, 
Scene *scene, ARegion *ar
  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
  UI_UNIT_Y, 
>flag, 0, 0, 0, 0,
  TIP_("Restrict/Allow 3D 
View visibility of objects in the collection"));
-   UI_but_func_set(bt, 
restrictbutton_collection_hide_cb, scene, collection);
+   UI_but_func_set(bt, 
restrictbutton_collection_flag_cb, scene, collection);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
 
bt = uiDefIconButBitS(block, 
UI_BTYPE_ICON_TOGGLE_N, COLLECTION_SELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
  UI_UNIT_Y, 
>flag, 0, 0, 0, 0,
  TIP_("Restrict/Allow 3D 
View selection of objects in the collection"));
-   UI_but_func_set(bt, 
restrictbutton_collection_hide_select_cb, scene, collection);
+   UI_but_func_set(bt, 
restrictbutton_collection_flag_cb, scene, collection);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
 
UI_block_emboss_set(block, UI_EMBOSS);
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 7f1b291d6f4..1691637ec03 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2634,30 +2634,14 @@ static int rna_LayerCollection_move_into(ID *id, 
LayerCollection *lc_src, Main *
return 1;
 }
 
-static void rna_LayerCollection_hide_update(bContext *C, PointerRNA 
*UNUSED(ptr))
+static void rna_LayerCollection_flag_update(bContext *C, PointerRNA 
*UNUSED(ptr))
 {
Scene *scene = CTX_data_scene(C);
-
-   /* hide and deselect bases that are directly influenced by this 
LayerCollection */
/* TODO(sergey): Use proper flag for tagging here. */
DAG_id_tag_update(>id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
 }
 
-static void rna_LayerCollection_hide_select_update(bContext *C, PointerRNA 
*ptr)
-{
-   LayerCollection *lc = 

[Bf-blender-cvs] [e4ab70da862] master: CMake: Add option to build against system-wide Glog

2017-04-21 Thread Sergey Sharybin
Commit: e4ab70da862b5852a6e3f7bab489bed8c3b18193
Author: Sergey Sharybin
Date:   Fri Apr 21 14:26:25 2017 +0200
Branches: master
https://developer.blender.org/rBe4ab70da862b5852a6e3f7bab489bed8c3b18193

CMake: Add option to build against system-wide Glog

Similar to previous commit for Gflags.

===

M   CMakeLists.txt
A   build_files/cmake/Modules/FindGlog.cmake
M   build_files/cmake/Modules/GTestTesting.cmake
M   build_files/cmake/macros.cmake
M   intern/cycles/CMakeLists.txt
M   intern/cycles/app/CMakeLists.txt
M   intern/cycles/cmake/external_libs.cmake
M   source/blenderplayer/CMakeLists.txt
M   tests/gtests/testing/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 748ed649800..c0ea2ef679e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -365,7 +365,9 @@ mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
 
 # Logging/unbit test libraries.
 option(WITH_SYSTEM_GFLAGS   "Use system-wide Gflags instead of a bundled one" 
OFF)
+option(WITH_SYSTEM_GFLOG"Use system-wide Glog instead of a bundled one" 
OFF)
 mark_as_advanced(WITH_SYSTEM_GFLAGS)
+mark_as_advanced(WITH_SYSTEM_GLOG)
 
 # Freestyle
 option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
@@ -1339,9 +1341,24 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND 
WITH_CYCLES_LOGGING))
set(GFLAGS_INCLUDE_DIRS 
"${PROJECT_SOURCE_DIR}/extern/gflags/src")
endif()
 
-   set(GLOG_DEFINES
-   -DGOOGLE_GLOG_DLL_DECL=
-   )
+   if(WITH_SYSTEM_GLOG)
+   find_package(Glog)
+   if(NOT GLOG_FOUND)
+   message(FATAL_ERROR "System wide Glog is requested but 
was not found")
+   endif()
+   # FindGlog does not define this, and we are not even sure what 
to use here.
+   set(GLOG_DEFINES)
+   else()
+   set(GLOG_DEFINES
+   -DGOOGLE_GLOG_DLL_DECL=
+   )
+   set(GLOG_LIBRARIES extern_glog)
+   if(WIN32)
+   set(GLOG_INCLUDE_DIRS 
${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
+   else()
+   set(GLOG_INCLUDE_DIRS 
${CMAKE_SOURCE_DIR}/extern/glog/src)
+   endif()
+   endif()
 endif()
 
 #-
diff --git a/build_files/cmake/Modules/FindGlog.cmake 
b/build_files/cmake/Modules/FindGlog.cmake
new file mode 100644
index 000..66c2aab2762
--- /dev/null
+++ b/build_files/cmake/Modules/FindGlog.cmake
@@ -0,0 +1,226 @@
+# Ceres Solver - A fast non-linear least squares minimizer
+# Copyright 2015 Google Inc. All rights reserved.
+# http://ceres-solver.org/
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. nor the names of its contributors may be
+#   used to endorse or promote products derived from this software without
+#   specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# Author: alexs@gmail.com (Alex Stewart)
+#
+
+# FindGlog.cmake - Find Google glog logging library.
+#
+# This module defines the following variables:
+#
+# GLOG_FOUND: TRUE iff glog is found.
+# GLOG_INCLUDE_DIRS: Include directories for glog.
+# GLOG_LIBRARIES: Libraries required to link glog.
+#
+# The following variables control the behaviour of this module:
+#
+# GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to
+# search for glog includes, e.g: /timbuktu/include.
+# GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to
+# 

[Bf-blender-cvs] [81011679ddb] blender2.8: Merge branch 'master' into blender2.8

2017-04-21 Thread Sybren A. Stüvel
Commit: 81011679ddb1fc57e37fe1ba2eb494a1dedaa0fd
Author: Sybren A. Stüvel
Date:   Fri Apr 21 14:19:05 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB81011679ddb1fc57e37fe1ba2eb494a1dedaa0fd

Merge branch 'master' into blender2.8

===



===

diff --cc tests/python/bl_alembic_import_test.py
index 5f7b4440e5f,33ccc49f301..7c0f0254973
--- a/tests/python/bl_alembic_import_test.py
+++ b/tests/python/bl_alembic_import_test.py
@@@ -85,8 -83,45 +85,45 @@@ class SimpleImportTest(unittest.TestCas
  
  # All cubes should be selected, but the sphere shouldn't be.
  for ob in bpy.data.objects:
 -self.assertEqual('Cube' in ob.name, ob.select)
 +self.assertEqual('Cube' in ob.name, ob.select_get())
  
+ def test_change_path(self):
+ import math
+ 
+ fname = 'cube-rotating1.abc'
+ abc = self.testdir / fname
+ relpath = bpy.path.relpath(str(abc))
+ 
+ res = bpy.ops.wm.alembic_import(filepath=str(abc), 
as_background_job=False)
+ self.assertEqual({'FINISHED'}, res)
+ cube = bpy.context.active_object
+ 
+ # Check that the file loaded ok.
+ bpy.context.scene.frame_set(10)
+ x, y, z = cube.matrix_world.to_euler('XYZ')
+ self.assertAlmostEqual(x, 0)
+ self.assertAlmostEqual(y, 0)
+ self.assertAlmostEqual(z, math.pi / 2, places=5)
+ 
+ # Change path from absolute to relative. This should not break the 
animation.
+ bpy.context.scene.frame_set(1)
+ bpy.data.cache_files[fname].filepath = relpath
+ bpy.context.scene.frame_set(10)
+ 
+ x, y, z = cube.matrix_world.to_euler('XYZ')
+ self.assertAlmostEqual(x, 0)
+ self.assertAlmostEqual(y, 0)
+ self.assertAlmostEqual(z, math.pi / 2, places=5)
+ 
+ # Replace the Alembic file; this should apply new animation.
+ bpy.data.cache_files[fname].filepath = relpath.replace('1.abc', 
'2.abc')
+ bpy.context.scene.update()
+ 
+ x, y, z = cube.matrix_world.to_euler('XYZ')
+ self.assertAlmostEqual(x, math.pi / 2, places=5)
+ self.assertAlmostEqual(y, 0)
+ self.assertAlmostEqual(z, 0)
+ 
  
  def main():
  global args

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


[Bf-blender-cvs] [099816587a0] master: Alembic: Construct ISampleSelector once and pass along

2017-04-21 Thread Sybren A. Stüvel
Commit: 099816587a0e064fb6a52c82a737ae8814cf21df
Author: Sybren A. Stüvel
Date:   Fri Apr 21 11:04:47 2017 +0200
Branches: master
https://developer.blender.org/rB099816587a0e064fb6a52c82a737ae8814cf21df

Alembic: Construct ISampleSelector once and pass along

No longer passing time as float and constructing ISampleSelectors all
over the place. Instead, just construct an ISampleSelector once and
pass it along.

===

M   source/blender/alembic/intern/abc_camera.cc
M   source/blender/alembic/intern/abc_camera.h
M   source/blender/alembic/intern/abc_curves.cc
M   source/blender/alembic/intern/abc_curves.h
M   source/blender/alembic/intern/abc_mesh.cc
M   source/blender/alembic/intern/abc_mesh.h
M   source/blender/alembic/intern/abc_nurbs.cc
M   source/blender/alembic/intern/abc_nurbs.h
M   source/blender/alembic/intern/abc_object.cc
M   source/blender/alembic/intern/abc_object.h
M   source/blender/alembic/intern/abc_points.cc
M   source/blender/alembic/intern/abc_points.h
M   source/blender/alembic/intern/abc_transform.cc
M   source/blender/alembic/intern/abc_transform.h
M   source/blender/alembic/intern/alembic_capi.cc

===

diff --git a/source/blender/alembic/intern/abc_camera.cc 
b/source/blender/alembic/intern/abc_camera.cc
index 4f70b2a972c..33344f6c9c5 100644
--- a/source/blender/alembic/intern/abc_camera.cc
+++ b/source/blender/alembic/intern/abc_camera.cc
@@ -117,11 +117,10 @@ bool AbcCameraReader::valid() const
return m_schema.valid();
 }
 
-void AbcCameraReader::readObjectData(Main *bmain, float time)
+void AbcCameraReader::readObjectData(Main *bmain, const ISampleSelector 
_sel)
 {
Camera *bcam = static_cast(BKE_camera_add(bmain, 
m_data_name.c_str()));
 
-   ISampleSelector sample_sel(time);
CameraSample cam_sample;
m_schema.get(cam_sample, sample_sel);
 
diff --git a/source/blender/alembic/intern/abc_camera.h 
b/source/blender/alembic/intern/abc_camera.h
index fafb4d3eb39..0201dd9d6e1 100644
--- a/source/blender/alembic/intern/abc_camera.h
+++ b/source/blender/alembic/intern/abc_camera.h
@@ -55,7 +55,7 @@ public:
 
bool valid() const;
 
-   void readObjectData(Main *bmain, float time);
+   void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector 
_sel);
 };
 
-#endif  /* __ABC_CAMERA_H__ */
\ No newline at end of file
+#endif  /* __ABC_CAMERA_H__ */
diff --git a/source/blender/alembic/intern/abc_curves.cc 
b/source/blender/alembic/intern/abc_curves.cc
index bf485c7ef61..d85d8df4d77 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -211,7 +211,7 @@ bool AbcCurveReader::valid() const
return m_curves_schema.valid();
 }
 
-void AbcCurveReader::readObjectData(Main *bmain, float time)
+void AbcCurveReader::readObjectData(Main *bmain, const 
Alembic::Abc::ISampleSelector _sel)
 {
Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE);
 
@@ -219,8 +219,6 @@ void AbcCurveReader::readObjectData(Main *bmain, float time)
cu->actvert = CU_ACT_NONE;
cu->resolu = 1;
 
-   const ISampleSelector sample_sel(time);
-
ICompoundProperty user_props = m_curves_schema.getUserProperties();
if (user_props) {
const PropertyHeader *header = 
user_props.getPropertyHeader(ABC_CURVE_RESOLUTION_U_PROPNAME);
@@ -389,9 +387,11 @@ void read_curve_sample(Curve *cu, const ICurvesSchema 
, const ISampleSele
  * object directly and create a new DerivedMesh from that. Also we might need 
to
  * create new or delete existing NURBS in the curve.
  */
-DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/, const 
float time, int /*read_flag*/, const char ** /*err_str*/)
+DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/,
+  const ISampleSelector 
_sel,
+  int /*read_flag*/,
+  const char ** /*err_str*/)
 {
-   ISampleSelector sample_sel(time);
const ICurvesSchema::Sample sample = 
m_curves_schema.getValue(sample_sel);
 
const P3fArraySamplePtr  = sample.getPositions();
diff --git a/source/blender/alembic/intern/abc_curves.h 
b/source/blender/alembic/intern/abc_curves.h
index 71b0d205820..1ad6d0bf278 100644
--- a/source/blender/alembic/intern/abc_curves.h
+++ b/source/blender/alembic/intern/abc_curves.h
@@ -55,8 +55,11 @@ public:
 
bool valid() const;
 
-   void readObjectData(Main *bmain, float time);
-   DerivedMesh *read_derivedmesh(DerivedMesh *, const float time, int 
read_flag, const char **err_str);
+   void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector 
_sel);
+   DerivedMesh *read_derivedmesh(DerivedMesh *dm,
+

[Bf-blender-cvs] [9d819775b71] master: Alembic: properly initialising cachefile object paths list.

2017-04-21 Thread Sybren A. Stüvel
Commit: 9d819775b719b6e1e838c833d7d4fb576503b2c7
Author: Sybren A. Stüvel
Date:   Fri Apr 21 12:47:14 2017 +0200
Branches: master
https://developer.blender.org/rB9d819775b719b6e1e838c833d7d4fb576503b2c7

Alembic: properly initialising cachefile object paths list.

===

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

===

diff --git a/source/blender/blenkernel/intern/cachefile.c 
b/source/blender/blenkernel/intern/cachefile.c
index 3dce08eb756..ff0a776aa82 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -82,6 +82,7 @@ void BKE_cachefile_init(CacheFile *cache_file)
cache_file->is_sequence = false;
cache_file->scale = 1.0f;
cache_file->handle_mutex = BLI_mutex_alloc();
+   BLI_listbase_clear(_file->object_paths);
 }
 
 /** Free (or release) any data used by this cachefile (does not free the 
cachefile itself). */

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


[Bf-blender-cvs] [45b9ee525d7] master: Alembic: fixed memory leak

2017-04-21 Thread Sybren A. Stüvel
Commit: 45b9ee525d718b151fec92bc5f9503f23e0a58bb
Author: Sybren A. Stüvel
Date:   Fri Apr 21 12:28:49 2017 +0200
Branches: master
https://developer.blender.org/rB45b9ee525d718b151fec92bc5f9503f23e0a58bb

Alembic: fixed memory leak

===

M   source/blender/editors/io/io_cache.c

===

diff --git a/source/blender/editors/io/io_cache.c 
b/source/blender/editors/io/io_cache.c
index ebe8898571d..af6f55d7a64 100644
--- a/source/blender/editors/io/io_cache.c
+++ b/source/blender/editors/io/io_cache.c
@@ -143,7 +143,7 @@ static int cachefile_reload_exec(bContext *C, wmOperator 
*op)
 
Main *bmain = CTX_data_main(C);
 
-   BLI_listbase_clear(_file->object_paths);
+   BLI_freelistN(_file->object_paths);
BKE_cachefile_reload(bmain, cache_file);
 
return OPERATOR_FINISHED;

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


[Bf-blender-cvs] [9c02990ac13] master: Alembic import: changing cache modifier path no longer discards object paths

2017-04-21 Thread Sybren A. Stüvel
Commit: 9c02990ac13a25968d8ec15da15129617d3f25d0
Author: Sybren A. Stüvel
Date:   Fri Apr 21 14:11:13 2017 +0200
Branches: master
https://developer.blender.org/rB9c02990ac13a25968d8ec15da15129617d3f25d0

Alembic import: changing cache modifier path no longer discards object paths

This allows, for example, the path of an Alembic file to be changed from
absolute to relative, without having to reconstruct all object paths.

===

M   source/blender/blenkernel/intern/cachefile.c
M   tests/python/bl_alembic_import_test.py

===

diff --git a/source/blender/blenkernel/intern/cachefile.c 
b/source/blender/blenkernel/intern/cachefile.c
index ff0a776aa82..67c66d4e40b 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -221,7 +221,6 @@ void BKE_cachefile_clean(Scene *scene, CacheFile 
*cache_file)
}
 #endif
mcmd->reader = NULL;
-   mcmd->object_path[0] = '\0';
}
}
 
@@ -239,7 +238,6 @@ void BKE_cachefile_clean(Scene *scene, CacheFile 
*cache_file)
}
 #endif
data->reader = NULL;
-   data->object_path[0] = '\0';
}
}
}
diff --git a/tests/python/bl_alembic_import_test.py 
b/tests/python/bl_alembic_import_test.py
index cd23183ec06..33ccc49f301 100644
--- a/tests/python/bl_alembic_import_test.py
+++ b/tests/python/bl_alembic_import_test.py
@@ -85,6 +85,43 @@ class SimpleImportTest(unittest.TestCase):
 for ob in bpy.data.objects:
 self.assertEqual('Cube' in ob.name, ob.select)
 
+def test_change_path(self):
+import math
+
+fname = 'cube-rotating1.abc'
+abc = self.testdir / fname
+relpath = bpy.path.relpath(str(abc))
+
+res = bpy.ops.wm.alembic_import(filepath=str(abc), 
as_background_job=False)
+self.assertEqual({'FINISHED'}, res)
+cube = bpy.context.active_object
+
+# Check that the file loaded ok.
+bpy.context.scene.frame_set(10)
+x, y, z = cube.matrix_world.to_euler('XYZ')
+self.assertAlmostEqual(x, 0)
+self.assertAlmostEqual(y, 0)
+self.assertAlmostEqual(z, math.pi / 2, places=5)
+
+# Change path from absolute to relative. This should not break the 
animation.
+bpy.context.scene.frame_set(1)
+bpy.data.cache_files[fname].filepath = relpath
+bpy.context.scene.frame_set(10)
+
+x, y, z = cube.matrix_world.to_euler('XYZ')
+self.assertAlmostEqual(x, 0)
+self.assertAlmostEqual(y, 0)
+self.assertAlmostEqual(z, math.pi / 2, places=5)
+
+# Replace the Alembic file; this should apply new animation.
+bpy.data.cache_files[fname].filepath = relpath.replace('1.abc', 
'2.abc')
+bpy.context.scene.update()
+
+x, y, z = cube.matrix_world.to_euler('XYZ')
+self.assertAlmostEqual(x, math.pi / 2, places=5)
+self.assertAlmostEqual(y, 0)
+self.assertAlmostEqual(z, 0)
+
 
 def main():
 global args

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


[Bf-blender-cvs] [bfa888cef28] blender2.8: Cleanup: move draw-cache creation from BKE to DRW

2017-04-21 Thread Campbell Barton
Commit: bfa888cef28955501195dfbee002bc793685e527
Author: Campbell Barton
Date:   Fri Apr 21 21:14:11 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBbfa888cef28955501195dfbee002bc793685e527

Cleanup: move draw-cache creation from BKE to DRW

Creating draw-cache should only ever be used by the draw-manager.

===

M   source/blender/blenkernel/BKE_curve.h
D   source/blender/blenkernel/BKE_curve_render.h
D   source/blender/blenkernel/BKE_displist_render.h
M   source/blender/blenkernel/BKE_lattice.h
D   source/blender/blenkernel/BKE_lattice_render.h
M   source/blender/blenkernel/BKE_mesh.h
D   source/blender/blenkernel/BKE_mesh_render.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/lattice.c
M   source/blender/blenkernel/intern/mesh.c
M   source/blender/blenkernel/intern/object_update.c
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
A   source/blender/draw/intern/draw_cache_impl.h
R095source/blender/blenkernel/intern/curve_render.c 
source/blender/draw/intern/draw_cache_impl_curve.c
R097source/blender/blenkernel/intern/displist_render.c  
source/blender/draw/intern/draw_cache_impl_displist.c
R093source/blender/blenkernel/intern/lattice_render.c   
source/blender/draw/intern/draw_cache_impl_lattice.c
R096source/blender/blenkernel/intern/mesh_render.c  
source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/curve/editfont.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/editors/space_view3d/space_view3d.c

===

diff --git a/source/blender/blenkernel/BKE_curve.h 
b/source/blender/blenkernel/BKE_curve.h
index e111bd0e16b..411e71e31e3 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -219,4 +219,12 @@ void BKE_curve_eval_geometry(struct EvaluationContext 
*eval_ctx,
 void BKE_curve_eval_path(struct EvaluationContext *eval_ctx,
  struct Curve *curve);
 
+/* Draw Cache */
+enum {
+   BKE_CURVE_BATCH_DIRTY_ALL = 0,
+   BKE_CURVE_BATCH_DIRTY_SELECT,
+};
+void BKE_curve_batch_cache_dirty(struct Curve *cu, int mode);
+void BKE_curve_batch_cache_free(struct Curve *cu);
+
 #endif  /* __BKE_CURVE_H__ */
diff --git a/source/blender/blenkernel/BKE_curve_render.h 
b/source/blender/blenkernel/BKE_curve_render.h
deleted file mode 100644
index be6da731d7c..000
--- a/source/blender/blenkernel/BKE_curve_render.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * * 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 *
- */
-#ifndef __BKE_CURVE_RENDER_H__
-#define __BKE_CURVE_RENDER_H__
-
-/** \file BKE_curve_render.h
- *  \ingroup bke
- */
-
-struct Batch;
-struct Curve;
-
-void BKE_curve_batch_cache_dirty(struct Curve *cu);
-void BKE_curve_batch_selection_dirty(struct Curve *cu);
-void BKE_curve_batch_cache_clear(struct Curve *cu);
-void BKE_curve_batch_cache_free(struct Curve *cu);
-struct Batch *BKE_curve_batch_cache_get_wire_edge(struct Curve *cu, struct 
CurveCache *ob_curve_cache);
-struct Batch *BKE_curve_batch_cache_get_normal_edge(
-struct Curve *cu, struct CurveCache *ob_curve_cache, float 
normal_size);
-struct Batch *BKE_curve_batch_cache_get_overlay_edges(struct Curve *cu);
-struct Batch *BKE_curve_batch_cache_get_overlay_verts(struct Curve *cu);
-
-struct Batch *BKE_curve_batch_cache_get_triangles_with_normals(struct Curve 
*cu, struct CurveCache *ob_curve_cache);
-
-/* OB_FONT */
-struct Batch *BKE_curve_batch_cache_get_overlay_cursor(struct Curve *cu);
-struct Batch *BKE_curve_batch_cache_get_overlay_select(struct Curve *cu);
-
-#endif /* __BKE_CURVE_RENDER_H__ */
diff --git a/source/blender/blenkernel/BKE_displist_render.h 
b/source/blender/blenkernel/BKE_displist_render.h
deleted file mode 100644
index 0724bdd29cd..000
--- a/source/blender/blenkernel/BKE_displist_render.h
+++ /dev/null
@@ 

[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61858] trunk/lib/darwin-9.x.universal/alembic: Upd darwin9 alembic to 1.7.1

2017-04-21 Thread jens verwiebe
Revision: 61858
  https://developer.blender.org/rBL61858
Author:   jensverwiebe
Date: 2017-04-21 13:32:39 +0200 (Fri, 21 Apr 2017)
Log Message:
---
Upd darwin9 alembic to 1.7.1

Modified Paths:
--
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/Argument.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/Foundation.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/IArchive.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/IArrayProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/IBaseProperty.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/ICompoundProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/IObject.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/IScalarProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/ISchema.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/ISchemaObject.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/ITypedArrayProperty.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/ITypedScalarProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OArchive.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OArrayProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OBaseProperty.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OCompoundProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OObject.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OScalarProperty.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OSchema.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OSchemaObject.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OTypedArrayProperty.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Abc/OTypedScalarProperty.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcCollection/ICollections.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcCollection/OCollections.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcCollection/SchemaInfoDeclarations.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcCoreAbstract/MetaData.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcCoreFactory/IFactory.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/ICamera.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/ICurves.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/IFaceSet.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/IGeomBase.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/ILight.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/INuPatch.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/IPoints.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/IPolyMesh.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/ISubD.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/IXform.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OCamera.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OCurves.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OFaceSet.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OGeomBase.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OGeomParam.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OLight.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/ONuPatch.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OPoints.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OPolyMesh.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OSubD.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/OXform.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcGeom/SchemaInfoDeclarations.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcMaterial/IMaterial.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcMaterial/OMaterial.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/AbcMaterial/SchemaInfoDeclarations.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Util/Config.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Util/Export.h
trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Util/Foundation.h

trunk/lib/darwin-9.x.universal/alembic/include/Alembic/Util/PlainOldDataType.h
trunk/lib/darwin-9.x.universal/alembic/lib/cmake/Alembic/AlembicConfig.cmake

trunk/lib/darwin-9.x.universal/alembic/lib/cmake/Alembic/AlembicConfigVersion.cmake

trunk/lib/darwin-9.x.universal/alembic/lib/cmake/Alembic/AlembicTargets.cmake

[Bf-blender-cvs] [ad99d53b8a0] fracture_modifier: fix for jumps in rotation when converting to keyframed objects

2017-04-21 Thread Martin Felke
Commit: ad99d53b8a04b2142ec35d4f347f5a527982a086
Author: Martin Felke
Date:   Fri Apr 21 13:14:08 2017 +0200
Branches: fracture_modifier
https://developer.blender.org/rBad99d53b8a04b2142ec35d4f347f5a527982a086

fix for jumps in rotation when converting to keyframed objects

===

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

===

diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index 2c57ce8cfa9..69605faea7b 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -3278,8 +3278,6 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
float size[3];
copy_v3_v3(size, ob->size);
 
-   /*move object (loc, rot)*/
-   if (i > start)
{
float loc[3] = {0.0f, 0.0f, 0.0f}, rot[4] = 
{0.0f, 0.0f, 0.0f, 0.0f};
float mat[4][4];
@@ -3317,16 +3315,7 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
 
copy_v3_v3(ob_new->loc, loc);
copy_qt_qt(ob_new->quat, rot);
-   quat_to_eul(ob_new->rot, rot);
-   }
-   else
-   {
-   mul_m4_v3(ob->obmat, ob_new->loc);
-   sub_v3_v3(ob_new->loc, obloc);
-   add_v3_v3(ob_new->loc, diff);
-
-   copy_qt_qt(ob_new->quat, ob->quat);
-   copy_v3_v3(ob_new->rot, ob->rot);
+   quat_to_compatible_eul(ob_new->rot, 
ob_new->rot, rot);
copy_v3_v3(ob_new->size, size);
}

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


[Bf-blender-cvs] [c7f00feabaa] blender2.8: Unify RNA and core depsgraph.objects

2017-04-21 Thread Dalai Felinto
Commit: c7f00feabaa334cd839a9e7904ee0fc1b8d8d718
Author: Dalai Felinto
Date:   Fri Apr 21 12:31:48 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBc7f00feabaa334cd839a9e7904ee0fc1b8d8d718

Unify RNA and core depsgraph.objects

Note: Since this is not listbase nor array I'm also expanding
RNA_types.h to allow for custom data.

===

M   source/blender/makesrna/RNA_types.h
M   source/blender/makesrna/intern/rna_depsgraph.c

===

diff --git a/source/blender/makesrna/RNA_types.h 
b/source/blender/makesrna/RNA_types.h
index cd04f9e8a6d..99ef0f9c8c4 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -282,6 +282,7 @@ typedef struct CollectionPropertyIterator {
union {
ArrayIterator array;
ListBaseIterator listbase;
+   void *custom;
} internal;
int idprop;
int level;
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c 
b/source/blender/makesrna/intern/rna_depsgraph.c
index 093685b4ff5..571f07471a7 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -40,12 +40,15 @@
 
 #ifdef RNA_RUNTIME
 
+#include "BLI_iterator.h"
 #include "BKE_report.h"
 #include "DNA_object_types.h"
 
 #include "DEG_depsgraph_debug.h"
 #include "DEG_depsgraph_query.h"
 
+#include "MEM_guardedalloc.h"
+
 static void rna_Depsgraph_debug_graphviz(Depsgraph *graph, const char 
*filename)
 {
FILE *f = fopen(filename, "w");
@@ -81,29 +84,29 @@ static void rna_Depsgraph_debug_stats(Depsgraph *graph, 
ReportList *reports)
ops, rels, outer);
 }
 
-static int rna_Depsgraph_objects_skip(CollectionPropertyIterator *iter, void 
*UNUSED(data))
+static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
 {
-   ListBaseIterator *internal = >internal.listbase;
-   Base *base = (Base *)internal->link;
+   Depsgraph *graph = (Depsgraph *)ptr->data;
+   iter->internal.custom = MEM_callocN(sizeof(Iterator), __func__);
+   DAG_objects_iterator_begin(iter->internal.custom, graph);
+   iter->valid = ((Iterator *)iter->internal.custom)->valid;
+}
 
-   return ((base->flag & BASE_VISIBLED) == 0);
+static void rna_Depsgraph_objects_next(CollectionPropertyIterator *iter)
+{
+   DAG_objects_iterator_next(iter->internal.custom);
+   iter->valid = ((Iterator *)iter->internal.custom)->valid;
 }
 
-static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
+static void rna_Depsgraph_objects_end(CollectionPropertyIterator *iter)
 {
-   Depsgraph *depsgraph = (Depsgraph *)ptr->data;
-   SceneLayer *sl = DAG_get_scene_layer(depsgraph);
-   rna_iterator_listbase_begin(iter, >object_bases, 
rna_Depsgraph_objects_skip);
+   DAG_objects_iterator_end(iter->internal.custom);
+   MEM_freeN(iter->internal.custom);
 }
 
 static PointerRNA rna_Depsgraph_objects_get(CollectionPropertyIterator *iter)
 {
-   ListBaseIterator *internal = >internal.listbase;
-   Base *base = (Base *)internal->link;
-   Object *ob = base->object;
-
-   ob->base_flag = base->flag;
-   ob->base_collection_properties = base->collection_properties;
+   Object *ob = ((Iterator *)iter->internal.custom)->current;
return rna_pointer_inherit_refine(>parent, _Object, ob);
 }
 
@@ -133,8 +136,8 @@ static void rna_def_depsgraph(BlenderRNA *brna)
 
prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
-   RNA_def_property_collection_funcs(prop, "rna_Depsgraph_objects_begin", 
"rna_iterator_listbase_next",
- "rna_iterator_listbase_end", 
"rna_Depsgraph_objects_get",
+   RNA_def_property_collection_funcs(prop, "rna_Depsgraph_objects_begin", 
"rna_Depsgraph_objects_next",
+ "rna_Depsgraph_objects_end", 
"rna_Depsgraph_objects_get",
  NULL, NULL, NULL, NULL);
 }

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


[Bf-blender-cvs] [4b77fb30759] blender2.8: Move DEG_OBJECT_ITER inside depsgraph

2017-04-21 Thread Dalai Felinto
Commit: 4b77fb30759d1b62224033fc92c55eef7f3e414a
Author: Dalai Felinto
Date:   Fri Apr 21 11:42:59 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB4b77fb30759d1b62224033fc92c55eef7f3e414a

Move DEG_OBJECT_ITER inside depsgraph

===

M   source/blender/blenkernel/BKE_layer.h
M   source/blender/depsgraph/DEG_depsgraph_query.h
M   source/blender/depsgraph/intern/depsgraph_query.cc
M   source/blender/draw/intern/draw_manager.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/blenkernel/BKE_layer.h 
b/source/blender/blenkernel/BKE_layer.h
index b91ff82dc9f..f19f9a65bb5 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -215,33 +215,6 @@ void BKE_visible_bases_Iterator_end(Iterator *iter);
ITER_END
  \
 }
 
-/* temporary hacky solution waiting for CoW depsgraph implementation */
-#define DEG_OBJECT_ITER(graph_, instance_)\
-{ \
-   Scene *sce_, *scene_ = DAG_get_scene(graph_);   
  \
-   SceneLayer *sl_ = DAG_get_scene_layer(graph_);  
  \
-   int flag_ = ~(BASE_FROM_SET);   
  \
-  \
-   /* flush all the depsgraph data to objects */   
  \
-   Object *instance_;  
  \
-   Base *base_;
  \
-   for(sce_ = scene_; sce_; sce_ = sce_->set) {
  \
-   for (base_ = (sl_)->object_bases.first; base_; base_ = 
base_->next) { \
-   if ((base_->flag & BASE_VISIBLED) != 0) {   
  \
-   instance_ = base_->object;  
  \
-   instance_->base_flag = (base_->flag | 
BASE_FROM_SET) & flag_; \
-   instance_->base_collection_properties = 
base_->collection_properties;
-
-#define DEG_OBJECT_ITER_END   \
-   }   
  \
-   }   
  \
-   if (sce_->set) {
  \
-   sl_ = BKE_scene_layer_render_active(sce_->set); 
  \
-   flag_ = ~(BASE_SELECTED | BASE_SELECTABLED);
  \
-   }   
  \
-   }   
  \
-}
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h 
b/source/blender/depsgraph/DEG_depsgraph_query.h
index 430398c113f..9960a1e45e2 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -36,6 +36,7 @@
 struct ID;
 
 struct Depsgraph;
+struct Iterator;
 struct SceneLayer;
 
 #ifdef __cplusplus
@@ -57,6 +58,22 @@ struct SceneLayer *DAG_get_scene_layer(struct Depsgraph 
*graph);
 /* Get the object as properly evaluated by depsgraph. */
 struct Object *DAG_get_object(struct Depsgraph *depsgraph, struct Object *ob);
 
+/*  DAG iterators * */
+
+void DAG_objects_iterator_begin(struct Iterator *iter, void *data_in);
+void DAG_objects_iterator_next(struct Iterator *iter);
+void DAG_objects_iterator_end(struct Iterator *iter);
+
+/* Temporary hacky solution waiting for cow depsgrpah implementation. */
+#define DEG_OBJECT_ITER(graph_, instance_)\
+   ITER_BEGIN(DAG_objects_iterator_begin,  
  \
+  DAG_objects_iterator_next,   
  \
+  DAG_objects_iterator_end,
  \
+  graph_, Object *, instance_)
+
+#define DEG_OBJECT_ITER_END   \
+   ITER_END
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 0fe2d2be396..2fe10766bba 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -37,6 +37,7 @@ extern "C" {
 #include "BKE_layer.h"
 #include "BKE_main.h"
 
+#include 

[Bf-blender-cvs] [df84082c70d] master: Cycles: Cleanup, indentation in preprocessor

2017-04-21 Thread Sergey Sharybin
Commit: df84082c70dafde0aa3a6a474f7885788e507ae1
Author: Sergey Sharybin
Date:   Fri Apr 21 12:26:04 2017 +0200
Branches: master
https://developer.blender.org/rBdf84082c70dafde0aa3a6a474f7885788e507ae1

Cycles: Cleanup, indentation in preprocessor

===

M   intern/cycles/kernel/kernel_types.h

===

diff --git a/intern/cycles/kernel/kernel_types.h 
b/intern/cycles/kernel/kernel_types.h
index 623f3728c69..9d5cad3f3e1 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -220,7 +220,7 @@ CCL_NAMESPACE_BEGIN
 #  undef __TRANSPARENT_SHADOWS__
 #endif
 #ifdef __NO_SHADOW_TRICKS__
-#undef __SHADOW_TRICKS__
+#  undef __SHADOW_TRICKS__
 #endif
 
 /* Random Numbers */

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61857] trunk/lib/tests/cycles/ctests/opengl: Cycles tests: Add OpenGL tests for principled shader

2017-04-21 Thread Sergey Sharybin
Revision: 61857
  https://developer.blender.org/rBL61857
Author:   sergey
Date: 2017-04-21 12:19:34 +0200 (Fri, 21 Apr 2017)
Log Message:
---
Cycles tests: Add OpenGL tests for principled shader

Added Paths:
---

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_subsurface.png

trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_transparent.png
trunk/lib/tests/cycles/ctests/opengl/shader_principled_coat.blend
trunk/lib/tests/cycles/ctests/opengl/shader_principled_default.blend
trunk/lib/tests/cycles/ctests/opengl/shader_principled_metallic.blend
trunk/lib/tests/cycles/ctests/opengl/shader_principled_metallic_aniso.blend
trunk/lib/tests/cycles/ctests/opengl/shader_principled_subsurface.blend
trunk/lib/tests/cycles/ctests/opengl/shader_principled_transparent.blend

Added: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png
===
(Binary files differ)

Index: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png
===
--- 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png
   2017-04-21 10:14:30 UTC (rev 61856)
+++ 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png
   2017-04-21 10:19:34 UTC (rev 61857)

Property changes on: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_coat.png
___
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png
===
(Binary files differ)

Index: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png
===
--- 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png
2017-04-21 10:14:30 UTC (rev 61856)
+++ 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png
2017-04-21 10:19:34 UTC (rev 61857)

Property changes on: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_default.png
___
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png
===
(Binary files differ)

Index: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png
===
--- 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png
   2017-04-21 10:14:30 UTC (rev 61856)
+++ 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png
   2017-04-21 10:19:34 UTC (rev 61857)

Property changes on: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic.png
___
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png
===
(Binary files differ)

Index: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png
===
--- 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png
 2017-04-21 10:14:30 UTC (rev 61856)
+++ 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png
 2017-04-21 10:19:34 UTC (rev 61857)

Property changes on: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_metallic_aniso.png
___
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_subsurface.png
===
(Binary files differ)

Index: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/shader_principled_subsurface.png

[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61856] trunk/lib/tests/cycles/ctests/shader: Cycles tests: Add tests for new principled shader

2017-04-21 Thread Sergey Sharybin
Revision: 61856
  https://developer.blender.org/rBL61856
Author:   sergey
Date: 2017-04-21 12:14:30 +0200 (Fri, 21 Apr 2017)
Log Message:
---
Cycles tests: Add tests for new principled shader

Added Paths:
---
trunk/lib/tests/cycles/ctests/shader/principled_coat.blend
trunk/lib/tests/cycles/ctests/shader/principled_default.blend
trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend
trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
trunk/lib/tests/cycles/ctests/shader/principled_transparent.blend
trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_coat.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_default.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_metallic.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_metallic_aniso.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_subsurface.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_transparent.png

Added: trunk/lib/tests/cycles/ctests/shader/principled_coat.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/shader/principled_coat.blend
===
--- trunk/lib/tests/cycles/ctests/shader/principled_coat.blend  2017-04-21 
09:59:07 UTC (rev 61855)
+++ trunk/lib/tests/cycles/ctests/shader/principled_coat.blend  2017-04-21 
10:14:30 UTC (rev 61856)

Property changes on: trunk/lib/tests/cycles/ctests/shader/principled_coat.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/cycles/ctests/shader/principled_default.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/shader/principled_default.blend
===
--- trunk/lib/tests/cycles/ctests/shader/principled_default.blend   
2017-04-21 09:59:07 UTC (rev 61855)
+++ trunk/lib/tests/cycles/ctests/shader/principled_default.blend   
2017-04-21 10:14:30 UTC (rev 61856)

Property changes on: 
trunk/lib/tests/cycles/ctests/shader/principled_default.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend
===
--- trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend  
2017-04-21 09:59:07 UTC (rev 61855)
+++ trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend  
2017-04-21 10:14:30 UTC (rev 61856)

Property changes on: 
trunk/lib/tests/cycles/ctests/shader/principled_metallic.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
===
--- trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
2017-04-21 09:59:07 UTC (rev 61855)
+++ trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
2017-04-21 10:14:30 UTC (rev 61856)

Property changes on: 
trunk/lib/tests/cycles/ctests/shader/principled_metallic_aniso.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
===
--- trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
2017-04-21 09:59:07 UTC (rev 61855)
+++ trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
2017-04-21 10:14:30 UTC (rev 61856)

Property changes on: 
trunk/lib/tests/cycles/ctests/shader/principled_subsurface.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: 

[Bf-blender-cvs] [aa2cff45091] master: Cycles: Fix regression in SSS rendering after principled commit

2017-04-21 Thread Sergey Sharybin
Commit: aa2cff450914c945b6038b6413c2c0d951b0b0ea
Author: Sergey Sharybin
Date:   Fri Apr 21 11:50:35 2017 +0200
Branches: master
https://developer.blender.org/rBaa2cff450914c945b6038b6413c2c0d951b0b0ea

Cycles: Fix regression in SSS rendering after principled commit

===

M   intern/cycles/kernel/kernel_subsurface.h

===

diff --git a/intern/cycles/kernel/kernel_subsurface.h 
b/intern/cycles/kernel/kernel_subsurface.h
index 17b3cf033a1..fb4a054dcd0 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -162,7 +162,9 @@ ccl_device void 
subsurface_scatter_setup_diffuse_bsdf(ShaderData *sd, ShaderClos
bsdf->type = CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID;
}
}
-   else if(CLOSURE_IS_BSSRDF(bssrdf->type)) {
+   else if(CLOSURE_IS_BSDF_BSSRDF(bssrdf->type) ||
+   CLOSURE_IS_BSSRDF(bssrdf->type))
+   {
DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, 
sizeof(DiffuseBsdf), weight);
 
if(bsdf) {

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


[Bf-blender-cvs] [c7a5c48cbad] master: CMake: Add option to link against system-wide Gflags library

2017-04-21 Thread Sergey Sharybin
Commit: c7a5c48cbad0062c55bf9fa6df2926646b2c3091
Author: Sergey Sharybin
Date:   Fri Apr 21 10:58:01 2017 +0200
Branches: master
https://developer.blender.org/rBc7a5c48cbad0062c55bf9fa6df2926646b2c3091

CMake: Add option to link against system-wide Gflags library

It is disabled by default, so should not affect existing configurations.

Main benefits of this goes as:

- Linux distros can use that to avoid libraries duplication and link
  blender package against gflags package from the system.

- It it easier to test whether Blender works with updated version of
  Gflags prior to re-bundling the library.

===

M   CMakeLists.txt
A   build_files/cmake/Modules/FindGflags.cmake
M   build_files/cmake/Modules/GTestTesting.cmake
M   build_files/cmake/macros.cmake
M   extern/CMakeLists.txt
M   intern/cycles/app/CMakeLists.txt
M   intern/cycles/cmake/external_libs.cmake
M   intern/libmv/CMakeLists.txt
M   intern/libmv/bundle.sh
M   intern/libmv/intern/logging.cc
M   source/blenderplayer/CMakeLists.txt
M   tests/gtests/CMakeLists.txt
M   tests/gtests/testing/CMakeLists.txt
M   tests/gtests/testing/testing_main.cc

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a91e1b655a..748ed649800 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -363,6 +363,10 @@ option(WITH_LIBMV "Enable Libmv structure from 
motion library" ON)
 option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur 
specializations." OFF)
 mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
 
+# Logging/unbit test libraries.
+option(WITH_SYSTEM_GFLAGS   "Use system-wide Gflags instead of a bundled one" 
OFF)
+mark_as_advanced(WITH_SYSTEM_GFLAGS)
+
 # Freestyle
 option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
 
@@ -1317,15 +1321,27 @@ endif()
 # Configure GLog/GFlags
 
 if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+   if(WITH_SYSTEM_GFLAGS)
+   find_package(Gflags)
+   if(NOT GFLAGS_FOUND)
+   message(FATAL_ERROR "System wide Gflags is requested 
but was not found")
+   endif()
+   # FindGflags does not define this, and we are not even sure 
what to use here.
+   set(GFLAGS_DEFINES)
+   else()
+   set(GFLAGS_DEFINES
+   -DGFLAGS_DLL_DEFINE_FLAG=
+   -DGFLAGS_DLL_DECLARE_FLAG=
+   -DGFLAGS_DLL_DECL=
+   )
+   set(GFLAGS_NAMESPACE "gflags")
+   set(GFLAGS_LIBRARIES extern_gflags)
+   set(GFLAGS_INCLUDE_DIRS 
"${PROJECT_SOURCE_DIR}/extern/gflags/src")
+   endif()
+
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
-
-   set(GFLAGS_DEFINES
-   -DGFLAGS_DLL_DEFINE_FLAG=
-   -DGFLAGS_DLL_DECLARE_FLAG=
-   -DGFLAGS_DLL_DECL=
-   )
 endif()
 
 #-
diff --git a/build_files/cmake/Modules/FindGflags.cmake 
b/build_files/cmake/Modules/FindGflags.cmake
new file mode 100644
index 000..0a138c02465
--- /dev/null
+++ b/build_files/cmake/Modules/FindGflags.cmake
@@ -0,0 +1,603 @@
+# Ceres Solver - A fast non-linear least squares minimizer
+# Copyright 2015 Google Inc. All rights reserved.
+# http://ceres-solver.org/
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. nor the names of its contributors may be
+#   used to endorse or promote products derived from this software without
+#   specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# 

[Bf-blender-cvs] [7a59d381cea] master: Cycles: Cleanup, indentation of comment

2017-04-21 Thread Sergey Sharybin
Commit: 7a59d381cea8ed2ba11b8e14dad44e3e91390b07
Author: Sergey Sharybin
Date:   Fri Apr 21 11:33:44 2017 +0200
Branches: master
https://developer.blender.org/rB7a59d381cea8ed2ba11b8e14dad44e3e91390b07

Cycles: Cleanup, indentation of comment

Was broken after principled commit.

===

M   intern/cycles/kernel/kernel_subsurface.h

===

diff --git a/intern/cycles/kernel/kernel_subsurface.h 
b/intern/cycles/kernel/kernel_subsurface.h
index 6c8b7cca4ce..17b3cf033a1 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -158,7 +158,7 @@ ccl_device void 
subsurface_scatter_setup_diffuse_bsdf(ShaderData *sd, ShaderClos
sd->flag |= bsdf_principled_diffuse_setup(bsdf);
 
/* replace CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID 
with this special ID so render passes
-   * can recognize it as not being a regular 
Disney principled diffuse closure */
+* can recognize it as not being a regular 
Disney principled diffuse closure */
bsdf->type = CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID;
}
}
@@ -170,7 +170,7 @@ ccl_device void 
subsurface_scatter_setup_diffuse_bsdf(ShaderData *sd, ShaderClos
sd->flag |= bsdf_diffuse_setup(bsdf);
 
/* replace CLOSURE_BSDF_DIFFUSE_ID with this 
special ID so render passes
-   * can recognize it as not being a regular 
diffuse closure */
+* can recognize it as not being a regular 
diffuse closure */
bsdf->type = CLOSURE_BSDF_BSSRDF_ID;
}
}

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


[Bf-blender-cvs] [470b54a37a8] master: Cycles: Cleanup, indentation inside preprocessor

2017-04-21 Thread Sergey Sharybin
Commit: 470b54a37a8f509c18a2e7f5f46c7dd59c3509b8
Author: Sergey Sharybin
Date:   Fri Apr 21 12:01:04 2017 +0200
Branches: master
https://developer.blender.org/rB470b54a37a8f509c18a2e7f5f46c7dd59c3509b8

Cycles: Cleanup, indentation inside preprocessor

===

M   intern/cycles/kernel/svm/svm_types.h

===

diff --git a/intern/cycles/kernel/svm/svm_types.h 
b/intern/cycles/kernel/svm/svm_types.h
index 4a8cdb60952..cc9b840b13f 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -471,7 +471,7 @@ typedef enum ClosureType {
 #define CLOSURE_IS_BSDF_ANISOTROPIC(type) (type >= 
CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID && type <= 
CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID)
 #define CLOSURE_IS_BSDF_MULTISCATTER(type) (type == 
CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID ||\
 type == 
CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID || \
-   
type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID)
+type == 
CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID)
 #define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_BURLEY_ID)
 #define CLOSURE_IS_BSSRDF(type) (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= 
CLOSURE_BSSRDF_BURLEY_ID)
 #define CLOSURE_IS_VOLUME(type) (type >= CLOSURE_VOLUME_ID && type <= 
CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID)

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61855] trunk/lib/tests/cycles/ctests/opengl/reference_renders/input_object_info_random.png: Cycles tests: Update Random output of object info n

2017-04-21 Thread Sergey Sharybin
Revision: 61855
  https://developer.blender.org/rBL61855
Author:   sergey
Date: 2017-04-21 11:59:07 +0200 (Fri, 21 Apr 2017)
Log Message:
---
Cycles tests: Update Random output of object info node

Thi feature is now implemented.

Modified Paths:
--

trunk/lib/tests/cycles/ctests/opengl/reference_renders/input_object_info_random.png

Modified: 
trunk/lib/tests/cycles/ctests/opengl/reference_renders/input_object_info_random.png
===
(Binary files differ)

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


[Bf-blender-cvs] [3540b507801] blender2.8: Cleanup: use id-property access macros

2017-04-21 Thread Campbell Barton
Commit: 3540b507801461d30d6a856daa26efda15011f79
Author: Campbell Barton
Date:   Fri Apr 21 19:47:01 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3540b507801461d30d6a856daa26efda15011f79

Cleanup: use id-property access macros

===

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

===

diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index e9c3a43fe1b..0fb945b64ea 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1188,37 +1188,37 @@ void BKE_collection_engine_property_add_bool(IDProperty 
*props, const char *name
 int BKE_collection_engine_property_value_get_int(IDProperty *props, const char 
*name)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   return idprop ? idprop->data.val : 0;
+   return idprop ? IDP_Int(idprop) : 0;
 }
 
 float BKE_collection_engine_property_value_get_float(IDProperty *props, const 
char *name)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   return idprop ? *((float *)>data.val) : 0.0f;
+   return idprop ? IDP_Float(idprop) : 0.0f;
 }
 
 bool BKE_collection_engine_property_value_get_bool(IDProperty *props, const 
char *name)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   return idprop ? idprop->data.val : 0;
+   return idprop ? IDP_Int(idprop) : 0;
 }
 
 void BKE_collection_engine_property_value_set_int(IDProperty *props, const 
char *name, int value)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   idprop->data.val = value;
+   IDP_Int(idprop) = value;
 }
 
 void BKE_collection_engine_property_value_set_float(IDProperty *props, const 
char *name, float value)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   *(float *)>data.val = value;
+   IDP_Float(idprop) = value;
 }
 
 void BKE_collection_engine_property_value_set_bool(IDProperty *props, const 
char *name, bool value)
 {
IDProperty *idprop = IDP_GetPropertyFromGroup(props, name);
-   idprop->data.val = value;
+   IDP_Int(idprop) = value;
 }
 
 /* Engine Settings recalculate  */

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


[Bf-blender-cvs] [6294bd1b8bb] blender2.8: Depsgraph: Move DAG_get_object function

2017-04-21 Thread Dalai Felinto
Commit: 6294bd1b8bba6ac6e906eab1e7738b07264df997
Author: Dalai Felinto
Date:   Fri Apr 21 11:29:47 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB6294bd1b8bba6ac6e906eab1e7738b07264df997

Depsgraph: Move DAG_get_object function

BKE_depsgraph.h will be deprecated eventually, so moving it to 
DEG_depsgraph_query.h

===

M   source/blender/blenkernel/BKE_depsgraph.h
M   source/blender/blenkernel/intern/depsgraph.c
M   source/blender/depsgraph/DEG_depsgraph_query.h
M   source/blender/depsgraph/intern/depsgraph_query.cc
M   source/blender/editors/uvedit/uvedit_draw.c

===

diff --git a/source/blender/blenkernel/BKE_depsgraph.h 
b/source/blender/blenkernel/BKE_depsgraph.h
index 7da95ef01b7..363f8c82853 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -128,10 +128,6 @@ void DAG_print_dependencies(struct Main *bmain, struct 
Scene *scene, struct Obje
 
 short DAG_get_eval_flags_for_object(struct Scene *scene, void *object);
 
-/*  DAG * */
-
-struct Object *DAG_get_object(struct Depsgraph *depsgraph, struct Object *ob);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/intern/depsgraph.c 
b/source/blender/blenkernel/intern/depsgraph.c
index c83b381ead2..f99a4acd81e 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -55,16 +55,6 @@
 
 /*  DAG * */
 
-/**
- * Get the object as properly evaluated by depsgraph.
- */
-Object *DAG_get_object(Depsgraph *depsgraph, Object *ob)
-{
-   /* XXX TODO */
-   UNUSED_VARS(depsgraph);
-   return ob;
-}
-
 /* 
  * This functions are to be supported *
  * 
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h 
b/source/blender/depsgraph/DEG_depsgraph_query.h
index 4bf2b63cf41..430398c113f 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -54,6 +54,9 @@ struct Scene *DAG_get_scene(struct Depsgraph *graph);
 /* Get scene layer the despgraph is created for. */
 struct SceneLayer *DAG_get_scene_layer(struct Depsgraph *graph);
 
+/* Get the object as properly evaluated by depsgraph. */
+struct Object *DAG_get_object(struct Depsgraph *depsgraph, struct Object *ob);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index d15217c40da..0fe2d2be396 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -93,3 +93,9 @@ SceneLayer *DAG_get_scene_layer(Depsgraph *graph)
}
return NULL;
 }
+
+Object *DAG_get_object(Depsgraph * /*depsgraph*/, Object *ob)
+{
+   /* XXX TODO */
+   return ob;
+}
diff --git a/source/blender/editors/uvedit/uvedit_draw.c 
b/source/blender/editors/uvedit/uvedit_draw.c
index 387ccd92cba..3149abc338b 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -46,7 +46,6 @@
 #include "BLI_buffer.h"
 #include "BLI_bitmap.h"
 
-#include "BKE_depsgraph.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_editmesh.h"
 #include "BKE_material.h"
@@ -56,6 +55,7 @@
 #include "BIF_glutil.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "GPU_immediate.h"
 #include "GPU_immediate_util.h"

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


[Bf-blender-cvs] [3e7968c35f8] blender2.8: Draw Manager: don't assign bool from flags

2017-04-21 Thread Campbell Barton
Commit: 3e7968c35f8eead4cb74146754d306afc25a3d62
Author: Campbell Barton
Date:   Fri Apr 21 18:43:54 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3e7968c35f8eead4cb74146754d306afc25a3d62

Draw Manager: don't assign bool from flags

Some MSVC versions don't support this.

===

M   source/blender/draw/engines/clay/clay.c
M   source/blender/draw/engines/eevee/eevee.c
M   source/blender/draw/intern/draw_view.c
M   source/blender/draw/modes/object_mode.c

===

diff --git a/source/blender/draw/engines/clay/clay.c 
b/source/blender/draw/engines/clay/clay.c
index 861204d3a34..14053c3d5ff 100644
--- a/source/blender/draw/engines/clay/clay.c
+++ b/source/blender/draw/engines/clay/clay.c
@@ -348,7 +348,7 @@ static void CLAY_engine_init(void *vedata)
int ssao_samples = 32; /* XXX get from render settings */
float invproj[4][4];
float dfdyfacs[2];
-   bool is_persp = DRW_viewport_is_persp_get();
+   const bool is_persp = DRW_viewport_is_persp_get();
/* view vectors for the corners of the view frustum. Can be 
used to recreate the world space position easily */
float viewvecs[3][4] = {
{-1.0f, -1.0f, -1.0f, 1.0f},
diff --git a/source/blender/draw/engines/eevee/eevee.c 
b/source/blender/draw/engines/eevee/eevee.c
index e5b92095c6d..d60a85ddebb 100644
--- a/source/blender/draw/engines/eevee/eevee.c
+++ b/source/blender/draw/engines/eevee/eevee.c
@@ -439,7 +439,7 @@ static void EEVEE_cache_populate(void *vedata, Object *ob)
struct Batch *geom = DRW_cache_object_surface_get(ob);
if (geom) {
IDProperty *ces_mode_ob = BKE_object_collection_engine_get(ob, 
COLLECTION_MODE_OBJECT, "");
-   bool do_cull = 
BKE_collection_engine_property_value_get_bool(ces_mode_ob, 
"show_backface_culling");
+   const bool do_cull = 
BKE_collection_engine_property_value_get_bool(ces_mode_ob, 
"show_backface_culling");
 
/* Depth Prepass */
DRW_shgroup_call_add((do_cull) ? stl->g_data->depth_shgrp_cull 
: stl->g_data->depth_shgrp, geom, ob->obmat);
diff --git a/source/blender/draw/intern/draw_view.c 
b/source/blender/draw/intern/draw_view.c
index b6a27c88a9e..4816b66220c 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -351,9 +351,9 @@ static void drawfloor(Scene *scene, View3D *v3d, const char 
**grid_unit)
 
const bool show_floor = (v3d->gridflag & V3D_SHOW_FLOOR) && 
gridlines >= 1;
 
-   bool show_axis_x = v3d->gridflag & V3D_SHOW_X;
-   bool show_axis_y = v3d->gridflag & V3D_SHOW_Y;
-   bool show_axis_z = v3d->gridflag & V3D_SHOW_Z;
+   bool show_axis_x = (v3d->gridflag & V3D_SHOW_X) != 0;
+   bool show_axis_y = (v3d->gridflag & V3D_SHOW_Y) != 0;
+   bool show_axis_z = (v3d->gridflag & V3D_SHOW_Z) != 0;
 
unsigned char col_grid[3], col_axis[3];
 
diff --git a/source/blender/draw/modes/object_mode.c 
b/source/blender/draw/modes/object_mode.c
index 9887d7f115d..739bbe50439 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -259,10 +259,10 @@ static void OBJECT_engine_init(void *vedata)
float grid_scale = ED_view3d_grid_scale(scene, v3d, NULL);
float grid_res, offs;
 
-   const bool show_axis_x = v3d->gridflag & V3D_SHOW_X;
-   const bool show_axis_y = v3d->gridflag & V3D_SHOW_Y;
-   const bool show_axis_z = v3d->gridflag & V3D_SHOW_Z;
-   const bool show_floor = (v3d->gridflag & V3D_SHOW_FLOOR);
+   const bool show_axis_x = (v3d->gridflag & V3D_SHOW_X) != 0;
+   const bool show_axis_y = (v3d->gridflag & V3D_SHOW_Y) != 0;
+   const bool show_axis_z = (v3d->gridflag & V3D_SHOW_Z) != 0;
+   const bool show_floor = (v3d->gridflag & V3D_SHOW_FLOOR) != 0;
 
DRW_viewport_matrix_get(winmat, DRW_MAT_WIN);
DRW_viewport_matrix_get(viewmat, DRW_MAT_VIEW);

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


[Bf-blender-cvs] [15d73e53c3a] blender2.8: Gawain: fix for building empty element list

2017-04-21 Thread Campbell Barton
Commit: 15d73e53c3a8381cff2006b5b7c43fdb57a72648
Author: Campbell Barton
Date:   Fri Apr 21 18:32:36 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB15d73e53c3a8381cff2006b5b7c43fdb57a72648

Gawain: fix for building empty element list

===

M   intern/gawain/src/element.c

===

diff --git a/intern/gawain/src/element.c b/intern/gawain/src/element.c
index 3c3ca1c7626..f27f3a6c43a 100644
--- a/intern/gawain/src/element.c
+++ b/intern/gawain/src/element.c
@@ -134,6 +134,12 @@ void add_triangle_vertices(ElementListBuilder* builder, 
unsigned v1, unsigned v2
 
 static unsigned index_range(const unsigned values[], unsigned value_ct, 
unsigned* min_out, unsigned* max_out)
{
+   if (value_ct == 0)
+   {
+   *min_out = 0;
+   *max_out = 0;
+   return 0;
+   }
unsigned min_value = values[0];
unsigned max_value = values[0];
for (unsigned i = 1; i < value_ct; ++i)

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


[Bf-blender-cvs] [dafdf72904a] blender2.8: Rename: Alembic job struct sl > scene_layer

2017-04-21 Thread Dalai Felinto
Commit: dafdf72904a8be1d4d95fc35be6fc232aa1c0570
Author: Dalai Felinto
Date:   Fri Apr 21 10:03:44 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBdafdf72904a8be1d4d95fc35be6fc232aa1c0570

Rename: Alembic job struct sl > scene_layer

===

M   source/blender/alembic/intern/alembic_capi.cc

===

diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index e1c94cc556f..3303b6a664b 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -618,7 +618,7 @@ enum {
 struct ImportJobData {
Main *bmain;
Scene *scene;
-   SceneLayer *sl;
+   SceneLayer *scene_layer;
 
char filename[1024];
ImportSettings settings;
@@ -816,7 +816,7 @@ static void import_endjob(void *user_data)
/* Add object to scene. */
Base *base;
LayerCollection *lc;
-   SceneLayer *sl = data->sl;
+   SceneLayer *sl = data->scene_layer;
 
BKE_scene_layer_base_deselect_all(sl);
 
@@ -880,7 +880,7 @@ bool ABC_import(bContext *C, const char *filepath, float 
scale, bool is_sequence
ImportJobData *job = new ImportJobData();
job->bmain = CTX_data_main(C);
job->scene = CTX_data_scene(C);
-   job->sl = CTX_data_scene_layer(C);
+   job->scene_layer = CTX_data_scene_layer(C);
job->import_ok = false;
BLI_strncpy(job->filename, filepath, 1024);

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


[Bf-blender-cvs] [01a627dac95] blender2.8: Include the set in the depsgraph objects iterator

2017-04-21 Thread Dalai Felinto
Commit: 01a627dac950062cf79214426ab086bd11edbaaf
Author: Dalai Felinto
Date:   Thu Apr 20 18:59:47 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB01a627dac950062cf79214426ab086bd11edbaaf

Include the set in the depsgraph objects iterator

Pending: Include the set in the rna depsgraph.objects

In fact it would be nice to unify them both. However this will likely
change once Depsgraph incorporate this iterator, so I'm not sure we
should bother with that.

Related to T51203

===

M   source/blender/blenkernel/BKE_layer.h
M   source/blender/depsgraph/DEG_depsgraph_query.h
M   source/blender/depsgraph/intern/depsgraph_query.cc
M   source/blender/draw/intern/draw_manager.c
M   source/blender/makesdna/DNA_layer_types.h
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/blenkernel/BKE_layer.h 
b/source/blender/blenkernel/BKE_layer.h
index e1aaf39e2a3..b91ff82dc9f 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -216,20 +216,30 @@ void BKE_visible_bases_Iterator_end(Iterator *iter);
 }
 
 /* temporary hacky solution waiting for CoW depsgraph implementation */
-#define DEG_OBJECT_ITER(sl_, instance_)   \
+#define DEG_OBJECT_ITER(graph_, instance_)\
 { \
+   Scene *sce_, *scene_ = DAG_get_scene(graph_);   
  \
+   SceneLayer *sl_ = DAG_get_scene_layer(graph_);  
  \
+   int flag_ = ~(BASE_FROM_SET);   
  \
+  \
/* flush all the depsgraph data to objects */   
  \
Object *instance_;  
  \
Base *base_;
  \
-   for (base_ = (sl_)->object_bases.first; base_; base_ = base_->next) {   
  \
-   if ((base_->flag & BASE_VISIBLED) != 0) {   
  \
-   instance_ = base_->object;  
  \
-   instance_->base_flag = base_->flag; 
  \
-   instance_->base_collection_properties = 
base_->collection_properties;
+   for(sce_ = scene_; sce_; sce_ = sce_->set) {
  \
+   for (base_ = (sl_)->object_bases.first; base_; base_ = 
base_->next) { \
+   if ((base_->flag & BASE_VISIBLED) != 0) {   
  \
+   instance_ = base_->object;  
  \
+   instance_->base_flag = (base_->flag | 
BASE_FROM_SET) & flag_; \
+   instance_->base_collection_properties = 
base_->collection_properties;
 
 #define DEG_OBJECT_ITER_END   \
-} \
-} \
+   }   
  \
+   }   
  \
+   if (sce_->set) {
  \
+   sl_ = BKE_scene_layer_render_active(sce_->set); 
  \
+   flag_ = ~(BASE_SELECTED | BASE_SELECTABLED);
  \
+   }   
  \
+   }   
  \
 }
 
 #ifdef __cplusplus
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h 
b/source/blender/depsgraph/DEG_depsgraph_query.h
index 01cbaf503b5..4bf2b63cf41 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -48,6 +48,9 @@ bool DEG_id_type_tagged(struct Main *bmain, short idtype);
 /* Get additional evaluation flags for the given ID. */
 short DEG_get_eval_flags_for_id(struct Depsgraph *graph, struct ID *id);
 
+/* Get scene the despgraph is created for. */
+struct Scene *DAG_get_scene(struct Depsgraph *graph);
+
 /* Get scene layer the despgraph is created for. */
 struct SceneLayer *DAG_get_scene_layer(struct Depsgraph *graph);
 
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 7d09cdf4ac2..d15217c40da 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ 

[Bf-blender-cvs] [3a75e84376e] blender2.8: Draw Manager: edit-mode 3d text drawing

2017-04-21 Thread Campbell Barton
Commit: 3a75e84376e291cc415f3405ebd32eaec671e0ee
Author: Campbell Barton
Date:   Fri Apr 21 17:58:18 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3a75e84376e291cc415f3405ebd32eaec671e0ee

Draw Manager: edit-mode 3d text drawing

Draw cursor and selection, also support for fast-display.

===

M   source/blender/blenkernel/BKE_curve_render.h
M   source/blender/blenkernel/intern/curve_render.c
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/modes/edit_curve_mode.c
M   source/blender/draw/modes/edit_text_mode.c
M   source/blender/editors/curve/editfont.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/creator/creator.c

===

diff --git a/source/blender/blenkernel/BKE_curve_render.h 
b/source/blender/blenkernel/BKE_curve_render.h
index 79152c92979..be6da731d7c 100644
--- a/source/blender/blenkernel/BKE_curve_render.h
+++ b/source/blender/blenkernel/BKE_curve_render.h
@@ -39,4 +39,8 @@ struct Batch *BKE_curve_batch_cache_get_overlay_verts(struct 
Curve *cu);
 
 struct Batch *BKE_curve_batch_cache_get_triangles_with_normals(struct Curve 
*cu, struct CurveCache *ob_curve_cache);
 
+/* OB_FONT */
+struct Batch *BKE_curve_batch_cache_get_overlay_cursor(struct Curve *cu);
+struct Batch *BKE_curve_batch_cache_get_overlay_select(struct Curve *cu);
+
 #endif /* __BKE_CURVE_RENDER_H__ */
diff --git a/source/blender/blenkernel/intern/curve_render.c 
b/source/blender/blenkernel/intern/curve_render.c
index 0543d833fad..4ef350d3868 100644
--- a/source/blender/blenkernel/intern/curve_render.c
+++ b/source/blender/blenkernel/intern/curve_render.c
@@ -37,6 +37,7 @@
 #include "BKE_curve.h"
 #include "BKE_curve_render.h"
 
+#include "BKE_font.h"
 #include "BKE_displist_render.h"
 
 #include "GPU_batch.h"
@@ -152,6 +153,10 @@ typedef struct CurveRenderData {
int len;
} normal;
 
+   struct {
+   EditFont *edit_font;
+   } text;
+
bool hide_handles;
bool hide_normals;
 
@@ -159,7 +164,6 @@ typedef struct CurveRenderData {
CurveCache *ob_curve_cache;
 
/* borrow from 'Curve' */
-   struct EditNurb *edit_latt;
ListBase *nurbs;
 
/* edit, index in nurb list */
@@ -177,6 +181,8 @@ enum {
CU_DATATYPE_NORMAL  = 1 << 2,
/* Geometry */
CU_DATATYPE_SURFACE = 1 << 3,
+   /* Text */
+   CU_DATATYPE_TEXT_SELECT = 1 << 4,
 };
 
 /*
@@ -206,8 +212,6 @@ static CurveRenderData *curve_render_data_create(Curve *cu, 
CurveCache *ob_curve
EditNurb *editnurb = cu->editnurb;
nurbs = >nurbs;
 
-   rdata->edit_latt = editnurb;
-
if (types & CU_DATATYPE_OVERLAY) {
curve_render_overlay_verts_edges_len_get(
nurbs, rdata->hide_handles,
@@ -227,6 +231,8 @@ static CurveRenderData *curve_render_data_create(Curve *cu, 
CurveCache *ob_curve
 
rdata->nurbs = nurbs;
 
+   rdata->text.edit_font = cu->editfont;
+
return rdata;
 }
 
@@ -305,6 +311,12 @@ typedef struct CurveBatchCache {
Batch *batch;
} surface;
 
+   /* 3d text */
+   struct {
+   Batch *select;
+   Batch *cursor;
+   } text;
+
/* settings to determine if cache is invalid */
bool is_dirty;
 
@@ -326,16 +338,21 @@ static bool curve_batch_cache_valid(Curve *cu)
return false;
}
 
-   if (cache->is_editmode != (cu->editnurb != NULL)) {
+   if (cache->is_editmode != ((cu->editnurb != NULL) || (cu->editfont != 
NULL))) {
return false;
}
 
if (cache->is_editmode) {
-   if ((cache->hide_handles != ((cu->drawflag & CU_HIDE_HANDLES) 
!= 0))) {
-   return false;
+   if (cu->editnurb) {
+   if ((cache->hide_handles != ((cu->drawflag & 
CU_HIDE_HANDLES) != 0))) {
+   return false;
+   }
+   else if ((cache->hide_normals != ((cu->drawflag & 
CU_HIDE_NORMALS) != 0))) {
+   return false;
+   }
}
-   else if ((cache->hide_normals != ((cu->drawflag & 
CU_HIDE_NORMALS) != 0))) {
-   return false;
+   else if (cu->editfont) {
+   /* TODO */
}
}
 
@@ -377,7 +394,7 @@ static void curve_batch_cache_init(Curve *cu)
}
 #endif
 
-   cache->is_editmode = cu->editnurb != NULL;
+   cache->is_editmode = (cu->editnurb != NULL) || (cu->editfont != NULL);
 
cache->is_dirty = false;
 }
@@ -403,8 +420,13 @@ void BKE_curve_batch_selection_dirty(Curve *cu)
 {

[Bf-blender-cvs] [55a3d480463] master: Docs: diagram for reflect_v3_v3v3

2017-04-21 Thread Campbell Barton
Commit: 55a3d48046377444a3c36ffe7a6164030d447f6f
Author: Campbell Barton
Date:   Fri Apr 21 17:26:27 2017 +1000
Branches: master
https://developer.blender.org/rB55a3d48046377444a3c36ffe7a6164030d447f6f

Docs: diagram for reflect_v3_v3v3

===

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

===

diff --git a/source/blender/blenlib/intern/math_vector.c 
b/source/blender/blenlib/intern/math_vector.c
index dfecc3b556a..37897e2cd32 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -697,7 +697,19 @@ void bisect_v3_v3v3v3(float out[3], const float v1[3], 
const float v2[3], const
 
 /**
  * Returns a reflection vector from a vector and a normal vector
- * reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
+ * reflect = vec - ((2 * dot(vec, mirror)) * mirror).
+ *
+ * 
+ * v
+ * +  ^
+ *  \ |
+ *   \|
+ *+ normal: axis of reflection
+ *   /
+ *  /
+ * +
+ * out: result (negate for a 'bounce').
+ * 
  */
 void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3])
 {

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


[Bf-blender-cvs] [2b9738b7f81] blender2.8: Merge branch 'master' into 28

2017-04-21 Thread Campbell Barton
Commit: 2b9738b7f814a7c5cae02d283d0958a2a0284cb5
Author: Campbell Barton
Date:   Fri Apr 21 17:14:13 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB2b9738b7f814a7c5cae02d283d0958a2a0284cb5

Merge branch 'master' into 28

===



===

diff --cc source/blender/editors/space_view3d/drawobject.c
index adf17117dae,0436f1335d8..1d0dacdd6d9
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@@ -7495,15 -6524,12 +7494,14 @@@ static void draw_editfont(Scene *scene
setlinestyle(0);
  
  
-   if (BKE_vfont_select_get(ob, , ) && ef->selboxes) {
-   const int seltot = selend - selstart;
+   if (ef->selboxes && ef->selboxes_len) {
float selboxw;
  
 -  cpack(0xff);
 +  unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), 
"pos", COMP_F32, 3, KEEP_FLOAT);
 +  immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
 +  imm_cpack(0xff);
set_inverted_drawing(1);
-   for (int i = 0; i <= seltot; i++) {
+   for (int i = 0; i < ef->selboxes_len; i++) {
EditFontSelBox *sb = >selboxes[i];
float tvec[3];

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


[Bf-blender-cvs] [13ee5ba467d] master: Store edit-font select-box length

2017-04-21 Thread Campbell Barton
Commit: 13ee5ba467d69b80f025d0d2542ed190ad1667db
Author: Campbell Barton
Date:   Fri Apr 21 17:08:28 2017 +1000
Branches: master
https://developer.blender.org/rB13ee5ba467d69b80f025d0d2542ed190ad1667db

Store edit-font select-box length

A little awkward to calculate when drawing.

===

M   source/blender/blenkernel/BKE_font.h
M   source/blender/blenkernel/intern/font.c
M   source/blender/editors/space_view3d/drawobject.c

===

diff --git a/source/blender/blenkernel/BKE_font.h 
b/source/blender/blenkernel/BKE_font.h
index 6775639125f..e7ae0f606e7 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -60,8 +60,9 @@ typedef struct EditFont {
struct CharInfo *textbufinfo;

/* array of rectangles & rotation */
-   EditFontSelBox *selboxes;
float textcurs[4][2];
+   EditFontSelBox *selboxes;
+   int selboxes_len;
 
/* positional vars relative to the textbuf, textbufinfo (not utf8 bytes)
 * a copy of these is kept in Curve, but use these in editmode */
diff --git a/source/blender/blenkernel/intern/font.c 
b/source/blender/blenkernel/intern/font.c
index 580842fe176..401fed74c52 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -695,10 +695,14 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, int 
mode, ListBase *r_nubase
if (ef->selboxes)
MEM_freeN(ef->selboxes);
 
-   if (BKE_vfont_select_get(ob, , ))
-   ef->selboxes = MEM_callocN((selend - selstart + 1) * 
sizeof(EditFontSelBox), "font selboxes");
-   else
+   if (BKE_vfont_select_get(ob, , )) {
+   ef->selboxes_len = (selend - selstart) + 1;
+   ef->selboxes = MEM_callocN(ef->selboxes_len * 
sizeof(EditFontSelBox), "font selboxes");
+   }
+   else {
+   ef->selboxes_len = 0;
ef->selboxes = NULL;
+   }
 
selboxes = ef->selboxes;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 71e10c9dffc..0436f1335d8 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6472,7 +6472,6 @@ static void draw_editfont(Scene *scene, View3D *v3d, 
RegionView3D *rv3d, Base *b
Curve *cu = ob->data;
EditFont *ef = cu->editfont;
float vec1[3], vec2[3];
-   int selstart, selend;
 
draw_editfont_textcurs(rv3d, ef->textcurs);
 
@@ -6525,17 +6524,16 @@ static void draw_editfont(Scene *scene, View3D *v3d, 
RegionView3D *rv3d, Base *b
setlinestyle(0);
 
 
-   if (BKE_vfont_select_get(ob, , ) && ef->selboxes) {
-   const int seltot = selend - selstart;
+   if (ef->selboxes && ef->selboxes_len) {
float selboxw;
 
cpack(0xff);
set_inverted_drawing(1);
-   for (int i = 0; i <= seltot; i++) {
+   for (int i = 0; i < ef->selboxes_len; i++) {
EditFontSelBox *sb = >selboxes[i];
float tvec[3];
 
-   if (i != seltot) {
+   if (i + 1 != ef->selboxes_len) {
if (ef->selboxes[i + 1].y == sb->y)
selboxw = ef->selboxes[i + 1].x - sb->x;
else

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