[Bf-blender-cvs] [82686f0a0c2] blender2.8: Eevee: World default shader.

2017-04-25 Thread Clément Foucault
Commit: 82686f0a0c2c1d5c42b07288935440aea4713cad
Author: Clément Foucault
Date:   Tue Apr 25 23:48:26 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB82686f0a0c2c1d5c42b07288935440aea4713cad

Eevee: World default shader.

- Use uniform color world for the world probe.
- Refactored the Fresnel expression to be better with Area Lights.
- Squared the roughness for default materials.

===

M   release/scripts/startup/bl_ui/properties_material.py
M   release/scripts/startup/bl_ui/properties_world.py
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/eevee/eevee.c
M   source/blender/draw/engines/eevee/eevee_probes.c
M   source/blender/draw/engines/eevee/shaders/bsdf_direct_lib.glsl
M   source/blender/draw/engines/eevee/shaders/default_frag.glsl
A   source/blender/draw/engines/eevee/shaders/default_world_frag.glsl
M   source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
D   source/blender/draw/engines/eevee/shaders/probe_frag.glsl

===

diff --git a/release/scripts/startup/bl_ui/properties_material.py 
b/release/scripts/startup/bl_ui/properties_material.py
index 0e8acf6e6c5..c8066fdaec8 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -1130,10 +1130,10 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, 
Panel):
 layout = self.layout
 
 mat = context.material
-if not mat.use_nodes:
-layout.prop(mat, "diffuse_color", text="Diffuse")
-layout.prop(mat, "specular_color", text="Specular")
-layout.prop(mat, "specular_hardness", text="Glossiness")
+
+layout.prop(mat, "diffuse_color", text="Diffuse")
+layout.prop(mat, "specular_color", text="Specular")
+layout.prop(mat, "specular_hardness", text="Glossiness")
 
 
 classes = (
diff --git a/release/scripts/startup/bl_ui/properties_world.py 
b/release/scripts/startup/bl_ui/properties_world.py
index 6aa39580d34..e419f8d1df3 100644
--- a/release/scripts/startup/bl_ui/properties_world.py
+++ b/release/scripts/startup/bl_ui/properties_world.py
@@ -249,6 +249,24 @@ class WORLD_PT_custom_props(WorldButtonsPanel, 
PropertyPanel, Panel):
 _property_type = bpy.types.World
 
 
+class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel):
+bl_label = "Surface"
+bl_context = "world"
+COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+@classmethod
+def poll(cls, context):
+engine = context.scene.render.engine
+return context.world and (engine in cls.COMPAT_ENGINES)
+
+def draw(self, context):
+layout = self.layout
+
+world = context.world
+
+layout.prop(world, "horizon_color", text="Color")
+
+
 classes = (
 WORLD_PT_context_world,
 WORLD_PT_preview,
@@ -259,6 +277,7 @@ classes = (
 WORLD_PT_gather,
 WORLD_PT_mist,
 WORLD_PT_custom_props,
+EEVEE_WORLD_PT_surface,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index 14dbd50c487..5be7ec81c05 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -110,11 +110,11 @@ data_to_c_simple(engines/clay/shaders/ssao_alchemy.glsl 
SRC)
 data_to_c_simple(engines/clay/shaders/ssao_groundtruth.glsl SRC)
 
 data_to_c_simple(engines/eevee/shaders/default_frag.glsl SRC)
+data_to_c_simple(engines/eevee/shaders/default_world_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/lit_surface_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/lit_surface_vert.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/probe_filter_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/probe_sh_frag.glsl SRC)
-data_to_c_simple(engines/eevee/shaders/probe_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/probe_geom.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/probe_vert.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/shadow_frag.glsl SRC)
diff --git a/source/blender/draw/engines/eevee/eevee.c 
b/source/blender/draw/engines/eevee/eevee.c
index 69d6c19b8a7..6ae29ba33a9 100644
--- a/source/blender/draw/engines/eevee/eevee.c
+++ b/source/blender/draw/engines/eevee/eevee.c
@@ -25,6 +25,8 @@
 
 #include "DRW_render.h"
 
+#include "DNA_world_types.h"
+
 #include "BLI_dynstr.h"
 #include "BLI_rand.h"
 #include "GPU_glew.h"
@@ -38,11 +40,11 @@
 /* *** STATIC *** */
 static struct {
struct GPUShader *default_lit;
+   struct GPUShader *default_world;
struct GPUShader *depth_sh;
struct GPUShader *tonemap;
struct GPUShader *shadow_sh;
-   /* Temp : use world shader */
-   struct GPUShader *probe_sh;
+
struct GPUShader *probe_filter_sh;
struct GPUShader *probe_spherical_harmonic_sh;
 
@@ -55,6 +57,7 @@ static struct 

[Bf-blender-cvs] [bb75b0bcbce] blender2.8: Eevee: Disable shadow rendering until we get proper update scheduling.

2017-04-25 Thread Clément Foucault
Commit: bb75b0bcbcea35fe32e439c8f3e618b66f5110cf
Author: Clément Foucault
Date:   Tue Apr 25 23:33:52 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBbb75b0bcbcea35fe32e439c8f3e618b66f5110cf

Eevee: Disable shadow rendering until we get proper update scheduling.

Performance is quickly getting poor when you have lights otherwise.

===

M   source/blender/draw/engines/eevee/eevee_lights.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_lights.c 
b/source/blender/draw/engines/eevee/eevee_lights.c
index b61f6295b3e..e2dd0c47cb4 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -89,6 +89,7 @@ void EEVEE_lights_cache_add(EEVEE_StorageList *stl, Object 
*ob)
 
DRW_lamp_engine_data_free((void *)led);
 
+#if 0 /* TODO Waiting for notified refresh. only on scene change. Else too 
much perf cost. */
if (la->mode & (LA_SHAD_BUF | LA_SHAD_RAY)) {
if (la->type == LA_SUN && linfo->num_cascade < 
MAX_SHADOW_CASCADE) {
led->sto = 
MEM_mallocN(sizeof(EEVEE_ShadowCascadeData), "EEVEE_ShadowCascadeData");
@@ -104,7 +105,7 @@ void EEVEE_lights_cache_add(EEVEE_StorageList *stl, Object 
*ob)
linfo->num_cube++;
}
}
-
+#endif
if (!led->sto) {
led->sto = MEM_mallocN(sizeof(EEVEE_LightData), 
"EEVEE_LightData");
((EEVEE_LightData *)led->sto)->shadow_id = -1;

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


[Bf-blender-cvs] [7bc637a40d8] blender2.8: Eevee: Fix Square light with non uniform scale.

2017-04-25 Thread Clément Foucault
Commit: 7bc637a40d8153190d5367e66559b3c3fc165df2
Author: Clément Foucault
Date:   Tue Apr 25 23:27:14 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB7bc637a40d8153190d5367e66559b3c3fc165df2

Eevee: Fix Square light with non uniform scale.

===

M   source/blender/draw/engines/eevee/eevee_lights.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_lights.c 
b/source/blender/draw/engines/eevee/eevee_lights.c
index 54a851fd3ab..b61f6295b3e 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -220,7 +220,7 @@ static void eevee_light_setup(Object *ob, EEVEE_LampsInfo 
*linfo, EEVEE_LampEngi
evli->sizey = MAX2(0.0001f, la->area_sizey * scale[1] * 
0.5f);
}
else {
-   evli->sizey = evli->sizex;
+   evli->sizey = MAX2(0.0001f, la->area_size * scale[1] * 
0.5f);
}
}
else {

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


[Bf-blender-cvs] [28edc3f46fa] greasepencil-object: Remove duplicate character on previous commit

2017-04-25 Thread Antonio Vazquez
Commit: 28edc3f46faf14c0b3201947620a8c6a8d74bda2
Author: Antonio Vazquez
Date:   Tue Apr 25 23:10:36 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB28edc3f46faf14c0b3201947620a8c6a8d74bda2

Remove duplicate character on previous commit

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c 
b/source/blender/draw/engines/gpencil/gpencil_mode.c
index 167ec5e6175..023b6aaca8b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_mode.c
+++ b/source/blender/draw/engines/gpencil/gpencil_mode.c
@@ -587,7 +587,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob)
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
-   ToolSettings *ts = scene->toolsettings;;
+   ToolSettings *ts = scene->toolsettings;
 
UNUSED_VARS(psl, stl);

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


[Bf-blender-cvs] [d80b3430a0e] greasepencil-object: Cleanup: remove evil context for toolsettings

2017-04-25 Thread Antonio Vazquez
Commit: d80b3430a0e307b94e2886ddd2c9ba4177ddc228
Author: Antonio Vazquez
Date:   Tue Apr 25 23:09:44 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd80b3430a0e307b94e2886ddd2c9ba4177ddc228

Cleanup: remove evil context for toolsettings

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c 
b/source/blender/draw/engines/gpencil/gpencil_mode.c
index 7b8049c08b9..167ec5e6175 100644
--- a/source/blender/draw/engines/gpencil/gpencil_mode.c
+++ b/source/blender/draw/engines/gpencil/gpencil_mode.c
@@ -587,7 +587,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob)
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
-   ToolSettings *ts = CTX_data_tool_settings(draw_ctx->evil_C);
+   ToolSettings *ts = scene->toolsettings;;
 
UNUSED_VARS(psl, stl);

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


[Bf-blender-cvs] [b568227c6ab] greasepencil-object: Cleanup: create function with all drawing steps

2017-04-25 Thread Antonio Vazquez
Commit: b568227c6ab3a4268831c7269b17fc5590c5ea77
Author: Antonio Vazquez
Date:   Tue Apr 25 23:07:28 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBb568227c6ab3a4268831c7269b17fc5590c5ea77

Cleanup: create function with all drawing steps

This separate the drawing function in order to prepare for drawing scene 
datablock

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c 
b/source/blender/draw/engines/gpencil/gpencil_mode.c
index 4eb92f7922d..7b8049c08b9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_mode.c
+++ b/source/blender/draw/engines/gpencil/gpencil_mode.c
@@ -558,6 +558,29 @@ static void gpencil_draw_onionskins(void *vedata, 
ToolSettings *ts, Object *ob,b
}
 }
 
+/* helper for complete grease pencil datablock */
+static void gpencil_draw_datablock(void *vedata, Scene *scene, Object *ob, 
ToolSettings *ts, bGPdata *gpd)
+{
+   for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+   /* don't draw layer if hidden */
+   if (gpl->flag & GP_LAYER_HIDE)
+   continue;
+
+   bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, 0);
+   if (gpf == NULL)
+   continue;
+   /* draw onion skins */
+   if ((gpl->flag & GP_LAYER_ONIONSKIN) || (gpl->flag & 
GP_LAYER_GHOST_ALWAYS))
+   {
+   gpencil_draw_onionskins(vedata, ts, ob, ob->gpd, gpl, 
gpf);
+   }
+   /* draw normal strokes */
+   gpencil_draw_strokes(vedata, ts, ob, gpl, gpf, gpl->opacity, 
gpl->tintcolor, false, false);
+   }
+   /* draw current painting strokes */
+   gpencil_draw_buffer_strokes(vedata, ts, ob);
+}
+
 static void GPENCIL_cache_populate(void *vedata, Object *ob)
 {
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
@@ -569,24 +592,7 @@ static void GPENCIL_cache_populate(void *vedata, Object 
*ob)
UNUSED_VARS(psl, stl);
 
if (ob->type == OB_GPENCIL && ob->gpd) {
-   for (bGPDlayer *gpl = ob->gpd->layers.first; gpl; gpl = 
gpl->next) {
-   /* don't draw layer if hidden */
-   if (gpl->flag & GP_LAYER_HIDE)
-   continue;
-
-   bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, 
0);
-   if (gpf == NULL)
-   continue;
-   /* draw onion skins */
-   if ((gpl->flag & GP_LAYER_ONIONSKIN) || (gpl->flag & 
GP_LAYER_GHOST_ALWAYS))
-   {
-   gpencil_draw_onionskins(vedata, ts, ob, 
ob->gpd, gpl, gpf);
-   }
-   /* draw normal strokes */
-   gpencil_draw_strokes(vedata, ts, ob, gpl, gpf, 
gpl->opacity, gpl->tintcolor, false, false);
-   }
-   /* draw current painting strokes */
-   gpencil_draw_buffer_strokes(vedata, ts, ob);
+   gpencil_draw_datablock(vedata, scene, ob, ts, ob->gpd);
}
 }

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


[Bf-blender-cvs] [8cd8be2929b] greasepencil-object: Reduce the use of context functions and use DRWContextState members

2017-04-25 Thread Antonio Vazquez
Commit: 8cd8be2929bf46289683b4e538dce1a9f91c8d2c
Author: Antonio Vazquez
Date:   Tue Apr 25 23:00:27 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8cd8be2929bf46289683b4e538dce1a9f91c8d2c

Reduce the use of context functions and use DRWContextState members

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw.c 
b/source/blender/draw/engines/gpencil/gpencil_draw.c
index 46b875d099c..b318a20606f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw.c
@@ -149,7 +149,7 @@ Batch *gpencil_get_stroke_geom(bGPDstroke *gps, short 
thickness, const float ink
 }
 
 /* helper to convert 2d to 3d for simple drawing buffer */
