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

2017-06-01 Thread Campbell Barton
Commit: eae486f5e6c79b7b31e276dfaea69d2ece7fbf7f
Author: Campbell Barton
Date:   Fri Jun 2 15:39:25 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBeae486f5e6c79b7b31e276dfaea69d2ece7fbf7f

Merge branch 'master' into blender2.8

===



===



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


[Bf-blender-cvs] [cb23927c9b2] blender2.8: Fix View3D orientation index initial value

2017-06-01 Thread Campbell Barton
Commit: cb23927c9b24d5b17e35c8682060cd6839337a12
Author: Campbell Barton
Date:   Fri Jun 2 15:21:56 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBcb23927c9b24d5b17e35c8682060cd6839337a12

Fix View3D orientation index initial value

Would assert after transform

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 13da6e5d407..fa03725fa6f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -390,6 +390,9 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *main)

v3d->custom_orientation_index = v3d->twmode - V3D_MANIP_CUSTOM;
v3d->twmode = 
V3D_MANIP_CUSTOM;
}
+   else {
+   
v3d->custom_orientation_index = -1;
+   }
}
}
}

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


[Bf-blender-cvs] [0d8bf4bf947] master: Cleanup: style

2017-06-01 Thread Campbell Barton
Commit: 0d8bf4bf947d84cdfc6e2b221ddb03c7f8d2114b
Author: Campbell Barton
Date:   Fri Jun 2 15:38:04 2017 +1000
Branches: master
https://developer.blender.org/rB0d8bf4bf947d84cdfc6e2b221ddb03c7f8d2114b

Cleanup: style

===

M   source/blender/alembic/intern/abc_exporter.cc
M   source/blender/alembic/intern/abc_util.cc
M   source/blender/alembic/intern/alembic_capi.cc
M   source/blender/blenkernel/intern/mesh_mapping.c
M   source/blender/blenkernel/intern/particle_distribute.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenlib/intern/math_color_blend_inline.c
M   source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M   source/blender/editors/curve/editcurve.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/space_text/text_autocomplete.c
M   source/blender/editors/transform/transform.c
M   
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/imbuf/intern/cineon/dpxlib.c
M   source/blender/render/intern/source/rendercore.c
M   source/gameengine/Ketsji/KX_SoundActuator.cpp

===

diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index 3da67ac0865..3f359990980 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -428,7 +428,7 @@ AbcTransformWriter * 
AbcExporter::createTransformWriter(Object *ob, Object *pare
 
/* check if we have already created a transform writer for this object 
*/
AbcTransformWriter *my_writer = getXForm(name);
-   if (my_writer != NULL){
+   if (my_writer != NULL) {
return my_writer;
}
 
diff --git a/source/blender/alembic/intern/abc_util.cc 
b/source/blender/alembic/intern/abc_util.cc
index 67d2d3b1eb2..26eb7620fb1 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -142,7 +142,7 @@ void create_swapped_rotation_matrix(
float rz;
 
/* Apply transformation */
-   switch(mode) {
+   switch (mode) {
case ABC_ZUP_FROM_YUP:
ry = -euler[2];
rz = euler[1];
@@ -217,7 +217,7 @@ void copy_m44_axis_swap(float dst_mat[4][4], float 
src_mat[4][4], AbcAxisSwapMod
copy_m4_m3(dst_mat, dst_rot);
 
/* Apply translation */
-   switch(mode) {
+   switch (mode) {
case ABC_ZUP_FROM_YUP:
copy_zup_from_yup(dst_mat[3], src_trans);
break;
diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index 5ac73175e5b..be454050098 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -452,7 +452,8 @@ static std::pair visit_object(
else {
if (child_claims_this_object) {
claiming_child_readers.push_back(child_reader);
-   } else {
+   }
+   else {

nonclaiming_child_readers.push_back(child_reader);
}
}
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c 
b/source/blender/blenkernel/intern/mesh_mapping.c
index 8562988b5e1..525c0c9728e 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -165,7 +165,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
vmap->vert[a] = newvlist;
}
 
-   if (use_winding)  {
+   if (use_winding) {
MEM_freeN(winding);
}
 
diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 44cf5b119c1..6603521c42f 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -1092,7 +1092,7 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 
/* For hair, sort by origindex (allows optimization's in rendering), */
/* however with virtual parents the children need to be in random 
order. */
-   if (part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && 
part->parents!=0.0f)) {
+   if (part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && 
part->parents != 0.0f)) {
int *orig_index = NULL;
 
if (from == PART_FROM_VERT) {
diff --git a/source/blender/blenkernel/intern/particle_system.c 

[Bf-blender-cvs] [7beb173d703] blender2.8: Fix crash using non-camera object as camera

2017-06-01 Thread Campbell Barton
Commit: 7beb173d703c11373b9883f39d65b8d528283ff2
Author: Campbell Barton
Date:   Fri Jun 2 15:12:39 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB7beb173d703c11373b9883f39d65b8d528283ff2

Fix crash using non-camera object as camera

Also sync with master to avoid conflicts

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index c664f66858e..b1938054944 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -444,14 +444,14 @@ static void drawviewborder(Scene *scene, ARegion *ar, 
View3D *v3d)
return;
if (v3d->camera->type == OB_CAMERA)
ca = v3d->camera->data;
-
+   
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, , false);
/* the offsets */
x1 = viewborder.xmin;
y1 = viewborder.ymin;
x2 = viewborder.xmax;
y2 = viewborder.ymax;
-
+   
glLineWidth(1.0f);
 
/* apply offsets so the real 3D camera shows through */
@@ -514,9 +514,9 @@ static void drawviewborder(Scene *scene, ARegion *ar, 
View3D *v3d)
}
 
/* And now, the dashed lines! */
-   {
-   immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR);
+   immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR);
 
+   {
float viewport_size[4];
glGetFloatv(GL_VIEWPORT, viewport_size);
immUniform2f("viewport_size", viewport_size[2], 
viewport_size[3]);
@@ -533,85 +533,87 @@ static void drawviewborder(Scene *scene, ARegion *ar, 
View3D *v3d)
 
immUniformThemeColor(TH_VIEW_OVERLAY);
imm_draw_line_box(shdr_pos, x1i, y1i, x2i, y2i);
+   }
 
-   /* border */
-   if (scene->r.mode & R_BORDER) {
-   float x3, y3, x4, y4;
+   /* border */
+   if (scene->r.mode & R_BORDER) {
+   float x3, y3, x4, y4;
 
-   x3 = floorf(x1 + (scene->r.border.xmin * (x2 - x1))) - 
1;
-   y3 = floorf(y1 + (scene->r.border.ymin * (y2 - y1))) - 
1;
-   x4 = floorf(x1 + (scene->r.border.xmax * (x2 - x1))) + 
(U.pixelsize - 1);
-   y4 = floorf(y1 + (scene->r.border.ymax * (y2 - y1))) + 
(U.pixelsize - 1);
+   x3 = floorf(x1 + (scene->r.border.xmin * (x2 - x1))) - 1;
+   y3 = floorf(y1 + (scene->r.border.ymin * (y2 - y1))) - 1;
+   x4 = floorf(x1 + (scene->r.border.xmax * (x2 - x1))) + 
(U.pixelsize - 1);
+   y4 = floorf(y1 + (scene->r.border.ymax * (y2 - y1))) + 
(U.pixelsize - 1);
 
-   immUniformColor3f(1.0f, 0.25f, 0.25f);
-   imm_draw_line_box(shdr_pos, x3, y3, x4, y4);
-   }
+   immUniformColor3f(1.0f, 0.25f, 0.25f);
+   imm_draw_line_box(shdr_pos, x3, y3, x4, y4);
+   }
 
-   /* safety border */
-   if (ca) {
-   immUniformThemeColorBlend(TH_VIEW_OVERLAY, TH_BACK, 
0.25f);
+   /* safety border */
+   if (ca) {
+   immUniformThemeColorBlend(TH_VIEW_OVERLAY, TH_BACK, 0.25f);
 
-   if (ca->dtx & CAM_DTX_CENTER) {
-   float x3, y3;
+   if (ca->dtx & CAM_DTX_CENTER) {
+   float x3, y3;
 
-   x3 = x1 + 0.5f * (x2 - x1);
-   y3 = y1 + 0.5f * (y2 - y1);
+   x3 = x1 + 0.5f * (x2 - x1);
+   y3 = y1 + 0.5f * (y2 - y1);
 
-   immBegin(PRIM_LINES, 4);
+   immBegin(PRIM_LINES, 4);
 
-   immVertex2f(shdr_pos, x1, y3);
-   immVertex2f(shdr_pos, x2, y3);
+   immVertex2f(shdr_pos, x1, y3);
+   immVertex2f(shdr_pos, x2, y3);
 
-   immVertex2f(shdr_pos, x3, y1);
-   immVertex2f(shdr_pos, x3, y2);
+   immVertex2f(shdr_pos, x3, y1);
+   immVertex2f(shdr_pos, x3, y2);
 
-   immEnd();
-   }
+   immEnd();
+   }
 
-   if (ca->dtx & CAM_DTX_CENTER_DIAG) {
-   immBegin(PRIM_LINES, 4);
+   if (ca->dtx & CAM_DTX_CENTER_DIAG) {
+   immBegin(PRIM_LINES, 4);
 
-   immVertex2f(shdr_pos, x1, y1);
-   immVertex2f(shdr_pos, x2, y2);
+   immVertex2f(shdr_pos, x1, y1);
+

[Bf-blender-cvs] [f59b1179c5b] blender2.8: Eevee: Tag shadow maps to update only when necessary.

2017-06-01 Thread Clément Foucault
Commit: f59b1179c5b368179fd78a2ad999161ad4f071b9
Author: Clément Foucault
Date:   Thu Jun 1 18:20:44 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBf59b1179c5b368179fd78a2ad999161ad4f071b9

Eevee: Tag shadow maps to update only when necessary.

Shadow maps are now only updated if one shadow casting object inside it's 
shadow bounds has been updated.

===

M   source/blender/draw/engines/eevee/eevee_engine.c
M   source/blender/draw/engines/eevee/eevee_lights.c
M   source/blender/draw/engines/eevee/eevee_private.h

===

diff --git a/source/blender/draw/engines/eevee/eevee_engine.c 
b/source/blender/draw/engines/eevee/eevee_engine.c
index cd3819b88e1..3e2b47819d7 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -441,6 +441,17 @@ static void EEVEE_cache_init(void *vedata)
EEVEE_effects_cache_init(vedata);
 }
 
+EEVEE_ObjectEngineData *EEVEE_get_object_engine_data(Object *ob)
+{
+   EEVEE_ObjectEngineData **oedata = (EEVEE_ObjectEngineData 
**)DRW_object_engine_data_get(ob, _engine_eevee_type, NULL);
+
+   if (*oedata == NULL) {
+   *oedata = MEM_callocN(sizeof(**oedata), 
"EEVEE_ObjectEngineData");
+   }
+
+   return *oedata;
+}
+
 static void EEVEE_cache_populate(void *vedata, Object *ob)
 {
EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl;
@@ -565,6 +576,9 @@ static void EEVEE_cache_populate(void *vedata, Object *ob)
 
if (cast_shadow) {
EEVEE_lights_cache_shcaster_add(sldata, psl, geom, 
ob->obmat);
+   BLI_addtail(>shadow_casters, 
BLI_genericNodeN(ob));
+   EEVEE_ObjectEngineData *oedata = 
EEVEE_get_object_engine_data(ob);
+   oedata->need_update = ((ob->deg_update_flag & 
DEG_RUNTIME_DATA_UPDATE) != 0);
}
}
else if (ob->type == OB_LAMP) {
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c 
b/source/blender/draw/engines/eevee/eevee_lights.c
index 4c992fca8e0..9dd87cc11f3 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -25,6 +25,8 @@
 
 #include "DRW_render.h"
 
+#include "BKE_object.h"
+
 #include "eevee_engine.h"
 #include "eevee_private.h"
 
@@ -47,6 +49,12 @@ typedef struct EEVEE_ShadowCascadeData {
float viewprojmat[MAX_CASCADE_NUM][4][4]; /* World->Lamp->NDC : used 
for rendering the shadow map. */
 } EEVEE_ShadowCascadeData;
 
+typedef struct ShadowCaster {
+   struct ShadowCaster *next, *prev;
+   void *ob;
+   bool prune;
+} ShadowCaster;
+
 static struct {
struct GPUShader *shadow_sh;
struct GPUShader *shadow_store_sh;
@@ -61,6 +69,25 @@ extern char datatoc_shadow_store_frag_glsl[];
 
 /* *** FUNCTIONS *** */
 
+static void eevee_lamp_engine_data_free(void *storage)
+{
+   EEVEE_LampEngineData *led = (EEVEE_LampEngineData *)storage;
+   MEM_SAFE_FREE(led->storage);
+   BLI_freelistN(>shadow_caster_list);
+}
+
+static EEVEE_LampEngineData *eevee_get_lamp_engine_data(Object *ob)
+{
+   EEVEE_LampEngineData **ledata = (EEVEE_LampEngineData 
**)DRW_object_engine_data_get(ob, _engine_eevee_type, 
_lamp_engine_data_free);
+
+   if (*ledata == NULL) {
+   *ledata = MEM_callocN(sizeof(**ledata), "EEVEE_LampEngineData");
+   (*ledata)->need_update = true;
+   }
+
+   return *ledata;
+}
+
 void EEVEE_lights_init(EEVEE_SceneLayerData *sldata)
 {
const unsigned int shadow_ubo_size = sizeof(EEVEE_ShadowCube) * 
MAX_SHADOW_CUBE +
@@ -109,6 +136,9 @@ void EEVEE_lights_cache_init(EEVEE_SceneLayerData *sldata, 
EEVEE_PassList *psl)
{
psl->shadow_cascade_pass = DRW_pass_create("Shadow Cascade 
Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
}
+
+   /* Reset shadow casters list */
+   BLI_freelistN(>shadow_casters);
 }
 
 void EEVEE_lights_cache_add(EEVEE_SceneLayerData *sldata, Object *ob)
@@ -122,37 +152,43 @@ void EEVEE_lights_cache_add(EEVEE_SceneLayerData *sldata, 
Object *ob)
}
else {
Lamp *la = (Lamp *)ob->data;
-   EEVEE_LampEngineData *led = (EEVEE_LampEngineData 
*)DRW_lamp_engine_data_get(ob, _engine_viewport_eevee_type);
+   EEVEE_LampEngineData *led = eevee_get_lamp_engine_data(ob);
+
+   if ((ob->deg_update_flag & DEG_RUNTIME_DATA_UPDATE) != 0) {
+   led->need_update = true;
+   }
 
-   DRW_lamp_engine_data_free((void *)led);
+   MEM_SAFE_FREE(led->storage);
 
 #if 1 /* TODO Waiting for notified refresh. only on scene change. Else too 
much perf cost. */
if (la->mode & (LA_SHAD_BUF | LA_SHAD_RAY)) {
if 

[Bf-blender-cvs] [071315e21bf] blender2.8: DEG: Add per object update flag for Depsgraph.

2017-06-01 Thread Clément Foucault
Commit: 071315e21bfec253639237e1244f0cc9b3f31812
Author: Clément Foucault
Date:   Thu Jun 1 16:44:24 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB071315e21bfec253639237e1244f0cc9b3f31812

DEG: Add per object update flag for Depsgraph.

This is in order to communicate what portion of this object has changed.
For now it's just a bool, but it will be extended later.

===

M   source/blender/blenkernel/intern/object.c
M   source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M   source/blender/draw/intern/draw_manager.c
M   source/blender/makesdna/DNA_object_types.h

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index c24a6d3c791..9a2251b0f93 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -464,6 +464,8 @@ void BKE_object_free(Object *ob)
}
BLI_freelistN(>drawdata);
 
+   ob->deg_update_flag = 0;
+
BKE_sculptsession_free(ob);
 
BLI_freelistN(>pc_ids);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc 
b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 34abbf46ed7..46b70c40b78 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -191,6 +191,9 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
object->recalc |= 
OB_RECALC_DATA;
break;
}
+
+   /* TODO : replace with more granular 
flags */
+   object->deg_update_flag |= 
DEG_RUNTIME_DATA_UPDATE;
}
}
 
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index cf882717f8a..0c74b68402c 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2869,6 +2869,8 @@ void DRW_draw_render_loop(
DEG_OBJECT_ITER(graph, ob);
{
DRW_engines_cache_populate(ob);
+   /* XXX find a better place for this. maybe Depsgraph? */
+   ob->deg_update_flag = 0;
}
DEG_OBJECT_ITER_END
 
diff --git a/source/blender/makesdna/DNA_object_types.h 
b/source/blender/makesdna/DNA_object_types.h
index 72a21437b7d..397781110b4 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -324,8 +324,9 @@ typedef struct Object {
struct IDProperty *base_collection_properties; /* used by depsgraph, 
flushed from base */
 
ListBase drawdata;  /* runtime, ObjectEngineData */
+   int deg_update_flag; /* what has been updated in this object */
int base_selection_color; /* flushed by depsgraph only */
-   int pad3[3];
+   int pad3[2];
 } Object;
 
 /* Warning, this is not used anymore because hooks are now modifiers */
@@ -626,6 +627,11 @@ enum {
OB_DEPS_EXTRA_DATA_RECALC   = 1 << 1,
 };
 
+/* ob->deg_update_flag */
+enum {
+   DEG_RUNTIME_DATA_UPDATE = 1 << 0,
+};
+
 /* ob->scavisflag */
 enum {
OB_VIS_SENS = 1 << 0,

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


[Bf-blender-cvs] [46fc0bb87eb] blender2.8: Move custom transform orientations to workspace

2017-06-01 Thread Julian Eisel
Commit: 46fc0bb87ebda166d08b23cbcca799acb2c54158
Author: Julian Eisel
Date:   Thu Jun 1 20:41:18 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB46fc0bb87ebda166d08b23cbcca799acb2c54158

Move custom transform orientations to workspace

This commit moves the list of transform orientations from scenes to workspaces.
Main reasons for this are:
* Transform orientations are UI data and should not be stored in the scene.
* Introducion of workspaces caused some (expected) glitches with transform 
orientations. Mainly when removing one.
* Improves code.

More technically speaking, this commit does:
* Move list of custom transform orientations from Scene to WorkSpace struct.
* Store active transform orientation index separate from View3D.twmode (twmode 
can only be set to preprocessor defined values now).
* Display custom transform orientation name in header when transforming in it 
(used to show "global" which isn't really correct).

===

M   source/blender/blenkernel/BKE_screen.h
M   source/blender/blenkernel/BKE_workspace.h
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/screen.c
M   source/blender/blenkernel/intern/workspace.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/editors/include/ED_transform.h
M   source/blender/editors/screen/workspace_edit.c
M   source/blender/editors/transform/transform.c
M   source/blender/editors/transform/transform.h
M   source/blender/editors/transform/transform_constraints.c
M   source/blender/editors/transform/transform_generics.c
M   source/blender/editors/transform/transform_manipulator.c
M   source/blender/editors/transform/transform_ops.c
M   source/blender/editors/transform/transform_orientations.c
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesdna/DNA_screen_types.h
M   source/blender/makesdna/DNA_view3d_types.h
M   source/blender/makesdna/DNA_workspace_types.h
M   source/blender/makesrna/intern/rna_scene.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/makesrna/intern/rna_workspace.c
M   source/blenderplayer/bad_level_call_stubs/stubs.c

===

diff --git a/source/blender/blenkernel/BKE_screen.h 
b/source/blender/blenkernel/BKE_screen.h
index 645a99d592f..6ff344fea38 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -42,6 +42,7 @@ struct Panel;
 struct Scene;
 struct ScrArea;
 struct SpaceType;
+struct TransformOrientation;
 struct View3D;
 struct bContext;
 struct bContextDataResult;
@@ -53,6 +54,7 @@ struct wmManipulatorMap;
 struct wmNotifier;
 struct wmWindow;
 struct wmWindowManager;
+struct WorkSpace;
 struct GPUFXSettings;
 
 #include "BLI_compiler_attrs.h"
@@ -309,8 +311,9 @@ unsigned int BKE_screen_view3d_layer_all(const struct 
bScreen *sc) ATTR_WARN_UNU
 
 void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
 void BKE_screen_view3d_scene_sync(struct bScreen *sc, struct Scene *scene);
-void BKE_screen_view3d_twmode_remove(struct View3D *v3d, const int i);
-void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, struct Scene 
*scene, const int i);
+void BKE_screen_transform_orientation_remove(
+const struct bScreen *screen, const struct WorkSpace *workspace,
+const struct TransformOrientation *orientation) ATTR_NONNULL();
 void BKE_screen_gpu_fx_validate(struct GPUFXSettings *fx_settings);
 bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) 
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 bool BKE_screen_is_used(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT 
ATTR_NONNULL();
diff --git a/source/blender/blenkernel/BKE_workspace.h 
b/source/blender/blenkernel/BKE_workspace.h
index e7eaf72dd15..5595c874e27 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -28,6 +28,7 @@
 #include "BLI_compiler_attrs.h"
 
 struct bScreen;
+struct TransformOrientation;
 
 typedef struct WorkSpace WorkSpace;
 typedef struct WorkSpaceInstanceHook WorkSpaceInstanceHook;
@@ -66,11 +67,18 @@ void BKE_workspace_layout_remove(
 /*  */
 /* General Utils */
 
+void BKE_workspace_transform_orientation_remove(
+WorkSpace *workspace, struct TransformOrientation *orientation) 
ATTR_NONNULL();
+struct TransformOrientation *BKE_workspace_transform_orientation_find(
+const WorkSpace *workspace, const int index) ATTR_NONNULL();
+int BKE_workspace_transform_orientation_get_index(
+const WorkSpace *workspace, const struct TransformOrientation 
*orientation) ATTR_NONNULL();
+
 WorkSpaceLayout *BKE_workspace_layout_find(
 

[Bf-blender-cvs] [7f564d74f9e] blender2.8: Main Workspace Integration

2017-06-01 Thread Julian Eisel
Commit: 7f564d74f9edaaa41ce27c6e854869096f70b4da
Author: Julian Eisel
Date:   Thu Jun 1 19:56:58 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB7f564d74f9edaaa41ce27c6e854869096f70b4da

Main Workspace Integration

This commit does the main integration of workspaces, which is a design we 
agreed on during the 2.8 UI workshop (see 
https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)

Workspaces should generally be stable, I'm not aware of any remaining bugs (or 
I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in 
some cases, would consider that a limitation/ToDo. Needs to be resolved at some 
point.)

== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user 
configuration. Needs further work to allow adding and deleting individual 
workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts 
converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate 
Current" and the workspaces from the user configuration. If no workspaces are 
stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will 
enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the 
mode of the new workspace. (Note that we still store the active mode in the 
object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps 
quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every 
screen-layout of old files. Old Blender versions should be able to read files 
saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.

Opening files without UI and commandline rendering should work fine.

Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.

== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` 
API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display 
"Grease Pencil Edit" mode anymore since its availability depends on the active 
editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync 
with the mode of the active object. Will either be resolved by moving mode out 
of object data, or we'll disable workspace modes again (there's a `#define 
USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had 
to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within 
workspaces, too. On the long run we could completely replace `bScreen` by 
workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs 
and struct members as private. BKE_workspace API should be used for accessing 
those.
* Added scene operators `SCENE_OT_`. Was previously done through screen 
operators.

== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and 
`render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI 
(may differ from internal name)

== What's left?
* There are a few open design questions (T50521). We should find the needed 
answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration 
(needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden 
buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always 
appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)

Reviewed By: campbellbarton, mont29

Tags: #user_interface, #bf_blender_2.8

Maniphest Tasks: T50521

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

===

M   build_files/cmake/macros.cmake
M   

[Bf-blender-cvs] [778f4f310a9] workspaces: Merge branch 'blender2.8' into workspaces

2017-06-01 Thread Julian Eisel
Commit: 778f4f310a92cb0bdd1d2a3dd1f4a5879021730f
Author: Julian Eisel
Date:   Thu Jun 1 19:56:58 2017 +0200
Branches: workspaces
https://developer.blender.org/rB778f4f310a92cb0bdd1d2a3dd1f4a5879021730f

Merge branch 'blender2.8' into workspaces

===



===



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


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

2017-06-01 Thread Julian Eisel
Commit: 0af93cf1ac276456619fc2e903c52a97fd09b9fb
Author: Julian Eisel
Date:   Thu Jun 1 19:56:11 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB0af93cf1ac276456619fc2e903c52a97fd09b9fb

Merge branch 'master' into blender2.8

===



===



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


[Bf-blender-cvs] [2eba9397008] workspaces: Show alternative mode button when building without USE_WORKSPACE_MODE

2017-06-01 Thread Julian Eisel
Commit: 2eba93970088862ba80e1e82422e6fbd32b42196
Author: Julian Eisel
Date:   Thu Jun 1 19:21:03 2017 +0200
Branches: workspaces
https://developer.blender.org/rB2eba93970088862ba80e1e82422e6fbd32b42196

Show alternative mode button when building without USE_WORKSPACE_MODE

Gets active mode from active object, like old mode switcher.

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_info.py 
b/release/scripts/startup/bl_ui/space_info.py
index 9e63573b706..f05808c7a2c 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -31,6 +31,7 @@ class INFO_HT_header(Header):
 workspace = context.workspace
 screen = context.screen
 scene = context.scene
+layer = context.render_layer
 rd = scene.render
 
 row = layout.row(align=True)
@@ -49,7 +50,10 @@ class INFO_HT_header(Header):
 
 if hasattr(workspace, 'object_mode'):
 act_mode_item = 
bpy.types.Object.bl_rna.properties['mode'].enum_items[workspace.object_mode]
-layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
+else:
+act_mode_item = 
bpy.types.Object.bl_rna.properties['mode'].enum_items[layer.objects.active.mode]
+layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
+
 layout.template_search(workspace, "render_layer", scene, 
"render_layers")
 
 layout.separator()

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


[Bf-blender-cvs] [f3e5c728162] workspaces: Move version patches from blender2.8 into version-checked blocks

2017-06-01 Thread Julian Eisel
Commit: f3e5c728162e75690559fd94547784a4d4cf8e8f
Author: Julian Eisel
Date:   Thu Jun 1 18:17:22 2017 +0200
Branches: workspaces
https://developer.blender.org/rBf3e5c728162e75690559fd94547784a4d4cf8e8f

Move version patches from blender2.8 into version-checked blocks

Need to do that because of bumped subversion. Didn't do earlier to avoid
merge conflicts.

===

M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/editors/interface/resources.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index b168ecad832..2d14238eb6f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -297,11 +297,9 @@ void do_versions_after_linking_280(Main *main)
}
}
 
-   {
-   /* New workspace design */
-   if (!MAIN_VERSION_ATLEAST(main, 280, 1)) {
-   do_version_workspaces_after_lib_link(main);
-   }
+   /* New workspace design */
+   if (!MAIN_VERSION_ATLEAST(main, 280, 1)) {
+   do_version_workspaces_after_lib_link(main);
}
 }
 
@@ -344,34 +342,35 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *main)
}
}
}
-
}
 
-   if (!DNA_struct_elem_find(fd->filesdna, "GPUDOFSettings", "float", 
"ratio")){
-   for (Camera *ca = main->camera.first; ca; ca = ca->id.next) {
-   ca->gpu_dof.ratio = 1.0f;
+   if (!MAIN_VERSION_ATLEAST(main, 280, 1)) {
+   if (!DNA_struct_elem_find(fd->filesdna, "GPUDOFSettings", 
"float", "ratio")){
+   for (Camera *ca = main->camera.first; ca; ca = 
ca->id.next) {
+   ca->gpu_dof.ratio = 1.0f;
+   }
}
-   }
 
-   if (!DNA_struct_elem_find(fd->filesdna, "SceneLayer", "IDProperty", 
"*properties")) {
-   for (Scene *scene = main->scene.first; scene; scene = 
scene->id.next) {
-   for (SceneLayer *sl = scene->render_layers.first; sl; 
sl = sl->next) {
-   IDPropertyTemplate val = {0};
-   sl->properties = IDP_New(IDP_GROUP, , 
ROOT_PROP);
-   
BKE_scene_layer_engine_settings_create(sl->properties);
+   if (!DNA_struct_elem_find(fd->filesdna, "SceneLayer", 
"IDProperty", "*properties")) {
+   for (Scene *scene = main->scene.first; scene; scene = 
scene->id.next) {
+   for (SceneLayer *sl = 
scene->render_layers.first; sl; sl = sl->next) {
+   IDPropertyTemplate val = {0};
+   sl->properties = IDP_New(IDP_GROUP, 
, ROOT_PROP);
+   
BKE_scene_layer_engine_settings_create(sl->properties);
+   }
}
}
-   }
 
-   /* MTexPoly now removed. */
-   if (DNA_struct_find(fd->filesdna, "MTexPoly")) {
-   const int cd_mtexpoly = 15;  /* CD_MTEXPOLY, deprecated */
-   for (Mesh *me = main->mesh.first; me; me = me->id.next) {
-   /* If we have UV's, so this file will have MTexPoly 
layers too! */
-   if (me->mloopuv != NULL) {
-   CustomData_update_typemap(>pdata);
-   CustomData_free_layers(>pdata, cd_mtexpoly, 
me->totpoly);
-   BKE_mesh_update_customdata_pointers(me, false);
+   /* MTexPoly now removed. */
+   if (DNA_struct_find(fd->filesdna, "MTexPoly")) {
+   const int cd_mtexpoly = 15;  /* CD_MTEXPOLY, deprecated 
*/
+   for (Mesh *me = main->mesh.first; me; me = me->id.next) 
{
+   /* If we have UV's, so this file will have 
MTexPoly layers too! */
+   if (me->mloopuv != NULL) {
+   CustomData_update_typemap(>pdata);
+   CustomData_free_layers(>pdata, 
cd_mtexpoly, me->totpoly);
+   BKE_mesh_update_customdata_pointers(me, 
false);
+   }
}
}
}
diff --git a/source/blender/editors/interface/resources.c 
b/source/blender/editors/interface/resources.c
index e8eda567a4a..09ec08fe265 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2899,13 +2899,7 @@ void init_userdef_do_versions(void)

[Bf-blender-cvs] [71ac1667d59] workspaces: Merge branch 'blender2.8' into workspaces

2017-06-01 Thread Julian Eisel
Commit: 71ac1667d596a7e1c3c27bb0cfcf0744ba54174c
Author: Julian Eisel
Date:   Thu Jun 1 16:50:15 2017 +0200
Branches: workspaces
https://developer.blender.org/rB71ac1667d596a7e1c3c27bb0cfcf0744ba54174c

Merge branch 'blender2.8' into workspaces

===



===



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


[Bf-blender-cvs] [f85893fb967] workspaces: Fix layout cycling not working

2017-06-01 Thread Julian Eisel
Commit: f85893fb967fcd3576291e92a75a6f86ed32d678
Author: Julian Eisel
Date:   Thu Jun 1 17:41:14 2017 +0200
Branches: workspaces
https://developer.blender.org/rBf85893fb967fcd3576291e92a75a6f86ed32d678

Fix layout cycling not working

Also added comment for layout iterator.

===

M   source/blender/blenkernel/intern/workspace.c
M   source/blender/editors/screen/workspace_layout_edit.c

===

diff --git a/source/blender/blenkernel/intern/workspace.c 
b/source/blender/blenkernel/intern/workspace.c
index 12bfedff6d2..8afad317dce 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -207,7 +207,7 @@ WorkSpaceLayout *BKE_workspace_layout_add(
BLI_assert(!workspaces_is_screen_used(G.main, screen));
layout->screen = screen;
workspace_layout_name_set(workspace, layout, name);
-   BLI_addhead(>layouts, layout);
+   BLI_addtail(>layouts, layout);
 
return layout;
 }
@@ -266,6 +266,14 @@ WorkSpaceLayout *BKE_workspace_layout_find_global(
return NULL;
 }
 
+/**
+ * Circular workspace layout iterator.
+ *
+ * \param callback: Custom function which gets executed for each layout. Can 
return false to stop iterating.
+ * \param arg: Custom data passed to each \a callback call.
+ *
+ * \return the layout at which \a callback returned false.
+ */
 WorkSpaceLayout *BKE_workspace_layout_iter_circular(
 const WorkSpace *workspace, WorkSpaceLayout *start,
 bool (*callback)(const WorkSpaceLayout *layout, void *arg),
diff --git a/source/blender/editors/screen/workspace_layout_edit.c 
b/source/blender/editors/screen/workspace_layout_edit.c
index 39f8170eb9a..e4dd841f833 100644
--- a/source/blender/editors/screen/workspace_layout_edit.c
+++ b/source/blender/editors/screen/workspace_layout_edit.c
@@ -105,7 +105,7 @@ bool workspace_layout_set_poll(const WorkSpaceLayout 
*layout)
return ((BKE_screen_is_used(screen) == false) &&
/* in typical usage temp screens should have a nonzero winid
 * (all temp screens should be used, or closed & freed). */
-   (screen->temp == false) &
+   (screen->temp == false) &&
(BKE_screen_is_fullscreen_area(screen) == false) &&
(screen->id.name[2] != '.' || !(U.uiflag & USER_HIDE_DOT)));
 }
@@ -160,7 +160,8 @@ bool ED_workspace_layout_delete(
 
 static bool workspace_layout_cycle_iter_cb(const WorkSpaceLayout *layout, void 
*UNUSED(arg))
 {
-   return workspace_layout_set_poll(layout);
+   /* return false to stop iterator when we have found a layout to 
activate */
+   return !workspace_layout_set_poll(layout);
 }
 
 bool ED_workspace_layout_cycle(

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


[Bf-blender-cvs] [020bbbb046d] master: Remove comment (missed last commit)

2017-06-01 Thread Campbell Barton
Commit: 020046d9d7a6fea58b3cbb06c2a977d01454
Author: Campbell Barton
Date:   Fri Jun 2 01:10:34 2017 +1000
Branches: master
https://developer.blender.org/rB020046d9d7a6fea58b3cbb06c2a977d01454

Remove comment (missed last commit)

===

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

===

diff --git a/source/blender/editors/transform/transform_conversions.c 
b/source/blender/editors/transform/transform_conversions.c
index 81687a6da12..071800a87d1 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2469,11 +2469,6 @@ static void createTransEditVerts(TransInfo *t)
editmesh_set_connectivity_distance(em->bm, mtx, dists, 
dists_index);
}
 
-   /* Only in case of rotation and resize, we want the elements of the 
edited
-* object to behave as groups whose pivot are the individual origins
-*
-* TODO: use island_info to detect the closest point when the "Snap 
Target"
-* in Blender UI is "Closest" */
if (is_island_center) {
/* In this specific case, near-by vertices will need to know 
the island of the nearest connected vertex. */
const bool calc_single_islands = (

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


[Bf-blender-cvs] [3be073807bd] master: Fix T51651: translate w/ individual origins fails

2017-06-01 Thread Campbell Barton
Commit: 3be073807bd7a5c2e2d55d92539afce7916bd382
Author: Campbell Barton
Date:   Fri Jun 2 01:04:11 2017 +1000
Branches: master
https://developer.blender.org/rB3be073807bd7a5c2e2d55d92539afce7916bd382

Fix T51651: translate w/ individual origins fails

Regression in fix for T46892

===

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

===

diff --git a/source/blender/editors/transform/transform_conversions.c 
b/source/blender/editors/transform/transform_conversions.c
index 04b9ae75c8f..81687a6da12 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2402,7 +2402,8 @@ static void createTransEditVerts(TransInfo *t)
int island_info_tot;
int *island_vert_map = NULL;
 
-   const bool is_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS) 
&& (t->mode != TFM_TRANSLATION);
+   /* Even for translation this is needed because of island-orientation, 
see: T51651. */
+   const bool is_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS);
/* Original index of our connected vertex when connected distances are 
calculated.
 * Optional, allocate if needed. */
int *dists_index = NULL;

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


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

2017-06-01 Thread Sergey Sharybin
Commit: 237e17a957ea16d4f326f8babfdb49b8d954e529
Author: Sergey Sharybin
Date:   Thu Jun 1 16:31:56 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB237e17a957ea16d4f326f8babfdb49b8d954e529

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index e4b5fd6ffec,1e51b8131e4..eb8b175a423
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -349,45 -317,25 +314,10 @@@ void DepsgraphNodeBuilder::build_group(
}
  }
  
- SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
- {
-   /* sanity checks */
-   if (!group)
-   return NULL;
- 
-   /* create new subgraph's data */
-   Depsgraph *subgraph = reinterpret_cast(DEG_graph_new());
- 
-   DepsgraphNodeBuilder subgraph_builder(m_bmain, subgraph);
- 
-   /* add group objects */
-   LINKLIST_FOREACH (GroupObject *, go, >gobject) {
-   /*Object *ob = go->ob;*/
- 
-   /* Each "group object" is effectively a separate instance of the
-* underlying object data. When the group is evaluated, the 
transform
-* results and/or some other attributes end up getting 
overridden by
-* the group.
-*/
-   }
- 
-   /* Create a node for representing subgraph. */
-   SubgraphDepsNode *subgraph_node = 
m_graph->add_subgraph_node(>id);
-   subgraph_node->graph = subgraph;
- 
-   /* Make a copy of the data this node will need? */
-   /* XXX: do we do this now, or later? */
-   /* TODO: need API function which queries graph's ID's hash, and 
duplicates
-* those blocks thoroughly with all outside links removed.
-*/
- 
-   return subgraph_node;
- }
- 
 -void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 +void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
  {
 -  const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
 -  IDDepsNode *id_node = (has_object)
 -  ? m_graph->find_id_node(>id)
 -  : add_id_node(>id);
 -  /* Update node layers.
 -   * Do it for both new and existing ID nodes. This is so because several
 -   * bases might be sharing same object.
 -   */
 -  if (base != NULL) {
 -  id_node->layers |= base->lay;
 -  }
 -  if (ob == scene->camera) {
 -  /* Camera should always be updated, it used directly by 
viewport. */
 -  id_node->layers |= (unsigned int)(-1);
 -  }
/* Skip rest of components if the ID node was already there. */
 -  if (has_object) {
 +  if (ob->id.tag & LIB_TAG_DOIT) {
return;
}
ob->id.tag |= LIB_TAG_DOIT;
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index b6279ed4217,ba8a5d01cb0..83a4dfda8a5
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@@ -125,9 -121,8 +121,8 @@@ struct DepsgraphNodeBuilder 
   int name_tag = -1);
  
void build_scene(Main *bmain, Scene *scene);
-   SubgraphDepsNode *build_subgraph(Group *group);
 -  void build_group(Scene *scene, Base *base, Group *group);
 -  void build_object(Scene *scene, Base *base, Object *ob);
 +  void build_group(Scene *scene, Group *group);
 +  void build_object(Scene *scene, Object *ob);
void build_object_transform(Scene *scene, Object *ob);
void build_object_constraints(Scene *scene, Object *ob);
void build_pose_constraints(Scene *scene, Object *ob, bPoseChannel 
*pchan);
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
index 9fd59608d9e,000..e419b72fee8
mode 100644,00..100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
@@@ -1,120 -1,0 +1,117 @@@
 +/*
 + * * BEGIN GPL LICENSE BLOCK *
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, 

[Bf-blender-cvs] [a72daea36eb] master: Depsgraph: use explicit marking of component entry/exit operations

2017-06-01 Thread Sergey Sharybin
Commit: a72daea36eb1585c5e4d7b6911381c53b480b055
Author: Sergey Sharybin
Date:   Thu Jun 1 16:04:35 2017 +0200
Branches: master
https://developer.blender.org/rBa72daea36eb1585c5e4d7b6911381c53b480b055

Depsgraph: use explicit marking of component entry/exit operations

This isn't used too often, and haivng such API will let us to skip
specifying operation type for all oeprations.

===

M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.h
M   source/blender/depsgraph/intern/nodes/deg_node_operation.cc
M   source/blender/depsgraph/intern/nodes/deg_node_operation.h

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 3330795d053..78d0b2b323e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -446,10 +446,13 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, 
Base *base, Object *ob)
 
 void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 {
+   OperationDepsNode *op_node;
+
/* local transforms (from transform channels - loc/rot/scale + deltas) 
*/
-   add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
+   op_node = add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
   DEPSOP_TYPE_INIT, 
function_bind(BKE_object_eval_local_transform, _1, scene, ob),
   DEG_OPCODE_TRANSFORM_LOCAL);
+   op_node->set_as_entry();
 
/* object parent */
if (ob->parent) {
@@ -475,9 +478,10 @@ void DepsgraphNodeBuilder::build_object_transform(Scene 
*scene, Object *ob)
   DEG_OPCODE_OBJECT_UBEREVAL);
 
/* object transform is done */
-   add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
+   op_node = add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
   DEPSOP_TYPE_POST, 
function_bind(BKE_object_eval_done, _1, ob),
   DEG_OPCODE_TRANSFORM_FINAL);
+   op_node->set_as_exit();
 }
 
 /**
@@ -735,18 +739,20 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key)
 void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 {
ID *obdata = (ID *)ob->data;
+   OperationDepsNode *op_node;
 
/* TODO(sergey): This way using this object's properties as driver 
target
 * works fine.
 *
 * Does this depend on other nodes?
 */
-   add_operation_node(>id,
+   op_node = add_operation_node(>id,
   DEG_NODE_TYPE_PARAMETERS,
   DEPSOP_TYPE_POST,
   NULL,
   DEG_OPCODE_PLACEHOLDER,
   "Parameters Eval");
+   op_node->set_as_exit();
 
/* Temporary uber-update node, which does everything.
 * It is for the being we're porting old dependencies into the new 
system.
@@ -755,18 +761,20 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene 
*scene, Object *ob)
 *
 * TODO(sergey): Get rid of this node.
 */
-   add_operation_node(>id,
+   op_node = add_operation_node(>id,
   DEG_NODE_TYPE_GEOMETRY,
   DEPSOP_TYPE_POST,
   function_bind(BKE_object_eval_uber_data, _1, scene, 
ob),
   DEG_OPCODE_GEOMETRY_UBEREVAL);
+   op_node->set_as_exit();
 
-   add_operation_node(>id,
+   op_node = add_operation_node(>id,
   DEG_NODE_TYPE_GEOMETRY,
   DEPSOP_TYPE_INIT,
   NULL,
   DEG_OPCODE_PLACEHOLDER,
   "Eval Init");
+   op_node->set_as_entry();
 
// TODO: "Done" operation
 
@@ -821,7 +829,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
//Mesh *me = (Mesh *)ob->data;
 
/* evaluation operations */
-   add_operation_node(obdata,
+   op_node = add_operation_node(obdata,
   DEG_NODE_TYPE_GEOMETRY,
   DEPSOP_TYPE_INIT,
   function_bind(BKE_mesh_eval_geometry,
@@ -829,6 +837,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
 (Mesh *)obdata),
   DEG_OPCODE_PLACEHOLDER,
   

[Bf-blender-cvs] [e5d8b04abe0] master: Depsgraph: Cleanup, line wraps after shortening API

2017-06-01 Thread Sergey Sharybin
Commit: e5d8b04abe0524ea31c1ef158a0cfba83e739b04
Author: Sergey Sharybin
Date:   Thu Jun 1 16:20:48 2017 +0200
Branches: master
https://developer.blender.org/rBe5d8b04abe0524ea31c1ef158a0cfba83e739b04

Depsgraph: Cleanup, line wraps after shortening API

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index d2188c94027..736766b5491 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -404,9 +404,7 @@ void DepsgraphRelationBuilder::build_group(Main *bmain,
build_object(bmain, scene, go->ob);
}
ComponentKey dupli_transform_key(>ob->id, 
DEG_NODE_TYPE_TRANSFORM);
-   add_relation(dupli_transform_key,
-object_local_transform_key,
-"Dupligroup");
+   add_relation(dupli_transform_key, object_local_transform_key, 
"Dupligroup");
}
group_id->tag |= LIB_TAG_DOIT;
 }
@@ -434,9 +432,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, 
Scene *scene, Object *o
build_object_parent(ob);
 
/* local -> parent */
-   add_relation(local_transform_key,
-parent_transform_key,
-"[ObLocal -> ObParent]");
+   add_relation(local_transform_key, parent_transform_key, 
"[ObLocal -> ObParent]");
}
 
if (ob->modifiers.first != NULL) {
@@ -471,20 +467,12 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, 
Scene *scene, Object *o
  NULL);
 
/* operation order */
-   add_relation(base_op_key,
-constraint_key,
-"[ObBase-> Constraint Stack]");
-   add_relation(constraint_key,
-final_transform_key,
-"[ObConstraints -> Done]");
+   add_relation(base_op_key, constraint_key, "[ObBase-> Constraint 
Stack]");
+   add_relation(constraint_key, final_transform_key, 
"[ObConstraints -> Done]");
 
// XXX
-   add_relation(constraint_key,
-ob_ubereval_key,
-"Temp Ubereval");
-   add_relation(ob_ubereval_key,
-final_transform_key,
-"Temp Ubereval");
+   add_relation(constraint_key, ob_ubereval_key, "Temp Ubereval");
+   add_relation(ob_ubereval_key, final_transform_key, "Temp 
Ubereval");
}
else {
/* NOTE: Keep an eye here, we skip some relations here to 
"streamline"
@@ -495,28 +483,20 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, 
Scene *scene, Object *o
/* Rigid body will hook up another node inbetween, so 
skip
 * relation here to avoid transitive relation.
 */
-   add_relation(base_op_key,
-ob_ubereval_key,
-"Temp Ubereval");
+   add_relation(base_op_key, ob_ubereval_key, "Temp 
Ubereval");
}
-   add_relation(ob_ubereval_key,
-final_transform_key,
-"Temp Ubereval");
+   add_relation(ob_ubereval_key, final_transform_key, "Temp 
Ubereval");
}
 
-
/* AnimData */
build_animdata(>id);
 
// XXX: This should be hooked up by the build_animdata code
if (needs_animdata_node(>id)) {
ComponentKey adt_key(>id, DEG_NODE_TYPE_ANIMATION);
-   add_relation(adt_key,
-local_transform_key,
-"Object Animation");
+   add_relation(adt_key, local_transform_key, "Object Animation");
}
 
-
/* object data */
if (ob->data) {
ID *obdata_id = (ID *)ob->data;
@@ -559,9 +539,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, 
Scene *scene, Object *o
if (key != NULL) {
ComponentKey geometry_key((ID *)ob->data, 
DEG_NODE_TYPE_GEOMETRY);
ComponentKey key_key(>id, DEG_NODE_TYPE_GEOMETRY);
-   add_relation(key_key,
-geometry_key,
-"Shapekeys");
+   

[Bf-blender-cvs] [df7d38c1112] master: Depsgraph: Remove operation types enum

2017-06-01 Thread Sergey Sharybin
Commit: df7d38c11127cc1ab84c32db645c72b870fe1a40
Author: Sergey Sharybin
Date:   Thu Jun 1 16:15:23 2017 +0200
Branches: master
https://developer.blender.org/rBdf7d38c11127cc1ab84c32db645c72b870fe1a40

Depsgraph: Remove operation types enum

Was only used to indicate entry/exit operation of component,
which is now done explicitly. No reason to keep something which
is unused and confusing.

===

M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/nodes/deg_node_component.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.h
M   source/blender/depsgraph/intern/nodes/deg_node_operation.h

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 78d0b2b323e..1e51b8131e4 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -193,7 +193,6 @@ ComponentDepsNode *DepsgraphNodeBuilder::add_component_node(
 
 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
 ComponentDepsNode *comp_node,
-eDepsOperation_Type optype,
 DepsEvalOperationCb op,
 eDepsOperation_Code opcode,
 const char *name,
@@ -203,7 +202,7 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
  name,
  name_tag);
if (op_node == NULL) {
-   op_node = comp_node->add_operation(optype, op, opcode, name, 
name_tag);
+   op_node = comp_node->add_operation(op, opcode, name, name_tag);
m_graph->operations.push_back(op_node);
}
else {
@@ -221,20 +220,18 @@ OperationDepsNode 
*DepsgraphNodeBuilder::add_operation_node(
 ID *id,
 eDepsNode_Type comp_type,
 const char *comp_name,
-eDepsOperation_Type optype,
 DepsEvalOperationCb op,
 eDepsOperation_Code opcode,
 const char *name,
 int name_tag)
 {
ComponentDepsNode *comp_node = add_component_node(id, comp_type, 
comp_name);
-   return add_operation_node(comp_node, optype, op, opcode, name, 
name_tag);
+   return add_operation_node(comp_node, op, opcode, name, name_tag);
 }
 
 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
 ID *id,
 eDepsNode_Type comp_type,
-eDepsOperation_Type optype,
 DepsEvalOperationCb op,
 eDepsOperation_Code opcode,
 const char *name,
@@ -243,7 +240,6 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
return add_operation_node(id,
  comp_type,
  "",
- optype,
  op,
  opcode,
  name,
@@ -450,14 +446,14 @@ void DepsgraphNodeBuilder::build_object_transform(Scene 
*scene, Object *ob)
 
/* local transforms (from transform channels - loc/rot/scale + deltas) 
*/
op_node = add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
-  DEPSOP_TYPE_INIT, 
function_bind(BKE_object_eval_local_transform, _1, scene, ob),
+  function_bind(BKE_object_eval_local_transform, _1, 
scene, ob),
   DEG_OPCODE_TRANSFORM_LOCAL);
op_node->set_as_entry();
 
/* object parent */
if (ob->parent) {
add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
-  DEPSOP_TYPE_EXEC, 
function_bind(BKE_object_eval_parent, _1, scene, ob),
+  function_bind(BKE_object_eval_parent, _1, 
scene, ob),
   DEG_OPCODE_TRANSFORM_PARENT);
}
 
@@ -474,13 +470,13 @@ void DepsgraphNodeBuilder::build_object_transform(Scene 
*scene, Object *ob)
 * TODO(sergey): Get rid of this node.
 */
add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
-  DEPSOP_TYPE_EXEC, 
function_bind(BKE_object_eval_uber_transform, _1, scene, ob),
+  function_bind(BKE_object_eval_uber_transform, _1, 
scene, ob),
   DEG_OPCODE_OBJECT_UBEREVAL);
 
/* object transform is done */
op_node = add_operation_node(>id, DEG_NODE_TYPE_TRANSFORM,
-  DEPSOP_TYPE_POST, 
function_bind(BKE_object_eval_done, _1, ob),
-  DEG_OPCODE_TRANSFORM_FINAL);
+ 

[Bf-blender-cvs] [3a7361ec395] master: Depsgraph: Cleanup, use DEG_NODE_CLASS prefix for node classes

2017-06-01 Thread Sergey Sharybin
Commit: 3a7361ec395293477bb395832459339348fb8e8b
Author: Sergey Sharybin
Date:   Thu Jun 1 15:42:53 2017 +0200
Branches: master
https://developer.blender.org/rB3a7361ec395293477bb395832459339348fb8e8b

Depsgraph: Cleanup, use DEG_NODE_CLASS prefix for node classes

===

M   source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/nodes/deg_node.cc

===

diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc 
b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
index 8cc9634f1a3..8da3e097d07 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
@@ -114,9 +114,9 @@ static int deg_debug_node_color_index(const DepsNode *node)
}
/* Do others based on class. */
switch (node->tclass) {
-   case DEPSNODE_CLASS_OPERATION:
+   case DEG_NODE_CLASS_OPERATION:
return 4;
-   case DEPSNODE_CLASS_COMPONENT:
+   case DEG_NODE_CLASS_COMPONENT:
return 1;
default:
return 9;
@@ -200,7 +200,7 @@ static void deg_debug_graphviz_node_color(const 
DebugContext ,
const char *color_update = "dodgerblue3";
const char *color = color_default;
if (ctx.show_tags) {
-   if (node->tclass == DEPSNODE_CLASS_OPERATION) {
+   if (node->tclass == DEG_NODE_CLASS_OPERATION) {
OperationDepsNode *op_node = (OperationDepsNode *)node;
if (op_node->flag & DEPSOP_FLAG_DIRECTLY_MODIFIED) {
color = color_modified;
@@ -221,7 +221,7 @@ static void deg_debug_graphviz_node_penwidth(const 
DebugContext ,
float penwidth_update = 4.0f;
float penwidth = penwidth_default;
if (ctx.show_tags) {
-   if (node->tclass == DEPSNODE_CLASS_OPERATION) {
+   if (node->tclass == DEG_NODE_CLASS_OPERATION) {
OperationDepsNode *op_node = (OperationDepsNode *)node;
if (op_node->flag & DEPSOP_FLAG_DIRECTLY_MODIFIED) {
penwidth = penwidth_modified;
@@ -259,7 +259,7 @@ static void deg_debug_graphviz_node_style(const 
DebugContext , const DepsNod
 {
const char *base_style = "filled"; /* default style */
if (ctx.show_tags) {
-   if (node->tclass == DEPSNODE_CLASS_OPERATION) {
+   if (node->tclass == DEG_NODE_CLASS_OPERATION) {
OperationDepsNode *op_node = (OperationDepsNode *)node;
if (op_node->flag & (DEPSOP_FLAG_DIRECTLY_MODIFIED | 
DEPSOP_FLAG_NEEDS_UPDATE)) {
base_style = "striped";
@@ -267,13 +267,13 @@ static void deg_debug_graphviz_node_style(const 
DebugContext , const DepsNod
}
}
switch (node->tclass) {
-   case DEPSNODE_CLASS_GENERIC:
+   case DEG_NODE_CLASS_GENERIC:
deg_debug_fprintf(ctx, "\"%s\"", base_style);
break;
-   case DEPSNODE_CLASS_COMPONENT:
+   case DEG_NODE_CLASS_COMPONENT:
deg_debug_fprintf(ctx, "\"%s\"", base_style);
break;
-   case DEPSNODE_CLASS_OPERATION:
+   case DEG_NODE_CLASS_OPERATION:
deg_debug_fprintf(ctx, "\"%s,rounded\"", base_style);
break;
}
@@ -291,7 +291,7 @@ static void deg_debug_graphviz_node_single(const 
DebugContext ,
BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", 
id_node->layers);
name += buf;
}
-   if (ctx.show_eval_priority && node->tclass == DEPSNODE_CLASS_OPERATION) 
{
+   if (ctx.show_eval_priority && node->tclass == DEG_NODE_CLASS_OPERATION) 
{
priority = ((OperationDepsNode *)node)->eval_priority;
}
deg_debug_fprintf(ctx, "// %s\n", name.c_str());
@@ -439,14 +439,14 @@ static bool deg_debug_graphviz_is_owner(const DepsNode 
*node,
 const DepsNode *other)
 {
switch (node->tclass) {
-   case DEPSNODE_CLASS_COMPONENT:
+   case DEG_NODE_CLASS_COMPONENT:
{
ComponentDepsNode *comp_node = (ComponentDepsNode 
*)node;
if (comp_node->owner == other)
return true;
break;
}
-   case DEPSNODE_CLASS_OPERATION:
+   case DEG_NODE_CLASS_OPERATION:
{
OperationDepsNode *op_node = 

[Bf-blender-cvs] [5bda458bce5] master: Depsgraph: Remove unused argument from time source query

2017-06-01 Thread Sergey Sharybin
Commit: 5bda458bce54d66da44ceb72202d9a2a36b12df3
Author: Sergey Sharybin
Date:   Thu Jun 1 15:38:15 2017 +0200
Branches: master
https://developer.blender.org/rB5bda458bce54d66da44ceb72202d9a2a36b12df3

Depsgraph: Remove unused argument from time source query

===

M   source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_debug.cc

===

diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc 
b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
index 3df4ee0c3dd..96325fb3822 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
@@ -506,7 +506,7 @@ static void deg_debug_graphviz_graph_nodes(const 
DebugContext ,
deg_debug_graphviz_node(ctx, node);
}
GHASH_FOREACH_END();
-   TimeSourceDepsNode *time_source = graph->find_time_source(NULL);
+   TimeSourceDepsNode *time_source = graph->find_time_source();
if (time_source != NULL) {
deg_debug_graphviz_node(ctx, time_source);
}
@@ -527,7 +527,7 @@ static void deg_debug_graphviz_graph_relations(const 
DebugContext ,
}
GHASH_FOREACH_END();
 
-   TimeSourceDepsNode *time_source = graph->find_time_source(NULL);
+   TimeSourceDepsNode *time_source = graph->find_time_source();
if (time_source != NULL) {
deg_debug_graphviz_node_relations(ctx, time_source);
}
diff --git a/source/blender/depsgraph/intern/depsgraph.cc 
b/source/blender/depsgraph/intern/depsgraph.cc
index 808e3f80bef..30146544b76 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -269,25 +269,10 @@ RootDepsNode *Depsgraph::add_root_node()
return root_node;
 }
 
-TimeSourceDepsNode *Depsgraph::find_time_source(const ID *id) const
+TimeSourceDepsNode *Depsgraph::find_time_source() const
 {
-   /* Search for one attached to a particular ID? */
-   if (id) {
-   /* Check if it was added as a component
-* (as may be done for subgraphs needing timeoffset).
-*/
-   IDDepsNode *id_node = find_id_node(id);
-   if (id_node) {
-   // XXX: review this
-// return 
id_node->find_component(DEPSNODE_TYPE_TIMESOURCE);
-   }
-   BLI_assert(!"Not implemented yet");
-   }
-   else {
-   /* Use "official" timesource. */
-   return root_node->time_source;
-   }
-   return NULL;
+   BLI_assert(root_node != NULL);
+   return root_node->time_source;
 }
 
 IDDepsNode *Depsgraph::find_id_node(const ID *id) const
diff --git a/source/blender/depsgraph/intern/depsgraph.h 
b/source/blender/depsgraph/intern/depsgraph.h
index 8622d378472..1c9ba8c4cb1 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -110,7 +110,7 @@ struct Depsgraph {
 
RootDepsNode *add_root_node();
 
-   TimeSourceDepsNode *find_time_source(const ID *id = NULL) const;
+   TimeSourceDepsNode *find_time_source() const;
 
IDDepsNode *find_id_node(const ID *id) const;
IDDepsNode *add_id_node(ID *id, const char *name = "");
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc 
b/source/blender/depsgraph/intern/depsgraph_debug.cc
index d3b48930779..0a8a57ae09f 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -232,7 +232,7 @@ void DEG_stats_simple(const Depsgraph *graph, size_t 
*r_outer,
}
GHASH_FOREACH_END();
 
-   DEG::TimeSourceDepsNode *time_source = 
deg_graph->find_time_source(NULL);
+   DEG::TimeSourceDepsNode *time_source = 
deg_graph->find_time_source();
if (time_source != NULL) {
tot_rels += time_source->inlinks.size();
}

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


[Bf-blender-cvs] [a13aa12d7c0] master: Depsgraph: Remove dead code from add_time_source()

2017-06-01 Thread Sergey Sharybin
Commit: a13aa12d7c002ecddc42dcae9135064fe3178b24
Author: Sergey Sharybin
Date:   Thu Jun 1 15:06:05 2017 +0200
Branches: master
https://developer.blender.org/rBa13aa12d7c002ecddc42dcae9135064fe3178b24

Depsgraph: Remove dead code from add_time_source()

This was never finished or done or used, no reason to keep it.
Better to simplify things before adding complexity of overrides
and copy-on-write.

===

M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 49ebdc8b8ac..03e6fa4d9e8 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -170,44 +170,13 @@ IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id)
return m_graph->add_id_node(id, id->name);
 }
 
-TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source(ID *id)
+TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source()
 {
-   /* determine which node to attach timesource to */
-   if (id) {
-#if 0 /* XXX TODO */
-   /* get ID node */
-   IDDepsNode id_node = m_graph->find_id_node(id);
-
-   /* depends on what this is... */
-   switch (GS(id->name)) {
-   case ID_SCE: /* Scene - Usually sequencer strip causing 
time remapping... */
-   {
-   // TODO...
-   }
-   break;
-
-   case ID_GR: /* Group */
-   {
-   // TODO...
-   }
-   break;
-
-   // XXX: time source...
-
-   default: /* Unhandled */
-   printf("%s(): Unhandled ID - %s \n", __func__, 
id->name);
-   break;
-   }
-#endif
+   /* root-node */
+   RootDepsNode *root_node = m_graph->root_node;
+   if (root_node != NULL) {
+   return root_node->add_time_source("Time Source");
}
-   else {
-   /* root-node */
-   RootDepsNode *root_node = m_graph->root_node;
-   if (root_node) {
-   return root_node->add_time_source("Time Source");
-   }
-   }
-
return NULL;
 }
 
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 745f8283328..93a8c6c6015 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -76,7 +76,7 @@ struct DepsgraphNodeBuilder {
 
RootDepsNode *add_root_node();
IDDepsNode *add_id_node(ID *id);
-   TimeSourceDepsNode *add_time_source(ID *id);
+   TimeSourceDepsNode *add_time_source();
 
ComponentDepsNode *add_component_node(ID *id,
  eDepsNode_Type comp_type,
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
index 7dd694cb570..d7ae10421df 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
@@ -69,7 +69,7 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene 
*scene)
add_id_node(>id);
 
/* timesource */
-   add_time_source(NULL);
+   add_time_source();
 
/* build subgraph for set, and link this in... */
// XXX: depending on how this goes, that scene itself could probably 
store its

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


[Bf-blender-cvs] [6799fb387db] master: Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types

2017-06-01 Thread Sergey Sharybin
Commit: 6799fb387db89ad1f4fc6a5137a12665d29df785
Author: Sergey Sharybin
Date:   Thu Jun 1 15:40:02 2017 +0200
Branches: master
https://developer.blender.org/rB6799fb387db89ad1f4fc6a5137a12665d29df785

Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types

===

M   source/blender/depsgraph/intern/builder/deg_builder.cc
M   source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
M   source/blender/depsgraph/intern/builder/deg_builder_transitive.cc
M   source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_debug.cc
M   source/blender/depsgraph/intern/depsgraph_tag.cc
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/eval/deg_eval.cc
M   source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M   source/blender/depsgraph/intern/nodes/deg_node.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.cc
M   source/blender/depsgraph/intern/nodes/deg_node_operation.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc 
b/source/blender/depsgraph/intern/builder/deg_builder.cc
index 143f9908db8..55caad91b4e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -79,7 +79,7 @@ void deg_graph_build_flush_layers(Depsgraph *graph)
node->done = 0;
node->num_links_pending = 0;
foreach (DepsRelation *rel, node->outlinks) {
-   if ((rel->from->type == DEPSNODE_TYPE_OPERATION) &&
+   if ((rel->from->type == DEG_NODE_TYPE_OPERATION) &&
(rel->flag & DEPSREL_FLAG_CYCLIC) == 0)
{
++node->num_links_pending;
@@ -97,14 +97,14 @@ void deg_graph_build_flush_layers(Depsgraph *graph)
BLI_stack_pop(stack, );
/* Flush layers to parents. */
foreach (DepsRelation *rel, node->inlinks) {
-   if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+   if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
OperationDepsNode *from = (OperationDepsNode 
*)rel->from;
from->owner->layers |= node->owner->layers;
}
}
/* Schedule parent nodes. */
foreach (DepsRelation *rel, node->inlinks) {
-   if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+   if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
OperationDepsNode *from = (OperationDepsNode 
*)rel->from;
if ((rel->flag & DEPSREL_FLAG_CYCLIC) == 0) {
BLI_assert(from->num_links_pending > 0);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
index 1420b5fc8a5..0922f359abe 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
@@ -71,7 +71,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
foreach (OperationDepsNode *node, graph->operations) {
bool has_inlinks = false;
foreach (DepsRelation *rel, node->inlinks) {
-   if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+   if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
has_inlinks = true;
}
}
@@ -95,7 +95,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
bool all_child_traversed = true;
for (int i = node->done; i < node->outlinks.size(); ++i) {
DepsRelation *rel = node->outlinks[i];
-   if (rel->to->type == DEPSNODE_TYPE_OPERATION) {
+   if (rel->to->type == DEG_NODE_TYPE_OPERATION) {
OperationDepsNode *to = (OperationDepsNode 
*)rel->to;
if (to->tag == NODE_IN_STACK) {
printf("Dependency cycle detected:\n");
diff --git 

[Bf-blender-cvs] [a4925b05a77] master: Depsgraph: Remove subgraph nodes

2017-06-01 Thread Sergey Sharybin
Commit: a4925b05a77974579f1a3b45816a7bd017192204
Author: Sergey Sharybin
Date:   Thu Jun 1 15:14:11 2017 +0200
Branches: master
https://developer.blender.org/rBa4925b05a77974579f1a3b45816a7bd017192204

Depsgraph: Remove subgraph nodes

Those were never finished nor used. Again, starting from clean
state before we go into more complicated details.

===

M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M   source/blender/depsgraph/intern/builder/deg_builder_relations.h
M   source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M   source/blender/depsgraph/intern/nodes/deg_node.cc
M   source/blender/depsgraph/intern/nodes/deg_node.h
M   source/blender/depsgraph/intern/nodes/deg_node_operation.h

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 03e6fa4d9e8..ef94dec4b61 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -321,41 +321,6 @@ void DepsgraphNodeBuilder::build_group(Scene *scene,
}
 }
 
-SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
-{
-   /* sanity checks */
-   if (!group)
-   return NULL;
-
-   /* create new subgraph's data */
-   Depsgraph *subgraph = reinterpret_cast(DEG_graph_new());
-
-   DepsgraphNodeBuilder subgraph_builder(m_bmain, subgraph);
-
-   /* add group objects */
-   LINKLIST_FOREACH (GroupObject *, go, >gobject) {
-   /*Object *ob = go->ob;*/
-
-   /* Each "group object" is effectively a separate instance of the
-* underlying object data. When the group is evaluated, the 
transform
-* results and/or some other attributes end up getting 
overridden by
-* the group.
-*/
-   }
-
-   /* Create a node for representing subgraph. */
-   SubgraphDepsNode *subgraph_node = 
m_graph->add_subgraph_node(>id);
-   subgraph_node->graph = subgraph;
-
-   /* Make a copy of the data this node will need? */
-   /* XXX: do we do this now, or later? */
-   /* TODO: need API function which queries graph's ID's hash, and 
duplicates
-* those blocks thoroughly with all outside links removed.
-*/
-
-   return subgraph_node;
-}
-
 void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 {
const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 93a8c6c6015..5774d8b6aed 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -62,7 +62,6 @@ namespace DEG {
 struct Depsgraph;
 struct DepsNode;
 struct RootDepsNode;
-struct SubgraphDepsNode;
 struct IDDepsNode;
 struct TimeSourceDepsNode;
 struct ComponentDepsNode;
@@ -125,7 +124,6 @@ struct DepsgraphNodeBuilder {
   int name_tag = -1);
 
void build_scene(Main *bmain, Scene *scene);
-   SubgraphDepsNode *build_subgraph(Group *group);
void build_group(Scene *scene, Base *base, Group *group);
void build_object(Scene *scene, Base *base, Object *ob);
void build_object_transform(Scene *scene, Object *ob);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index ace629e471d..411f3be4036 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -78,7 +78,6 @@ struct Depsgraph;
 struct DepsNode;
 struct DepsNodeHandle;
 struct RootDepsNode;
-struct SubgraphDepsNode;
 struct IDDepsNode;
 struct TimeSourceDepsNode;
 struct ComponentDepsNode;
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc 
b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
index 0d56ce71c7d..3df4ee0c3dd 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
@@ -80,17 +80,16 @@ static const int deg_debug_node_type_color_map[][2] = {
 {DEPSNODE_TYPE_ROOT, 0},
 {DEPSNODE_TYPE_TIMESOURCE,   1},
 {DEPSNODE_TYPE_ID_REF,   2},
-{DEPSNODE_TYPE_SUBGRAPH, 3},
 
 /* Outer Types */
-

[Bf-blender-cvs] [a6bb98aef99] master: Depsgraph: Cleanup, get rid of relation type

2017-06-01 Thread Sergey Sharybin
Commit: a6bb98aef99d13877f0d4d32bd9c1419e8930619
Author: Sergey Sharybin
Date:   Thu Jun 1 14:49:17 2017 +0200
Branches: master
https://developer.blender.org/rBa6bb98aef99d13877f0d4d32bd9c1419e8930619

Depsgraph: Cleanup, get rid of relation type

It was never actually used apart from being stored at a construciton time.
This caused some redundancy and ncertanty about which relation type to use
during construciton (often existing types were not close enough to particular
use case).

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.h
M   source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_types.h

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index df56ff5897c..7df33e07e49 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -282,7 +282,7 @@ void 
DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc,
  const char *description)
 {
if (timesrc && node_to) {
-   m_graph->add_new_relation(timesrc, node_to, DEPSREL_TYPE_TIME, 
description);
+   m_graph->add_new_relation(timesrc, node_to, description);
}
else {
DEG_DEBUG_PRINTF("add_time_relation(%p = %s, %p = %s, %s) 
Failed\n",
@@ -295,17 +295,16 @@ void 
DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc,
 void DepsgraphRelationBuilder::add_operation_relation(
 OperationDepsNode *node_from,
 OperationDepsNode *node_to,
-eDepsRelation_Type type,
 const char *description)
 {
if (node_from && node_to) {
-   m_graph->add_new_relation(node_from, node_to, type, 
description);
+   m_graph->add_new_relation(node_from, node_to, description);
}
else {
-   DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %d, 
%s) Failed\n",
+   DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %s) 
Failed\n",
 node_from, (node_from) ? 
node_from->identifier().c_str() : "",
 node_to,   (node_to)   ? 
node_to->identifier().c_str() : "",
-type, description);
+description);
}
 }
 
@@ -319,10 +318,10 @@ void 
DepsgraphRelationBuilder::add_collision_relations(const OperationKey ,
Object *ob1 = collobjs[i];
 
ComponentKey trf_key(>id, DEPSNODE_TYPE_TRANSFORM);
-   add_relation(trf_key, key, DEPSREL_TYPE_STANDARD, name);
+   add_relation(trf_key, key, name);
 
ComponentKey coll_key(>id, DEPSNODE_TYPE_GEOMETRY);
-   add_relation(coll_key, key, DEPSREL_TYPE_STANDARD, name);
+   add_relation(coll_key, key, name);
}
 
if (collobjs)
@@ -337,30 +336,30 @@ void 
DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey ,
for (EffectorCache *eff = (EffectorCache *)effectors->first; 
eff; eff = eff->next) {
if (eff->ob != ob) {
ComponentKey eff_key(>ob->id, 
DEPSNODE_TYPE_TRANSFORM);
-   add_relation(eff_key, key, 
DEPSREL_TYPE_STANDARD, name);
+   add_relation(eff_key, key, name);
}
 
if (eff->psys) {
if (eff->ob != ob) {
ComponentKey eff_key(>ob->id, 
DEPSNODE_TYPE_EVAL_PARTICLES);
-   add_relation(eff_key, key, 
DEPSREL_TYPE_STANDARD, name);
+   add_relation(eff_key, key, name);
 
/* TODO: remove this when/if 
EVAL_PARTICLES is sufficient for up to date particles */
ComponentKey mod_key(>ob->id, 
DEPSNODE_TYPE_GEOMETRY);
-   add_relation(mod_key, key, 
DEPSREL_TYPE_STANDARD, name);
+   add_relation(mod_key, key, name);
}
else if (eff->psys != psys) {
OperationKey eff_key(>ob->id, 
DEPSNODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, eff->psys->name);
-

[Bf-blender-cvs] [d5d7455796a] master: Cleanup: use row() sub-layout to expand enum properties horizontaly

2017-06-01 Thread raa
Commit: d5d7455796a0c66d4874749b368b2a65f1dfeda0
Author: raa
Date:   Thu Jun 1 16:38:32 2017 +0300
Branches: master
https://developer.blender.org/rBd5d7455796a0c66d4874749b368b2a65f1dfeda0

Cleanup: use row() sub-layout to expand enum properties horizontaly

===

M   release/scripts/startup/bl_ui/properties_animviz.py
M   release/scripts/startup/bl_ui/properties_data_armature.py
M   release/scripts/startup/bl_ui/properties_data_camera.py
M   release/scripts/startup/bl_ui/properties_data_curve.py
M   release/scripts/startup/bl_ui/properties_data_lamp.py
M   release/scripts/startup/bl_ui/properties_data_metaball.py
M   release/scripts/startup/bl_ui/properties_game.py
M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/properties_material.py
M   release/scripts/startup/bl_ui/properties_object.py
M   release/scripts/startup/bl_ui/properties_particle.py
M   release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
M   release/scripts/startup/bl_ui/properties_physics_field.py
M   release/scripts/startup/bl_ui/properties_physics_smoke.py
M   release/scripts/startup/bl_ui/properties_physics_softbody.py
M   release/scripts/startup/bl_ui/properties_texture.py
M   release/scripts/startup/bl_ui/properties_world.py
M   release/scripts/startup/bl_ui/space_userpref.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/properties_animviz.py 
b/release/scripts/startup/bl_ui/properties_animviz.py
index 84bae18dd6f..43c01822b58 100644
--- a/release/scripts/startup/bl_ui/properties_animviz.py
+++ b/release/scripts/startup/bl_ui/properties_animviz.py
@@ -37,7 +37,7 @@ class MotionPathButtonsPanel:
 mps = avs.motion_path
 
 # Display Range
-layout.prop(mps, "type", expand=True)
+layout.row().prop(mps, "type", expand=True)
 
 split = layout.split()
 
@@ -120,7 +120,7 @@ class OnionSkinButtonsPanel:
 
 arm = context.armature
 
-layout.prop(arm, "ghost_type", expand=True)
+layout.row().prop(arm, "ghost_type", expand=True)
 
 split = layout.split()
 
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py 
b/release/scripts/startup/bl_ui/properties_data_armature.py
index a2ecf984eb5..8d3ab24b4cf 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -57,7 +57,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
 
 arm = context.armature
 
-layout.prop(arm, "pose_position", expand=True)
+layout.row().prop(arm, "pose_position", expand=True)
 
 col = layout.column()
 col.label(text="Layers:")
@@ -80,7 +80,7 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
 ob = context.object
 arm = context.armature
 
-layout.prop(arm, "draw_type", expand=True)
+layout.row().prop(arm, "draw_type", expand=True)
 
 split = layout.split()
 
@@ -215,7 +215,7 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
 
 arm = context.armature
 
-layout.prop(arm, "ghost_type", expand=True)
+layout.row().prop(arm, "ghost_type", expand=True)
 
 split = layout.split()
 
@@ -252,11 +252,11 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
 layout.prop(ob.pose, "ik_solver")
 
 if itasc:
-layout.prop(itasc, "mode", expand=True)
+layout.row().prop(itasc, "mode", expand=True)
 simulation = (itasc.mode == 'SIMULATION')
 if simulation:
 layout.label(text="Reiteration:")
-layout.prop(itasc, "reiteration_method", expand=True)
+layout.row().prop(itasc, "reiteration_method", expand=True)
 
 row = layout.row()
 row.active = not simulation or itasc.reiteration_method != 'NEVER'
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py 
b/release/scripts/startup/bl_ui/properties_data_camera.py
index 101062095c4..14286045704 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -79,7 +79,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
 
 cam = context.camera
 
-layout.prop(cam, "type", expand=True)
+layout.row().prop(cam, "type", expand=True)
 
 split = layout.split()
 
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py 
b/release/scripts/startup/bl_ui/properties_data_curve.py
index ac1eb9505a6..3a3ad31a8ef 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ 

[Bf-blender-cvs] [2ee74e94aaf] greasepencil-object: Fix error for ghost icon in palette

2017-06-01 Thread Antonio Vazquez
Commit: 2ee74e94aaf24489cee77f151931398e85976d2f
Author: Antonio Vazquez
Date:   Thu Jun 1 15:46:40 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2ee74e94aaf24489cee77f151931398e85976d2f

Fix error for ghost icon in palette

THe ghost icon was not working with new draw manager because the check was not 
migrated.

===

M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M   source/blender/draw/engines/gpencil/gpencil_engine.h
M   source/blender/draw/engines/gpencil/gpencil_geom.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index f3a07f6bcf8..8c7e9bcf26b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -455,7 +455,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, 
GPENCIL_e_data *e_dat
 
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
/* check if stroke can be drawn */
-   if (gpencil_can_draw_stroke(rv3d, gpf, gps) == false) {
+   if (gpencil_can_draw_stroke(rv3d, gpf, gps, onion) == false) {
continue;
}
/* limit the number of shading groups */
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h 
b/source/blender/draw/engines/gpencil/gpencil_engine.h
index cd173262ff8..09b56ddbe53 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -147,7 +147,7 @@ struct Batch *DRW_gpencil_get_buffer_point_geom(struct 
bGPdata *gpd, short thick
 
 void gpencil_batch_cache_clear(struct bGPdata *gpd);
 
-bool gpencil_can_draw_stroke(struct RegionView3D *rv3d, const struct bGPDframe 
*gpf, const struct bGPDstroke *gps);
+bool gpencil_can_draw_stroke(struct RegionView3D *rv3d, const struct bGPDframe 
*gpf, const struct bGPDstroke *gps, const bool onion);
 
 struct tGPencilObjectCache *gpencil_object_cache_allocate(struct 
tGPencilObjectCache *cache, int *gp_cache_size, int *gp_cache_used);
 void gpencil_object_cache_add(struct tGPencilObjectCache *cache, struct 
RegionView3D *rv3d, struct Object *ob, int *gp_cache_used);
diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c 
b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 2ea30e3d77d..0c90d6f9569 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -364,7 +364,7 @@ Batch *DRW_gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints,
 
 
 /* Helper for doing all the checks on whether a stroke can be drawn */
-bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), const bGPDframe 
*UNUSED(gpf), const bGPDstroke *gps)
+bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), const bGPDframe 
*UNUSED(gpf), const bGPDstroke *gps, const bool onion)
 {
/* skip stroke if it doesn't have any valid data */
if ((gps->points == NULL) || (gps->totpoints < 1))
@@ -373,7 +373,8 @@ bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), 
const bGPDframe *UNUSED
/* check if the color is visible */
PaletteColor *palcolor = gps->palcolor;
if ((palcolor == NULL) ||
-   (palcolor->flag & PC_COLOR_HIDE))
+   (palcolor->flag & PC_COLOR_HIDE) ||
+   (onion && (palcolor->flag & PC_COLOR_ONIONSKIN)))
{
return false;
}

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


[Bf-blender-cvs] [6b77aba9fc4] custom-manipulators: Merge remote-tracking branch 'origin/blender2.8' into custom-manipulators

2017-06-01 Thread Dalai Felinto
Commit: 6b77aba9fc4d44b4f9217ec26ec3c9d6df7a339b
Author: Dalai Felinto
Date:   Thu Jun 1 12:43:38 2017 +0200
Branches: custom-manipulators
https://developer.blender.org/rB6b77aba9fc4d44b4f9217ec26ec3c9d6df7a339b

Merge remote-tracking branch 'origin/blender2.8' into custom-manipulators

===



===



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


[Bf-blender-cvs] [7a5098f78e4] custom-manipulators: Fix blenderplayer build (ED_object_facemap*)

2017-06-01 Thread Dalai Felinto
Commit: 7a5098f78e432df2e33a46b97fc12410d8333d79
Author: Dalai Felinto
Date:   Thu Jun 1 12:45:23 2017 +0200
Branches: custom-manipulators
https://developer.blender.org/rB7a5098f78e432df2e33a46b97fc12410d8333d79

Fix blenderplayer build (ED_object_facemap*)

===

M   source/blenderplayer/bad_level_call_stubs/stubs.c

===

diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c 
b/source/blenderplayer/bad_level_call_stubs/stubs.c
index d09f15a4c4e..5f87b4f1ad3 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -546,8 +546,6 @@ void ED_object_constraint_tag_update(struct Object *ob, 
struct bConstraint *con)
 void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int 
vertnum, float weight, int assignmode) RET_NONE
 void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int 
vertnum) RET_NONE
 float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int 
vertnum) RET_ZERO
-void ED_object_facemap_face_add(struct Object *ob, struct bFaceMap *fmap, int 
facenum) RET_NONE
-void ED_object_facemap_face_remove(struct Object *ob, struct bFaceMap *fmap, 
int facenum) RET_NONE
 int ED_mesh_mirror_topo_table(struct Object *ob, struct DerivedMesh *dm, char 
mode) RET_ZERO
 int ED_mesh_mirror_spatial_table(struct Object *ob, struct BMEditMesh *em, 
struct DerivedMesh *dm, const float co[3], char mode) RET_ZERO

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


[Bf-blender-cvs] [a293d028b9b] fracture_modifier: new "Handle" option for convert to keyframes, if set calculates handles to be auto or vector(adaptive), but can be slower

2017-06-01 Thread Martin Felke
Commit: a293d028b9b0e3623dd69eb06b6eb5acf6f861d4
Author: Martin Felke
Date:   Thu Jun 1 12:42:32 2017 +0200
Branches: fracture_modifier
https://developer.blender.org/rBa293d028b9b0e3623dd69eb06b6eb5acf6f861d4

new "Handle" option for convert to keyframes, if set calculates handles to be 
auto or vector(adaptive), but can be slower

===

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

===

diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index 9693d28dd5c..8c5afcdf06b 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -3112,7 +3112,7 @@ MINLINE void compare_v3_fl(bool r[3], const float a[3], 
const float b)
 static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland 
*mi, Group* gr, Object* ob, Scene* scene,
   int start, int end, int count, Object* 
parent, bool is_baked,
   PTCacheID* pid, PointCache *cache, float 
obloc[3], float diff[3], int *j, Base **base,
-  float threshold, int step, ReportList* 
reports)
+  float threshold, int step, bool 
calc_handles, ReportList* reports)
 {
int i = 0;
Object* ob_new = NULL;
@@ -3179,14 +3179,25 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
{
//bAnimContext *ac;
int stepp = adaptive ? 1 : step;
-   short flag = INSERTKEY_FAST /*| INSERTKEY_NEEDED*/ | 
INSERTKEY_NO_USERPREF;
+   short flag = calc_handles ? 0 : INSERTKEY_FAST | 
INSERTKEY_NO_USERPREF | INSERTKEY_NEEDED;
for (i = start; i < end; i += stepp)
{
+   char handle = U.keyhandles_new;
+   char interp = U.ipo_new;
bool dostep = adaptive ? (((i + start) % step == 0) || 
i == start || i == end) : true;
float size[3] = {1, 1, 1};
bool locset[3] = {true, true, true};
bool rotset[3] = {true, true, true};
 
+   if (dostep) {
+   U.keyhandles_new = HD_AUTO;
+   U.ipo_new = BEZT_IPO_BEZ;
+   }
+   else if (adaptive && !dostep) {
+   U.keyhandles_new = HD_VECT;
+   U.ipo_new = BEZT_IPO_BEZ;
+   }
+
//adaptive optimization, only try to insert necessary 
frames... but doesnt INSERT_NEEDED do the same ?!
if (adaptive || !dostep)
{
@@ -3282,8 +3293,9 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
 
loc_quat_size_to_mat4(mat, loc, rot, size);
 
-   if (locset[0] || locset[1] || locset[2] || 
rotset[0] || rotset[1] || rotset[2])
+   if (locset[0] || locset[1] || locset[2] || 
rotset[0] || rotset[1] || rotset[2]) {
BKE_scene_frame_set(scene, (double)i);
+   }
 
copy_m4_m4(ob_new->obmat, mat);
 
@@ -3314,6 +3326,10 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
//insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", 
"scale", 0, i, BEZT_KEYTYPE_KEYFRAME, flag);
//insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", 
"scale", 1, i, BEZT_KEYTYPE_KEYFRAME, flag);
//insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", 
"scale", 2, i, BEZT_KEYTYPE_KEYFRAME, flag);
+
+   //restore values
+   U.keyhandles_new = handle;
+   U.ipo_new = interp;
}
 
if (mi->locs)
@@ -3358,7 +3374,7 @@ static Object* 
do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
 }
 
 static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* 
gr, Object* ob, Scene* scene, int start, int end,
-  float threshold, int step, 
ReportList *reports)
+  float threshold, int step, bool 
calc_handles, ReportList *reports)
 {
bool is_baked = false;
PointCache* cache = NULL;
@@ -3408,7 +3424,7 @@ static bool 
convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
{
Object *obj = do_convert_meshIsland(fmd, mi, gr, ob, scene, 
start, end, count,
parent, is_baked, , 
cache, obloc, diff, , _old[i],
-   

[Bf-blender-cvs] [8c09826d58a] blender2.8: Gawain: Optimize shader uniform access

2017-06-01 Thread Sergey Sharybin
Commit: 8c09826d58ad219b7229fcce396b967866458e99
Author: Sergey Sharybin
Date:   Thu Jun 1 12:26:27 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB8c09826d58ad219b7229fcce396b967866458e99

Gawain: Optimize shader uniform access

Before this change Gawain was doing list lookup twice,
doing string comparison of every and each input which
is not efficient and not friendly for CPUs with small
cache size.

Now we store hash of input name together with actual
name and compare hashes first. Additionally, we do
everything in a single pass which is much better from
cache coherency point of view.

This brings Eevee cache population time from 80ms to
60ms on my desktop and from 800ms to 400ms for Clement
when navigating in a file from T50027.

Reviewers: merwin, dfelinto

Subscribers: fclem

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

===

M   intern/gawain/gawain/shader_interface.h
M   intern/gawain/src/shader_interface.c

===

diff --git a/intern/gawain/gawain/shader_interface.h 
b/intern/gawain/gawain/shader_interface.h
index 5c37d507806..cf10180e3d5 100644
--- a/intern/gawain/gawain/shader_interface.h
+++ b/intern/gawain/gawain/shader_interface.h
@@ -32,6 +32,7 @@ typedef enum {
 
 typedef struct {
const char* name;
+   unsigned name_hash;
GLenum gl_type;
BuiltinUniform builtin_type; // only for uniform inputs
GLint size;
diff --git a/intern/gawain/src/shader_interface.c 
b/intern/gawain/src/shader_interface.c
index 4a07f954c36..f0da342f088 100644
--- a/intern/gawain/src/shader_interface.c
+++ b/intern/gawain/src/shader_interface.c
@@ -49,6 +49,24 @@ static bool match(const char* a, const char* b)
return strcmp(a, b) == 0;
}
 
+static unsigned hash_string(const char *str)
+   {
+   unsigned i = 0, c;
+
+   while ((c = *str++))
+   {
+   i = i * 37 + c;
+   }
+
+   return i;
+   }
+
+static inline void set_input_name(ShaderInput* input, const char* name)
+   {
+   input->name = name;
+   input->name_hash = hash_string(name);
+   }
+
 // keep these in sync with BuiltinUniform order
 #define FIRST_MAT4_UNIFORM UNIFORM_MODELVIEW
 #define LAST_MAT4_UNIFORM UNIFORM_PROJECTION_INV
@@ -67,7 +85,7 @@ static bool setup_builtin_uniform(ShaderInput* input, const 
char* name)
const char* builtin_name = 
BuiltinUniform_name(u);
if (match(name, builtin_name))
{
-   input->name = builtin_name;
+   set_input_name(input, builtin_name);
input->builtin_type = u;
return true;
}
@@ -78,7 +96,7 @@ static bool setup_builtin_uniform(ShaderInput* input, const 
char* name)
const char* builtin_name = 
BuiltinUniform_name(UNIFORM_NORMAL);
if (match(name, builtin_name))
{
-   input->name = builtin_name;
+   set_input_name(input, builtin_name);
input->builtin_type = UNIFORM_NORMAL;
return true;
}
@@ -89,7 +107,7 @@ static bool setup_builtin_uniform(ShaderInput* input, const 
char* name)
const char* builtin_name = 
BuiltinUniform_name(UNIFORM_COLOR);
if (match(name, builtin_name))
{
-   input->name = builtin_name;
+   set_input_name(input, builtin_name);
input->builtin_type = UNIFORM_COLOR;
return true;
}
@@ -149,7 +167,7 @@ ShaderInterface* ShaderInterface_create(GLint program)
; // reclaim space from name buffer (don't 
advance offset)
else
{
-   input->name = name;
+   set_input_name(input, name);
name_buffer_offset += name_len + 1; // include 
NULL terminator
}
 #if SUPPORT_LEGACY_GLSL
@@ -181,7 +199,7 @@ ShaderInterface* ShaderInterface_create(GLint program)
assert(input->location != -1);
 #endif
 
-   input->name = name;
+   set_input_name(input, name);
name_buffer_offset += name_len + 1; // include NULL 
terminator
 #if SUPPORT_LEGACY_GLSL
}
@@ -233,33 +251,19 @@ void 

[Bf-blender-cvs] [528ae8885eb] master: Fix T51687: GPUmat evaluation of shader tree would crash uppon unknown/unsupported socket types.

2017-06-01 Thread Bastien Montagne
Commit: 528ae8885ebb8a2eebbc6726af3950ca4db38665
Author: Bastien Montagne
Date:   Thu Jun 1 12:18:57 2017 +0200
Branches: master
https://developer.blender.org/rB528ae8885ebb8a2eebbc6726af3950ca4db38665

Fix T51687: GPUmat evaluation of shader tree would crash uppon 
unknown/unsupported socket types.

Made this resilient to unknown types, for now. Supporting specific INT
sockets (through implicit conversion to GPU_FLOAT ones) is considered nice TODO.

===

M   source/blender/nodes/intern/node_exec.c
M   source/blender/nodes/shader/node_shader_util.c

===

diff --git a/source/blender/nodes/intern/node_exec.c 
b/source/blender/nodes/intern/node_exec.c
index 2347564c696..0cf131adbdc 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -78,7 +78,8 @@ void node_get_stack(bNode *node, bNodeStack *stack, 
bNodeStack **in, bNodeStack
 
 static void node_init_input_index(bNodeSocket *sock, int *index)
 {
-   if (sock->link && sock->link->fromsock) {
+   /* Only consider existing link if from socket is valid! */
+   if (sock->link && sock->link->fromsock && 
sock->link->fromsock->stack_index >= 0) {
sock->stack_index = sock->link->fromsock->stack_index;
}
else {
diff --git a/source/blender/nodes/shader/node_shader_util.c 
b/source/blender/nodes/shader/node_shader_util.c
index 9bd43f331fb..5bc97f13b41 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -142,28 +142,40 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, 
int type, bNodeStack *ns)
 {
memset(gs, 0, sizeof(*gs));

-   nodestack_get_vec(gs->vec, type, ns);
-   gs->link = ns->data;
-   
-   if (type == SOCK_FLOAT)
-   gs->type = GPU_FLOAT;
-   else if (type == SOCK_VECTOR)
-   gs->type = GPU_VEC3;
-   else if (type == SOCK_RGBA)
-   gs->type = GPU_VEC4;
-   else if (type == SOCK_SHADER)
-   gs->type = GPU_VEC4;
-   else
+   if (ns == NULL) {
+   /* node_get_stack() will generate NULL bNodeStack pointers for 
unknown/unsuported types of sockets... */
+   zero_v4(gs->vec);
+   gs->link = NULL;
gs->type = GPU_NONE;
+   gs->name = "";
+   gs->hasinput = false;
+   gs->hasoutput = false;
+   gs->sockettype = type;
+   }
+   else {
+   nodestack_get_vec(gs->vec, type, ns);
+   gs->link = ns->data;

-   gs->name = "";
-   gs->hasinput = ns->hasinput && ns->data;
-   /* XXX Commented out the ns->data check here, as it seems it's not 
always set,
-* even though there *is* a valid connection/output... But that 
might need
-* further investigation.
-*/
-   gs->hasoutput = ns->hasoutput /*&& ns->data*/;
-   gs->sockettype = ns->sockettype;
+   if (type == SOCK_FLOAT)
+   gs->type = GPU_FLOAT;
+   else if (type == SOCK_VECTOR)
+   gs->type = GPU_VEC3;
+   else if (type == SOCK_RGBA)
+   gs->type = GPU_VEC4;
+   else if (type == SOCK_SHADER)
+   gs->type = GPU_VEC4;
+   else
+   gs->type = GPU_NONE;
+
+   gs->name = "";
+   gs->hasinput = ns->hasinput && ns->data;
+   /* XXX Commented out the ns->data check here, as it seems it's 
not always set,
+* even though there *is* a valid connection/output... But 
that might need
+* further investigation.
+*/
+   gs->hasoutput = ns->hasoutput /*&& ns->data*/;
+   gs->sockettype = ns->sockettype;
+   }
 }
 
 void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61892] trunk/lib/tests/cycles/ctests/shader/reference_renders/principled_subsurface.png: Cycles tests: Update principled SSS reference file

2017-06-01 Thread Sergey Sharybin
Revision: 61892
  https://developer.blender.org/rBL61892
Author:   sergey
Date: 2017-06-01 12:09:06 +0200 (Thu, 01 Jun 2017)
Log Message:
---
Cycles tests: Update principled SSS reference file

Need to do this after recent backscatter fix for this closure.

Modified Paths:
--

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

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

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


[Bf-blender-cvs] [7d903fea7da] custom-manipulators: Merge branch '28' into custom-manipulators

2017-06-01 Thread Campbell Barton
Commit: 7d903fea7da1a25605fa85a9e8826d0977fe3af6
Author: Campbell Barton
Date:   Thu Jun 1 19:42:08 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB7d903fea7da1a25605fa85a9e8826d0977fe3af6

Merge branch '28' into custom-manipulators

===



===



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


[Bf-blender-cvs] [3c703df327c] blender2.8: Correct select-similar end value

2017-06-01 Thread Campbell Barton
Commit: 3c703df327c45f60cf4672874e700420e3a11f0d
Author: Campbell Barton
Date:   Thu Jun 1 19:41:19 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3c703df327c45f60cf4672874e700420e3a11f0d

Correct select-similar end value

===

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

===

diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index c68c429bfb5..61891907050 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1169,7 +1169,7 @@ static EnumPropertyItem 
*select_similar_type_itemf(bContext *C, PointerRNA *UNUS
 #ifdef WITH_FREESTYLE
const int a_end = SIMFACE_FREESTYLE;
 #else
-   const int a_end = SIMFACE_SMOOTH;
+   const int a_end = SIMFACE_FACEMAP;
 #endif
for (a = SIMFACE_MATERIAL; a <= a_end; a++) {
RNA_enum_items_add_value(, , 
prop_similar_types, a);

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


[Bf-blender-cvs] [5fa1b47494f] soc-2017-sculpting_improvements: Small cleanup. Cleared every unconnected changes and fixed some minor ui bugs.

2017-06-01 Thread witt
Commit: 5fa1b47494fae3caed358f4aebc32425b77ffdfa
Author: witt
Date:   Thu Jun 1 11:10:03 2017 +0200
Branches: soc-2017-sculpting_improvements
https://developer.blender.org/rB5fa1b47494fae3caed358f4aebc32425b77ffdfa

Small cleanup. Cleared every unconnected changes and fixed some minor ui bugs.

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/editors/sculpt_paint/paint_stroke.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_intern.h
M   source/blender/editors/sculpt_paint/sculpt_undo.c
M   source/blender/makesdna/DNA_brush_types.h
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 7701ea712cb..8d375ec861c 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1032,7 +1032,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 row = col.row(align=True)
 row.prop(brush, "rake_factor", slider=True)
 
-# use_original_normal and sculpt_plane and sculpt_plane_range
+# use_original_normal and sculpt_plane
 if capabilities.has_sculpt_plane:
 col.separator()
 row = col.row(align=True)
@@ -1041,9 +1041,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
 row.prop(brush, "sculpt_plane", text="")
 
-row = col.row()
-row.prop(brush, "sculpt_plane_range")
-
 if brush.sculpt_tool == 'MASK':
 col.prop(brush, "mask_tool", text="")
 
@@ -1448,11 +1445,6 @@ class VIEW3D_PT_tools_brush_stroke(Panel, 
View3DPaintPanel):
 col.separator()
 col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
 
-if brush.use_line or brush.use_curve:
-col.separator()
-row = col.row(align=True)
-row.prop(brush, "spacing", text="Spacing")
-
 if brush.use_curve:
 col.separator()
 col.template_ID(brush, "paint_curve", new="paintcurve.new")
diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 80aa8efa0a9..1a9295d579e 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -78,8 +78,7 @@ static void brush_defaults(Brush *brush)
brush->alpha = 0.5f; /* brush strength/intensity probably variable 
should be renamed? */
brush->autosmooth_factor = 0.0f;
brush->crease_pinch_factor = 0.5f;
-   brush->sculpt_plane = SCULPT_DISP_DIR_AREA; /* default to the area 
normal as the sculpt plane displacement direction */
-   brush->sculpt_plane_range= 1; /* how large an area to determine the 
normal of the plane in brush radiuses */
+   brush->sculpt_plane = SCULPT_DISP_DIR_AREA;
brush->plane_offset = 0.0f; /* how far above or below the plane that is 
found by averaging the faces */
brush->plane_trim = 0.5f;
brush->clone.alpha = 0.5f;
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 09ba7f23809..d3260db1477 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1575,16 +1575,6 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
}
}
 
-   Brush *br;
-   for (br = main->brush.first; br; br = br->id.next) {
-   br->flag |= BRUSH_SPACE_ATTEN; // enable adaptive 
attenuation
-   //TODO currently too slow to be enabled on by default
-   //br->flag |= BRUSH_ADAPTIVE_SPACE;
-   if (br->ob_mode & OB_MODE_SCULPT)
-   br->sculpt_plane_range = 1.0;   

-   }
-
-
/* Fix for T50736, Glare comp node using same var for two 
different things. */
if (!DNA_struct_elem_find(fd->filesdna, "NodeGlare", "char", 
"star_45")) {
FOREACH_NODETREE(main, ntree, id) {
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c 
b/source/blender/editors/sculpt_paint/paint_stroke.c
index d6dd6be0d75..158ada1a2ea 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -640,13 +640,11 @@ static float paint_stroke_integrate_overlap(Brush *br, 
float factor)
 
 static float paint_space_stroke_spacing_variable(const 

[Bf-blender-cvs] [81786c91e4a] greasepencil-object: Cleanup comment

2017-06-01 Thread Antonio Vazquez
Commit: 81786c91e4a7029ad985d83d244833a5f8b46d45
Author: Antonio Vazquez
Date:   Thu Jun 1 11:12:19 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB81786c91e4a7029ad985d83d244833a5f8b46d45

Cleanup comment

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 859b4165d5c..b606227207a 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -108,10 +108,10 @@ static void GPENCIL_cache_init(void *vedata)
stl->storage->xray = GP_XRAY_FRONT; /* used for drawing */
}
if (!stl->shgroups) {
-   /* Alloc maximum size because count strokes is very slow and 
can be very complex due onion skinning
-  Note: I tried to allocate only one and using realloc, 
increase the size when read a new strokes 
-in cache_finish, but the realloc produce weird things 
on screen, so we keep as is while we
-found a better solution
+   /* Alloc maximum size because count strokes is very slow and 
can be very complex due onion skinning.
+  I tried to allocate only one block and using realloc, 
increasing the size when read a new strokes
+  in cache_finish, but the realloc produce weird things on 
screen, so we keep as is while we found
+  a better solution
 */
stl->shgroups = MEM_mallocN(sizeof(GPENCIL_shgroup) * 
GPENCIL_MAX_SHGROUPS, "GPENCIL_shgroup");
}

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


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

2017-06-01 Thread Antonio Vazquez
Commit: c0c0483244ca2198fd022c1295e6b9128f440ed1
Author: Antonio Vazquez
Date:   Thu Jun 1 10:42:41 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc0c0483244ca2198fd022c1295e6b9128f440ed1

Merge branch 'blender2.8' into greasepencil-object

===



===

diff --cc source/blender/blenloader/intern/versioning_280.c
index 34b97353a4e,3eeb0fc78e4..3cebaa78746
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -37,9 -37,7 +37,8 @@@
  #include "DNA_scene_types.h"
  #include "DNA_screen_types.h"
  #include "DNA_genfile.h"
 +#include "DNA_gpencil_types.h"
  
- #include "BKE_blender.h"
  #include "BKE_collection.h"
  #include "BKE_customdata.h"
  #include "BKE_idprop.h"

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


[Bf-blender-cvs] [ed338ba9d0d] greasepencil-object: Cleanup: Remove unused field

2017-06-01 Thread Antonio Vazquez
Commit: ed338ba9d0d4950343a5168abcda975e7a13fd83
Author: Antonio Vazquez
Date:   Wed May 31 19:18:39 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBed338ba9d0d4950343a5168abcda975e7a13fd83

Cleanup: Remove unused field

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h 
b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 0107ec233ae..c208efc3121 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -103,7 +103,6 @@ typedef struct GPENCIL_e_data {
struct GPUShader *gpencil_stroke_sh;
struct GPUShader *gpencil_volumetric_sh;
struct GPUShader *gpencil_drawing_fill_sh;
-   struct Main *bmain;
 } GPENCIL_e_data; /* Engine data */
 
 /* Batch Cache */

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


[Bf-blender-cvs] [844e8fbcd0a] greasepencil-object: Cleanup: Remove unused code

2017-06-01 Thread Antonio Vazquez
Commit: 844e8fbcd0a8d4186ebc2448266642240bff0a36
Author: Antonio Vazquez
Date:   Wed May 31 19:16:58 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB844e8fbcd0a8d4186ebc2448266642240bff0a36

Cleanup: Remove unused code

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index d70479a93cb..ce979a77999 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -49,7 +49,6 @@ static void GPENCIL_engine_init(void *vedata)
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
 
const DRWContextState *draw_ctx = DRW_context_state_get();
-   e_data.bmain = CTX_data_main(draw_ctx->evil_C);
 
/* normal fill shader */
if (!e_data.gpencil_fill_sh) {

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


[Bf-blender-cvs] [7edf993ba6e] greasepencil-object: Try to use dynamic memory for shading groups

2017-06-01 Thread Antonio Vazquez
Commit: 7edf993ba6e07ced0e6e26723a4ae64bcdf2c18c
Author: Antonio Vazquez
Date:   Thu Jun 1 10:35:24 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB7edf993ba6e07ced0e6e26723a4ae64bcdf2c18c

Try to use dynamic memory for shading groups

The reallocation of the memory produce weird things, so we keep allocation 
maximum number while we found better solution.

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 294b924c587..f3a07f6bcf8 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -235,8 +235,8 @@ static DRWShadingGroup 
*DRW_gpencil_shgroup_fill_create(GPENCIL_Data *vedata, DR
/* e_data.gpencil_fill_sh */
DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
DRW_shgroup_uniform_vec4(grp, "color2", palcolor->scolor, 1);
-   stl->storage->shgroups[id].fill_style = palcolor->fill_style;
-   DRW_shgroup_uniform_int(grp, "fill_type", 
>storage->shgroups[id].fill_style, 1);
+   stl->shgroups[id].fill_style = palcolor->fill_style;
+   DRW_shgroup_uniform_int(grp, "fill_type", 
>shgroups[id].fill_style, 1);
DRW_shgroup_uniform_float(grp, "mix_factor", >mix_factor, 1);
 
DRW_shgroup_uniform_float(grp, "g_angle", >g_angle, 1);
@@ -250,11 +250,11 @@ static DRWShadingGroup 
*DRW_gpencil_shgroup_fill_create(GPENCIL_Data *vedata, DR
DRW_shgroup_uniform_vec2(grp, "t_shift", palcolor->t_shift, 1);
DRW_shgroup_uniform_float(grp, "t_opacity", >t_opacity, 1);
 
-   stl->storage->shgroups[id].t_mix = palcolor->flag & PAC_COLOR_TEX_MIX ? 
1 : 0;
-   DRW_shgroup_uniform_int(grp, "t_mix", 
>storage->shgroups[id].t_mix, 1);
+   stl->shgroups[id].t_mix = palcolor->flag & PAC_COLOR_TEX_MIX ? 1 : 0;
+   DRW_shgroup_uniform_int(grp, "t_mix", >shgroups[id].t_mix, 1);
 
-   stl->storage->shgroups[id].t_flip = palcolor->flag & 
PAC_COLOR_FLIP_FILL ? 1 : 0;
-   DRW_shgroup_uniform_int(grp, "t_flip", 
>storage->shgroups[id].t_flip, 1);
+   stl->shgroups[id].t_flip = palcolor->flag & PAC_COLOR_FLIP_FILL ? 1 : 0;
+   DRW_shgroup_uniform_int(grp, "t_flip", >shgroups[id].t_flip, 1);
 
DRW_shgroup_uniform_int(grp, "xraymode", (const int *) >xray_mode, 
1);
 
@@ -276,8 +276,8 @@ static DRWShadingGroup 
*DRW_gpencil_shgroup_fill_create(GPENCIL_Data *vedata, DR
GPUTexture *texture = 
GPU_texture_from_blender(palcolor->ima, , GL_TEXTURE_2D, true, 0.0, 0);
DRW_shgroup_uniform_texture(grp, "myTexture", texture);
 
-   stl->storage->shgroups[id].t_clamp = palcolor->flag & 
PAC_COLOR_TEX_CLAMP ? 1 : 0;
-   DRW_shgroup_uniform_int(grp, "t_clamp", 
>storage->shgroups[id].t_clamp, 1);
+   stl->shgroups[id].t_clamp = palcolor->flag & 
PAC_COLOR_TEX_CLAMP ? 1 : 0;
+   DRW_shgroup_uniform_int(grp, "t_clamp", 
>shgroups[id].t_clamp, 1);
 
BKE_image_release_ibuf(image, ibuf, NULL);
}
@@ -452,26 +452,34 @@ static void gpencil_draw_strokes(GpencilBatchCache 
*cache, GPENCIL_e_data *e_dat
/* get parent matrix and save as static data */
ED_gpencil_parent_location(ob, gpd, gpl, viewmatrix);
copy_m4_m4(gpf->viewmatrix, viewmatrix);
-   
+
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
/* check if stroke can be drawn */
if (gpencil_can_draw_stroke(rv3d, gpf, gps) == false) {
continue;
}
-
/* limit the number of shading groups */
if (stl->storage->pal_id >= GPENCIL_MAX_SHGROUPS) {
continue;
}
-
+#if 0   /* if we use the reallocate the shading group is doing weird thing, so 
disable while find a solution 
+  and allocate the max size on cache_init */
+   /* realloc memory */
+   GPENCIL_shgroup *p = NULL;
+   int size = stl->storage->pal_id + 1;
+   p = MEM_recallocN(stl->shgroups, sizeof(struct GPENCIL_shgroup) 
* size);
+   if (p != NULL) {
+   stl->shgroups = p;
+   }
+#endif
if (gps->totpoints > 1) {
int id = stl->storage->pal_id;
-   stl->storage->shgroups[id].shgrps_fill = 
DRW_gpencil_shgroup_fill_create(vedata, psl->stroke_pass, 
e_data->gpencil_fill_sh, gpd, gps->palcolor, id);
-

[Bf-blender-cvs] [e4ef59a6a38] greasepencil-object: Fix error when drawing in an empty frame

2017-06-01 Thread Antonio Vazquez
Commit: e4ef59a6a38c4be32c0e2e780006123651f85962
Author: Antonio Vazquez
Date:   Thu Jun 1 10:20:29 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBe4ef59a6a38c4be32c0e2e780006123651f85962

Fix error when drawing in an empty frame

If drawing new stroke in an empty frame, but the layer had previous frames, the 
cache must be set as dirty to avoid segment fault.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 233645b2e29..fdf7b2fc95c 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1632,6 +1632,8 @@ static void gp_paint_initstroke(tGPsdata *p, 
eGPencil_PaintModes paintmode)
add_frame_mode = GP_GETFRAME_ADD_NEW;

p->gpf = BKE_gpencil_layer_getframe(p->gpl, CFRA, 
add_frame_mode);
+   /* set as dirty draw manager cache */
+   BKE_gpencil_batch_cache_dirty(p->gpd, 0);

if (p->gpf == NULL) {
p->status = GP_STATUS_ERROR;

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


[Bf-blender-cvs] [a0c668d8ed2] custom-manipulators: Merge branch '28' into custom-manipulators

2017-06-01 Thread Campbell Barton
Commit: a0c668d8ed294a6b718d46874ad5857fe7c4b7c4
Author: Campbell Barton
Date:   Thu Jun 1 17:43:42 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBa0c668d8ed294a6b718d46874ad5857fe7c4b7c4

Merge branch '28' into custom-manipulators

===



===



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


[Bf-blender-cvs] [8cf5eaa2baa] blender2.8: Add Face-Map to select similar

2017-06-01 Thread Campbell Barton
Commit: 8cf5eaa2baa70515f4731cc9ac5ac6c5e5cf3c44
Author: Campbell Barton
Date:   Thu Jun 1 16:42:14 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB8cf5eaa2baa70515f4731cc9ac5ac6c5e5cf3c44

Add Face-Map to select similar

Handy for setting up face-maps,
also allows selecting all faces with no assigned map.

===

M   source/blender/bmesh/intern/bmesh_operators.h
M   source/blender/bmesh/operators/bmo_similar.c
M   source/blender/editors/mesh/editmesh_select.c

===

diff --git a/source/blender/bmesh/intern/bmesh_operators.h 
b/source/blender/bmesh/intern/bmesh_operators.h
index 31c696da0d4..80b57eb3565 100644
--- a/source/blender/bmesh/intern/bmesh_operators.h
+++ b/source/blender/bmesh/intern/bmesh_operators.h
@@ -83,6 +83,7 @@ enum {
SIMFACE_NORMAL,
SIMFACE_COPLANAR,
SIMFACE_SMOOTH,
+   SIMFACE_FACEMAP,
 #ifdef WITH_FREESTYLE
SIMFACE_FREESTYLE
 #endif
diff --git a/source/blender/bmesh/operators/bmo_similar.c 
b/source/blender/bmesh/operators/bmo_similar.c
index 0e49c957213..0cd17258834 100644
--- a/source/blender/bmesh/operators/bmo_similar.c
+++ b/source/blender/bmesh/operators/bmo_similar.c
@@ -106,11 +106,28 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
const float thresh = BMO_slot_float_get(op->slots_in, "thresh");
const float thresh_radians = thresh * (float)M_PI;
const int compare = BMO_slot_int_get(op->slots_in, "compare");
+   /* for comparison types that use custom-data */
+   int cd_offset = -1;
 
/* initial_elem - other_elem */
float delta_fl;
int   delta_i;
 
+   if (type == SIMFACE_FACEMAP) {
+   cd_offset = CustomData_get_offset(>pdata, CD_FACEMAP);
+   if (cd_offset == -1) {
+   return;
+   }
+   }
+#ifdef WITH_FREESTYLE
+   else if (type == SIMFACE_FREESTYLE) {
+   cd_offset = CustomData_get_offset(>pdata, 
CD_FREESTYLE_FACE);
+   if (cd_offset == -1) {
+   return;
+   }
+   }
+#endif
+
num_total = BM_mesh_elem_count(bm, BM_FACE);
 
/*
@@ -182,7 +199,6 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
cont = false;
}
break;
-
case SIMFACE_NORMAL:
angle = 
angle_normalized_v3v3(fs->no, fm->no);  /* if the angle between the normals -> 
0 */
if (angle <= thresh_radians) {
@@ -239,20 +255,29 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
cont = false;
}
break;
+   case SIMFACE_FACEMAP:
+   {
+   BLI_assert(cd_offset != -1);
+   const int *fmap1 = 
BM_ELEM_CD_GET_VOID_P(fs, cd_offset);
+   const int *fmap2 = 
BM_ELEM_CD_GET_VOID_P(fm, cd_offset);
+   if (*fmap1  == *fmap2) {
+   
BMO_face_flag_enable(bm, fm, FACE_MARK);
+   cont = false;
+   }
+   break;
+   }
 #ifdef WITH_FREESTYLE
case SIMFACE_FREESTYLE:
-   if 
(CustomData_has_layer(>pdata, CD_FREESTYLE_FACE)) {
-   FreestyleEdge *ffa1, 
*ffa2;
-
-   ffa1 = 
CustomData_bmesh_get(>pdata, fs->head.data, CD_FREESTYLE_FACE);
-   ffa2 = 
CustomData_bmesh_get(>pdata, fm->head.data, CD_FREESTYLE_FACE);
-
-   if (ffa1 && ffa2 && 
(ffa1->flag & FREESTYLE_FACE_MARK) == (ffa2->flag & FREESTYLE_FACE_MARK)) {
-   
BMO_face_flag_enable(bm, fm, FACE_MARK);
-   cont = false;
-   }
+   {
+   BLI_assert(cd_offset != -1);
+   const FreestyleEdge *ffa1 =