-static void gpencil_stroke_convertcoords(Scene *scene, ARegion *ar, ScrArea 
*sa, const tGPspoint *point2D, float out[3], float *depth)
+static void gpencil_stroke_convertcoords(Scene *scene, ARegion *ar, View3D 
*v3d, const tGPspoint *point2D, float out[3], float *depth)
 {
float mval_f[2] = { point2D->x, point2D->y };
float mval_prj[2];
@@ -159,7 +159,6 @@ static void gpencil_stroke_convertcoords(Scene *scene, 
ARegion *ar, ScrArea *sa,
/* Current method just converts each point in screen-coordinates to
* 3D-coordinates using the 3D-cursor as reference.
*/
-   View3D *v3d = sa->spacedata.first;
const float *cursor = ED_view3d_cursor3d_get(scene, v3d);
copy_v3_v3(rvec, cursor);
 
@@ -176,11 +175,11 @@ static void gpencil_stroke_convertcoords(Scene *scene, 
ARegion *ar, ScrArea *sa,
 }
 
 /* convert 2d tGPspoint to 3d bGPDspoint */
-void gpencil_tpoint_to_point(Scene *scene, ARegion *ar, ScrArea *sa, const 
tGPspoint *tpt, bGPDspoint *pt)
+void gpencil_tpoint_to_point(Scene *scene, ARegion *ar, View3D *v3d, const 
tGPspoint *tpt, bGPDspoint *pt)
 {
float p3d[3];
/* conversion to 3d format */
-   gpencil_stroke_convertcoords(scene, ar, sa, tpt, p3d, NULL);
+   gpencil_stroke_convertcoords(scene, ar, v3d, tpt, p3d, NULL);
copy_v3_v3(>x, p3d);
 
pt->pressure = tpt->pressure;
@@ -192,7 +191,7 @@ Batch *gpencil_get_buffer_point_geom(bGPdata *gpd, short 
thickness)
 {
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
-   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   View3D *v3d = draw_ctx->v3d;
ARegion *ar = draw_ctx->ar;
 
const tGPspoint *tpt = gpd->sbuffer;
@@ -212,7 +211,7 @@ Batch *gpencil_get_buffer_point_geom(bGPdata *gpd, short 
thickness)
VertexBuffer_allocate_data(vbo, 1);

/* convert to 3D */
-   gpencil_tpoint_to_point(scene, ar, sa, tpt, );
+   gpencil_tpoint_to_point(scene, ar, v3d, tpt, );
 
float alpha = ink[3] * pt.strength;
CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
@@ -232,7 +231,7 @@ Batch *gpencil_get_buffer_stroke_geom(bGPdata *gpd, short 
thickness)
 {
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
-   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   View3D *v3d = draw_ctx->v3d;
ARegion *ar = draw_ctx->ar;
 
tGPspoint *points = gpd->sbuffer;
@@ -255,7 +254,7 @@ Batch *gpencil_get_buffer_stroke_geom(bGPdata *gpd, short 
thickness)
int idx = 0;
 
for (int i = 0; i < totpoints; i++, tpt++) {
-   gpencil_tpoint_to_point(scene, ar, sa, tpt, );
+   gpencil_tpoint_to_point(scene, ar, v3d, tpt, );
 
/* first point for adjacency (not drawn) */
if (i == 0) {
@@ -282,7 +281,7 @@ Batch *gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints, floa
 
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
-   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   View3D *v3d = draw_ctx->v3d;
ARegion *ar = draw_ctx->ar;
 
int tot_triangles = totpoints - 2;
@@ -321,19 +320,19 @@ Batch *gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints, floa
for (int i = 0; i < tot_triangles; i++) {
/* vertex 1 */
tpt = [tmp_triangles[i][0]];
-   gpencil_tpoint_to_point(scene, ar, sa, tpt, );
+   gpencil_tpoint_to_point(scene, ar, v3d, tpt, );
VertexBuffer_set_attrib(vbo, pos_id, idx, );
VertexBuffer_set_attrib(vbo, color_id, idx, ink);
++idx;
/* vertex 2 */
tpt = [tmp_triangles[i][1]];
-   gpencil_tpoint_to_point(scene, ar, sa, tpt, );
+   gpencil_tpoint_to_point(scene, ar, v3d, 

[Bf-blender-cvs] [3b874ef6fc9] temp-remove-mingw: MinGW: Fix various errors

2017-04-25 Thread Aaron Carlisle
Commit: 3b874ef6fc90cc0ffe04a577fabf2f65d5c296e8
Author: Aaron Carlisle
Date:   Tue Apr 25 16:31:46 2017 -0400
Branches: temp-remove-mingw
https://developer.blender.org/rB3b874ef6fc90cc0ffe04a577fabf2f65d5c296e8

MinGW: Fix various errors

===

M   build_files/cmake/platform/platform_win32_msvc.cmake
M   intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
M   intern/ghost/intern/GHOST_SystemWin32.h
M   intern/ghost/intern/GHOST_TaskbarWin32.h
M   source/blender/blenlib/BLI_winstuff.h
M   source/blender/blenlib/intern/storage.c
M   source/blender/imbuf/intern/IMB_anim.h
M   source/blender/imbuf/intern/anim_movie.c

===

diff --git a/build_files/cmake/platform/platform_win32_msvc.cmake 
b/build_files/cmake/platform/platform_win32_msvc.cmake
index b459dc9ba3f..2055b164f6d 100644
--- a/build_files/cmake/platform/platform_win32_msvc.cmake
+++ b/build_files/cmake/platform/platform_win32_msvc.cmake
@@ -472,11 +472,7 @@ if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBPATH ${SDL}/lib)
-   if(NOT CMAKE_COMPILER_IS_GNUCC)
-   set(SDL_LIBRARY SDL2)
-   else()
-   set(SDL_LIBRARY SDL)
-   endif()
+   set(SDL_LIBRARY SDL2)
 endif()
 
 # Audio IO
diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp 
b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
index 2dc24e12b34..7b9a897fe57 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
@@ -41,6 +41,7 @@
 
 // We do not support multiple monitors at the moment
 #define COMPILE_MULTIMON_STUBS
+#include 
 
 
 GHOST_DisplayManagerWin32::GHOST_DisplayManagerWin32(void)
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h 
b/intern/ghost/intern/GHOST_SystemWin32.h
index aa1021c3142..099d14e68ae 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -37,6 +37,10 @@
 #error WIN32 only!
 #endif // WIN32
 
+/* require Windows XP or newer */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+
 #define WIN32_LEAN_AND_MEAN
 #include 
 #include  // for drag-n-drop
diff --git a/intern/ghost/intern/GHOST_TaskbarWin32.h 
b/intern/ghost/intern/GHOST_TaskbarWin32.h
index 9489644bc21..0ef71754717 100644
--- a/intern/ghost/intern/GHOST_TaskbarWin32.h
+++ b/intern/ghost/intern/GHOST_TaskbarWin32.h
@@ -8,6 +8,10 @@
 #error WIN32 only!
 #endif // WIN32
 
+/* require Windows XP or newer */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+
 #define WIN32_LEAN_AND_MEAN
 #include 
 #include 
diff --git a/source/blender/blenlib/BLI_winstuff.h 
b/source/blender/blenlib/BLI_winstuff.h
index 1ad1407da4b..6fbbed01400 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -93,6 +93,16 @@ extern "C" {
 #  define  F_OK0
 #endif
 
+typedef unsigned int mode_t;
+
+/* use functions that take a 64 bit offset for files larger than 4GB */
+#include 
+#define fseek(stream, offset, origin) _fseeki64(stream, offset, origin)
+#define ftell(stream) _ftelli64(stream)
+#define lseek(fd, offset, origin) _lseeki64(fd, offset, origin)
+#define tell(fd) _telli64(fd)
+
+
 #ifndef _SSIZE_T_
 #  define _SSIZE_T_
 /* python uses HAVE_SSIZE_T */
diff --git a/source/blender/blenlib/intern/storage.c 
b/source/blender/blenlib/intern/storage.c
index 4b75e5a8d08..7f66834bf20 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -422,11 +422,14 @@ void BLI_file_free_lines(LinkNode *lines)
 bool BLI_file_older(const char *file1, const char *file2)
 {
 #ifdef WIN32
+  struct _stat st1, st2;
struct _stati64 st1, st2;
 
UTF16_ENCODE(file1);
UTF16_ENCODE(file2);
 
+   if (_wstat(file1_16, )) return false;
+  if (_wstat(file2_16, )) return false;
if (_wstati64(file1_16, )) return false;
if (_wstati64(file2_16, )) return false;
 
diff --git a/source/blender/imbuf/intern/IMB_anim.h 
b/source/blender/imbuf/intern/IMB_anim.h
index a565cd068a3..6d7ad7985f9 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -40,7 +40,7 @@
 #  include 
 #  include 
 #  include 
-#   include 
+#  include 
 
 #  undef AVIIF_KEYFRAME // redefined in AVI_avi.h
 #  undef AVIIF_LIST // redefined in AVI_avi.h
diff --git a/source/blender/imbuf/intern/anim_movie.c 
b/source/blender/imbuf/intern/anim_movie.c
index 9120c63009d..9806ff006d7 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #undef AVIIF_KEYFRAME /* redefined in AVI_avi.h */
 #undef AVIIF_LIST /* redefined in AVI_avi.h */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org

[Bf-blender-cvs] [0f2d0ff124c] master: workaround for T50176

2017-04-25 Thread lazydodo
Commit: 0f2d0ff124c67d474a29406525953e63a659bb91
Author: lazydodo
Date:   Tue Apr 25 14:17:41 2017 -0600
Branches: master
https://developer.blender.org/rB0f2d0ff124c67d474a29406525953e63a659bb91

workaround for T50176

This works around a long outstanding issue T50176 with cycles on msvc2015/x86 . 
root cause is still unknown though,feels like a game of whack'a'mole

Reviewers: sergey, dingto

Subscribers: Blendify

Tags: #cycles

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

===

M   intern/cycles/render/shader.cpp

===

diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index a7d42a4b4a0..015d0fa087b 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -49,6 +49,16 @@ static float beckmann_table_slope_max()
return 6.0;
 }
 
+
+/* MSVC 2015 needs this ugly hack to prevent a codegen bug on x86
+ * see T50176 for details
+ */
+#if _MSC_VER==1900
+#  define MSVC_VOLATILE volatile  
+#else
+#  define MSVC_VOLATILE 
+#endif
+
 /* Paper used: Importance Sampling Microfacet-Based BSDFs with the
  * Distribution of Visible Normals. Supplemental Material 2/2.
  *
@@ -72,7 +82,7 @@ static void beckmann_table_rows(float *table, int row_from, 
int row_to)
slope_x[0] = (double)-beckmann_table_slope_max();
CDF_P22_omega_i[0] = 0;
 
-   for(int index_slope_x = 1; index_slope_x < DATA_TMP_SIZE; 
++index_slope_x) {
+   for(MSVC_VOLATILE int index_slope_x = 1; index_slope_x < 
DATA_TMP_SIZE; ++index_slope_x) {
/* slope_x */
slope_x[index_slope_x] = 
(double)(-beckmann_table_slope_max() + 2.0f * beckmann_table_slope_max() * 
index_slope_x/(DATA_TMP_SIZE - 1.0f));
 
@@ -116,6 +126,8 @@ static void beckmann_table_rows(float *table, int row_from, 
int row_to)
}
 }
 
+#undef MSVC_VOLATILE
+
 static void beckmann_table_build(vector& table)
 {
table.resize(BECKMANN_TABLE_SIZE*BECKMANN_TABLE_SIZE);

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


[Bf-blender-cvs] [7349480da81] temp-remove-mingw: MinGW: fix missing typedef

2017-04-25 Thread Aaron Carlisle
Commit: 7349480da81db01f480998135e62911c479bdcf5
Author: Aaron Carlisle
Date:   Tue Apr 25 15:39:15 2017 -0400
Branches: temp-remove-mingw
https://developer.blender.org/rB7349480da81db01f480998135e62911c479bdcf5

MinGW: fix missing typedef

===

M   source/blender/blenlib/BLI_winstuff.h

===

diff --git a/source/blender/blenlib/BLI_winstuff.h 
b/source/blender/blenlib/BLI_winstuff.h
index 0753061f1d9..1ad1407da4b 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -98,6 +98,7 @@ extern "C" {
 /* python uses HAVE_SSIZE_T */
 #  ifndef HAVE_SSIZE_T
 #define HAVE_SSIZE_T 1
+typedef long ssize_t;
 #  endif
 #endif

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


[Bf-blender-cvs] [28b78480697] greasepencil-object: Adapt code to new context methods

2017-04-25 Thread Antonio Vazquez
Commit: 28b784806970a934a1e013f624992e77f23f1b5b
Author: Antonio Vazquez
Date:   Tue Apr 25 21:21:58 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB28b784806970a934a1e013f624992e77f23f1b5b

Adapt code to new context methods

===

M   source/blender/draw/engines/gpencil/gpencil_draw.c
M   source/blender/draw/engines/gpencil/gpencil_mode.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw.c 
b/source/blender/draw/engines/gpencil/gpencil_draw.c
index 55984183343..46b875d099c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw.c
@@ -190,10 +190,10 @@ void gpencil_tpoint_to_point(Scene *scene, ARegion *ar, 
ScrArea *sa, const tGPsp
 /* create batch geometry data for current buffer for one point stroke shader */
 Batch *gpencil_get_buffer_point_geom(bGPdata *gpd, short thickness)
 {
-   const struct bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
-   ScrArea *sa = CTX_wm_area(C);
-   ARegion *ar = CTX_wm_region(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
+   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   ARegion *ar = draw_ctx->ar;
 
const tGPspoint *tpt = gpd->sbuffer;
bGPDspoint pt;
@@ -230,10 +230,10 @@ Batch *gpencil_get_buffer_point_geom(bGPdata *gpd, short 
thickness)
 /* create batch geometry data for current buffer stroke shader */
 Batch *gpencil_get_buffer_stroke_geom(bGPdata *gpd, short thickness)
 {
-   const struct bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
-   ScrArea *sa = CTX_wm_area(C);
-   ARegion *ar = CTX_wm_region(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
+   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   ARegion *ar = draw_ctx->ar;
 
tGPspoint *points = gpd->sbuffer;
int totpoints = gpd->sbuffer_size;
@@ -280,10 +280,10 @@ Batch *gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints, floa
return NULL;
}
 
-   const struct bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
-   ScrArea *sa = CTX_wm_area(C);
-   ARegion *ar = CTX_wm_region(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
+   ScrArea *sa = CTX_wm_area(draw_ctx->evil_C);
+   ARegion *ar = draw_ctx->ar;
 
int tot_triangles = totpoints - 2;
/* allocate memory for temporary areas */
diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c 
b/source/blender/draw/engines/gpencil/gpencil_mode.c
index 7bcb54ed0b1..4eb92f7922d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_mode.c
+++ b/source/blender/draw/engines/gpencil/gpencil_mode.c
@@ -270,10 +270,10 @@ static void GPENCIL_cache_init(void *vedata)
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 
-   const struct bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
-   SceneLayer *sl = CTX_data_scene_layer(C);
-   PaletteColor *palcolor = CTX_data_active_palettecolor(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
+   SceneLayer *sl = draw_ctx->sl;
+   PaletteColor *palcolor = CTX_data_active_palettecolor(draw_ctx->evil_C);
 
if (!stl->g_data) {
/* Alloc transient pointers */
@@ -562,9 +562,9 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob)
 {
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
-   const bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
-   ToolSettings *ts = CTX_data_tool_settings(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
+   ToolSettings *ts = CTX_data_tool_settings(draw_ctx->evil_C);
 
UNUSED_VARS(psl, stl);

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


[Bf-blender-cvs] [d8e83516e20] blender2.8: Draw Manager: support for selection using engines

2017-04-25 Thread Campbell Barton
Commit: d8e83516e209cbb7c040211da558d7fff9ecc5be
Author: Campbell Barton
Date:   Wed Apr 26 04:39:25 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBd8e83516e209cbb7c040211da558d7fff9ecc5be

Draw Manager: support for selection using engines

Needed to remove old draw code entirely.

Object mode selection support, pose and armature still need to be added.
Enabled when 'use_modern_viewport' is set.

===

M   source/blender/draw/DRW_engine.h
M   source/blender/draw/engines/clay/clay.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/draw/modes/object_mode.c
M   source/blender/editors/space_view3d/view3d_view.c
M   source/blender/gpu/GPU_viewport.h
M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index 60e8e40ea61..03ba8e39447 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -26,6 +26,7 @@
 #ifndef __DRW_ENGINE_H__
 #define __DRW_ENGINE_H__
 
+struct ARegion;
 struct CollectionEngineSettings;
 struct DRWPass;
 struct Material;
@@ -34,6 +35,12 @@ struct DrawEngineType;
 struct IDProperty;
 struct bContext;
 struct Object;
+struct SceneLayer;
+struct ViewContext;
+struct View3D;
+struct rcti;
+
+#include "BLI_sys_types.h"  /* for bool */
 
 /* Buffer and textures used by the viewport by default */
 typedef struct DefaultFramebufferList {
@@ -54,6 +61,9 @@ void DRW_engine_viewport_data_size_get(
 int *r_fbl_len, int *r_txl_len, int *r_psl_len, int *r_stl_len);
 
 void DRW_draw_view(const struct bContext *C);
+void DRW_draw_select_loop(
+struct ViewContext *vc, struct Scene *scene, struct SceneLayer *sl, 
struct View3D *v3d, struct ARegion *ar,
+bool use_obedit_skip, bool use_nearest, const struct rcti *rect);
 
 void DRW_object_engine_data_free(struct Object *ob);
 
diff --git a/source/blender/draw/engines/clay/clay.c 
b/source/blender/draw/engines/clay/clay.c
index 5b1c6045808..3466f4f8b67 100644
--- a/source/blender/draw/engines/clay/clay.c
+++ b/source/blender/draw/engines/clay/clay.c
@@ -335,7 +335,7 @@ static void CLAY_engine_init(void *vedata)
}
}
 
-   {
+   if (DRW_viewport_is_fbo()) {
const float *viewport_size = DRW_viewport_size_get();
DRWFboTexture tex = {>depth_dup, DRW_BUF_DEPTH_24, 0};
DRW_framebuffer_init(>dupli_depth,
@@ -607,7 +607,9 @@ static void CLAY_draw_scene(void *vedata)
 
/* Pass 2 : Duplicate depth */
/* Unless we go for deferred shading we need this to avoid manual depth 
test and artifacts */
-   DRW_framebuffer_blit(dfbl->default_fb, fbl->dupli_depth, true);
+   if (DRW_viewport_is_fbo()) {
+   DRW_framebuffer_blit(dfbl->default_fb, fbl->dupli_depth, true);
+   }
 
/* Pass 3 : Shading */
DRW_draw_pass(psl->clay_pass);
diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 93fd8d610ea..f98f39d7bb3 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -295,6 +295,8 @@ const float *DRW_viewport_size_get(void);
 const float *DRW_viewport_screenvecs_get(void);
 const float *DRW_viewport_pixelsize_get(void);
 bool DRW_viewport_is_persp_get(void);
+bool DRW_viewport_is_fbo(void);
+bool DRW_viewport_is_select(void);
 bool DRW_viewport_cache_is_dirty(void);
 
 struct DefaultFramebufferList *DRW_viewport_framebuffer_list_get(void);
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index 6046db874b8..67e2496e09f 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -77,6 +77,14 @@
 #define MAX_ATTRIB_NAME 32
 #define MAX_PASS_NAME 32
 
+/* Use draw manager to call GPU_select, see: DRW_draw_select_loop */
+#define USE_GPU_SELECT
+
+#ifdef USE_GPU_SELECT
+#  include "ED_view3d.h"
+#  include "GPU_select.h"
+#endif
+
 extern char datatoc_gpu_shader_2D_vert_glsl[];
 extern char datatoc_gpu_shader_3D_vert_glsl[];
 extern char datatoc_gpu_shader_fullscreen_vert_glsl[];
@@ -155,12 +163,18 @@ struct DRWPass {
 
 typedef struct DRWCall {
struct DRWCall *next, *prev;
+#ifdef USE_GPU_SELECT
+   int select_id;
+#endif
Batch *geometry;
float (*obmat)[4];
 } DRWCall;
 
 typedef struct DRWCallDynamic {
struct DRWCallDynamic *next, *prev;
+#ifdef USE_GPU_SELECT
+   int select_id;
+#endif
const void *data[];
 } DRWCallDynamic;
 
@@ -175,6 +189,11 @@ struct DRWShadingGroup {
 
Batch *instance_geom;  /* Geometry to instance */
Batch *batch_geom; /* Result of call batching */
+
+#ifdef USE_GPU_SELECT
+   /* backlink to pass we're in */
+ 

[Bf-blender-cvs] [546b73334f5] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

2017-04-25 Thread Antonio Vazquez
Commit: 546b73334f514ad5dbed7cc39609589eb3d5e37e
Author: Antonio Vazquez
Date:   Tue Apr 25 20:49:16 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB546b73334f514ad5dbed7cc39609589eb3d5e37e

Merge branch 'blender2.8' into greasepencil-object

===



===



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


[Bf-blender-cvs] [45a47be6dfd] temp-remove-mingw: MinGW: Adress review points raised in cmake

2017-04-25 Thread Aaron Carlisle
Commit: 45a47be6dfd5c3736d459b103e30ecaeca856efb
Author: Aaron Carlisle
Date:   Tue Apr 25 14:29:03 2017 -0400
Branches: temp-remove-mingw
https://developer.blender.org/rB45a47be6dfd5c3736d459b103e30ecaeca856efb

MinGW: Adress review points raised in cmake

- Add early error on unsupported compiler
- Remove some `CMAKE_COMPILER_IS_GNUCC`
- Add back `if sys.platform == "win32":`

===

M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   build_files/cmake/project_info.py

===

diff --git a/build_files/cmake/config/blender_full.cmake 
b/build_files/cmake/config/blender_full.cmake
index 1d520b34bd4..a35ea464bd9 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -63,9 +63,6 @@ if(UNIX AND NOT APPLE)
set(WITH_OPENSUBDIV  ON  CACHE BOOL "" FORCE)
 elseif(WIN32)
set(WITH_JACKOFF CACHE BOOL "" FORCE)
-   if(NOT CMAKE_COMPILER_IS_GNUCC)
-   set(WITH_OPENSUBDIV  ON  CACHE BOOL "" FORCE)
-   endif()
 elseif(APPLE)
set(WITH_JACKON  CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_release.cmake 
b/build_files/cmake/config/blender_release.cmake
index a35b6dc124f..0ef20476741 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -64,9 +64,6 @@ if(UNIX AND NOT APPLE)
set(WITH_OPENSUBDIV  ON  CACHE BOOL "" FORCE)
 elseif(WIN32)
set(WITH_JACKOFF CACHE BOOL "" FORCE)
-   if(NOT CMAKE_COMPILER_IS_GNUCC)
-   set(WITH_OPENSUBDIV  ON  CACHE BOOL "" FORCE)
-   endif()
 elseif(APPLE)
set(WITH_JACKON  CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 952528eb728..7ce6992d043 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -27,6 +27,8 @@ add_definitions(-DWIN32)
 
 if(MSVC)
include(platform_win32_msvc)
+else()
+   message([FATAL_ERROR] "Compiler is unsupported")
 endif()
 
 set(WINTAB_INC ${LIBDIR}/wintab/include)
diff --git a/build_files/cmake/project_info.py 
b/build_files/cmake/project_info.py
index 6e73c5cdcdf..3ac4c4c9480 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -144,12 +144,15 @@ def cmake_advanced_info():
 
 def create_eclipse_project():
 print("CMAKE_DIR %r" % CMAKE_DIR)
-if make_exe_basename.startswith(("make", "gmake")):
-cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR
-elif make_exe_basename.startswith("ninja"):
-cmd = 'cmake "%s" -G"Eclipse CDT4 - Ninja"' % CMAKE_DIR
+if sys.platform == "win32":
+raise Exception("Error: win32 is not supported")
 else:
-raise Exception("Unknown make program %r" % make_exe)
+if make_exe_basename.startswith(("make", "gmake")):
+cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % 
CMAKE_DIR
+elif make_exe_basename.startswith("ninja"):
+cmd = 'cmake "%s" -G"Eclipse CDT4 - Ninja"' % CMAKE_DIR
+else:
+raise Exception("Unknown make program %r" % make_exe)
 
 os.system(cmd)
 return join(CMAKE_DIR, ".cproject")

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


[Bf-blender-cvs] [10f354c4b44] temp-remove-mingw: MinGW: From review: revert edits to Cycles, Libmv, FindGflags

2017-04-25 Thread Aaron Carlisle
Commit: 10f354c4b44aa64eff2e456c506d914f19c1001c
Author: Aaron Carlisle
Date:   Tue Apr 25 13:58:45 2017 -0400
Branches: temp-remove-mingw
https://developer.blender.org/rB10f354c4b44aa64eff2e456c506d914f19c1001c

MinGW: From review: revert edits to Cycles, Libmv, FindGflags

===

M   build_files/cmake/Modules/FindGflags.cmake
M   intern/cycles/util/util_aligned_malloc.cpp
M   intern/cycles/util/util_optimization.h
M   intern/cycles/util/util_path.cpp
M   intern/cycles/util/util_simd.h
M   intern/cycles/util/util_system.cpp
M   intern/cycles/util/util_types.h
M   intern/libmv/libmv/base/aligned_malloc.cc
M   intern/libmv/libmv/numeric/numeric.h

===

diff --git a/build_files/cmake/Modules/FindGflags.cmake 
b/build_files/cmake/Modules/FindGflags.cmake
index 4766dfb0f9b..0a138c02465 100644
--- a/build_files/cmake/Modules/FindGflags.cmake
+++ b/build_files/cmake/Modules/FindGflags.cmake
@@ -496,7 +496,8 @@ if(NOT GFLAGS_FOUND)
   # detect threads, we assume that gflags requires it.
   find_package(Threads QUIET)
   set(GFLAGS_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-  # On Windows, the Shlwapi library is used by gflags if available.
+  # On Windows (including MinGW), the Shlwapi library is used by gflags if
+  # available.
   if(WIN32)
 include(CheckIncludeFileCXX)
 check_include_file_cxx("shlwapi.h" HAVE_SHLWAPI)
diff --git a/intern/cycles/util/util_aligned_malloc.cpp 
b/intern/cycles/util/util_aligned_malloc.cpp
index 78669a17c72..cc7252dcc58 100644
--- a/intern/cycles/util/util_aligned_malloc.cpp
+++ b/intern/cycles/util/util_aligned_malloc.cpp
@@ -23,6 +23,13 @@
 
 #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
 /* Needed for memalign on Linux and _aligned_alloc on Windows. */
+#  ifdef FREE_WINDOWS
+/* Make sure _aligned_malloc is included. */
+#ifdef __MSVCRT_VERSION__
+#  undef __MSVCRT_VERSION__
+#endif
+#define __MSVCRT_VERSION__ 0x0700
+#  endif  /* FREE_WINDOWS */
 #  include 
 #else
 /* Apple's malloc is 16-byte aligned, and does not have malloc.h, so include
diff --git a/intern/cycles/util/util_optimization.h 
b/intern/cycles/util/util_optimization.h
index d441198cb2b..6f70a474fe7 100644
--- a/intern/cycles/util/util_optimization.h
+++ b/intern/cycles/util/util_optimization.h
@@ -99,6 +99,7 @@
  * We assume __KERNEL_SSEX__ flags to have been defined at this point */
 
 /* SSE intrinsics headers */
+#ifndef FREE_WINDOWS64
 
 #ifdef _MSC_VER
 #  include 
@@ -106,6 +107,14 @@
 #  include 
 #endif
 
+#else
+
+/* MinGW64 has conflicting declarations for these SSE headers in .
+ * Since we can't avoid including , better only include that */
+#include "util/util_windows.h"
+
+#endif
+
 #endif
 
 #endif /* __UTIL_OPTIMIZATION_H__ */
diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp
index b0d46d39b50..cd3067f7650 100644
--- a/intern/cycles/util/util_path.cpp
+++ b/intern/cycles/util/util_path.cpp
@@ -50,8 +50,10 @@ OIIO_NAMESPACE_USING
 CCL_NAMESPACE_BEGIN
 
 #ifdef _WIN32
-#  if defined(_MSC_VER)
+#  if defined(_MSC_VER) || defined(__MINGW64__)
 typedef struct _stat64 path_stat_t;
+#  elif defined(__MINGW32__)
+typedef struct _stati64 path_stat_t;
 #  else
 typedef struct _stat path_stat_t;
 #  endif
@@ -566,8 +568,10 @@ static string path_make_compatible(const string& path)
 
 static int path_wstat(const wstring& path_wc, path_stat_t *st)
 {
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW64__)
return _wstat64(path_wc.c_str(), st);
+#elif defined(__MINGW32__)
+   return _wstati64(path_wc.c_str(), st);
 #else
return _wstat(path_wc.c_str(), st);
 #endif
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h
index 69dbc2ed86d..557809a5719 100644
--- a/intern/cycles/util/util_simd.h
+++ b/intern/cycles/util/util_simd.h
@@ -71,7 +71,7 @@ __forceinline operator  int  ( ) const { return 
std::numeric_limits<
 #define _lzcnt_u64 __lzcnt64
 #endif
 
-#if defined(_WIN32) && !defined(__clang__)
+#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__)
 
 __forceinline int __popcnt(int in) {
   return _mm_popcnt_u32(in);
diff --git a/intern/cycles/util/util_system.cpp 
b/intern/cycles/util/util_system.cpp
index 9c993d6ba08..a942d738b8a 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -22,6 +22,9 @@
 #include "util/util_string.h"
 
 #ifdef _WIN32
+#  if(!defined(FREE_WINDOWS))
+#include 
+#  endif
 #  include "util_windows.h"
 #elif defined(__APPLE__)
 #  include 
@@ -102,7 +105,7 @@ unsigned short system_cpu_process_groups(unsigned short 
max_groups,
 #endif
 }
 
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined(FREE_WINDOWS)
 static void __cpuid(int data[4], int selector)
 {
 #ifdef __x86_64__
diff --git a/intern/cycles/util/util_types.h 

[Bf-blender-cvs] [e91dc3a97c0] master: Cycles: use safe compiler flags for OpenCL.

2017-04-25 Thread Hristo Gueorguiev
Commit: e91dc3a97c0ce1951ce76790210f7197ab9e014a
Author: Hristo Gueorguiev
Date:   Tue Apr 25 20:10:51 2017 +0200
Branches: master
https://developer.blender.org/rBe91dc3a97c0ce1951ce76790210f7197ab9e014a

Cycles: use safe compiler flags for OpenCL.

Using -cl-fast-relaxed-math assumes no NaN/Inf values in any expression.
This causes problems on overflow, division by zero, square root of negative 
number.
Comparisons with NaN or infinite value are affected as well.

This patch causes <2% slowdown on benchmark scenes.

Fix T50985: Rendering volume scatter with GPU OpenCL comes to an halt after a 
few seconds

===

M   intern/cycles/device/opencl/opencl_base.cpp

===

diff --git a/intern/cycles/device/opencl/opencl_base.cpp 
b/intern/cycles/device/opencl/opencl_base.cpp
index 52d0662a8e3..22aeaddcde8 100644
--- a/intern/cycles/device/opencl/opencl_base.cpp
+++ b/intern/cycles/device/opencl/opencl_base.cpp
@@ -612,7 +612,7 @@ void OpenCLDeviceBase::shader(DeviceTask& task)
 
 string OpenCLDeviceBase::kernel_build_options(const string *debug_src)
 {
-   string build_options = "-cl-fast-relaxed-math ";
+   string build_options = "-cl-no-signed-zeros -cl-mad-enable ";
 
if(platform_name == "NVIDIA CUDA") {
build_options += "-D__KERNEL_OPENCL_NVIDIA__ "

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


[Bf-blender-cvs] [9d26e32ea28] master: Workaround for AMD GPU OpenCL compiler.

2017-04-25 Thread Hristo Gueorguiev
Commit: 9d26e32ea28b35bf51b27828f7b58fe479a29a68
Author: Hristo Gueorguiev
Date:   Tue Apr 25 20:08:14 2017 +0200
Branches: master
https://developer.blender.org/rB9d26e32ea28b35bf51b27828f7b58fe479a29a68

Workaround for AMD GPU OpenCL compiler.

===

M   intern/cycles/kernel/kernel_subsurface.h
M   intern/cycles/kernel/split/kernel_split_data_types.h

===

diff --git a/intern/cycles/kernel/kernel_subsurface.h 
b/intern/cycles/kernel/kernel_subsurface.h
index f58eef7a368..baf629342b9 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -399,6 +399,12 @@ ccl_device_noinline void subsurface_scatter_multi_setup(
 #else
Ray *ray = _isect->ray;
 #endif
+
+   /* Workaround for AMD GPU OpenCL compiler. Most probably cache bypass 
issue. */
+#if defined(__SPLIT_KERNEL__) && defined(__KERNEL_OPENCL_AMD__) && 
defined(__KERNEL_GPU__)
+   kernel_split_params.dummy_sd_flag = sd->flag;
+#endif
+
/* Setup new shading point. */
shader_setup_from_subsurface(kg, sd, _isect->hits[hit], ray);
 
diff --git a/intern/cycles/kernel/split/kernel_split_data_types.h 
b/intern/cycles/kernel/split/kernel_split_data_types.h
index 748197b7183..0af8bfc89d5 100644
--- a/intern/cycles/kernel/split/kernel_split_data_types.h
+++ b/intern/cycles/kernel/split/kernel_split_data_types.h
@@ -43,6 +43,9 @@ typedef struct SplitParams {
ccl_global char *use_queues_flag;
 
ccl_global float *buffer;
+
+   /* Place for storing sd->flag. AMD GPU OpenCL compiler workaround */
+   int dummy_sd_flag;
 } SplitParams;
 
 /* Global memory variables [porting]; These memory is used for

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


[Bf-blender-cvs] [041a50291b7] blender2.8: Eevee: Make default shaders works.

2017-04-25 Thread Clément Foucault
Commit: 041a50291b73b727fdf8bc3192de2917e8563ce0
Author: Clément Foucault
Date:   Tue Apr 25 18:46:59 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB041a50291b73b727fdf8bc3192de2917e8563ce0

Eevee: Make default shaders works.

- Added New Batch cache routine to get the split mesh for each material. 
(optimization needed)
- Did some shader modifications to create default_frag and support a somwhat 
correct fresnel for lamps (to finish)

===

M   release/scripts/startup/bl_ui/properties_material.py
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/eevee/eevee.c
M   source/blender/draw/engines/eevee/eevee_private.h
M   source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
A   source/blender/draw/engines/eevee/shaders/default_frag.glsl
M   source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/intern/draw_cache_impl.h
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_manager.c

===

diff --git a/release/scripts/startup/bl_ui/properties_material.py 
b/release/scripts/startup/bl_ui/properties_material.py
index 06ae1847d06..0e8acf6e6c5 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -1054,6 +1054,88 @@ class MATERIAL_PT_custom_props(MaterialButtonsPanel, 
PropertyPanel, Panel):
 _property_type = bpy.types.Material
 
 
+class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
+bl_label = ""
+bl_context = "material"
+bl_options = {'HIDE_HEADER'}
+COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+@classmethod
+def poll(cls, context):
+engine = context.scene.render.engine
+return (context.material or context.object) and (engine in 
cls.COMPAT_ENGINES)
+
+def draw(self, context):
+layout = self.layout
+
+mat = context.material
+ob = context.object
+slot = context.material_slot
+space = context.space_data
+
+if ob:
+is_sortable = len(ob.material_slots) > 1
+rows = 1
+if (is_sortable):
+rows = 4
+
+row = layout.row()
+
+row.template_list("MATERIAL_UL_matslots", "", ob, 
"material_slots", ob, "active_material_index", rows=rows)
+
+col = row.column(align=True)
+col.operator("object.material_slot_add", icon='ZOOMIN', text="")
+col.operator("object.material_slot_remove", icon='ZOOMOUT', 
text="")
+
+col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
+
+if is_sortable:
+col.separator()
+
+col.operator("object.material_slot_move", icon='TRIA_UP', 
text="").direction = 'UP'
+col.operator("object.material_slot_move", icon='TRIA_DOWN', 
text="").direction = 'DOWN'
+
+if ob.mode == 'EDIT':
+row = layout.row(align=True)
+row.operator("object.material_slot_assign", text="Assign")
+row.operator("object.material_slot_select", text="Select")
+row.operator("object.material_slot_deselect", text="Deselect")
+
+split = layout.split(percentage=0.65)
+
+if ob:
+split.template_ID(ob, "active_material", new="material.new")
+row = split.row()
+
+if slot:
+row.prop(slot, "link", text="")
+else:
+row.label()
+elif mat:
+split.template_ID(space, "pin_id")
+split.separator()
+
+
+class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
+bl_label = "Surface"
+bl_context = "material"
+COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+@classmethod
+def poll(cls, context):
+engine = context.scene.render.engine
+return context.material and (engine in cls.COMPAT_ENGINES)
+
+def draw(self, context):
+layout = self.layout
+
+mat = context.material
+if not mat.use_nodes:
+layout.prop(mat, "diffuse_color", text="Diffuse")
+layout.prop(mat, "specular_color", text="Specular")
+layout.prop(mat, "specular_hardness", text="Glossiness")
+
+
 classes = (
 MATERIAL_MT_sss_presets,
 MATERIAL_MT_specials,
@@ -1082,6 +1164,8 @@ classes = (
 MATERIAL_PT_volume_integration,
 MATERIAL_PT_volume_options,
 MATERIAL_PT_custom_props,
+EEVEE_MATERIAL_PT_context_material,
+EEVEE_MATERIAL_PT_surface,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index 

[Bf-blender-cvs] [00f5c621a65] blender2.8: Outliner: Re-build depsgraph when reordering collections

2017-04-25 Thread Dalai Felinto
Commit: 00f5c621a65b6bc9847776b2542588835fb4054c
Author: Dalai Felinto
Date:   Tue Apr 25 18:43:53 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB00f5c621a65b6bc9847776b2542588835fb4054c

Outliner: Re-build depsgraph when reordering collections

Otherwise if we create a new collection, and drag a collection into it we either
get a crash, or at the very least we dont get the visibility flags correct.

===

M   source/blender/editors/space_outliner/outliner_intern.h
M   source/blender/editors/space_outliner/outliner_ops.c
M   source/blender/editors/space_outliner/outliner_tree.c

===

diff --git a/source/blender/editors/space_outliner/outliner_intern.h 
b/source/blender/editors/space_outliner/outliner_intern.h
index 2256e55a315..06b37377535 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -39,6 +39,7 @@
 struct wmOperatorType;
 struct TreeElement;
 struct TreeStoreElem;
+struct Main;
 struct bContext;
 struct Scene;
 struct SceneLayer;
@@ -68,7 +69,8 @@ typedef enum TreeTraversalAction {
  * Callback type for reinserting elements at a different position, used to 
allow user customizable element order.
  * Passing scene right now, may be better to allow some custom data.
  */
-typedef void (*TreeElementReinsertFunc)(const struct Scene *scene, struct 
TreeElement *insert_element,
+typedef void (*TreeElementReinsertFunc)(struct Main *bmain, const struct Scene 
*scene,
+struct TreeElement *insert_element,
 struct TreeElement *insert_handle, 
TreeElementInsertType action);
 /**
  * Executed on (almost) each mouse move while dragging. It's supposed to give 
info
diff --git a/source/blender/editors/space_outliner/outliner_ops.c 
b/source/blender/editors/space_outliner/outliner_ops.c
index 90d27b09292..5466ef1a9ed 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -29,6 +29,7 @@
  */
 
 #include "BKE_context.h"
+#include "BKE_main.h"
 
 #include "BLI_listbase.h"
 #include "BLI_math.h"
@@ -164,7 +165,7 @@ static void outliner_item_drag_handle(
te_dragged->drag_data->insert_handle = te_insert_handle;
 }
 
-static bool outliner_item_drag_drop_apply(const Scene *scene, TreeElement 
*dragged_te)
+static bool outliner_item_drag_drop_apply(Main *bmain, const Scene *scene, 
TreeElement *dragged_te)
 {
TreeElement *insert_handle = dragged_te->drag_data->insert_handle;
TreeElementInsertType insert_type = dragged_te->drag_data->insert_type;
@@ -178,7 +179,7 @@ static bool outliner_item_drag_drop_apply(const Scene 
*scene, TreeElement *dragg
/* call of assert above should not have changed insert_handle 
and insert_type at this point */
BLI_assert(dragged_te->drag_data->insert_handle == 
insert_handle &&
   dragged_te->drag_data->insert_type == insert_type);
-   dragged_te->reinsert(scene, dragged_te, insert_handle, 
insert_type);
+   dragged_te->reinsert(bmain, scene, dragged_te, insert_handle, 
insert_type);
return true;
}
 
@@ -187,6 +188,7 @@ static bool outliner_item_drag_drop_apply(const Scene 
*scene, TreeElement *dragg
 
 static int outliner_item_drag_drop_modal(bContext *C, wmOperator *op, const 
wmEvent *event)
 {
+   Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
SpaceOops *soops = CTX_wm_space_outliner(C);
@@ -198,7 +200,7 @@ static int outliner_item_drag_drop_modal(bContext *C, 
wmOperator *op, const wmEv
switch (event->type) {
case EVT_MODAL_MAP:
if (event->val == OUTLINER_ITEM_DRAG_CONFIRM) {
-   if (outliner_item_drag_drop_apply(scene, 
te_dragged)) {
+   if (outliner_item_drag_drop_apply(bmain, scene, 
te_dragged)) {
skip_rebuild = false;
}
retval = OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index 9cca2416acc..e7a866524fd 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -61,6 +61,7 @@
 
 #include "BLT_translation.h"
 
+#include "BKE_depsgraph.h"
 #include "BKE_fcurve.h"
 #include "BKE_main.h"
 #include "BKE_layer.h"
@@ -389,7 +390,8 @@ static void outliner_add_scene_contents(SpaceOops *soops, 
ListBase *lb, Scene *s
 }
 
 static void outliner_object_reorder(
-const Scene *scene, TreeElement *insert_element, TreeElement 

[Bf-blender-cvs] [973f4944e08] blender2.8: Render API: Rename render > render_to_image; view_draw > render_to_view

2017-04-25 Thread Dalai Felinto
Commit: 973f4944e08c449d68b43edf39d9cb2d209f4b7a
Author: Dalai Felinto
Date:   Tue Apr 25 18:02:18 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB973f4944e08c449d68b43edf39d9cb2d209f4b7a

Render API: Rename render > render_to_image; view_draw > render_to_view

This is part of the new draw manager design. Any engine (even clay, eevee, ...) 
should be able to draw to the viewport, as well as render to an image directly.
Changing the API names to conform to that.

===

M   intern/cycles/blender/addon/__init__.py
M   source/blender/editors/render/render_update.c
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/editors/space_view3d/view3d_draw_legacy.c
M   source/blender/makesrna/intern/rna_render.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/render/extern/include/RE_engine.h
M   source/blender/render/intern/source/external_engine.c

===

diff --git a/intern/cycles/blender/addon/__init__.py 
b/intern/cycles/blender/addon/__init__.py
index 1e971a5eb15..7c58df68011 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -79,7 +79,7 @@ class CyclesRender(bpy.types.RenderEngine):
 else:
 engine.reset(self, data, scene)
 
-def render(self, depsgraph):
+def render_to_image(self, depsgraph):
 engine.render(self, depsgraph)
 
 def bake(self, scene, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result):
@@ -92,7 +92,7 @@ class CyclesRender(bpy.types.RenderEngine):
   context.region, context.space_data, 
context.region_data)
 engine.update(self, context.blend_data, context.scene)
 
-def view_draw(self, context):
+def render_to_view(self, context):
 engine.draw(self, context.depsgraph, context.region, 
context.space_data, context.region_data)
 
 def update_script_node(self, node):
diff --git a/source/blender/editors/render/render_update.c 
b/source/blender/editors/render/render_update.c
index 46c3417e8c2..8167acdd331 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -574,6 +574,6 @@ void ED_render_internal_init(void)
RenderEngineType *ret = RE_engines_find(RE_engine_id_BLENDER_RENDER);

ret->view_update = render_view3d_update;
-   ret->view_draw = render_view3d_draw;
+   ret->render_to_view = render_view3d_draw;

 }
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index 802c3f9b96b..5ef4909e857 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -757,7 +757,7 @@ static bool view3d_draw_render_draw(const bContext *C, 
Scene *scene,
 
type = RE_engines_find(scene->r.engine);
 
-   if (!(type->view_update && type->view_draw))
+   if (!(type->view_update && type->render_to_view))
return false;
 
engine = RE_engine_create_ex(type, true);
@@ -794,7 +794,7 @@ static bool view3d_draw_render_draw(const bContext *C, 
Scene *scene,
 
/* render result draw */
type = rv3d->render_engine->type;
-   type->view_draw(rv3d->render_engine, C);
+   type->render_to_view(rv3d->render_engine, C);
 
if (clip_border) {
/* restore scissor as it was before */
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c 
b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 510a66bfd09..fb995c0e649 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -2182,7 +2182,7 @@ static bool view3d_main_region_do_render_draw(Scene 
*scene)
 {
RenderEngineType *type = RE_engines_find(scene->r.engine);
 
-   return (type && type->view_update && type->view_draw);
+   return (type && type->view_update && type->render_to_view);
 }
 
 bool ED_view3d_calc_render_border(Scene *scene, View3D *v3d, ARegion *ar, rcti 
*rect)
@@ -2244,7 +2244,7 @@ static bool view3d_main_region_draw_engine(const bContext 
*C, Scene *scene,
 
type = RE_engines_find(scene->r.engine);
 
-   if (!(type->view_update && type->view_draw))
+   if (!(type->view_update && type->render_to_view))
return false;
 
engine = RE_engine_create_ex(type, true);
@@ -2285,7 +2285,7 @@ static bool view3d_main_region_draw_engine(const bContext 
*C, Scene *scene,
 
/* render result draw */
type = rv3d->render_engine->type;
-   type->view_draw(rv3d->render_engine, C);
+   type->render_to_view(rv3d->render_engine, C);
 
if (v3d->flag & 

[Bf-blender-cvs] [b43200a1208] blender2.8: Cleanup: Line-width

2017-04-25 Thread Dalai Felinto
Commit: b43200a12087a1785dd35b5746874eb400bd864d
Author: Dalai Felinto
Date:   Mon Apr 24 12:41:54 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBb43200a12087a1785dd35b5746874eb400bd864d

Cleanup: Line-width

===

M   source/blender/render/intern/source/external_engine.c

===

diff --git a/source/blender/render/intern/source/external_engine.c 
b/source/blender/render/intern/source/external_engine.c
index f7466dd23b2..cfc45df29ff 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -125,7 +125,8 @@ void RE_engines_register(Main *bmain, RenderEngineType 
*render_type)
DRW_engine_register(render_type->draw_engine);
}
if (render_type->collection_settings_create) {
-   BKE_layer_collection_engine_settings_callback_register(bmain, 
render_type->idname, render_type->collection_settings_create);
+   BKE_layer_collection_engine_settings_callback_register(
+   bmain, render_type->idname, 
render_type->collection_settings_create);
}
BLI_addtail(_engines, render_type);
 }
@@ -202,7 +203,8 @@ static RenderPart *get_part_from_result(Render *re, 
RenderResult *result)
return NULL;
 }
 
-RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int 
w, int h, const char *layername, const char *viewname)
+RenderResult *RE_engine_begin_result(
+RenderEngine *engine, int x, int y, int w, int h, const char 
*layername, const char *viewname)
 {
Render *re = engine->re;
RenderResult *result;
@@ -414,7 +416,8 @@ float RE_engine_get_camera_shift_x(RenderEngine *engine, 
Object *camera, int use
return BKE_camera_multiview_shift_x(re ? >r : NULL, camera, 
re->viewname);
 }
 
-void RE_engine_get_camera_model_matrix(RenderEngine *engine, Object *camera, 
int use_spherical_stereo, float *r_modelmat)
+void RE_engine_get_camera_model_matrix(
+RenderEngine *engine, Object *camera, int use_spherical_stereo, float 
*r_modelmat)
 {
Render *re = engine->re;
 
@@ -544,8 +547,19 @@ bool RE_bake_engine(
if (type->update)
type->update(engine, re->main, re->scene);
 
-   if (type->bake)
-   type->bake(engine, re->scene, object, pass_type, pass_filter, 
object_id, pixel_array, num_pixels, depth, result);
+   if (type->bake) {
+   type->bake(
+   engine,
+   re->scene,
+   object,
+   pass_type,
+   pass_filter,
+   object_id,
+   pixel_array,
+   num_pixels,
+   depth,
+   result);
+   }
 
engine->tile_x = 0;
engine->tile_y = 0;

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


[Bf-blender-cvs] [4122eeb09ab] blender2.8: Cycles: Use depsgraph instead of layers

2017-04-25 Thread Dalai Felinto
Commit: 4122eeb09abcc389915c53fd5017dc853e109279
Author: Dalai Felinto
Date:   Tue Apr 25 16:18:24 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB4122eeb09abcc389915c53fd5017dc853e109279

Cycles: Use depsgraph instead of layers

===

M   intern/cycles/blender/addon/__init__.py
M   intern/cycles/blender/addon/engine.py
M   intern/cycles/blender/blender_object.cpp
M   intern/cycles/blender/blender_python.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/blender/blender_sync.h
M   source/blender/editors/object/CMakeLists.txt
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/CMakeLists.txt
M   source/blender/editors/render/render_internal.c
M   source/blender/editors/render/render_preview.c
M   source/blender/makesrna/intern/rna_render.c
M   source/blender/render/extern/include/RE_engine.h
M   source/blender/render/extern/include/RE_pipeline.h
M   source/blender/render/intern/include/render_types.h
M   source/blender/render/intern/source/external_engine.c
M   source/blender/render/intern/source/initrender.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/intern/cycles/blender/addon/__init__.py 
b/intern/cycles/blender/addon/__init__.py
index eb792af7264..1e971a5eb15 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -19,7 +19,7 @@
 bl_info = {
 "name": "Cycles Render Engine",
 "author": "",
-"blender": (2, 76, 0),
+"blender": (2, 80, 0),
 "location": "Info header, render engine menu",
 "description": "Cycles Render Engine integration",
 "warning": "",
@@ -66,21 +66,21 @@ class CyclesRender(bpy.types.RenderEngine):
 engine.free(self)
 
 # final render
-def update(self, data, scene):
+def update(self, data, depsgraph, scene):
 if not self.session:
 if self.is_preview:
 cscene = bpy.context.scene.cycles
 use_osl = cscene.shading_system and cscene.device == 'CPU'
 
-engine.create(self, data, scene,
+engine.create(self, data, depsgraph, scene,
   None, None, None, use_osl)
 else:
-engine.create(self, data, scene)
+engine.create(self, data, depsgraph, scene)
 else:
 engine.reset(self, data, scene)
 
-def render(self, scene):
-engine.render(self)
+def render(self, depsgraph):
+engine.render(self, depsgraph)
 
 def bake(self, scene, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result):
 engine.bake(self, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result)
@@ -88,12 +88,12 @@ class CyclesRender(bpy.types.RenderEngine):
 # viewport render
 def view_update(self, context):
 if not self.session:
-engine.create(self, context.blend_data, context.scene,
+engine.create(self, context.blend_data, context.depsgraph, 
context.scene,
   context.region, context.space_data, 
context.region_data)
 engine.update(self, context.blend_data, context.scene)
 
 def view_draw(self, context):
-engine.draw(self, context.region, context.space_data, 
context.region_data)
+engine.draw(self, context.depsgraph, context.region, 
context.space_data, context.region_data)
 
 def update_script_node(self, node):
 if engine.with_osl():
diff --git a/intern/cycles/blender/addon/engine.py 
b/intern/cycles/blender/addon/engine.py
index ab57dd44bdb..a418cdd6821 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -123,12 +123,13 @@ def exit():
 _cycles.exit()
 
 
-def create(engine, data, scene, region=None, v3d=None, rv3d=None, 
preview_osl=False):
+def create(engine, data, depsgraph, scene, region=None, v3d=None, rv3d=None, 
preview_osl=False):
 import bpy
 import _cycles
 
 data = data.as_pointer()
 userpref = bpy.context.user_preferences.as_pointer()
+depsgraph = depsgraph.as_pointer()
 scene = scene.as_pointer()
 if region:
 region = region.as_pointer()
@@ -142,7 +143,8 @@ def create(engine, data, scene, region=None, v3d=None, 
rv3d=None, preview_osl=Fa
 else:
 _cycles.debug_flags_reset()
 
-engine.session = _cycles.create(engine.as_pointer(), userpref, data, 
scene, region, v3d, rv3d, preview_osl)
+engine.session = _cycles.create(
+engine.as_pointer(), userpref, data, depsgraph, scene, region, 
v3d, rv3d, preview_osl)
 
 
 def free(engine):
@@ -153,7 +155,7 @@ def free(engine):
 del 

[Bf-blender-cvs] [05243a633a7] blender2.8: Depsgraph: Store Scene in depsgraph struct

2017-04-25 Thread Dalai Felinto
Commit: 05243a633a7ccf4abf75e3a88d67e2e5cc02a1a6
Author: Dalai Felinto
Date:   Tue Apr 25 17:46:23 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB05243a633a7ccf4abf75e3a88d67e2e5cc02a1a6

Depsgraph: Store Scene in depsgraph struct

This way we can retrieve the scene from depsgraph that were not created from a 
G.main (e.g., when doing material thumbnail preview render).

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_query.cc

===

diff --git 
a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
index 3a007c4153a..748a36d2c4d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
@@ -70,6 +70,9 @@ namespace DEG {
 
 void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
 {
+   /* XXX store scene to access from DAG_get_scene */
+   m_graph->scene = scene;
+
if (scene->set) {
build_scene(bmain, scene->set);
}
diff --git a/source/blender/depsgraph/intern/depsgraph.h 
b/source/blender/depsgraph/intern/depsgraph.h
index a8548ebaa4e..035abcf0ba1 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -45,6 +45,7 @@ struct GHash;
 struct GSet;
 struct PointerRNA;
 struct PropertyRNA;
+struct Scene;
 
 namespace DEG {
 
@@ -173,6 +174,8 @@ struct Depsgraph {
SpinLock lock;
 
// XXX: additional stuff like eval contexts, mempools for allocating 
nodes from, etc.
+
+   Scene *scene; /* XXX: We really shouldn't do that, but it's required 
for shader preview */
 };
 
 }  // namespace DEG
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 952a4af0208..6193fd3d7cf 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -76,14 +76,8 @@ short DEG_get_eval_flags_for_id(Depsgraph *graph, ID *id)
 
 Scene *DAG_get_scene(Depsgraph *graph)
 {
-   Main *bmain = G.main;
-   LINKLIST_FOREACH (Scene*, scene, >scene) {
-   if (scene->depsgraph == graph) {
-   /* Got the scene! */
-   return scene;
-   }
-   }
-   return NULL;
+   DEG::Depsgraph *deg_graph = reinterpret_cast(graph);
+   return deg_graph->scene;
 }
 
 SceneLayer *DAG_get_scene_layer(Depsgraph *graph)

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


[Bf-blender-cvs] [c38e64c4a1c] cycles-depsgraph: Cleanup: Line-width

2017-04-25 Thread Dalai Felinto
Commit: c38e64c4a1cf3157ec1409e781f7a6b5e5a1eb8c
Author: Dalai Felinto
Date:   Mon Apr 24 12:41:54 2017 +0200
Branches: cycles-depsgraph
https://developer.blender.org/rBc38e64c4a1cf3157ec1409e781f7a6b5e5a1eb8c

Cleanup: Line-width

===

M   source/blender/render/intern/source/external_engine.c

===

diff --git a/source/blender/render/intern/source/external_engine.c 
b/source/blender/render/intern/source/external_engine.c
index f7466dd23b2..cfc45df29ff 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -125,7 +125,8 @@ void RE_engines_register(Main *bmain, RenderEngineType 
*render_type)
DRW_engine_register(render_type->draw_engine);
}
if (render_type->collection_settings_create) {
-   BKE_layer_collection_engine_settings_callback_register(bmain, 
render_type->idname, render_type->collection_settings_create);
+   BKE_layer_collection_engine_settings_callback_register(
+   bmain, render_type->idname, 
render_type->collection_settings_create);
}
BLI_addtail(_engines, render_type);
 }
@@ -202,7 +203,8 @@ static RenderPart *get_part_from_result(Render *re, 
RenderResult *result)
return NULL;
 }
 
-RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int 
w, int h, const char *layername, const char *viewname)
+RenderResult *RE_engine_begin_result(
+RenderEngine *engine, int x, int y, int w, int h, const char 
*layername, const char *viewname)
 {
Render *re = engine->re;
RenderResult *result;
@@ -414,7 +416,8 @@ float RE_engine_get_camera_shift_x(RenderEngine *engine, 
Object *camera, int use
return BKE_camera_multiview_shift_x(re ? >r : NULL, camera, 
re->viewname);
 }
 
-void RE_engine_get_camera_model_matrix(RenderEngine *engine, Object *camera, 
int use_spherical_stereo, float *r_modelmat)
+void RE_engine_get_camera_model_matrix(
+RenderEngine *engine, Object *camera, int use_spherical_stereo, float 
*r_modelmat)
 {
Render *re = engine->re;
 
@@ -544,8 +547,19 @@ bool RE_bake_engine(
if (type->update)
type->update(engine, re->main, re->scene);
 
-   if (type->bake)
-   type->bake(engine, re->scene, object, pass_type, pass_filter, 
object_id, pixel_array, num_pixels, depth, result);
+   if (type->bake) {
+   type->bake(
+   engine,
+   re->scene,
+   object,
+   pass_type,
+   pass_filter,
+   object_id,
+   pixel_array,
+   num_pixels,
+   depth,
+   result);
+   }
 
engine->tile_x = 0;
engine->tile_y = 0;

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


[Bf-blender-cvs] [5127ab29fa1] cycles-depsgraph: Depsgraph: Store Scene in depsgraph struct

2017-04-25 Thread Dalai Felinto
Commit: 5127ab29fa1ac7036951b161977431c010b44011
Author: Dalai Felinto
Date:   Tue Apr 25 17:46:23 2017 +0200
Branches: cycles-depsgraph
https://developer.blender.org/rB5127ab29fa1ac7036951b161977431c010b44011

Depsgraph: Store Scene in depsgraph struct

This way we can retrieve the scene from depsgraph that were not created from a 
G.main (e.g., when doing material thumbnail preview render).

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_query.cc

===

diff --git 
a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
index 3a007c4153a..748a36d2c4d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
@@ -70,6 +70,9 @@ namespace DEG {
 
 void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
 {
+   /* XXX store scene to access from DAG_get_scene */
+   m_graph->scene = scene;
+
if (scene->set) {
build_scene(bmain, scene->set);
}
diff --git a/source/blender/depsgraph/intern/depsgraph.h 
b/source/blender/depsgraph/intern/depsgraph.h
index a8548ebaa4e..035abcf0ba1 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -45,6 +45,7 @@ struct GHash;
 struct GSet;
 struct PointerRNA;
 struct PropertyRNA;
+struct Scene;
 
 namespace DEG {
 
@@ -173,6 +174,8 @@ struct Depsgraph {
SpinLock lock;
 
// XXX: additional stuff like eval contexts, mempools for allocating 
nodes from, etc.
+
+   Scene *scene; /* XXX: We really shouldn't do that, but it's required 
for shader preview */
 };
 
 }  // namespace DEG
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 952a4af0208..6193fd3d7cf 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -76,14 +76,8 @@ short DEG_get_eval_flags_for_id(Depsgraph *graph, ID *id)
 
 Scene *DAG_get_scene(Depsgraph *graph)
 {
-   Main *bmain = G.main;
-   LINKLIST_FOREACH (Scene*, scene, >scene) {
-   if (scene->depsgraph == graph) {
-   /* Got the scene! */
-   return scene;
-   }
-   }
-   return NULL;
+   DEG::Depsgraph *deg_graph = reinterpret_cast(graph);
+   return deg_graph->scene;
 }
 
 SceneLayer *DAG_get_scene_layer(Depsgraph *graph)

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


[Bf-blender-cvs] [e7d3825d89f] cycles-depsgraph: Render API: Rename render > render_to_image; view_draw > render_to_view

2017-04-25 Thread Dalai Felinto
Commit: e7d3825d89f98a866c02e8bfdbe41209d61cc233
Author: Dalai Felinto
Date:   Tue Apr 25 18:02:18 2017 +0200
Branches: cycles-depsgraph
https://developer.blender.org/rBe7d3825d89f98a866c02e8bfdbe41209d61cc233

Render API: Rename render > render_to_image; view_draw > render_to_view

This is part of the new draw manager design. Any engine (even clay, eevee, ...) 
should be able to draw to the viewport, as well as render to an image directly.
Changing the API names to conform to that.

===

M   intern/cycles/blender/addon/__init__.py
M   source/blender/editors/render/render_update.c
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/editors/space_view3d/view3d_draw_legacy.c
M   source/blender/makesrna/intern/rna_render.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/render/extern/include/RE_engine.h
M   source/blender/render/intern/source/external_engine.c

===

diff --git a/intern/cycles/blender/addon/__init__.py 
b/intern/cycles/blender/addon/__init__.py
index 1e971a5eb15..7c58df68011 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -79,7 +79,7 @@ class CyclesRender(bpy.types.RenderEngine):
 else:
 engine.reset(self, data, scene)
 
-def render(self, depsgraph):
+def render_to_image(self, depsgraph):
 engine.render(self, depsgraph)
 
 def bake(self, scene, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result):
@@ -92,7 +92,7 @@ class CyclesRender(bpy.types.RenderEngine):
   context.region, context.space_data, 
context.region_data)
 engine.update(self, context.blend_data, context.scene)
 
-def view_draw(self, context):
+def render_to_view(self, context):
 engine.draw(self, context.depsgraph, context.region, 
context.space_data, context.region_data)
 
 def update_script_node(self, node):
diff --git a/source/blender/editors/render/render_update.c 
b/source/blender/editors/render/render_update.c
index 46c3417e8c2..8167acdd331 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -574,6 +574,6 @@ void ED_render_internal_init(void)
RenderEngineType *ret = RE_engines_find(RE_engine_id_BLENDER_RENDER);

ret->view_update = render_view3d_update;
-   ret->view_draw = render_view3d_draw;
+   ret->render_to_view = render_view3d_draw;

 }
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index 802c3f9b96b..5ef4909e857 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -757,7 +757,7 @@ static bool view3d_draw_render_draw(const bContext *C, 
Scene *scene,
 
type = RE_engines_find(scene->r.engine);
 
-   if (!(type->view_update && type->view_draw))
+   if (!(type->view_update && type->render_to_view))
return false;
 
engine = RE_engine_create_ex(type, true);
@@ -794,7 +794,7 @@ static bool view3d_draw_render_draw(const bContext *C, 
Scene *scene,
 
/* render result draw */
type = rv3d->render_engine->type;
-   type->view_draw(rv3d->render_engine, C);
+   type->render_to_view(rv3d->render_engine, C);
 
if (clip_border) {
/* restore scissor as it was before */
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c 
b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 510a66bfd09..fb995c0e649 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -2182,7 +2182,7 @@ static bool view3d_main_region_do_render_draw(Scene 
*scene)
 {
RenderEngineType *type = RE_engines_find(scene->r.engine);
 
-   return (type && type->view_update && type->view_draw);
+   return (type && type->view_update && type->render_to_view);
 }
 
 bool ED_view3d_calc_render_border(Scene *scene, View3D *v3d, ARegion *ar, rcti 
*rect)
@@ -2244,7 +2244,7 @@ static bool view3d_main_region_draw_engine(const bContext 
*C, Scene *scene,
 
type = RE_engines_find(scene->r.engine);
 
-   if (!(type->view_update && type->view_draw))
+   if (!(type->view_update && type->render_to_view))
return false;
 
engine = RE_engine_create_ex(type, true);
@@ -2285,7 +2285,7 @@ static bool view3d_main_region_draw_engine(const bContext 
*C, Scene *scene,
 
/* render result draw */
type = rv3d->render_engine->type;
-   type->view_draw(rv3d->render_engine, C);
+   type->render_to_view(rv3d->render_engine, C);
 
if (v3d->flag & 

[Bf-blender-cvs] [eca8018b635] cycles-depsgraph: Cycles: Use depsgraph instead of layers

2017-04-25 Thread Dalai Felinto
Commit: eca8018b635995717fa7727b3c8e70b9748904bc
Author: Dalai Felinto
Date:   Tue Apr 25 16:18:24 2017 +0200
Branches: cycles-depsgraph
https://developer.blender.org/rBeca8018b635995717fa7727b3c8e70b9748904bc

Cycles: Use depsgraph instead of layers

===

M   intern/cycles/blender/addon/__init__.py
M   intern/cycles/blender/addon/engine.py
M   intern/cycles/blender/blender_object.cpp
M   intern/cycles/blender/blender_python.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/blender/blender_sync.h
M   source/blender/editors/object/CMakeLists.txt
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/CMakeLists.txt
M   source/blender/editors/render/render_internal.c
M   source/blender/editors/render/render_preview.c
M   source/blender/makesrna/intern/rna_render.c
M   source/blender/render/extern/include/RE_engine.h
M   source/blender/render/extern/include/RE_pipeline.h
M   source/blender/render/intern/include/render_types.h
M   source/blender/render/intern/source/external_engine.c
M   source/blender/render/intern/source/initrender.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/intern/cycles/blender/addon/__init__.py 
b/intern/cycles/blender/addon/__init__.py
index eb792af7264..1e971a5eb15 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -19,7 +19,7 @@
 bl_info = {
 "name": "Cycles Render Engine",
 "author": "",
-"blender": (2, 76, 0),
+"blender": (2, 80, 0),
 "location": "Info header, render engine menu",
 "description": "Cycles Render Engine integration",
 "warning": "",
@@ -66,21 +66,21 @@ class CyclesRender(bpy.types.RenderEngine):
 engine.free(self)
 
 # final render
-def update(self, data, scene):
+def update(self, data, depsgraph, scene):
 if not self.session:
 if self.is_preview:
 cscene = bpy.context.scene.cycles
 use_osl = cscene.shading_system and cscene.device == 'CPU'
 
-engine.create(self, data, scene,
+engine.create(self, data, depsgraph, scene,
   None, None, None, use_osl)
 else:
-engine.create(self, data, scene)
+engine.create(self, data, depsgraph, scene)
 else:
 engine.reset(self, data, scene)
 
-def render(self, scene):
-engine.render(self)
+def render(self, depsgraph):
+engine.render(self, depsgraph)
 
 def bake(self, scene, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result):
 engine.bake(self, obj, pass_type, pass_filter, object_id, pixel_array, 
num_pixels, depth, result)
@@ -88,12 +88,12 @@ class CyclesRender(bpy.types.RenderEngine):
 # viewport render
 def view_update(self, context):
 if not self.session:
-engine.create(self, context.blend_data, context.scene,
+engine.create(self, context.blend_data, context.depsgraph, 
context.scene,
   context.region, context.space_data, 
context.region_data)
 engine.update(self, context.blend_data, context.scene)
 
 def view_draw(self, context):
-engine.draw(self, context.region, context.space_data, 
context.region_data)
+engine.draw(self, context.depsgraph, context.region, 
context.space_data, context.region_data)
 
 def update_script_node(self, node):
 if engine.with_osl():
diff --git a/intern/cycles/blender/addon/engine.py 
b/intern/cycles/blender/addon/engine.py
index ab57dd44bdb..a418cdd6821 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -123,12 +123,13 @@ def exit():
 _cycles.exit()
 
 
-def create(engine, data, scene, region=None, v3d=None, rv3d=None, 
preview_osl=False):
+def create(engine, data, depsgraph, scene, region=None, v3d=None, rv3d=None, 
preview_osl=False):
 import bpy
 import _cycles
 
 data = data.as_pointer()
 userpref = bpy.context.user_preferences.as_pointer()
+depsgraph = depsgraph.as_pointer()
 scene = scene.as_pointer()
 if region:
 region = region.as_pointer()
@@ -142,7 +143,8 @@ def create(engine, data, scene, region=None, v3d=None, 
rv3d=None, preview_osl=Fa
 else:
 _cycles.debug_flags_reset()
 
-engine.session = _cycles.create(engine.as_pointer(), userpref, data, 
scene, region, v3d, rv3d, preview_osl)
+engine.session = _cycles.create(
+engine.as_pointer(), userpref, data, depsgraph, scene, region, 
v3d, rv3d, preview_osl)
 
 
 def free(engine):
@@ -153,7 +155,7 @@ def free(engine):
 del 

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

2017-04-25 Thread Sybren A. Stüvel
Commit: 6822e353ffa90e1fe8290b243b1bc2c43d5d157a
Author: Sybren A. Stüvel
Date:   Tue Apr 25 17:04:17 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB6822e353ffa90e1fe8290b243b1bc2c43d5d157a

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/editors/uvedit/uvedit_draw.c
index 3149abc338b,15be6ab3b78..16d430c9421
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@@ -548,12 -495,14 +548,12 @@@ static void draw_uvs_texpaint(SpaceImag
Material *ma;
  
if (sima->flag & SI_DRAW_OTHER) {
 -  draw_uvs_other(scene, ob, curimage, new_shading_nodes, 
sima->other_uv_filter);
 +  draw_uvs_other(sl, ob, curimage, new_shading_nodes, 
sima->other_uv_filter);
}
  
 -  UI_ThemeColor(TH_UV_SHADOW);
 -
ma = give_current_material(ob, ob->actcol);
  
-   if (me->mtpoly) {
+   if (me->mloopuv) {
MPoly *mpoly = me->mpoly;
MLoopUV *mloopuv, *mloopuv_base;
int a, b;

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


[Bf-blender-cvs] [99d2d6f3871] blender2.8: Alembic import: don't use global main

2017-04-25 Thread Sybren A. Stüvel
Commit: 99d2d6f3871f88c485684c6f9c8b5f0ab0d8dda3
Author: Sybren A. Stüvel
Date:   Tue Apr 25 17:03:15 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB99d2d6f3871f88c485684c6f9c8b5f0ab0d8dda3

Alembic import: don't use global main

===

M   source/blender/blenkernel/BKE_cachefile.h
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/makesrna/intern/rna_cachefile.c

===

diff --git a/source/blender/blenkernel/BKE_cachefile.h 
b/source/blender/blenkernel/BKE_cachefile.h
index cfa5913c547..b8e08524dbe 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -63,7 +63,7 @@ bool BKE_cachefile_filepath_get(
 
 float BKE_cachefile_time_offset(struct CacheFile *cache_file, const float 
time, const float fps);
 
-void BKE_cachefile_clean(struct CacheFile *cache_file);
+void BKE_cachefile_clean(struct Main *bmain, struct CacheFile *cache_file);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/intern/cachefile.c 
b/source/blender/blenkernel/intern/cachefile.c
index a86960f6268..859aa628781 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -204,9 +204,9 @@ float BKE_cachefile_time_offset(CacheFile *cache_file, 
const float time, const f
 }
 
 /* TODO(kevin): replace this with some depsgraph mechanism, or something 
similar. */
-void BKE_cachefile_clean(CacheFile *cache_file)
+void BKE_cachefile_clean(struct Main *bmain, CacheFile *cache_file)
 {
-   for (Object *ob = G.main->object.first; ob; ob = ob->id.next) {
+   for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md = modifiers_findByType(ob, 
eModifierType_MeshSequenceCache);
 
if (md) {
diff --git a/source/blender/makesrna/intern/rna_cachefile.c 
b/source/blender/makesrna/intern/rna_cachefile.c
index 3916e3c27a1..a3b1d584ef5 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -63,7 +63,7 @@ static void rna_CacheFile_update_handle(Main *bmain, Scene 
*scene, PointerRNA *p
CacheFile *cache_file = ptr->data;
 
if ((cache_file->flag & CACHEFILE_DIRTY) != 0) {
-   BKE_cachefile_clean(cache_file);
+   BKE_cachefile_clean(bmain, cache_file);
BLI_freelistN(_file->object_paths);
cache_file->flag &= ~CACHEFILE_DIRTY;
}

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


[Bf-blender-cvs] [2aa4f8ab92a] blender2.8: Alembic import: removed BaseLegacy from BKE_cachefile_clean

2017-04-25 Thread Sybren A. Stüvel
Commit: 2aa4f8ab92a4c17f4960ff10f4a50b5b9aae91b5
Author: Sybren A. Stüvel
Date:   Tue Apr 25 16:56:36 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB2aa4f8ab92a4c17f4960ff10f4a50b5b9aae91b5

Alembic import: removed BaseLegacy from BKE_cachefile_clean

Now we just iterate over all objects. It may be a better idea to use a
smarter approach for performance. However, since this function is not
called regularly (only when changing Alembic file paths), it's not a very
big deal.

===

M   source/blender/blenkernel/BKE_cachefile.h
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/makesrna/intern/rna_cachefile.c

===

diff --git a/source/blender/blenkernel/BKE_cachefile.h 
b/source/blender/blenkernel/BKE_cachefile.h
index 0d4ed2083b1..cfa5913c547 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -63,7 +63,7 @@ bool BKE_cachefile_filepath_get(
 
 float BKE_cachefile_time_offset(struct CacheFile *cache_file, const float 
time, const float fps);
 
-void BKE_cachefile_clean(struct Scene *scene, struct CacheFile *cache_file);
+void BKE_cachefile_clean(struct CacheFile *cache_file);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/intern/cachefile.c 
b/source/blender/blenkernel/intern/cachefile.c
index 4bf48bd614d..a86960f6268 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -204,11 +204,9 @@ float BKE_cachefile_time_offset(CacheFile *cache_file, 
const float time, const f
 }
 
 /* TODO(kevin): replace this with some depsgraph mechanism, or something 
similar. */
-void BKE_cachefile_clean(Scene *scene, CacheFile *cache_file)
+void BKE_cachefile_clean(CacheFile *cache_file)
 {
-   for (BaseLegacy *base = scene->base.first; base; base = base->next) {
-   Object *ob = base->object;
-
+   for (Object *ob = G.main->object.first; ob; ob = ob->id.next) {
ModifierData *md = modifiers_findByType(ob, 
eModifierType_MeshSequenceCache);
 
if (md) {
diff --git a/source/blender/makesrna/intern/rna_cachefile.c 
b/source/blender/makesrna/intern/rna_cachefile.c
index 09fdeb15b10..3916e3c27a1 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -63,7 +63,7 @@ static void rna_CacheFile_update_handle(Main *bmain, Scene 
*scene, PointerRNA *p
CacheFile *cache_file = ptr->data;
 
if ((cache_file->flag & CACHEFILE_DIRTY) != 0) {
-   BKE_cachefile_clean(scene, cache_file);
+   BKE_cachefile_clean(cache_file);
BLI_freelistN(_file->object_paths);
cache_file->flag &= ~CACHEFILE_DIRTY;
}

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


[Bf-blender-cvs] [acf07e73666] blender2.8: Draw Manager: store context vars per draw

2017-04-25 Thread Campbell Barton
Commit: acf07e73666a4a3edaeeb36489902b9373a9779d
Author: Campbell Barton
Date:   Wed Apr 26 00:35:08 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBacf07e73666a4a3edaeeb36489902b9373a9779d

Draw Manager: store context vars per draw

Was performing context access per object for scene, region etc.
While not very slow they don't change during drawing so cache in a struct.

This also makes it possible to draw in views besides the current context.

===

M   source/blender/draw/engines/eevee/eevee_probes.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/draw/intern/draw_view.c
M   source/blender/draw/modes/edit_curve_mode.c
M   source/blender/draw/modes/edit_lattice_mode.c
M   source/blender/draw/modes/edit_mesh_mode.c
M   source/blender/draw/modes/edit_text_mode.c
M   source/blender/draw/modes/object_mode.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_probes.c 
b/source/blender/draw/engines/eevee/eevee_probes.c
index a0e01ee1d80..213f470e3a7 100644
--- a/source/blender/draw/engines/eevee/eevee_probes.c
+++ b/source/blender/draw/engines/eevee/eevee_probes.c
@@ -133,8 +133,8 @@ void EEVEE_refresh_probe(EEVEE_Data *vedata)
EEVEE_StorageList *stl = vedata->stl;
EEVEE_ProbesInfo *pinfo = stl->probes;
 
-   const bContext *C = DRW_get_context();
-   Scene *scene = CTX_data_scene(C);
+   const DRWContextState *draw_ctx = DRW_context_state_get();
+   Scene *scene = draw_ctx->scene;
World *world = scene->world;
 
float projmat[4][4];
diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 50e5741b527..cf86a6a81e8 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -316,5 +316,21 @@ void DRW_state_reset(void);
 
 /* Other */
 void DRW_get_dfdy_factors(float dfdyfac[2]);
-const struct bContext *DRW_get_context(void);
+
+/* Avoid too many lookups while drawing */
+typedef struct DRWContextState {
+   struct ARegion *ar;
+   struct RegionView3D *rv3d;
+   struct View3D *v3d;
+
+   struct Scene *scene;/* CTX_data_scene(C) */
+   struct SceneLayer *sl;  /* CTX_data_scene_layer(C) */
+
+   /* last resort (some functions take this as an arg so we can't easily 
avoid) */
+   const struct bContext *evil_C;
+} DRWContextState;
+
+void DRW_context_state_init(const struct bContext *C, DRWContextState 
*r_draw_ctx);
+const DRWContextState *DRW_context_state_get(void);
+
 #endif /* __DRW_RENDER_H__ */
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index 9f7729e0fd8..d84f2e3dfcb 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -205,7 +205,8 @@ static struct DRWGlobalState {
float pixsize;
 
/* Current rendering context */
-   const struct bContext *context;
+   DRWContextState draw_ctx;
+
ListBase enabled_engines; /* RenderEngineType */
 } DST = {NULL};
 
@@ -957,7 +958,7 @@ typedef struct DRWBoundTexture {
 
 static void draw_geometry(DRWShadingGroup *shgroup, Batch *geom, const float 
(*obmat)[4])
 {
-   RegionView3D *rv3d = CTX_wm_region_view3d(DST.context);
+   RegionView3D *rv3d = DST.draw_ctx.rv3d;
DRWInterface *interface = shgroup->interface;
 
float mvp[4][4], mv[4][4], n[3][3], wn[3][3];
@@ -1178,24 +1179,18 @@ void DRW_draw_pass(DRWPass *pass)
 
 void DRW_draw_callbacks_pre_scene(void)
 {
-   struct ARegion *ar = CTX_wm_region(DST.context);
-   RegionView3D *rv3d = CTX_wm_region_view3d(DST.context);
+   RegionView3D *rv3d = DST.draw_ctx.rv3d;
 
gpuLoadProjectionMatrix(rv3d->winmat);
gpuLoadMatrix(rv3d->viewmat);
-
-   ED_region_draw_cb_draw(DST.context, ar, REGION_DRAW_PRE_VIEW);
 }
 
 void DRW_draw_callbacks_post_scene(void)
 {
-   struct ARegion *ar = CTX_wm_region(DST.context);
-   RegionView3D *rv3d = CTX_wm_region_view3d(DST.context);
+   RegionView3D *rv3d = DST.draw_ctx.rv3d;
 
gpuLoadProjectionMatrix(rv3d->winmat);
gpuLoadMatrix(rv3d->viewmat);
-
-   ED_region_draw_cb_draw(DST.context, ar, REGION_DRAW_POST_VIEW);
 }
 
 /* Reset state to not interfer with other UI drawcall */
@@ -1222,7 +1217,7 @@ void DRW_state_reset(void) {}
 
 bool DRW_is_object_renderable(Object *ob)
 {
-   Scene *scene = CTX_data_scene(DST.context);
+   Scene *scene = DST.draw_ctx.scene;
Object *obedit = scene->obedit;
 
if (ob->type == OB_MESH) {
@@ -1405,7 +1400,10 @@ const float *DRW_viewport_pixelsize_get(void)
  * if this value change per viewport */
 static void DRW_viewport_var_init(const bContext *C)
 {
-   RegionView3D *rv3d = CTX_wm_region_view3d(C);
+   

[Bf-blender-cvs] [7cf7b3b7e50] blender2.8: Draw Manager: clear draw global data after use

2017-04-25 Thread Campbell Barton
Commit: 7cf7b3b7e505b7a13b4f2cd04920e314e129b87f
Author: Campbell Barton
Date:   Wed Apr 26 00:39:53 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB7cf7b3b7e505b7a13b4f2cd04920e314e129b87f

Draw Manager: clear draw global data after use

===

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 d84f2e3dfcb..501c7d2dba0 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1892,6 +1892,9 @@ void DRW_draw_view(const bContext *C)
 
DRW_state_reset();
DRW_engines_disable();
+
+   /* avoid accidental reuse */
+   memset(, 0x0, sizeof(DST));
 }
 
 /* ** OTHER 
* */

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


[Bf-blender-cvs] [9dadd5ff937] master: Fix T51292: Alembic import, show notification when trying to load HDF5

2017-04-25 Thread Sybren A. Stüvel
Commit: 9dadd5ff937f81cc1e5aa9136b8eafb5a5414bb1
Author: Sybren A. Stüvel
Date:   Tue Apr 25 14:30:01 2017 +0200
Branches: master
https://developer.blender.org/rB9dadd5ff937f81cc1e5aa9136b8eafb5a5414bb1

Fix T51292: Alembic import, show notification when trying to load HDF5

HDF5 Alembic files are not officially supported by Blender. With this
commit, the HDF5 format is detected even when Blender is compiled without
HDF5 support, and the user is given an explanatory error message (rather
than the generic "Could not open Alembic archive for reading".

===

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

===

diff --git a/source/blender/alembic/intern/abc_archive.cc 
b/source/blender/alembic/intern/abc_archive.cc
index 5f8fc1a3739..cdbda0ace69 100644
--- a/source/blender/alembic/intern/abc_archive.cc
+++ b/source/blender/alembic/intern/abc_archive.cc
@@ -28,6 +28,8 @@
 #  include "utfconv.h"
 #endif
 
+#include 
+
 using Alembic::Abc::Exception;
 using Alembic::Abc::ErrorHandler;
 using Alembic::Abc::IArchive;
@@ -38,8 +40,9 @@ static IArchive open_archive(const std::string ,
  const std::vector _streams,
  bool _hdf5)
 {
+   is_hdf5 = false;
+
try {
-   is_hdf5 = false;
Alembic::AbcCoreOgawa::ReadArchive 
archive_reader(input_streams);
 
return IArchive(archive_reader(filename),
@@ -63,6 +66,27 @@ static IArchive open_archive(const std::string ,
return IArchive();
}
 #else
+   /* Inspect the file to see whether it's really a HDF5 file. */
+   char header[4];  /* char(0x89) + "HDF" */
+   std::ifstream the_file(filename, std::ios::in | 
std::ios::binary);
+   if (!the_file) {
+   std::cerr << "Unable to open " << filename << std::endl;
+   }
+   else if (!the_file.read(header, sizeof(header))) {
+   std::cerr << "Unable to read from " << filename << 
std::endl;
+   }
+   else if (strncmp(header + 1, "HDF", 3)) {
+   std::cerr << filename << " has an unknown file format, 
unable to read." << std::endl;
+   }
+   else {
+   is_hdf5 = true;
+   std::cerr << filename << " is in the obsolete HDF5 
format, unable to read." << std::endl;
+   }
+
+   if (the_file.is_open()) {
+   the_file.close();
+   }
+
return IArchive();
 #endif
}
@@ -83,16 +107,20 @@ ArchiveReader::ArchiveReader(const char *filename)
 
m_streams.push_back(_infile);
 
-   bool is_hdf5;
-   m_archive = open_archive(filename, m_streams, is_hdf5);
+   m_archive = open_archive(filename, m_streams, m_is_hdf5);
 
/* We can't open an HDF5 file from a stream, so close it. */
-   if (is_hdf5) {
+   if (m_is_hdf5) {
m_infile.close();
m_streams.clear();
}
 }
 
+bool ArchiveReader::is_hdf5() const
+{
+   return m_is_hdf5;
+}
+
 bool ArchiveReader::valid() const
 {
return m_archive.valid();
diff --git a/source/blender/alembic/intern/abc_archive.h 
b/source/blender/alembic/intern/abc_archive.h
index d412574b736..84309fbc9df 100644
--- a/source/blender/alembic/intern/abc_archive.h
+++ b/source/blender/alembic/intern/abc_archive.h
@@ -44,12 +44,21 @@ class ArchiveReader {
Alembic::Abc::IArchive m_archive;
std::ifstream m_infile;
std::vector m_streams;
+   bool m_is_hdf5;
 
 public:
explicit ArchiveReader(const char *filename);
 
bool valid() const;
 
+   /**
+* Returns true when either Blender is compiled with HDF5 support and
+* the archive was succesfully opened (valid() will also return true),
+* or when Blender was built without HDF5 support but a HDF5 file was
+* detected (valid() will return false).
+*/
+   bool is_hdf5() const;
+
Alembic::Abc::IObject getTop();
 };
 
diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index e44f66b7e56..50e7626ad1e 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -595,6 +595,7 @@ static std::pair visit_object(
 enum {
ABC_NO_ERROR = 0,
ABC_ARCHIVE_FAIL,
+   ABC_UNSUPPORTED_HDF5,
 };
 
 struct ImportJobData {
@@ -659,8 +660,12 @@ static void import_startjob(void *user_data, short *stop, 
short *do_update, floa
ArchiveReader *archive = new ArchiveReader(data->filename);
 
if 

[Bf-blender-cvs] [ab4f6f01a69] master: Cycles: Fix strict compiler flags

2017-04-25 Thread Sergey Sharybin
Commit: ab4f6f01a69cd155877fdf618993dddbf408565f
Author: Sergey Sharybin
Date:   Tue Apr 25 14:11:45 2017 +0200
Branches: master
https://developer.blender.org/rBab4f6f01a69cd155877fdf618993dddbf408565f

Cycles: Fix strict compiler flags

===

M   intern/cycles/util/util_types_uint2_impl.h
M   intern/cycles/util/util_types_uint3_impl.h
M   intern/cycles/util/util_types_uint4_impl.h

===

diff --git a/intern/cycles/util/util_types_uint2_impl.h 
b/intern/cycles/util/util_types_uint2_impl.h
index d5af59ec2bf..b50ffa2667f 100644
--- a/intern/cycles/util/util_types_uint2_impl.h
+++ b/intern/cycles/util/util_types_uint2_impl.h
@@ -26,14 +26,12 @@ CCL_NAMESPACE_BEGIN
 #ifndef __KERNEL_GPU__
 __forceinline uint uint2::operator[](uint i) const
 {
-   util_assert(i >= 0);
util_assert(i < 2);
return *( + i);
 }
 
 __forceinline uint& uint2::operator[](uint i)
 {
-   util_assert(i >= 0);
util_assert(i < 2);
return *( + i);
 }
diff --git a/intern/cycles/util/util_types_uint3_impl.h 
b/intern/cycles/util/util_types_uint3_impl.h
index 22a6a1aa29a..26005d5baff 100644
--- a/intern/cycles/util/util_types_uint3_impl.h
+++ b/intern/cycles/util/util_types_uint3_impl.h
@@ -26,14 +26,12 @@ CCL_NAMESPACE_BEGIN
 #ifndef __KERNEL_GPU__
 __forceinline uint uint3::operator[](uint i) const
 {
-   util_assert(i >= 0);
util_assert(i < 3);
return *( + i);
 }
 
 __forceinline uint& uint3::operator[](uint i)
 {
-   util_assert(i >= 0);
util_assert(i < 3);
return *( + i);
 }
diff --git a/intern/cycles/util/util_types_uint4_impl.h 
b/intern/cycles/util/util_types_uint4_impl.h
index 2858e09dec7..6d48131a446 100644
--- a/intern/cycles/util/util_types_uint4_impl.h
+++ b/intern/cycles/util/util_types_uint4_impl.h
@@ -26,14 +26,12 @@ CCL_NAMESPACE_BEGIN
 #ifndef __KERNEL_GPU__
 __forceinline uint uint4::operator[](uint i) const
 {
-   util_assert(i >= 0);
util_assert(i < 3);
return *( + i);
 }
 
 __forceinline uint& uint4::operator[](uint i)
 {
-   util_assert(i >= 0);
util_assert(i < 3);
return *( + i);
 }

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


[Bf-blender-cvs] [0b84f21b081] master: Fix OSX buildbot

2017-04-25 Thread Jens Verwiebe
Commit: 0b84f21b081efa6c18da6ef51b4bb29b1cde96dd
Author: Jens Verwiebe
Date:   Tue Apr 25 14:05:03 2017 +0200
Branches: master
https://developer.blender.org/rB0b84f21b081efa6c18da6ef51b4bb29b1cde96dd

Fix OSX buildbot

===

M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_release.cmake

===

diff --git a/build_files/cmake/config/blender_full.cmake 
b/build_files/cmake/config/blender_full.cmake
index bd8a2dbaf2c..87b8ed5f921 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -77,6 +77,6 @@ elseif(APPLE)
set(WITH_OPENSUBDIV  OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON  CACHE BOOL "" FORCE)
 
-   
include("${CMAKE_SOURCE_DIR}/build_files/cmake/platform/platform_apple_xcode.cmake")
+   
include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
apple_check_quicktime()
 endif()
diff --git a/build_files/cmake/config/blender_release.cmake 
b/build_files/cmake/config/blender_release.cmake
index 42e8c111714..b60c8c7380c 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -78,6 +78,6 @@ elseif(APPLE)
set(WITH_OPENSUBDIV  OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON  CACHE BOOL "" FORCE)
 
-   
include("${CMAKE_SOURCE_DIR}/build_files/cmake/platform/platform_apple_xcode.cmake")
+   
include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
apple_check_quicktime()
 endif()

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


[Bf-blender-cvs] [3128600a8ab] master: Fix T51262: Blender CRASH with alembic file

2017-04-25 Thread Sybren A. Stüvel
Commit: 3128600a8ab2badd9ea39c80133f15f766794ec6
Author: Sybren A. Stüvel
Date:   Tue Apr 25 12:05:55 2017 +0200
Branches: master
https://developer.blender.org/rB3128600a8ab2badd9ea39c80133f15f766794ec6

Fix T51262: Blender CRASH with alembic file

Also added a unit test for exporting & importing very long names.

===

M   source/blender/makesdna/DNA_cachefile_types.h
M   tests/python/alembic_tests.py
M   tests/python/bl_alembic_import_test.py

===

diff --git a/source/blender/makesdna/DNA_cachefile_types.h 
b/source/blender/makesdna/DNA_cachefile_types.h
index 46b1adf2725..e6fe8102b4f 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -50,7 +50,7 @@ enum {
 typedef struct AlembicObjectPath {
struct AlembicObjectPath *next, *prev;
 
-   char path[1024];  /* 1024 = FILE_MAX, might use PATH_MAX in the future. 
*/
+   char path[4096];  /* 4096 = PATH_MAX */
 } AlembicObjectPath;
 
 typedef struct CacheFile {
@@ -64,7 +64,7 @@ typedef struct CacheFile {
 * CacheFile. */
ListBase object_paths;
 
-   char filepath[1024];  /* 1024 = FILE_MAX */
+   char filepath[4096];  /* 4096 = PATH_MAX */
 
char is_sequence;
char forward_axis;
diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py
index 1cdfd75426a..2a2dd0230cf 100755
--- a/tests/python/alembic_tests.py
+++ b/tests/python/alembic_tests.py
@@ -372,6 +372,95 @@ class HairParticlesExportTest(AbstractAlembicTest):
 self.assertIn('.faceIndices', abcprop)
 
 
+class LongNamesExportTest(AbstractAlembicTest):
+@with_tempdir
+def test_export_long_names(self, tempdir: pathlib.Path):
+abc = tempdir / 'long-names.abc'
+script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', 
start=1, end=1, " \
+ "renderable_only=False, visible_layers_only=False, 
flatten=False)" % abc
+self.run_blender('long-names.blend', script)
+
+name_parts = [
+'foG9aeLahgoh5goacee1dah6Hethaghohjaich5pasizairuWigee1ahPeekiGh',
+'yoNgoisheedah2ua0eigh2AeCaiTee5bo0uphoo7Aixephah9racahvaingeeH4',
+'zuthohnoi1thooS3eezoo8seuph2Boo5aefacaethuvee1aequoonoox1sookie',
+'wugh4ciTh3dipiepeequait5uug7thiseek5ca7Eijei5ietaizokohhaecieto',
+'up9aeheenein9oteiX6fohP3thiez6Ahvah0oohah1ep2Eesho4Beboechaipoh',
+'coh4aehiacheTh0ue0eegho9oku1lohl4loht9ohPoongoow7dasiego6yimuis',
+'lohtho8eigahfeipohviepajaix4it2peeQu6Iefee1nevihaes4cee2soh4noy',
+'kaht9ahv0ieXaiyih7ohxe8bah7eeyicahjoa2ohbu7Choxua7oongah6sei4bu',
+'deif0iPaechohkee5nahx6oi2uJeeN7ze3seunohJibe4shai0mah5Iesh3Quai',
+'ChohDahshooNee0NeNohthah0eiDeese3Vu6ohShil1Iey9ja0uebi2quiShae6',
+'Dee1kai7eiph2ahh2nufah3zai3eexeengohQue1caj0eeW0xeghi3eshuadoot',
+'aeshiup3aengajoog0AhCoo5tiu3ieghaeGhie4Tu1ohh1thee8aepheingah1E',
+'ooRa6ahciolohshaifoopeo9ZeiGhae2aech4raisheiWah9AaNga0uas9ahquo',
+'thaepheip2aip6shief4EaXopei8ohPo0ighuiXah2ashowai9nohp4uach6Mei',
+'ohph4yaev3quieji3phophiem3OoNuisheepahng4waithae3Naichai7aw3noo',
+'aibeawaneBahmieyuph8ieng8iopheereeD2uu9Uyee5bei2phahXeir8eeJ8oo',
+'ooshahphei2hoh3uth5chaen7ohsai6uutiesucheichai8ungah9Gie1Aiphie',
+'eiwohchoo7ere2iebohn4Aapheichaelooriiyaoxaik7ooqua7aezahx0aeJei',
+'Vah0ohgohphiefohTheshieghichaichahch5moshoo0zai5eeva7eisi4yae8T',
+'EibeeN0fee0Gohnguz8iec6yeigh7shuNg4eingu3siph9joucahpeidoom4ree',
+'iejiu3shohheeZahHusheimeefaihoh5eecachu5eeZie9ceisugu9taidohT3U',
+'eex6dilakaix5Eetai7xiCh5Jaa8aiD4Ag3tuij1aijohv5fo0heevah8hohs3m',
+'ohqueeNgahraew6uraemohtoo5qua3oojiex6ohqu6Aideibaithaiphuriquie',
+'cei0eiN4Shiey7Aeluy3unohboo5choiphahc2mahbei5paephaiKeso1thoog1',
+'ieghif4ohKequ7ong0jah5ooBah0eiGh1caechahnahThae9Shoo0phopashoo4',
+'roh9er3thohwi5am8iequeequuSh3aic0voocai3ihi5nie2abahphupiegh7vu',
+'uv3Quei7wujoo5beingei2aish5op4VaiX0aebai7iwoaPee5pei8ko9IepaPig',
+'co7aegh5beitheesi9lu7jeeQu3johgeiphee9cheichi8aithuDehu2gaeNein',
+'thai3Tiewoo4nuir1ohy4aithiuZ7shae1luuwei5phibohriepe2paeci1Ach8',
+'phoi3ribah7ufuvoh8eigh1oB6deeBaiPohphaghiPieshahfah5EiCi3toogoo',
+'aiM8geil7ooreinee4Cheiwea4yeec8eeshi7Sei4Shoo3wu6ohkaNgooQu1mai',
+'agoo3faciewah9ZeesiXeereek7am0eigaeShie3Tisu8haReeNgoo0ci2Hae5u',
+'Aesatheewiedohshaephaenohbooshee8eu7EiJ8isal1laech2eiHo0noaV3ta',
+'liunguep3ooChoo4eir8ahSie8eenee0oo1TooXu8Cais8Aimo4eir6Phoo3xei',
+'toe9heepeobein3teequachemei0Cejoomef9ujie3ohwae9AiNgiephi3ep0de',
+

[Bf-blender-cvs] [1a8d15c75a4] soc-2016-pbvh-painting: Merge branch 'master' into soc-2016-pbvh-painting

2017-04-25 Thread Bastien Montagne
Commit: 1a8d15c75a4a5bb26c48ac7990f5169905c72abc
Author: Bastien Montagne
Date:   Tue Apr 25 12:02:59 2017 +0200
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB1a8d15c75a4a5bb26c48ac7990f5169905c72abc

Merge branch 'master' into soc-2016-pbvh-painting

===



===



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


[Bf-blender-cvs] [1f85a35a3db] master: Cycles: Cleanup, mainly line length in random module

2017-04-25 Thread Sergey Sharybin
Commit: 1f85a35a3db362124cc355ddc86588a434a613a5
Author: Sergey Sharybin
Date:   Tue Apr 25 11:42:36 2017 +0200
Branches: master
https://developer.blender.org/rB1f85a35a3db362124cc355ddc86588a434a613a5

Cycles: Cleanup, mainly line length in random module

Was doing lots of investigation recently, with need to have lots of things
side by side.

===

M   intern/cycles/kernel/kernel_random.h

===

diff --git a/intern/cycles/kernel/kernel_random.h 
b/intern/cycles/kernel/kernel_random.h
index d4f0caff5de..e8a912ccc0b 100644
--- a/intern/cycles/kernel/kernel_random.h
+++ b/intern/cycles/kernel/kernel_random.h
@@ -20,14 +20,15 @@ CCL_NAMESPACE_BEGIN
 
 #ifdef __SOBOL__
 
-/* skip initial numbers that are not as well distributed, especially the
+/* Skip initial numbers that are not as well distributed, especially the
  * first sequence is just 0 everywhere, which can be problematic for e.g.
- * path termination */
+ * path termination.
+ */
 #define SOBOL_SKIP 64
 
-/* High Dimensional Sobol */
+/* High Dimensional Sobol. */
 
-/* van der corput radical inverse */
+/* Van der Corput radical inverse. */
 ccl_device uint van_der_corput(uint bits)
 {
bits = (bits << 16) | (bits >> 16);
@@ -38,58 +39,63 @@ ccl_device uint van_der_corput(uint bits)
return bits;
 }
 
-/* sobol radical inverse */
+/* Sobol radical inverse. */
 ccl_device uint sobol(uint i)
 {
uint r = 0;
-
-   for(uint v = 1U << 31; i; i >>= 1, v ^= v >> 1)
-   if(i & 1)
+   for(uint v = 1U << 31; i; i >>= 1, v ^= v >> 1) {
+   if(i & 1) {
r ^= v;
-
+   }
+   }
return r;
 }
 
-/* inverse of sobol radical inverse */
+/* Inverse of sobol radical inverse. */
 ccl_device uint sobol_inverse(uint i)
 {
const uint msb = 1U << 31;
uint r = 0;
-
-   for(uint v = 1; i; i <<= 1, v ^= v << 1)
-   if(i & msb)
+   for(uint v = 1; i; i <<= 1, v ^= v << 1) {
+   if(i & msb) {
r ^= v;
-
+   }
+   }
return r;
 }
 
-/* multidimensional sobol with generator matrices
- * dimension 0 and 1 are equal to van_der_corput() and sobol() respectively */
+/* Multidimensional sobol with generator matrices
+ * dimension 0 and 1 are equal to van_der_corput() and sobol() respectively.
+ */
 ccl_device uint sobol_dimension(KernelGlobals *kg, int index, int dimension)
 {
uint result = 0;
uint i = index;
-
-   for(uint j = 0; i; i >>= 1, j++)
-   if(i & 1)
+   for(uint j = 0; i; i >>= 1, j++) {
+   if(i & 1) {
result ^= kernel_tex_fetch(__sobol_directions, 
32*dimension + j);
-   
+   }
+   }
return result;
 }
 
-/* lookup index and x/y coordinate, assumes m is a power of two */
-ccl_device uint sobol_lookup(const uint m, const uint frame, const uint ex, 
const uint ey, uint *x, uint *y)
+/* Lookup index and x/y coordinate, assumes m is a power of two. */
+ccl_device uint sobol_lookup(const uint m,
+ const uint frame,
+ const uint ex,
+ const uint ey,
+ uint *x, uint *y)
 {
-   /* shift is constant per frame */
+   /* Shift is constant per frame. */
const uint shift = frame << (m << 1);
const uint sobol_shift = sobol(shift);
-   /* van der Corput is its own inverse */
+   /* Van der Corput is its own inverse. */
const uint lower = van_der_corput(ex << (32 - m));
-   /* need to compensate for ey difference and shift */
+   /* Need to compensate for ey difference and shift. */
const uint sobol_lower = sobol(lower);
-   const uint mask = ~-(1 << m) << (32 - m); /* only m upper bits */
+   const uint mask = ~-(1 << m) << (32 - m);  /* Only m upper bits. */
const uint delta = ((ey << (32 - m)) ^ sobol_lower ^ sobol_shift) & 
mask;
-   /* only use m upper bits for the index (m is a power of two) */
+   /* Only use m upper bits for the index (m is a power of two). */
const uint sobol_result = delta | (delta >> m);
const uint upper = sobol_inverse(sobol_result);
const uint index = shift | upper | lower;
@@ -98,11 +104,14 @@ ccl_device uint sobol_lookup(const uint m, const uint 
frame, const uint ex, cons
return index;
 }
 
-ccl_device_forceinline float path_rng_1D(KernelGlobals *kg, RNG *rng, int 
sample, int num_samples, int dimension)
+ccl_device_forceinline float path_rng_1D(KernelGlobals *kg,
+ RNG *rng,
+ int sample, int num_samples,
+ int dimension)
 {
 #ifdef __CMJ__
if(kernel_data.integrator.sampling_pattern == 

[Bf-blender-cvs] [e353cf8705b] master: Revert "Alembic: Construct ISampleSelector once and pass along"

2017-04-25 Thread Sybren A. Stüvel
Commit: e353cf8705b0c8da529e0bd229dd13fe2b3c2abc
Author: Sybren A. Stüvel
Date:   Tue Apr 25 10:43:36 2017 +0200
Branches: master
https://developer.blender.org/rBe353cf8705b0c8da529e0bd229dd13fe2b3c2abc

Revert "Alembic: Construct ISampleSelector once and pass along"

This reverts commit 099816587a0e064fb6a52c82a737ae8814cf21df. It had some
unforseen side-effects that should be investigated first.

===

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 33344f6c9c5..4f70b2a972c 100644
--- a/source/blender/alembic/intern/abc_camera.cc
+++ b/source/blender/alembic/intern/abc_camera.cc
@@ -117,10 +117,11 @@ bool AbcCameraReader::valid() const
return m_schema.valid();
 }
 
-void AbcCameraReader::readObjectData(Main *bmain, const ISampleSelector 
_sel)
+void AbcCameraReader::readObjectData(Main *bmain, float time)
 {
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 0201dd9d6e1..1c4b7f77949 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, const Alembic::Abc::ISampleSelector 
_sel);
+   void readObjectData(Main *bmain, float time);
 };
 
 #endif  /* __ABC_CAMERA_H__ */
diff --git a/source/blender/alembic/intern/abc_curves.cc 
b/source/blender/alembic/intern/abc_curves.cc
index d85d8df4d77..bf485c7ef61 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, const 
Alembic::Abc::ISampleSelector _sel)
+void AbcCurveReader::readObjectData(Main *bmain, float time)
 {
Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE);
 
@@ -219,6 +219,8 @@ void AbcCurveReader::readObjectData(Main *bmain, const 
Alembic::Abc::ISampleSele
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);
@@ -387,11 +389,9 @@ 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 ISampleSelector 
_sel,
-  int /*read_flag*/,
-  const char ** /*err_str*/)
+DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/, const 
float time, 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 1ad6d0bf278..71b0d205820 100644
--- a/source/blender/alembic/intern/abc_curves.h
+++ b/source/blender/alembic/intern/abc_curves.h
@@ -55,11 +55,8 @@ public:
 
bool valid() const;
 
-   void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector 
_sel);
-   DerivedMesh *read_derivedmesh(DerivedMesh *dm,
- const Alembic::Abc::ISampleSelector 
_sel,
- int read_flag,
- const char **err_str);
+   void readObjectData(Main *bmain, 

[Bf-blender-cvs] [0a07cdbe80b] master: Cycles: Split vectorized math utilities to a dedicated files

2017-04-25 Thread Sergey Sharybin
Commit: 0a07cdbe80b2999478fa0d062a846e9bcfafc872
Author: Sergey Sharybin
Date:   Fri Apr 14 14:05:23 2017 +0200
Branches: master
https://developer.blender.org/rB0a07cdbe80b2999478fa0d062a846e9bcfafc872

Cycles: Split vectorized math utilities to a dedicated files

This file was even a bigger mess than vectorized types header,
cleaning it up to make it easier to maintain this files and
extend further.

===

M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/util/CMakeLists.txt
M   intern/cycles/util/util_math.h
A   intern/cycles/util/util_math_float2.h
A   intern/cycles/util/util_math_float3.h
A   intern/cycles/util/util_math_float4.h
A   intern/cycles/util/util_math_int2.h
A   intern/cycles/util/util_math_int3.h
A   intern/cycles/util/util_math_int4.h
M   intern/cycles/util/util_types_float2.h
M   intern/cycles/util/util_types_float2_impl.h
M   intern/cycles/util/util_types_float3.h
M   intern/cycles/util/util_types_float3_impl.h
M   intern/cycles/util/util_types_float4.h
M   intern/cycles/util/util_types_float4_impl.h
M   intern/cycles/util/util_types_int3.h
M   intern/cycles/util/util_types_int3_impl.h
M   intern/cycles/util/util_types_int4.h
M   intern/cycles/util/util_types_int4_impl.h

===

diff --git a/intern/cycles/kernel/CMakeLists.txt 
b/intern/cycles/kernel/CMakeLists.txt
index 10eff10d809..3750225571d 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -196,6 +196,12 @@ set(SRC_UTIL_HEADERS
../util/util_math.h
../util/util_math_fast.h
../util/util_math_intersect.h
+   ../util/util_math_float2.h
+   ../util/util_math_float3.h
+   ../util/util_math_float4.h
+   ../util/util_math_int2.h
+   ../util/util_math_int3.h
+   ../util/util_math_int4.h
../util/util_static_assert.h
../util/util_transform.h
../util/util_texture.h
diff --git a/intern/cycles/util/CMakeLists.txt 
b/intern/cycles/util/CMakeLists.txt
index 8d0a6c9fff9..388aba65460 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -53,6 +53,12 @@ set(SRC_HEADERS
util_math_cdf.h
util_math_fast.h
util_math_intersect.h
+   util_math_float2.h
+   util_math_float3.h
+   util_math_float4.h
+   util_math_int2.h
+   util_math_int3.h
+   util_math_int4.h
util_md5.h
util_opengl.h
util_optimization.h
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 77781ed4574..52b4fa859b7 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -28,12 +28,10 @@
 
 
 #ifndef __KERNEL_OPENCL__
-
-#include 
-#include 
-#include 
-
-#endif
+#  include 
+#  include 
+#  include 
+#endif  /* __KERNEL_OPENCL__ */
 
 #include "util/util_types.h"
 
@@ -43,49 +41,44 @@ CCL_NAMESPACE_BEGIN
 
 /* Division */
 #ifndef M_PI_F
-#define M_PI_F(3.1415926535897932f)  /* pi */
+#  define M_PI_F(3.1415926535897932f)  /* pi */
 #endif
 #ifndef M_PI_2_F
-#define M_PI_2_F  (1.5707963267948966f)  /* pi/2 */
+#  define M_PI_2_F  (1.5707963267948966f)  /* pi/2 */
 #endif
 #ifndef M_PI_4_F
-#define M_PI_4_F  (0.7853981633974830f)  /* pi/4 */
+#  define M_PI_4_F  (0.7853981633974830f)  /* pi/4 */
 #endif
 #ifndef M_1_PI_F
-#define M_1_PI_F  (0.3183098861837067f)  /* 1/pi */
+#  define M_1_PI_F  (0.3183098861837067f)  /* 1/pi */
 #endif
 #ifndef M_2_PI_F
-#define M_2_PI_F  (0.6366197723675813f)  /* 2/pi */
+#  define M_2_PI_F  (0.6366197723675813f)  /* 2/pi */
 #endif
 
 /* Multiplication */
 #ifndef M_2PI_F
-#define M_2PI_F   (6.2831853071795864f)  /* 2*pi */
+#  define M_2PI_F   (6.2831853071795864f)  /* 2*pi */
 #endif
 #ifndef M_4PI_F
-#define M_4PI_F   (12.566370614359172f)  /* 4*pi */
+#  define M_4PI_F   (12.566370614359172f)  /* 4*pi */
 #endif
 
 /* Float sqrt variations */
-
 #ifndef M_SQRT2_F
-#define M_SQRT2_F (1.4142135623730950f)  /* sqrt(2) */
+#  define M_SQRT2_F (1.4142135623730950f)  /* sqrt(2) */
 #endif
-
 #ifndef M_LN2_F
-#define M_LN2_F   (0.6931471805599453f)  /* ln(2) */
+#  define M_LN2_F   (0.6931471805599453f)  /* ln(2) */
 #endif
-
 #ifndef M_LN10_F
-#define M_LN10_F  (2.3025850929940457f)  /* ln(10) */
+#  define M_LN10_F  (2.3025850929940457f)  /* ln(10) */
 #endif
 
 /* Scalar */
 
 #ifdef _WIN32
-
-#ifndef __KERNEL_OPENCL__
-
+#  ifndef __KERNEL_OPENCL__
 ccl_device_inline float fmaxf(float a, float b)
 {
return (a > b)? a: b;
@@ -95,13 +88,10 @@ ccl_device_inline float fminf(float a, float b)
 {
return (a < b)? a: b;
 }
-
-#endif
-
-#endif
+#  endif  /* !__KERNEL_OPENCL__ */
+#endif  /* _WIN32 */
 
 #ifndef __KERNEL_GPU__
-
 using std::isfinite;
 using std::isnan;
 
@@ -157,8 +147,7 @@ ccl_device_inline T max4(const T& a, const T& b, const T& 
c, const T& d)

[Bf-blender-cvs] [51ec9441b74] master: Cycles: Split vectorized types into separate files

2017-04-25 Thread Sergey Sharybin
Commit: 51ec9441b74ccd02eb9385c3b2531f7411a6
Author: Sergey Sharybin
Date:   Thu Apr 13 19:34:45 2017 +0200
Branches: master
https://developer.blender.org/rB51ec9441b74ccd02eb9385c3b2531f7411a6

Cycles: Split vectorized types into separate files

The final goal to reach is to make vectorized types much easier to maintain
and the previous design had following issues:

- Having all types and methods implementation made the source file rather
  bloated and unfun to navigate in.

- It was not possible to quickly glance available API for the type you are
  interested in.

- Adding more vectorization types will bloat the file even more, making
  things even more tricky to follow.

===

M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/util/CMakeLists.txt
M   intern/cycles/util/util_types.h
A   intern/cycles/util/util_types_float2.h
A   intern/cycles/util/util_types_float2_impl.h
A   intern/cycles/util/util_types_float3.h
A   intern/cycles/util/util_types_float3_impl.h
A   intern/cycles/util/util_types_float4.h
A   intern/cycles/util/util_types_float4_impl.h
A   intern/cycles/util/util_types_int2.h
A   intern/cycles/util/util_types_int2_impl.h
A   intern/cycles/util/util_types_int3.h
A   intern/cycles/util/util_types_int3_impl.h
A   intern/cycles/util/util_types_int4.h
A   intern/cycles/util/util_types_int4_impl.h
A   intern/cycles/util/util_types_uchar2.h
A   intern/cycles/util/util_types_uchar2_impl.h
A   intern/cycles/util/util_types_uchar3.h
A   intern/cycles/util/util_types_uchar3_impl.h
A   intern/cycles/util/util_types_uchar4.h
A   intern/cycles/util/util_types_uchar4_impl.h
A   intern/cycles/util/util_types_uint2.h
A   intern/cycles/util/util_types_uint2_impl.h
A   intern/cycles/util/util_types_uint3.h
A   intern/cycles/util/util_types_uint3_impl.h
A   intern/cycles/util/util_types_uint4.h
A   intern/cycles/util/util_types_uint4_impl.h
A   intern/cycles/util/util_types_vector3.h
A   intern/cycles/util/util_types_vector3_impl.h

===

diff --git a/intern/cycles/kernel/CMakeLists.txt 
b/intern/cycles/kernel/CMakeLists.txt
index c3772dfa2d8..10eff10d809 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -200,6 +200,32 @@ set(SRC_UTIL_HEADERS
../util/util_transform.h
../util/util_texture.h
../util/util_types.h
+   ../util/util_types_float2.h
+   ../util/util_types_float2_impl.h
+   ../util/util_types_float3.h
+   ../util/util_types_float3_impl.h
+   ../util/util_types_float4.h
+   ../util/util_types_float4_impl.h
+   ../util/util_types_int2.h
+   ../util/util_types_int2_impl.h
+   ../util/util_types_int3.h
+   ../util/util_types_int3_impl.h
+   ../util/util_types_int4.h
+   ../util/util_types_int4_impl.h
+   ../util/util_types_uchar2.h
+   ../util/util_types_uchar2_impl.h
+   ../util/util_types_uchar3.h
+   ../util/util_types_uchar3_impl.h
+   ../util/util_types_uchar4.h
+   ../util/util_types_uchar4_impl.h
+   ../util/util_types_uint2.h
+   ../util/util_types_uint2_impl.h
+   ../util/util_types_uint3.h
+   ../util/util_types_uint3_impl.h
+   ../util/util_types_uint4.h
+   ../util/util_types_uint4_impl.h
+   ../util/util_types_vector3.h
+   ../util/util_types_vector3_impl.h
 )
 
 set(SRC_SPLIT_HEADERS
diff --git a/intern/cycles/util/CMakeLists.txt 
b/intern/cycles/util/CMakeLists.txt
index a015fef8284..8d0a6c9fff9 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -80,6 +80,32 @@ set(SRC_HEADERS
util_time.h
util_transform.h
util_types.h
+   util_types_float2.h
+   util_types_float2_impl.h
+   util_types_float3.h
+   util_types_float3_impl.h
+   util_types_float4.h
+   util_types_float4_impl.h
+   util_types_int2.h
+   util_types_int2_impl.h
+   util_types_int3.h
+   util_types_int3_impl.h
+   util_types_int4.h
+   util_types_int4_impl.h
+   util_types_uchar2.h
+   util_types_uchar2_impl.h
+   util_types_uchar3.h
+   util_types_uchar3_impl.h
+   util_types_uchar4.h
+   util_types_uchar4_impl.h
+   util_types_uint2.h
+   util_types_uint2_impl.h
+   util_types_uint3.h
+   util_types_uint3_impl.h
+   util_types_uint4.h
+   util_types_uint4_impl.h
+   util_types_vector3.h
+   util_types_vector3_impl.h
util_vector.h
util_version.h
util_view.h
diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index 756ab2cfe93..137cc73b70b 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -125,339 +125,6 @@ typedef int32_t ssize_t;
 /* Generic Memory Pointer 

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

2017-04-25 Thread Sergey Sharybin
Commit: b06cd746ce9fb8dfe5361fa9d148bde73c26f5d3
Author: Sergey Sharybin
Date:   Thu Apr 13 18:59:46 2017 +0200
Branches: master
https://developer.blender.org/rBb06cd746ce9fb8dfe5361fa9d148bde73c26f5d3

Cycles: Cleanup, preprocessor indentation

===

M   intern/cycles/util/util_types.h

===

diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index 5a8f11694a7..756ab2cfe93 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -18,78 +18,68 @@
 #define __UTIL_TYPES_H__
 
 #ifndef __KERNEL_OPENCL__
-
-#include 
-
+#  include 
 #endif
 
 /* Bitness */
 
 #if defined(__ppc64__) || defined(__PPC64__) || defined(__x86_64__) || 
defined(__ia64__) || defined(_M_X64)
-#define __KERNEL_64_BIT__
+#  define __KERNEL_64_BIT__
 #endif
 
 /* Qualifiers for kernel code shared by CPU and GPU */
 
 #ifndef __KERNEL_GPU__
-
-#define ccl_device static inline
-#define ccl_device_noinline static
-#define ccl_global
-#define ccl_constant
-#define ccl_local
-#define ccl_local_param
-#define ccl_private
-#define ccl_restrict __restrict
-#define __KERNEL_WITH_SSE_ALIGN__
-
-#if defined(_WIN32) && !defined(FREE_WINDOWS)
-#define ccl_device_inline static __forceinline
-#define ccl_device_forceinline static __forceinline
-#define ccl_align(...) __declspec(align(__VA_ARGS__))
-#ifdef __KERNEL_64_BIT__
-#define ccl_try_align(...) __declspec(align(__VA_ARGS__))
-#else
-#undef __KERNEL_WITH_SSE_ALIGN__
-#define ccl_try_align(...) /* not support for function arguments (error C2719) 
*/
-#endif
-#define ccl_may_alias
-#define ccl_always_inline __forceinline
-#define ccl_never_inline __declspec(noinline)
-#define ccl_maybe_unused
-
-#else
-
-#define ccl_device_inline static inline __attribute__((always_inline))
-#define ccl_device_forceinline static inline __attribute__((always_inline))
-#define ccl_align(...) __attribute__((aligned(__VA_ARGS__)))
-#ifndef FREE_WINDOWS64
-#define __forceinline inline __attribute__((always_inline))
-#endif
-#define ccl_try_align(...) __attribute__((aligned(__VA_ARGS__)))
-#define ccl_may_alias __attribute__((__may_alias__))
-#define ccl_always_inline __attribute__((always_inline))
-#define ccl_never_inline __attribute__((noinline))
-#define ccl_maybe_unused __attribute__((used))
-
-#endif
-
-#endif
+#  define ccl_device static inline
+#  define ccl_device_noinline static
+#  define ccl_global
+#  define ccl_constant
+#  define ccl_local
+#  define ccl_local_param
+#  define ccl_private
+#  define ccl_restrict __restrict
+#  define __KERNEL_WITH_SSE_ALIGN__
+
+#  if defined(_WIN32) && !defined(FREE_WINDOWS)
+#define ccl_device_inline static __forceinline
+#define ccl_device_forceinline static __forceinline
+#define ccl_align(...) __declspec(align(__VA_ARGS__))
+#ifdef __KERNEL_64_BIT__
+#  define ccl_try_align(...) __declspec(align(__VA_ARGS__))
+#else  /* __KERNEL_64_BIT__ */
+#  undef __KERNEL_WITH_SSE_ALIGN__
+/* No support for function arguments (error C2719). */
+#  define ccl_try_align(...)
+#endif  /* __KERNEL_64_BIT__ */
+#define ccl_may_alias
+#define ccl_always_inline __forceinline
+#define ccl_never_inline __declspec(noinline)
+#define ccl_maybe_unused
+#  else  /* _WIN32 && !FREE_WINDOWS */
+#define ccl_device_inline static inline __attribute__((always_inline))
+#define ccl_device_forceinline static inline __attribute__((always_inline))
+#define ccl_align(...) __attribute__((aligned(__VA_ARGS__)))
+#ifndef FREE_WINDOWS64
+#  define __forceinline inline __attribute__((always_inline))
+#endif
+#define ccl_try_align(...) __attribute__((aligned(__VA_ARGS__)))
+#define ccl_may_alias __attribute__((__may_alias__))
+#define ccl_always_inline __attribute__((always_inline))
+#define ccl_never_inline __attribute__((noinline))
+#define ccl_maybe_unused __attribute__((used))
+#  endif  /* _WIN32 && !FREE_WINDOWS */
+#endif  /* __KERNEL_GPU__ */
 
 /* Standard Integer Types */
 
 #ifndef __KERNEL_GPU__
-
 /* int8_t, uint16_t, and friends */
-#ifndef _WIN32
-#include 
-#endif
-
+#  ifndef _WIN32
+#include 
+#  endif
 /* SIMD Types */
-
-#include "util/util_optimization.h"
-
-#endif
+#  include "util/util_optimization.h"
+#endif  /* __KERNEL_GPU__ */
 
 CCL_NAMESPACE_BEGIN
 
@@ -102,24 +92,18 @@ CCL_NAMESPACE_BEGIN
 /* Shorter Unsigned Names */
 
 #ifndef __KERNEL_OPENCL__
-
 typedef unsigned char uchar;
 typedef unsigned int uint;
-
 #endif
 
 /* Fixed Bits Types */
 
 #ifdef __KERNEL_OPENCL__
-
 typedef ulong uint64_t;
-
 #endif
 
 #ifndef __KERNEL_GPU__
-
-#ifdef _WIN32
-
+#  ifdef _WIN32
 typedef signed char int8_t;
 typedef unsigned char uint8_t;
 
@@ -131,14 +115,12 @@ typedef unsigned int uint32_t;
 
 typedef long long int64_t;
 typedef unsigned long long uint64_t;
-
-#ifdef __KERNEL_64_BIT__
+#ifdef 

[Bf-blender-cvs] [573f6d1ec45] master: Fix T51284: Mesh not skinned

2017-04-25 Thread Sybren A. Stüvel
Commit: 573f6d1ec45f02d4dadf292433874cbced2a5f32
Author: Sybren A. Stüvel
Date:   Tue Apr 25 10:01:34 2017 +0200
Branches: master
https://developer.blender.org/rB573f6d1ec45f02d4dadf292433874cbced2a5f32

Fix T51284: Mesh not skinned

===

M   source/blender/alembic/intern/abc_object.h

===

diff --git a/source/blender/alembic/intern/abc_object.h 
b/source/blender/alembic/intern/abc_object.h
index a9dbaa89c97..c5da84d3c2a 100644
--- a/source/blender/alembic/intern/abc_object.h
+++ b/source/blender/alembic/intern/abc_object.h
@@ -172,10 +172,10 @@ public:
 
virtual void readObjectData(Main *bmain, const 
Alembic::Abc::ISampleSelector _sel) = 0;
 
-   DerivedMesh *read_derivedmesh(DerivedMesh *dm,
- const Alembic::Abc::ISampleSelector 
_sel,
- int read_flag,
- const char **err_str);
+   virtual DerivedMesh *read_derivedmesh(DerivedMesh *dm,
+ const 
Alembic::Abc::ISampleSelector _sel,
+ int read_flag,
+ const char **err_str);
 
/** Reads the object matrix and sets up an object transform if 
animated. */
void setupObjectTransform(const float time);

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


[Bf-blender-cvs] [7398b3b71b4] master: WM: don't search for app-template when its empty

2017-04-25 Thread Campbell Barton
Commit: 7398b3b71b48ca80867cb899494d28790821846e
Author: Campbell Barton
Date:   Tue Apr 25 17:14:46 2017 +1000
Branches: master
https://developer.blender.org/rB7398b3b71b48ca80867cb899494d28790821846e

WM: don't search for app-template when its empty

Changing from a loaded app-template back to Default (none set)
would scan paths for a file with no name. Harmless but silly.

===

M   source/blender/windowmanager/intern/wm_files.c

===

diff --git a/source/blender/windowmanager/intern/wm_files.c 
b/source/blender/windowmanager/intern/wm_files.c
index 028355f9af3..187c1193ec6 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -724,7 +724,7 @@ int wm_homefile_read(
if (filepath_startup_override != NULL) {
/* pass */
}
-   else if (app_template_override) {
+   else if (app_template_override && app_template_override[0]) {
app_template = app_template_override;
}
else if (!use_factory_settings && U.app_template[0]) {

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


[Bf-blender-cvs] [07f76baa863] workspaces: App Templates: optionally use app-template path for workspaces

2017-04-25 Thread Campbell Barton
Commit: 07f76baa8632207ed9cddc0ebd4de55fc6890c93
Author: Campbell Barton
Date:   Tue Apr 25 16:53:28 2017 +1000
Branches: workspaces
https://developer.blender.org/rB07f76baa8632207ed9cddc0ebd4de55fc6890c93

App Templates: optionally use app-template path for workspaces

Also make WM_OT_save_workspace_file follow WM_OT_save_userpref logic
more closely.

===

M   source/blender/editors/screen/workspace_edit.c
M   source/blender/windowmanager/intern/wm_files.c

===

diff --git a/source/blender/editors/screen/workspace_edit.c 
b/source/blender/editors/screen/workspace_edit.c
index f208bf92eb9..d96be3a28cd 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -315,7 +315,8 @@ static void WORKSPACE_OT_workspace_delete(wmOperatorType 
*ot)
 static void workspace_config_file_path_from_folder_id(
 const Main *bmain, int folder_id, char *r_path)
 {
-   const char *cfgdir = BKE_appdir_folder_id(folder_id, NULL);
+   const char *app_template = U.app_template[0] ? U.app_template : NULL;
+   const char * const cfgdir = BKE_appdir_folder_id(folder_id, 
app_template);
 
if (cfgdir) {
BLI_make_file_string(bmain->name, r_path, cfgdir, 
BLENDER_WORKSPACES_FILE);
diff --git a/source/blender/windowmanager/intern/wm_files.c 
b/source/blender/windowmanager/intern/wm_files.c
index db21d9b99e9..00e83da7e3f 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1517,22 +1517,23 @@ static int 
wm_workspace_configuration_file_write_exec(bContext *C, wmOperator *o
 {
Main *bmain = CTX_data_main(C);
char filepath[FILE_MAX];
-   const char *configdir = 
BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL);
 
-   if (configdir) {
-   BLI_path_join(filepath, sizeof(filepath), configdir, 
BLENDER_WORKSPACES_FILE, NULL);
-   printf("trying to save workspace configuration file at %s ", 
filepath);
+   const char *app_template = U.app_template[0] ? U.app_template : NULL;
+   const char * const cfgdir = 
BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, app_template);
+   if (cfgdir == NULL) {
+   BKE_report(op->reports, RPT_ERROR, "Unable to create workspace 
configuration file path");
+   return OPERATOR_CANCELLED;
+   }
 
-   if (BKE_blendfile_workspace_config_write(bmain, filepath, 
op->reports) != 0) {
-   printf("ok\n");
-   return OPERATOR_FINISHED;
-   }
-   else {
-   printf("fail\n");
-   }
+   BLI_path_join(filepath, sizeof(filepath), cfgdir, 
BLENDER_WORKSPACES_FILE, NULL);
+   printf("trying to save workspace configuration file at %s ", filepath);
+
+   if (BKE_blendfile_workspace_config_write(bmain, filepath, op->reports) 
!= 0) {
+   printf("ok\n");
+   return OPERATOR_FINISHED;
}
else {
-   BKE_report(op->reports, RPT_ERROR, "Unable to create workspace 
configuration file path");
+   printf("fail\n");
}
 
return OPERATOR_CANCELLED;

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


[Bf-blender-cvs] [a09609f21e7] workspaces: Minor changes only, use BKE prefix and remove nested header

2017-04-25 Thread Campbell Barton
Commit: a09609f21e79d9773b01357048653180218f1dd3
Author: Campbell Barton
Date:   Tue Apr 25 16:24:26 2017 +1000
Branches: workspaces
https://developer.blender.org/rBa09609f21e79d9773b01357048653180218f1dd3

Minor changes only, use BKE prefix and remove nested header

===

M   source/blender/blenkernel/BKE_workspace.h
M   source/blender/blenkernel/intern/library.c
M   source/blender/blenkernel/intern/workspace.c
M   source/blender/blenlib/BLI_string.h

===

diff --git a/source/blender/blenkernel/BKE_workspace.h 
b/source/blender/blenkernel/BKE_workspace.h
index a2f577ad006..52aa06aa97c 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -150,6 +150,6 @@ void BKE_workspace_relation_data_set(struct 
WorkSpaceDataRelation *relation, voi
 /*  */
 /* Don't use outside of BKE! */
 
-WorkSpace *workspace_alloc(void) ATTR_WARN_UNUSED_RESULT;
+WorkSpace *BKE_workspace_alloc(void) ATTR_WARN_UNUSED_RESULT;
 
 #endif /* __BKE_WORKSPACE_H__ */
diff --git a/source/blender/blenkernel/intern/library.c 
b/source/blender/blenkernel/intern/library.c
index 144540db2dc..d9aa4d689d8 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -971,7 +971,7 @@ void *BKE_libblock_alloc_notest(short type)
id = MEM_callocN(sizeof(CacheFile), "Cache File");
break;
case ID_WS:
-   id = (ID *)workspace_alloc();
+   id = (ID *)BKE_workspace_alloc();
break;
}
return id;
diff --git a/source/blender/blenkernel/intern/workspace.c 
b/source/blender/blenkernel/intern/workspace.c
index b0829f0213d..9edb0830dc5 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -26,9 +26,9 @@
 
 #include 
 
+#include "BLI_utildefines.h"
 #include "BLI_string.h"
 #include "BLI_string_utils.h"
-#include "BLI_utildefines.h"
 #include "BLI_listbase.h"
 
 #include "BKE_global.h"
@@ -51,7 +51,7 @@
 /**
  * Only to be called by #BKE_libblock_alloc_notest! Always use 
BKE_workspace_add to add a new workspace.
  */
-WorkSpace *workspace_alloc(void)
+WorkSpace *BKE_workspace_alloc(void)
 {
return MEM_callocN(sizeof(WorkSpace), __func__);
 }
diff --git a/source/blender/blenlib/BLI_string.h 
b/source/blender/blenlib/BLI_string.h
index d7430648a5c..d137806c575 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -38,7 +38,6 @@
 extern "C" {
 #endif
 
-#include "BLI_utildefines.h"
 #include "BLI_compiler_attrs.h"
 
 char *BLI_strdupn(const char *str, const size_t len) ATTR_MALLOC 
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

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