[Bf-blender-cvs] [e176d66cbe8] greasepencil-object: Fix: Depsgraph was complaining in debug mode about the "geometry_eval" opnode for GPencil not having any function attached

2017-11-06 Thread Joshua Leung
Commit: e176d66cbe84b7365bf3bf953ab314bdf82f00f3
Author: Joshua Leung
Date:   Tue Nov 7 20:51:54 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBe176d66cbe84b7365bf3bf953ab314bdf82f00f3

Fix: Depsgraph was complaining in debug mode about the "geometry_eval" opnode 
for GPencil not having any function attached

In future, maybe we should move the derived_gpf calculations
(and by extension, the modifier-evaluation loops) into the
BKE_gpencil_eval_geometry() callback added in this commit.

===

M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/blenkernel/intern/gpencil_modifier.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

===

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index 48ad56c74af..ac242620005 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -187,6 +187,9 @@ struct bGPDweight 
*BKE_gpencil_vgroup_add_point_weight(struct bGPDspoint *pt, in
 bool BKE_gpencil_vgroup_remove_point_weight(struct bGPDspoint *pt, int index);
 void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct 
bGPDstroke *gps_dst);
 
+/* GPencil geometry evaluation */
+void BKE_gpencil_eval_geometry(const struct EvaluationContext *eval_ctx, 
struct bGPdata *gpd);
+
 /* modifiers */
 bool BKE_gpencil_has_geometry_modifiers(struct Object *ob);
 
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 7d50e9cb454..9fc535bcd16 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -362,4 +362,16 @@ void BKE_gpencil_geometry_modifiers(EvaluationContext 
*eval_ctx, Object *ob, bGP
}
 }
 
+/* *** */
+
+void BKE_gpencil_eval_geometry(const EvaluationContext *UNUSED(eval_ctx),
+   bGPdata *UNUSED(gpd))
+{
+   /* TODO: Move "derived_gpf" logic here from 
DRW_gpencil_populate_datablock()?
+* This way, we wouldn't have to mess around trying to figure out how 
to pass
+* an EvaluationContext to each of the modifiers.
+*/
+}
+
+
 /* *** */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 26700b26d8d..1a5027953b2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -75,6 +75,7 @@ extern "C" {
 #include "BKE_curve.h"
 #include "BKE_effect.h"
 #include "BKE_fcurve.h"
+#include "BKE_gpencil.h"
 #include "BKE_idcode.h"
 #include "BKE_group.h"
 #include "BKE_key.h"
@@ -1030,8 +1031,13 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene 
*scene, Object *ob)
bGPdata *gpd = (bGPdata *)obdata;
ID *gpd_id = &gpd->id; /* No COW for now, as GP uses 
its own cache system. See gpencil_engine.c */

-   op_node = add_operation_node(gpd_id, 
DEG_NODE_TYPE_GEOMETRY, NULL, // XXX: cannot be null
-DEG_OPCODE_PLACEHOLDER, "GP Geometry 
Eval");
+   op_node = add_operation_node(gpd_id, 
+DEG_NODE_TYPE_GEOMETRY,
+
function_bind(BKE_gpencil_eval_geometry,
+  _1,
+  gpd),
+  
DEG_OPCODE_PLACEHOLDER,
+  "Geometry 
Eval");
op_node->set_as_entry();
break;
}

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


[Bf-blender-cvs] [806aa232fef] greasepencil-object: WIP

2017-11-06 Thread Joshua Leung
Commit: 806aa232fef4a0fb680e0304fd983c1c76cf8911
Author: Joshua Leung
Date:   Tue Nov 7 19:40:07 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB806aa232fef4a0fb680e0304fd983c1c76cf8911

WIP

===

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

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index d2ea38f91d9..26700b26d8d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1030,7 +1030,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene 
*scene, Object *ob)
bGPdata *gpd = (bGPdata *)obdata;
ID *gpd_id = &gpd->id; /* No COW for now, as GP uses 
its own cache system. See gpencil_engine.c */

-   op_node = add_operation_node(gpd_id, 
DEG_NODE_TYPE_GEOMETRY, NULL,
+   op_node = add_operation_node(gpd_id, 
DEG_NODE_TYPE_GEOMETRY, NULL, // XXX: cannot be null
 DEG_OPCODE_PLACEHOLDER, "GP Geometry 
Eval");
op_node->set_as_entry();
break;

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


[Bf-blender-cvs] [03235ea6723] greasepencil-object: GP drawing: Try to init the eval_ctx from draw_ctx, if C isn't provided

2017-11-06 Thread Joshua Leung
Commit: 03235ea672317749d822fd142d0650db7a20530d
Author: Joshua Leung
Date:   Sun Nov 5 01:54:16 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB03235ea672317749d822fd142d0650db7a20530d

GP drawing: Try to init the eval_ctx from draw_ctx, if C isn't provided

===

M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.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 4493f830a71..a47565316e2 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -165,6 +165,7 @@ static void gpencil_batch_cache_check_free_slots(Object 
*ob, bGPdata *UNUSED(gpd
gpencil_batch_cache_resize(cache, cache->cache_size);
}
 }
+
 /* cache init */
 static void gpencil_batch_cache_init(Object *ob, int cfra)
 {
@@ -197,7 +198,7 @@ static void gpencil_batch_cache_init(Object *ob, int cfra)
cache->cache_frame = cfra;
 }
 
-/*  clear cache */
+/* clear cache */
 static void gpencil_batch_cache_clear(GpencilBatchCache *cache, bGPdata *gpd)
 {
if (!cache) {
@@ -249,7 +250,7 @@ static GpencilBatchCache *gpencil_batch_cache_get(Object 
*ob, int cfra)
return gpencil_batch_get_element(ob);
 }
 
- /* create shading group for filling */
+/* create shading group for filling */
 static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data 
*e_data, GPENCIL_Data *vedata, DRWPass *pass, 
GPUShader *shader, bGPdata *gpd, PaletteColor *palcolor, int id)
 {
@@ -655,6 +656,22 @@ static void gpencil_draw_onion_strokes(GpencilBatchCache 
*cache, GPENCIL_e_data
}
 }
 
+
+/* Construct eval_ctx from draw_ctx state
+ * Note: This function copies CTX_data_eval_ctx() / 
DEG_evaluation_context_init_from_scene()
+ */
+static void gpencil_init_evalctx_from_drawctx(const DRWContextState *draw_ctx, 
EvaluationContext *eval_ctx)
+{
+   Scene *scene = draw_ctx->scene;
+   if (scene) {
+   eval_ctx->depsgraph = scene->depsgraph_legacy;
+   eval_ctx->ctime = BKE_scene_frame_get(scene);
+   }
+
+   eval_ctx->scene_layer = draw_ctx->scene_layer;
+   eval_ctx->engine = draw_ctx->engine;
+}
+
 /* main function to draw strokes */
 static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data 
*e_data, void *vedata, ToolSettings *ts, Object *ob,
bGPdata *gpd, bGPDlayer *gpl, bGPDframe *src_gpf, bGPDframe 
*derived_gpf,
@@ -670,16 +687,19 @@ static void gpencil_draw_strokes(GpencilBatchCache 
*cache, GPENCIL_e_data *e_dat
bool playing = (bool)stl->storage->playing;
 
/* Get evaluation context */
+   /* NOTE: We must check if C is valid, otherwise we get crashes when 
trying to save files
+* (i.e. the thumbnail offscreen rendering fails) 
+*/
const DRWContextState *draw_ctx = DRW_context_state_get();
const bContext *C = draw_ctx->evil_C;
 
EvaluationContext eval_ctx = {0};
if (C) {
-   /* NOTE: We must check if C is valid, otherwise we get crashes 
when trying to save files
-* (i.e. the thumbnail offscreen rendering fails) 
-*/
CTX_data_eval_ctx(C, &eval_ctx);
}
+   else {
+   gpencil_init_evalctx_from_drawctx(draw_ctx, &eval_ctx);
+   }
 
/* get parent matrix and save as static data */
ED_gpencil_parent_location(ob, gpd, gpl, viewmatrix);

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


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

2017-11-06 Thread Brecht Van Lommel
Commit: 2440415bd32a11561a1b7a57f9740978b2f93bdf
Author: Brecht Van Lommel
Date:   Tue Nov 7 03:06:18 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB2440415bd32a11561a1b7a57f9740978b2f93bdf

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/makesrna/intern/rna_image.c
index 09ea2efcd85,cb5d731efc5..75d9c1fe7fb
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@@ -175,6 -174,11 +175,11 @@@ static void rna_ImageUser_update(Main *
ImageUser *iuser = ptr->data;
  
BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
+ 
+   if(ptr->id.data) {
+   /* Update material or texture for render preview. */
 -  DAG_id_tag_update(ptr->id.data, 0);
++  DEG_id_tag_update(ptr->id.data, 0);
+   }
  }

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


[Bf-blender-cvs] [0e3fd70d7ac] master: Fix T53129: Cycles missing update when changing image auto refresh.

2017-11-06 Thread Brecht Van Lommel
Commit: 0e3fd70d7ac62c12ed85d3a90266994fac26bad0
Author: Brecht Van Lommel
Date:   Tue Nov 7 02:27:27 2017 +0100
Branches: master
https://developer.blender.org/rB0e3fd70d7ac62c12ed85d3a90266994fac26bad0

Fix T53129: Cycles missing update when changing image auto refresh.

Previously auto refresh worked, but only if it was already enabled before
starting the viewport render.

===

M   source/blender/makesrna/intern/rna_image.c

===

diff --git a/source/blender/makesrna/intern/rna_image.c 
b/source/blender/makesrna/intern/rna_image.c
index d7991ed6ef3..cb5d731efc5 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -174,6 +174,11 @@ static void rna_ImageUser_update(Main *UNUSED(bmain), 
Scene *scene, PointerRNA *
ImageUser *iuser = ptr->data;
 
BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
+
+   if(ptr->id.data) {
+   /* Update material or texture for render preview. */
+   DAG_id_tag_update(ptr->id.data, 0);
+   }
 }

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


[Bf-blender-cvs] [96d67c2e96c] temp-group-collections: Outliner: support Add Selected to group internal collections

2017-11-06 Thread Dalai Felinto
Commit: 96d67c2e96cc461d335a62d76aa63433ef37e6f6
Author: Dalai Felinto
Date:   Mon Nov 6 22:29:45 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rB96d67c2e96cc461d335a62d76aa63433ef37e6f6

Outliner: support Add Selected to group internal collections

===

M   source/blender/blenkernel/intern/collection.c
M   source/blender/editors/space_outliner/outliner_tools.c

===

diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index 7b34d377226..99a2a20c0ef 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -313,6 +313,9 @@ static void collection_object_add(const ID *id, 
SceneCollection *sc, Object *ob)
}
else {
BLI_assert(GS(id->name) == ID_GR);
+   if ((ob->flag & OB_FROMGROUP) == 0) {
+   ob->flag |= OB_FROMGROUP;
+   }
}
 
BKE_layer_sync_object_link(id, sc, ob);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c 
b/source/blender/editors/space_outliner/outliner_tools.c
index dce7cd917b0..03c08193e5e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -831,7 +831,7 @@ static void collection_cb(int event, TreeElement *te, 
TreeStoreElem *UNUSED(tsel
if (event == OL_COLLECTION_OP_OBJECTS_ADD) {
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
-   BKE_collection_object_add(&scene->id, sc, ob);
+   BKE_collection_object_add(id, sc, ob);
}
CTX_DATA_END;
 
@@ -1828,6 +1828,7 @@ static EnumPropertyItem prop_collection_op_none_types[] = 
{
 };
 
 static EnumPropertyItem prop_collection_op_group_internal_types[] = {
+   {OL_COLLECTION_OP_OBJECTS_ADD, "OBJECTS_ADD", ICON_ZOOMIN, "Add 
Selected", "Add selected objects to collection"},
{OL_COLLECTION_OP_COLLECTION_NEW, "COLLECTION_NEW", ICON_NEW, "New 
Collection", "Add a new nested collection"},
{OL_COLLECTION_OP_COLLECTION_DEL, "COLLECTION_DEL", ICON_X, "Delete 
Collection", "Delete the collection"},
{0, NULL, 0, NULL, NULL}

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


[Bf-blender-cvs] [57cef2fee31] temp-group-collections: Remove "Group Collection" functionality

2017-11-06 Thread Dalai Felinto
Commit: 57cef2fee3104f38320c97adcabb08cf0ed7bdfb
Author: Dalai Felinto
Date:   Mon Nov 6 20:48:17 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rB57cef2fee3104f38320c97adcabb08cf0ed7bdfb

Remove "Group Collection" functionality

This may get "double-reverted" in the future. But we want to separate this
from the main patch before merging it. And then eventually merging them
separately.

===

M   release/scripts/startup/bl_ui/properties_collection.py
M   source/blender/blenkernel/BKE_layer.h
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/layer.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations_layer.cc
M   source/blender/depsgraph/intern/depsgraph_query.cc
M   source/blender/editors/space_outliner/outliner_collections.c
M   source/blender/editors/space_outliner/outliner_tools.c
M   source/blender/makesdna/DNA_layer_types.h
M   source/blender/makesrna/intern/rna_layer.c

===

diff --git a/release/scripts/startup/bl_ui/properties_collection.py 
b/release/scripts/startup/bl_ui/properties_collection.py
index d810e02984c..dab9def37f4 100644
--- a/release/scripts/startup/bl_ui/properties_collection.py
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -43,24 +43,6 @@ class 
COLLECTION_PT_context_collection(CollectionButtonsPanel, Panel):
 layout.prop(collection, "name", text="", icon='COLLAPSEMENU')
 
 
-class COLLECTION_PT_collection(CollectionButtonsPanel, Panel):
-bl_label = "Collection"
-
-@classmethod
-def poll(cls, context):
-collection = context.layer_collection
-return collection and collection.collection.type == 'GROUP'
-
-def draw(self, context):
-layout = self.layout
-
-layer_collection = context.layer_collection
-scene_collection = layer_collection.collection
-
-if scene_collection.type == 'GROUP':
-layout.prop(scene_collection, "group")
-
-
 class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel):
 bl_label = "Render Settings"
 COMPAT_ENGINES = {'BLENDER_CLAY'}
@@ -171,7 +153,6 @@ class 
COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel):
 
 classes = (
 COLLECTION_PT_context_collection,
-COLLECTION_PT_collection,
 COLLECTION_PT_clay_settings,
 COLLECTION_PT_object_mode_settings,
 COLLECTION_PT_edit_mode_settings,
diff --git a/source/blender/blenkernel/BKE_layer.h 
b/source/blender/blenkernel/BKE_layer.h
index 0ce8c4a4a2e..78d5d40687e 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -80,7 +80,6 @@ void BKE_scene_layer_copy_data(struct SceneLayer *sl_dst, 
struct SceneLayer *sl_
const int flag);
 
 void BKE_layer_collection_free(struct SceneLayer *sl, struct LayerCollection 
*lc);
-void BKE_layer_collection_convert(struct SceneLayer *sl, struct 
LayerCollection *lc, const int type);
 
 struct LayerCollection *BKE_layer_collection_get_active(struct SceneLayer *sl);
 struct LayerCollection *BKE_layer_collection_get_active_ensure(struct Scene 
*scene, struct SceneLayer *sl);
diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index b2e52060a26..7b34d377226 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -420,48 +420,6 @@ bool BKE_collections_object_remove(Main *bmain, ID *id, 
Object *ob, const bool f
return removed;
 }
 
-#if 0
-static void collection_group_set_linking(ListBase *lb, const SceneCollection 
*sc)
-{
-   for (LayerCollection *lc = sl->layer_collections.first; lc; lc = 
lc->next) {
-   if (lc->scene_collection == sc) {
-   //XXX link
-   }
-   else {
-   collection_group_set_linking(&lc->layer_collections, 
sc);
-   }
-   }
-}
-#endif
-
-/**
- * Define a group for a group collection, and populate the collections 
accordingly
- *
- * \param group can be NULL
- */
-void BKE_collection_group_set(Scene *UNUSED(scene), SceneCollection *sc, Group 
*group)
-{
-   BLI_assert(sc->type == COLLECTION_TYPE_GROUP);
-   /* Add */
-   sc->group = group;
-}
-
-/**
- * \param lb: ListBase of LayerCollection elements.
- */
-static void collection_group_convert_layer_collections(const Group *group, 
SceneLayer *sl,
-   const SceneCollection 
*sc, ListBase *lb)
-{
-   for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
-   if (lc->scene_collection == sc) {
-   BKE_layer_collect

[Bf-blender-cvs] [4f8e13f948b] temp-group-collections: Outliner: Support moving objects from/to group internal collections

2017-11-06 Thread Dalai Felinto
Commit: 4f8e13f948b8dcb63e535529ec7cf95fd3ea5c17
Author: Dalai Felinto
Date:   Mon Nov 6 23:06:31 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rB4f8e13f948b8dcb63e535529ec7cf95fd3ea5c17

Outliner: Support moving objects from/to group internal collections

===

M   source/blender/blenkernel/BKE_collection.h
M   source/blender/blenkernel/intern/collection.c
M   source/blender/editors/space_outliner/outliner_intern.h
M   source/blender/editors/space_outliner/outliner_ops.c
M   source/blender/editors/space_outliner/outliner_tree.c

===

diff --git a/source/blender/blenkernel/BKE_collection.h 
b/source/blender/blenkernel/BKE_collection.h
index 6ae98e3456a..ba539f41f86 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -51,6 +51,7 @@ bool BKE_collection_remove(struct ID *id, struct 
SceneCollection *sc);
 void BKE_collection_copy_data(struct SceneCollection *sc_dst, struct 
SceneCollection *sc_src, const int flag);
 struct SceneCollection *BKE_collection_master(const struct Scene *scene);
 struct SceneCollection *BKE_collection_group_master(const struct Group *group);
+struct SceneCollection *BKE_collection_master_from_id(const struct ID *id);
 void BKE_collection_rename(const struct Scene *scene, struct SceneCollection 
*sc, const char *name);
 void BKE_collection_master_free(struct Scene *scene, const bool do_id_user);
 void BKE_collection_master_group_free(struct Group *group);
@@ -58,7 +59,7 @@ bool BKE_collection_object_add(const struct ID *id, struct 
SceneCollection *sc,
 void BKE_collection_object_add_from(struct Scene *scene, struct Object 
*ob_src, struct Object *ob_dst);
 bool BKE_collection_object_remove(struct Main *bmain, struct ID *id, struct 
SceneCollection *sc, struct Object *object, const bool free_us);
 bool BKE_collections_object_remove(struct Main *bmain, struct ID *id, struct 
Object *object, const bool free_us);
-void BKE_collection_object_move(struct Scene *scene, struct SceneCollection 
*sc_dst, struct SceneCollection *sc_src, struct Object *ob);
+void BKE_collection_object_move(struct ID *id, struct SceneCollection *sc_dst, 
struct SceneCollection *sc_src, struct Object *ob);
 
 void BKE_collection_group_set(struct Scene *scene, struct SceneCollection *sc, 
struct Group *group);
 struct Group *BKE_collection_group_create(struct Main *bmain, struct Scene 
*scene, struct LayerCollection *lc);
diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index 99a2a20c0ef..b4fa857b6a4 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -251,6 +251,11 @@ static SceneCollection *master_collection_from_id(const ID 
*id)
}
 }
 
+SceneCollection *BKE_collection_master_from_id(const ID *id)
+{
+   return master_collection_from_id(id);
+}
+
 struct UniqueNameCheckData {
ListBase *lb;
SceneCollection *lookup_sc;
@@ -396,10 +401,10 @@ bool BKE_collection_object_remove(Main *bmain, ID *id, 
SceneCollection *sc, Obje
 /**
  * Move object from a collection into another
  */
-void BKE_collection_object_move(Scene *scene, SceneCollection *sc_dst, 
SceneCollection *sc_src, Object *ob)
+void BKE_collection_object_move(ID *id, SceneCollection *sc_dst, 
SceneCollection *sc_src, Object *ob)
 {
-   BKE_collection_object_add(&scene->id, sc_dst, ob);
-   BKE_collection_object_remove(NULL, &scene->id, sc_src, ob, false);
+   BKE_collection_object_add(id, sc_dst, ob);
+   BKE_collection_object_remove(NULL, id, sc_src, ob, false);
 }
 
 /**
diff --git a/source/blender/editors/space_outliner/outliner_intern.h 
b/source/blender/editors/space_outliner/outliner_intern.h
index 1177514b859..8d7634e1a21 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -67,9 +67,8 @@ typedef enum TreeTraversalAction {
 
 /**
  * Callback type for reinserting elements at a different position, used to 
allow user customizable element order.
- * Passing scene right now, may be better to allow some custom data.
  */
-typedef void (*TreeElementReinsertFunc)(struct Main *bmain, struct ID *id,
+typedef void (*TreeElementReinsertFunc)(struct Main *bmain,
 struct TreeElement *insert_element,
 struct TreeElement *insert_handle, 
TreeElementInsertType action);
 /**
@@ -77,7 +76,7 @@ typedef void (*TreeElementReinsertFunc)(struct Main *bmain, 
struct ID *id,
  * if reinserting insert_element before/after/into insert_handle would be 
allowed.
  * It's allowed to change the reinsert info here for non const pointers.
  */
-typedef bool (*TreeElementReinsertPollFunc)(const struct ID *id, const struct 
TreeElement

[Bf-blender-cvs] [e4c408ca711] temp-group-collections: Merge remote-tracking branch 'origin/blender2.8' into temp-group-collections

2017-11-06 Thread Dalai Felinto
Commit: e4c408ca71132bf54d753e4c2031e974d08bf29a
Author: Dalai Felinto
Date:   Mon Nov 6 19:42:08 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rBe4c408ca71132bf54d753e4c2031e974d08bf29a

Merge remote-tracking branch 'origin/blender2.8' into temp-group-collections

===



===

diff --cc source/blender/depsgraph/DEG_depsgraph_query.h
index 2001053eb8b,59158ef0454..cbd2927f255
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@@ -102,8 -101,10 +101,12 @@@ typedef struct DEGObjectsIteratorData 
 * other users of the iterator.
 */
struct Object temp_dupli_object;
+ 
+   /*  ghash  */
+   struct GHashIterator gh_iter;
+ 
 +  /* List of all groups in current scene layer. */
 +  struct GSet *groups;
  } DEGObjectsIteratorData;
  
  void DEG_objects_iterator_begin(struct BLI_Iterator *iter, 
DEGObjectsIteratorData *data);
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 73aa75076e2,464a1454749..3f9c906dbbc
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -392,34 -396,14 +397,36 @@@ void DepsgraphNodeBuilder::build_group(
}
group_id->tag |= LIB_TAG_DOIT;
  
 -  LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
 -  build_object(scene, go->ob, DEG_ID_LINKED_INDIRECTLY);
 +  LINKLIST_FOREACH (Base *, base, &group->scene_layer->object_bases) {
-   build_object(scene, base->object);
++  build_object(scene, base->object, DEG_ID_LINKED_INDIRECTLY);
}
  }
  
 +void DepsgraphNodeBuilder::build_group(Scene *scene, Group *group, 
LayerCollectionState *state)
 +{
 +  /* XXX What happens if the group is instanced AND is in a layer 
collection?
 +   * We need to test something different than LIB_TAG_DOIT here 
(dfelinto). */
 +  ID *group_id = &group->id;
 +  if (group_id->tag & LIB_TAG_DOIT) {
 +  return;
 +  }
 +  group_id->tag |= LIB_TAG_DOIT;
 +
 +  LINKLIST_FOREACH (Base *, base, &group->scene_layer->object_bases) {
-   build_object(scene, base->object);
++  build_object(scene, base->object, DEG_ID_LINKED_INDIRECTLY);
 +  }
 +
 +  ComponentDepsNode *comp = add_component_node(&group->id, 
DEG_NODE_TYPE_LAYER_COLLECTIONS);
 +  add_operation_node(comp,
 + function_bind(BKE_layer_eval_layer_collection_pre, 
_1, scene, group->scene_layer, false),
 + DEG_OPCODE_SCENE_LAYER_GROUP,
 + group->id.name + 2);
 +  ++state->index;
 +}
 +
- void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
+ void DepsgraphNodeBuilder::build_object(Scene *scene,
+ Object *ob,
+ eDepsNode_LinkedState_Type 
linked_state)
  {
/* Skip rest of components if the ID node was already there. */
if (ob->id.tag & LIB_TAG_DOIT) {
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 8e7138f6be0,e7bf8c9998d..b576e7eab23
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@@ -156,15 -157,13 +157,22 @@@ struct DepsgraphNodeBuilder 
   const char *name = "",
   int name_tag = -1);
  
 +  struct LayerCollectionState {
 +  int index;
 +  LayerCollection *parent;
 +  };
 +
-   void build_scene(Main *bmain, Scene *scene);
-   void build_group(Scene *scene, Group *group);
-   void build_group(Scene *scene, Group *group, LayerCollectionState 
*state);
-   void build_object(Scene *scene, Object *ob);
+   void build_scene(Main *bmain,
+Scene *scene,
+eDepsNode_LinkedState_Type linked_state);
 -  void build_group(Scene *scene, Group *group);
++  void build_group(Scene *scene,
++   Group *group);
++  void build_group(Scene *scene,
++   Group *group,
++   LayerCollectionState *state);
+   void build_object(Scene *scene,
+ Object *ob,
+ eDepsNode_LinkedState_Type linked_state);
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/depsgraph_query.cc
index 9c884c0ecbd,156b98a6421..9e330efcff9
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph

[Bf-blender-cvs] [83de7c4094b] blender2.8: Fix break on duplicated instances since IDNodes depsgraph iterator

2017-11-06 Thread Dalai Felinto
Commit: 83de7c4094beb73036e71b5170502512c6936766
Author: Dalai Felinto
Date:   Mon Nov 6 21:18:27 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB83de7c4094beb73036e71b5170502512c6936766

Fix break on duplicated instances since IDNodes depsgraph iterator

===

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

===

diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index 156b98a6421..9fba961279b 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -264,6 +264,7 @@ void DEG_objects_iterator_begin(BLI_Iterator *iter, 
DEGObjectsIteratorData *data
data->dupli_list = NULL;
data->dupli_object_next = NULL;
data->dupli_object_current = NULL;
+   data->scene = DEG_get_evaluated_scene(graph);
 
DEG::Depsgraph *deg_graph = reinterpret_cast(graph);
BLI_ghashIterator_init(&data->gh_iter, deg_graph->id_hash);

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


[Bf-blender-cvs] [956ee5e2658] master: macOS: remove old OpenMP lib stuff from cmake

2017-11-06 Thread Arto Kitula
Commit: 956ee5e2658f3e823885f97668a75c48df34b765
Author: Arto Kitula
Date:   Mon Nov 6 23:54:35 2017 +0200
Branches: master
https://developer.blender.org/rB956ee5e2658f3e823885f97668a75c48df34b765

macOS: remove old OpenMP lib stuff from cmake

===

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

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bef37072de..359e51adbb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1422,10 +1422,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
 
 elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
 
-   if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to 
not fail all tests due presence of -fopenmp !
-   set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # 
these are only used for the checks
-   endif()
-
# strange, clang complains these are not supported, but then uses them.
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS 
C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION 
-Werror=implicit-function-declaration)
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index fcdebbb74ad..1435572fa5e 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -388,22 +388,6 @@ if(WITH_OPENMP)
set(WITH_OPENMP OFF)
else() # vanilla gcc or clang_omp support OpenMP
message(STATUS "Using special OpenMP enabled compiler !") # 
letting find_package(OpenMP) module work for gcc
-   if(CMAKE_C_COMPILER_ID MATCHES "Clang") # clang-omp in darwin 
libs
-   set(OPENMP_FOUND ON)
-   set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "C compiler 
flags for OpenMP parallization" FORCE)
-   set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "C++ 
compiler flags for OpenMP parallization" FORCE)
-   include_directories(${LIBDIR}/openmp/include)
-   link_directories(${LIBDIR}/openmp/lib)
-   # This is a workaround for our helperbinaries ( 
datatoc, masgfmt, ... ),
-   # They are linked also to omp lib, so we need it in 
builddir for runtime exexcution,
-   # TODO: remove all unneeded dependencies from these
-
-   # for intermediate binaries, in respect to lib ID
-   execute_process(
-   COMMAND ditto -arch ${CMAKE_OSX_ARCHITECTURES}
-   ${LIBDIR}/openmp/lib/libiomp5.dylib
-   
${CMAKE_BINARY_DIR}/Resources/lib/libiomp5.dylib)
-   endif()
endif()
 endif()
 
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 54a212f805b..2bda651f756 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -894,18 +894,6 @@ elseif(APPLE)
blender.app/Contents/
)
 
-   if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT 
${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
-   install(
-   FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
-   DESTINATION blender.app/Contents/Resources/lib/
-   )
-   install(
-   FILES ${LIBDIR}/openmp/LICENSE.txt
-   DESTINATION "."
-   RENAME LICENSE-libiomp5.txt
-   )
-   endif()
-
if(WITH_LLVM AND NOT LLVM_STATIC)
install(
FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib

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


[Bf-blender-cvs] [535adcdaa3c] blender2.8: Depsgraph: Iterates over ID Nodes instead of Bases

2017-11-06 Thread Dalai Felinto
Commit: 535adcdaa3cc83c62abe211b0f645cf0a8237eba
Author: Dalai Felinto
Date:   Mon Nov 6 17:44:39 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB535adcdaa3cc83c62abe211b0f645cf0a8237eba

Depsgraph: Iterates over ID Nodes instead of Bases

Although this works by itself, it should actually happen after:

"Reshuffle collections base flags evaluation, make it so object is gathering
its base flags from collections."

Meanwhile we have one single hacky function (deg_flush_base_flags_and_settings)
to be removed once the task above is tackled.

Reviewers: sergey

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

===

M   source/blender/depsgraph/DEG_depsgraph_query.h
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/builder/deg_builder_nodes_scene.cc
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_query.cc
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/nodes/deg_node.cc
M   source/blender/depsgraph/intern/nodes/deg_node.h

===

diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h 
b/source/blender/depsgraph/DEG_depsgraph_query.h
index 1020d4e606e..59158ef0454 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -33,6 +33,8 @@
 #ifndef __DEG_DEPSGRAPH_QUERY_H__
 #define __DEG_DEPSGRAPH_QUERY_H__
 
+#include "BLI_ghash.h"
+
 #include "DEG_depsgraph.h"
 
 struct ID;
@@ -81,9 +83,6 @@ typedef struct DEGObjectsIteratorData {
struct Scene *scene;
struct EvaluationContext eval_ctx;
 
-   /* TODO(sergey): Base should never be a thing coming FROM depsgraph. */
-   struct Base *base;
-   int base_flag;
int flag;
 
/*  Iteration over dupli-list. *** */
@@ -102,13 +101,16 @@ typedef struct DEGObjectsIteratorData {
 * other users of the iterator.
 */
struct Object temp_dupli_object;
+
+   /*  ghash  */
+   struct GHashIterator gh_iter;
+
 } DEGObjectsIteratorData;
 
 void DEG_objects_iterator_begin(struct BLI_Iterator *iter, 
DEGObjectsIteratorData *data);
 void DEG_objects_iterator_next(struct BLI_Iterator *iter);
 void DEG_objects_iterator_end(struct BLI_Iterator *iter);
 
-/* Temporary hacky solution waiting for cow depsgraph implementation. */
 #define DEG_OBJECT_ITER(graph_, instance_, flag_)  
   \
{   
  \
DEGObjectsIteratorData data_ = {
  \
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index ec60d86ec82..464a1454749 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -128,7 +128,7 @@ static void modifier_walk(void *user_data,
 {
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
if (*obpoin) {
-   data->builder->build_object(data->scene, *obpoin);
+   data->builder->build_object(data->scene, *obpoin, 
DEG_ID_LINKED_INDIRECTLY);
}
 }
 
@@ -141,7 +141,7 @@ void constraint_walk(bConstraint * /*con*/,
if (*idpoin) {
ID *id = *idpoin;
if (GS(id->name) == ID_OB) {
-   data->builder->build_object(data->scene, (Object *)id);
+   data->builder->build_object(data->scene, (Object *)id, 
DEG_ID_LINKED_INDIRECTLY);
}
}
 }
@@ -203,6 +203,11 @@ IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id, bool 
do_tag)
return id_node;
 }
 
+IDDepsNode *DepsgraphNodeBuilder::find_id_node(ID *id)
+{
+   return m_graph->find_id_node(id);
+}
+
 TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source()
 {
return m_graph->add_time_source();
@@ -392,27 +397,33 @@ void DepsgraphNodeBuilder::build_group(Scene *scene, 
Group *group)
group_id->tag |= LIB_TAG_DOIT;
 
LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
-   build_object(scene, go->ob);
+   build_object(scene, go->ob, DEG_ID_LINKED_INDIRECTLY);
}
 }
 
-void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
+void DepsgraphNodeBuilder::build_object(Scene *scene,
+Object *ob,
+eDepsNode_LinkedState_Type 
linked_state)
 {
/* Skip rest of components if the ID node was already there. */
if (ob->

[Bf-blender-cvs] [5a1a6dfd1e6] asset-engine: Merge branch 'id_override_static' into asset-engine

2017-11-06 Thread Bastien Montagne
Commit: 5a1a6dfd1e6ee9e07cc06bfee71a67ccf4b33ec8
Author: Bastien Montagne
Date:   Mon Nov 6 20:26:37 2017 +0100
Branches: asset-engine
https://developer.blender.org/rB5a1a6dfd1e6ee9e07cc06bfee71a67ccf4b33ec8

Merge branch 'id_override_static' into asset-engine

Conflicts:
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/node.c
source/blender/makesdna/DNA_ID.h

===



===



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


[Bf-blender-cvs] [d60a1c30956] id_override_static: Merge branch 'master' into id_override_static

2017-11-06 Thread Bastien Montagne
Commit: d60a1c30956ae84e0adc1ca0ceb67a504ab0be9a
Author: Bastien Montagne
Date:   Mon Nov 6 20:18:58 2017 +0100
Branches: id_override_static
https://developer.blender.org/rBd60a1c30956ae84e0adc1ca0ceb67a504ab0be9a

Merge branch 'master' into id_override_static

Conflicts:
source/blender/makesrna/intern/rna_access.c

===



===

diff --cc source/blender/blenkernel/intern/library_query.c
index bec5329b0e2,f6101498aca..466df5862f7
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@@ -368,13 -368,9 +368,13 @@@ void BKE_library_foreach_ID_link(Main *
  #define CALLBACK_INVOKE(check_id_super, cb_flag) \
FOREACH_CALLBACK_INVOKE(&data, check_id_super, cb_flag)
  
 +  if (id->override != NULL) {
 +  CALLBACK_INVOKE_ID(id->override->reference, IDWALK_CB_USER | 
IDWALK_CB_STATIC_OVERRIDE_REFERENCE);
 +  }
 +
for (; id != NULL; id = (flag & IDWALK_RECURSE) ? 
BLI_LINKSTACK_POP(data.ids_todo) : NULL) {
data.self_id = id;
-   data.cb_flag = ID_IS_LINKED_DATABLOCK(id) ? 
IDWALK_CB_INDIRECT_USAGE : 0;
+   data.cb_flag = ID_IS_LINKED(id) ? IDWALK_CB_INDIRECT_USAGE : 0;
  
if (bmain != NULL && bmain->relations != NULL && (flag & 
IDWALK_READONLY)) {
/* Note that this is minor optimization, even in worst 
cases (like id being an object with lots of
diff --cc source/blender/makesrna/intern/rna_access.c
index 0cbfa71c72c,14e0f6d45aa..4146bb2aca1
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@@ -1756,8 -1755,7 +1756,8 @@@ bool RNA_property_editable(PointerRNA *
  
return ((flag & PROP_EDITABLE) &&
(flag & PROP_REGISTER) == 0 &&
-   (!id || ((!ID_IS_LINKED_DATABLOCK(id) || (prop->flag & 
PROP_LIB_EXCEPTION)) &&
 -  (!id || !ID_IS_LINKED(id) || (prop->flag & 
PROP_LIB_EXCEPTION)));
++  (!id || ((!ID_IS_LINKED(id) || (prop->flag & 
PROP_LIB_EXCEPTION)) &&
 +   (!id->override || (prop->flag & PROP_OVERRIDABLE);
  }
  
  /**
@@@ -1783,19 -1781,11 +1783,19 @@@ bool RNA_property_editable_info(Pointer
}
  
/* property from linked data-block */
 -  if (id && ID_IS_LINKED(id) && (prop->flag & PROP_LIB_EXCEPTION) == 0) {
 -  if (!(*r_info)[0]) {
 -  *r_info = "Can't edit this property from a linked 
data-block.";
 +  if (id) {
-   if (ID_IS_LINKED_DATABLOCK(id) && (prop->flag & 
PROP_LIB_EXCEPTION) == 0) {
++  if (ID_IS_LINKED(id) && (prop->flag & PROP_LIB_EXCEPTION) == 0) 
{
 +  if (!(*r_info)[0]) {
 +  *r_info = "Can't edit this property from a 
linked data-block.";
 +  }
 +  return false;
 +  }
 +  if (id->override != NULL && (prop->flag & PROP_OVERRIDABLE) == 
0) {
 +  if (!(*r_info)[0]) {
 +  *r_info = "Can't edit this property from an 
override data-block.";
 +  }
 +  return false;
}
 -  return false;
}
  
return ((flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0);

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


[Bf-blender-cvs] [866c4a881da] greasepencil-object: Fix merge errors

2017-11-06 Thread Antonio Vazquez
Commit: 866c4a881dadaa43a3081cece18aee3a09e7220e
Author: Antonio Vazquez
Date:   Mon Nov 6 18:56:55 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB866c4a881dadaa43a3081cece18aee3a09e7220e

Fix merge errors

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_data.c 
b/source/blender/editors/gpencil/gpencil_data.c
index 99d747c4563..13f4256da6d 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1680,8 +1680,8 @@ static int gpencil_vertex_group_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
 
if ((ob) && (ob->type == OB_GPENCIL)) {
-   return (!ID_IS_LINKED_DATABLOCK(ob) &&
-   !ID_IS_LINKED_DATABLOCK(ob->data) &&
+   return (!ID_IS_LINKED(ob) &&
+   !ID_IS_LINKED(ob->data) &&
ob->defbase.first && 
((ob->mode == OB_MODE_GPENCIL_EDIT) || (ob->mode == 
OB_MODE_GPENCIL_SCULPT)));
}

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


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

2017-11-06 Thread Antonio Vazquez
Commit: fdf0191d78d071d175a37ca2d4417bc9dc2fadb2
Author: Antonio Vazquez
Date:   Mon Nov 6 18:44:25 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfdf0191d78d071d175a37ca2d4417bc9dc2fadb2

Merge branch 'blender2.8' into greasepencil-object

===



===

diff --cc source/blender/editors/space_outliner/outliner_tree.c
index a2dbae4968c,88c5aa431c9..f699b5506eb
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@@ -444,10 -444,10 +444,10 @@@ static void outliner_add_object_content
  
outliner_add_element(soops, &te->subtree, ob->poselib, te, 0, 0); // 
XXX FIXME.. add a special type for this

-   if (ob->proxy && !ID_IS_LINKED_DATABLOCK(ob))
+   if (ob->proxy && !ID_IS_LINKED(ob))
outliner_add_element(soops, &te->subtree, ob->proxy, te, 
TSE_PROXY, 0);

 -  outliner_add_element(soops, &te->subtree, ob->gpd, te, 0, 0);
 +  //outliner_add_element(soops, &te->subtree, ob->gpd, te, 0, 0); /* 
FIXME: Kept for now to make it easier to identify these objects for fixing */

outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0);

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


[Bf-blender-cvs] [facdc15fdd3] blender2.8: DRW: Fix compilation error.

2017-11-06 Thread Clément Foucault
Commit: facdc15fdd32c36abcdd4166c539a3c1b98c3966
Author: Clément Foucault
Date:   Mon Nov 6 18:40:29 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBfacdc15fdd32c36abcdd4166c539a3c1b98c3966

DRW: Fix compilation error.

===

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

===

diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index f18bc9969b1..62f343a0679 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -971,7 +971,7 @@ void DRW_shgroup_instance_batch(DRWShadingGroup *shgroup, 
struct Gwn_Batch *inst
shgroup->calls_first = call; \
} \
else { \
-   ((typeof(call))shgroup->calls)->head.prev = call; \
+   ((DRWCall *)(shgroup->calls))->head.prev = call; \
shgroup->calls = call; \
} \
call->head.prev = NULL; \

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


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

2017-11-06 Thread Bastien Montagne
Commit: 91af8f2ae2b5238839b57eaf74b0f950259ec57a
Author: Bastien Montagne
Date:   Mon Nov 6 18:02:46 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB91af8f2ae2b5238839b57eaf74b0f950259ec57a

Merge branch 'master' into blender2.8

Conflicts:
intern/cycles/device/device.cpp
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_relations.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/util/ed_util.c
source/blender/windowmanager/intern/wm_files_link.c

===



===

diff --cc intern/cycles/device/device.cpp
index 6a666eb946e,641e3fde140..3e052bb926e
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@@ -90,268 -85,127 +90,268 @@@ Device::~Device(
}
  }
  
 -void Device::draw_pixels(device_memory& rgba, int y, int w, int h, int dx, 
int dy, int width, int height, bool transparent,
 -  const DeviceDrawParams &draw_params)
 +/* TODO move shaders to standalone .glsl file. */
 +const char *FALLBACK_VERTEX_SHADER =
 +"#version 330\n"
 +"uniform vec2 fullscreen;\n"
 +"in vec2 texCoord;\n"
 +"in vec2 pos;\n"
 +"out vec2 texCoord_interp;\n"
 +"\n"
 +"vec2 normalize_coordinates()\n"
 +"{\n"
 +" return (vec2(2.0) * (pos / fullscreen)) - vec2(1.0);\n"
 +"}\n"
 +"\n"
 +"void main()\n"
 +"{\n"
 +" gl_Position = vec4(normalize_coordinates(), 0.0, 1.0);\n"
 +" texCoord_interp = texCoord;\n"
 +"}\n\0";
 +
 +const char *FALLBACK_FRAGMENT_SHADER =
 +"#version 330\n"
 +"uniform sampler2D image_texture;\n"
 +"in vec2 texCoord_interp;\n"
 +"out vec4 fragColor;\n"
 +"\n"
 +"void main()\n"
 +"{\n"
 +" fragColor = texture(image_texture, texCoord_interp);\n"
 +"}\n\0";
 +
 +static void shader_print_errors(const char *task, const char *log, const char 
*code)
  {
 -  assert(rgba.type == MEM_PIXELS);
 +  LOG(ERROR) << "Shader: " << task << " error:";
 +  LOG(ERROR) << "= shader string ";
  
 -  mem_copy_from(rgba, y, w, h, rgba.memory_elements_size(1));
 +  stringstream stream(code);
 +  string partial;
  
 -  if(transparent) {
 -  glEnable(GL_BLEND);
 -  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 +  int line = 1;
 +  while(getline(stream, partial, '\n')) {
 +  if(line < 10) {
 +  LOG(ERROR) << " " << line << " " << partial;
 +  }
 +  else {
 +  LOG(ERROR) << line << " " << partial;
 +  }
 +  line++;
}
 +  LOG(ERROR) << log;
 +}
  
 -  glColor3f(1.0f, 1.0f, 1.0f);
 +static int bind_fallback_shader(void)
 +{
 +  GLint status;
 +  GLchar log[5000];
 +  GLsizei length = 0;
 +  GLuint program = 0;
  
 -  if(rgba.data_type == TYPE_HALF) {
 -  /* for multi devices, this assumes the inefficient method that 
we allocate
 -   * all pixels on the device even though we only render to a 
subset */
 -  GLhalf *host_pointer = (GLhalf*)rgba.host_pointer;
 -  float vbuffer[16], *basep;
 -  float *vp = NULL;
 -
 -  host_pointer += 4*y*w;
 -
 -  /* draw half float texture, GLSL shader for display transform 
assumed to be bound */
 -  GLuint texid;
 -  glGenTextures(1, &texid);
 -  glBindTexture(GL_TEXTURE_2D, texid);
 -  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, 
GL_RGBA, GL_HALF_FLOAT, host_pointer);
 -  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
GL_NEAREST);
 -  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 
GL_NEAREST);
 -
 -  glEnable(GL_TEXTURE_2D);
 -
 -  if(draw_params.bind_display_space_shader_cb) {
 -  draw_params.bind_display_space_shader_cb();
 +  struct Shader {
 +  const char *source;
 +  GLenum type;
 +  } shaders[2] = {
 +  {FALLBACK_VERTEX_SHADER, GL_VERTEX_SHADER},
 +  {FALLBACK_FRAGMENT_SHADER, GL_FRAGMENT_SHADER}
 +};
 +
 +  program = glCreateProgram();
 +
 +  for(int i = 0; i < 2; i++) {
 +  GLuint shader = glCreateShader(shaders[i].type);
 +
 +  string source_str = shaders[i].source;
 +  const char *c_str = source_str.c_str();
 +
 +  glShaderSource(shader, 1, &c_str, NULL);
 +  glCompileShader(shader);
 +
 +  glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
 +
 +  if(!status) {
 +  glGetShaderInfoLog(shader, sizeof(log), &leng

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

2017-11-06 Thread Antonio Vazquez
Commit: 92a3028e92f24b4f005db4a98065d9661dabfdfa
Author: Antonio Vazquez
Date:   Mon Nov 6 17:47:18 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB92a3028e92f24b4f005db4a98065d9661dabfdfa

Merge branch 'blender2.8' into greasepencil-object

===



===



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


[Bf-blender-cvs] [9d77b5d5910] blender2.8: Eevee: Remove uses of DRW_shgroup_call_dynamic_add_empty in shadows and probe rendering.

2017-11-06 Thread Clément Foucault
Commit: 9d77b5d5910b65bed88817169d5444cfb189eb63
Author: Clément Foucault
Date:   Mon Nov 6 16:54:33 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB9d77b5d5910b65bed88817169d5444cfb189eb63

Eevee: Remove uses of DRW_shgroup_call_dynamic_add_empty in shadows and probe 
rendering.

This was adding an unecessary high number of DRWCall per objects.

===

M   source/blender/draw/engines/eevee/eevee_effects.c
M   source/blender/draw/engines/eevee/eevee_lightprobes.c
M   source/blender/draw/engines/eevee/eevee_lights.c
M   source/blender/draw/intern/DRW_render.h

===

diff --git a/source/blender/draw/engines/eevee/eevee_effects.c 
b/source/blender/draw/engines/eevee/eevee_effects.c
index a01ba6a3acf..e8ccd886630 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -214,8 +214,7 @@ void EEVEE_effects_cache_init(EEVEE_SceneLayerData 
*UNUSED(sldata), EEVEE_Data *
DRW_shgroup_uniform_buffer(grp, "source", &e_data.color_src);
DRW_shgroup_uniform_float(grp, "texelSize", 
&e_data.cube_texel_size, 1);
DRW_shgroup_uniform_int(grp, "Layer", &zero, 1);
-   for (int i = 0; i < 6; ++i)
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, 6);
}
 
{
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c 
b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 7b134ab4967..7913689d299 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -410,7 +410,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_SceneLayerData 
*sldata, EEVEE_Data *veda
// DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter);
DRW_shgroup_uniform_texture(grp, "probeHdr", sldata->probe_rt);
 
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, 1);
}
 
{
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c 
b/source/blender/draw/engines/eevee/eevee_lights.c
index 5f25f5ef815..6c1ed277005 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -307,16 +307,12 @@ void EEVEE_lights_cache_shcaster_add(EEVEE_SceneLayerData 
*sldata, EEVEE_PassLis
DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.shadow_sh, 
psl->shadow_cube_pass, geom);
DRW_shgroup_uniform_block(grp, "shadow_render_block", 
sldata->shadow_render_ubo);
DRW_shgroup_uniform_mat4(grp, "ShadowModelMatrix", (float *)obmat);
-
-   for (int i = 0; i < 6; ++i)
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, 6);
 
grp = DRW_shgroup_instance_create(e_data.shadow_sh, 
psl->shadow_cascade_pass, geom);
DRW_shgroup_uniform_block(grp, "shadow_render_block", 
sldata->shadow_render_ubo);
DRW_shgroup_uniform_mat4(grp, "ShadowModelMatrix", (float *)obmat);
-
-   for (int i = 0; i < MAX_CASCADE_NUM; ++i)
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, MAX_CASCADE_NUM);
 }
 
 void EEVEE_lights_cache_shcaster_material_add(
@@ -333,8 +329,7 @@ void EEVEE_lights_cache_shcaster_material_add(
if (alpha_threshold != NULL)
DRW_shgroup_uniform_float(grp, "alphaThreshold", 
alpha_threshold, 1);
 
-   for (int i = 0; i < 6; ++i)
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, 6);
 
grp = DRW_shgroup_material_instance_create(gpumat, 
psl->shadow_cascade_pass, geom, ob);
DRW_shgroup_uniform_block(grp, "shadow_render_block", 
sldata->shadow_render_ubo);
@@ -343,8 +338,7 @@ void EEVEE_lights_cache_shcaster_material_add(
if (alpha_threshold != NULL)
DRW_shgroup_uniform_float(grp, "alphaThreshold", 
alpha_threshold, 1);
 
-   for (int i = 0; i < MAX_CASCADE_NUM; ++i)
-   DRW_shgroup_call_dynamic_add_empty(grp);
+   DRW_shgroup_set_instance_count(grp, MAX_CASCADE_NUM);
 }
 
 void EEVEE_lights_cache_finish(EEVEE_SceneLayerData *sldata)
diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 599656ae163..fe489315e97 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -326,9 +326,11 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup 
*shgroup, const void *at
const void *array[] = {__VA_ARGS__}; \
DRW_shgroup_call_dynamic_add_array(shgroup, array, (sizeof(array) / 
sizeof(*array))); \
 } while (0)
+/* Use this only to make your instances selectable. */
 #define DRW_shgroup_call_dynamic_

[Bf-blender-cvs] [ed555750eb8] blender2.8: DRW: Use pseudo persistent memory pool for the rendering data structure.

2017-11-06 Thread Clément Foucault
Commit: ed555750eb8294005f54425094cb692f29830631
Author: Clément Foucault
Date:   Mon Nov 6 16:47:23 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBed555750eb8294005f54425094cb692f29830631

DRW: Use pseudo persistent memory pool for the rendering data structure.

This gets rid of the bottleneck of allocation / free of thousands of elements 
every frame.

Cache time (Eevee) (test scene is default file with cube duplicated 3241 times)
pre-patch: 23ms
post-patch: 14ms

===

M   source/blender/draw/intern/draw_manager.c
M   source/blender/gpu/GPU_viewport.h
M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index 57489153ba0..f18bc9969b1 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -27,6 +27,7 @@
 
 #include "BLI_dynstr.h"
 #include "BLI_listbase.h"
+#include "BLI_mempool.h"
 #include "BLI_rect.h"
 #include "BLI_string.h"
 
@@ -130,13 +131,6 @@
 /* Use draw manager to call GPU_select, see: DRW_draw_select_loop */
 #define USE_GPU_SELECT
 
-/* Use BLI_memiter */
-#define USE_MEM_ITER
-
-#ifdef USE_MEM_ITER
-#include "BLI_memiter.h"
-#endif
-
 #ifdef USE_GPU_SELECT
 #  include "ED_view3d.h"
 #  include "ED_armature.h"
@@ -147,6 +141,7 @@
 
 
 #define MAX_ATTRIB_NAME 32
+#define MAX_ATTRIB_COUNT 6 /* Can be adjusted for more */
 #define MAX_PASS_NAME 32
 #define MAX_CLIP_PLANES 6 /* GL_MAX_CLIP_PLANES is at least 6 */
 
@@ -177,7 +172,7 @@ typedef enum {
 } DRWAttribType;
 
 struct DRWUniform {
-   struct DRWUniform *next, *prev;
+   struct DRWUniform *next;
DRWUniformType type;
int location;
int length;
@@ -186,7 +181,7 @@ struct DRWUniform {
 };
 
 typedef struct DRWAttrib {
-   struct DRWAttrib *next, *prev;
+   struct DRWAttrib *prev;
char name[MAX_ATTRIB_NAME];
int location;
int format_id;
@@ -195,8 +190,9 @@ typedef struct DRWAttrib {
 } DRWAttrib;
 
 struct DRWInterface {
-   ListBase uniforms;   /* DRWUniform */
-   ListBase attribs;/* DRWAttrib */
+   DRWUniform *uniforms;   /* DRWUniform, single-linked list */
+   DRWAttrib *attribs; /* DRWAttrib, single-linked list */
+   DRWAttrib *attribs_first; /* First added attrib to traverse in the 
right order */
int attribs_count;
int attribs_stride;
int attribs_size[16];
@@ -227,15 +223,16 @@ struct DRWInterface {
 };
 
 struct DRWPass {
-   ListBase shgroups; /* DRWShadingGroup */
+   /* Single linked list with last member to append */
+   DRWShadingGroup *shgroups;
+   DRWShadingGroup *shgroups_last;
+
DRWState state;
char name[MAX_PASS_NAME];
 };
 
 typedef struct DRWCallHeader {
-#ifndef USE_MEM_ITER
-   void *next, *prev;
-#endif
+   void *prev;
 
 #ifdef USE_GPU_SELECT
int select_id;
@@ -265,21 +262,18 @@ typedef struct DRWCallGenerate {
 typedef struct DRWCallDynamic {
DRWCallHeader head;
 
-   const void *data[];
+   const void *data[MAX_ATTRIB_COUNT];
 } DRWCallDynamic;
 
 struct DRWShadingGroup {
-   struct DRWShadingGroup *next, *prev;
+   struct DRWShadingGroup *next;
 
GPUShader *shader;   /* Shader to bind */
-   DRWInterface *interface; /* Uniforms pointers */
+   DRWInterface interface;  /* Uniforms pointers */
 
/* DRWCall or DRWCallDynamic depending of type */
-#ifdef USE_MEM_ITER
-   BLI_memiter *calls;
-#else
-   ListBase calls;
-#endif
+   void *calls;
+   void *calls_first; /* To be able to traverse the list in the order of 
addition */
 
DRWState state_extra;/* State changes for this batch only 
(or'd with the pass's state) */
DRWState state_extra_disable;/* State changes for this batch only 
(and'd with the pass's state) */
@@ -322,6 +316,15 @@ enum {
 
 /** Render State: No persistent data between draw calls. */
 static struct DRWGlobalState {
+   /* Cache generation */
+   ViewportMemoryPool *vmempool;
+   DRWUniform *last_uniform;
+   DRWAttrib *last_attrib;
+   DRWCall *last_call;
+   DRWCallGenerate *last_callgenerate;
+   DRWCallDynamic *last_calldynamic;
+   DRWShadingGroup *last_shgroup;
+
/* Rendering state */
GPUShader *shader;
 
@@ -652,10 +655,8 @@ void DRW_shader_free(GPUShader *shader)
 /** \name Interface (DRW_interface)
  * \{ */
 
-static DRWInterface *DRW_interface_create(GPUShader *shader)
+static void DRW_interface_create(DRWInterface *interface, GPUShader *shader)
 {
-   DRWInterface *interface = MEM_mallocN(sizeof(DRWInterface), 
"DRWInterface");
-
interface->model = GPU_shader_get_builtin_uniform(shader, 
GWN_UNIFORM_MODEL);
interface->modelinverse = GP

[Bf-blender-cvs] [1431d9a5457] temp_cryptomatte: Revert moving includes to fix linux linking and just change linkorder again

2017-11-06 Thread Jens Verwiebe
Commit: 1431d9a5457cbbcb01c4e9254673aeb9799eb051
Author: Jens Verwiebe
Date:   Mon Nov 6 17:32:30 2017 +0100
Branches: temp_cryptomatte
https://developer.blender.org/rB1431d9a5457cbbcb01c4e9254673aeb9799eb051

Revert moving includes to fix linux linking and just change linkorder again

===

M   build_files/cmake/macros.cmake
M   intern/cycles/device/CMakeLists.txt
M   intern/cycles/render/CMakeLists.txt

===

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 6998595a6fc..1630ff3d973 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -651,10 +651,10 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_intern_mikktspace
bf_intern_dualcon
bf_intern_cycles
+   cycles_device
cycles_render
cycles_graph
cycles_bvh
-   cycles_device
cycles_kernel
cycles_util
cycles_subd
diff --git a/intern/cycles/device/CMakeLists.txt 
b/intern/cycles/device/CMakeLists.txt
index 30b0e7a0da0..959c0aa97c9 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -31,7 +31,6 @@ set(SRC
device_opencl.cpp
device_split_kernel.cpp
device_task.cpp
-   ../render/coverage.cpp
 )
 
 set(SRC_OPENCL
@@ -59,7 +58,6 @@ set(SRC_HEADERS
device_network.h
device_split_kernel.h
device_task.h
-   ../render/coverage.h
 )
 
 add_definitions(${GL_DEFINITIONS})
diff --git a/intern/cycles/render/CMakeLists.txt 
b/intern/cycles/render/CMakeLists.txt
index 17ac66644e2..ce2344b9c35 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -15,6 +15,7 @@ set(SRC
buffers.cpp
camera.cpp
constant_fold.cpp
+   coverage.cpp
film.cpp
graph.cpp
image.cpp
@@ -44,6 +45,7 @@ set(SRC_HEADERS
buffers.h
camera.h
constant_fold.h
+   coverage.h
film.h
graph.h
image.h

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


[Bf-blender-cvs] [66a6d160fe2] master: Rename ID_IS_LINKED_DATABLOCK to ID_IS_LINKED.

2017-11-06 Thread Bastien Montagne
Commit: 66a6d160fe26c1bac7a5dd4cd26cb5fbd5cf348e
Author: Bastien Montagne
Date:   Mon Nov 6 17:17:10 2017 +0100
Branches: master
https://developer.blender.org/rB66a6d160fe26c1bac7a5dd4cd26cb5fbd5cf348e

Rename ID_IS_LINKED_DATABLOCK to ID_IS_LINKED.

This makes code closer to id_override/assent-engine ones, which
introduce a new type of linked data, and hence reserve
ID_IS_LINKED_DATABLOCK to real linked datablocks.

===

M   source/blender/blenkernel/intern/armature_update.c
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/blenkernel/intern/library.c
M   source/blender/blenkernel/intern/library_query.c
M   source/blender/blenkernel/intern/library_remap.c
M   source/blender/blenkernel/intern/material.c
M   source/blender/blenkernel/intern/modifier.c
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/object_update.c
M   source/blender/blenkernel/intern/packedFile.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/editors/animation/anim_filter.c
M   source/blender/editors/animation/keyframes_draw.c
M   source/blender/editors/armature/pose_edit.c
M   source/blender/editors/armature/pose_lib.c
M   source/blender/editors/interface/interface_eyedropper.c
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/interface/interface_region_tooltip.c
M   source/blender/editors/interface/interface_templates.c
M   source/blender/editors/mesh/editmesh_tools.c
M   source/blender/editors/mesh/mesh_data.c
M   source/blender/editors/object/object_add.c
M   source/blender/editors/object/object_constraint.c
M   source/blender/editors/object/object_data_transfer.c
M   source/blender/editors/object/object_edit.c
M   source/blender/editors/object/object_modifier.c
M   source/blender/editors/object/object_relations.c
M   source/blender/editors/object/object_shapekey.c
M   source/blender/editors/object/object_transform.c
M   source/blender/editors/object/object_vgroup.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/physics/particle_object.c
M   source/blender/editors/screen/screen_ops.c
M   source/blender/editors/sculpt_paint/paint_image.c
M   source/blender/editors/sculpt_paint/paint_vertex.c
M   source/blender/editors/space_logic/logic_ops.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/editors/space_outliner/outliner_edit.c
M   source/blender/editors/space_outliner/outliner_tools.c
M   source/blender/editors/space_outliner/outliner_tree.c
M   source/blender/editors/space_text/text_ops.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/editors/space_view3d/view3d_edit.c
M   source/blender/editors/space_view3d/view3d_fly.c
M   source/blender/editors/space_view3d/view3d_view.c
M   source/blender/editors/space_view3d/view3d_walk.c
M   source/blender/editors/transform/transform_conversions.c
M   source/blender/editors/util/ed_util.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesrna/intern/rna_access.c
M   source/blender/makesrna/intern/rna_object.c
M   source/blender/render/intern/source/pipeline.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/blenkernel/intern/armature_update.c 
b/source/blender/blenkernel/intern/armature_update.c
index 45d1d36aeca..aac9cfdf792 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -705,7 +705,7 @@ void BKE_pose_eval_flush(EvaluationContext 
*UNUSED(eval_ctx),
 
 void BKE_pose_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx), Object *ob)
 {
-   BLI_assert(ID_IS_LINKED_DATABLOCK(ob) && ob->proxy_from != NULL);
+   BLI_assert(ID_IS_LINKED(ob) && ob->proxy_from != NULL);
DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
diff --git a/source/blender/blenkernel/intern/bpath.c 
b/source/blender/blenkernel/intern/bpath.c
index f210c6aa7f3..158c6c31432 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -425,7 +425,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, 
BPathVisitor visit_cb, const int
 {
const char *absbase = (flag & BKE_BPATH_TRAVERSE_ABS) ? 
ID_BLEND_PATH(bmain, id) : NULL;
 
-   if ((flag 

[Bf-blender-cvs] [51ca8f81edb] greasepencil-object: Fix problem after merge

2017-11-06 Thread Antonio Vazquez
Commit: 51ca8f81edbc12872161385baedeb98f4f83fe49
Author: Antonio Vazquez
Date:   Mon Nov 6 17:17:19 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB51ca8f81edbc12872161385baedeb98f4f83fe49

Fix problem after merge

One BKE function used changed

===

M   source/blender/modifiers/intern/MOD_gpencillattice.c

===

diff --git a/source/blender/modifiers/intern/MOD_gpencillattice.c 
b/source/blender/modifiers/intern/MOD_gpencillattice.c
index 54d81d6c1f4..26095381b4c 100644
--- a/source/blender/modifiers/intern/MOD_gpencillattice.c
+++ b/source/blender/modifiers/intern/MOD_gpencillattice.c
@@ -43,6 +43,7 @@
 #include "BKE_library_query.h"
 #include "BKE_scene.h"
 #include "BKE_main.h"
+#include "BKE_layer.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -107,6 +108,9 @@ static void bakeModifierGP(const bContext *C, const 
EvaluationContext *eval_ctx,
LatticeDeformData *ldata = NULL;
bGPdata *gpd = ob->data;
int oldframe = CFRA;
+   /* Get depsgraph and scene layer */
+   SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene);
+   Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
 
if (mmd->object == NULL)
return;
@@ -119,7 +123,7 @@ static void bakeModifierGP(const bContext *C, const 
EvaluationContext *eval_ctx,
 * NOTE: this assumes that we don't want lattice 
animation on non-keyframed frames
 */
CFRA = gpf->framenum;
-   BKE_scene_update_for_newframe(&eval_ctx_copy, bmain, 
scene);
+   BKE_scene_graph_update_for_newframe(&eval_ctx_copy, 
depsgraph, bmain, scene);

/* recalculate lattice data */
BKE_gpencil_lattice_init(ob);
@@ -140,7 +144,7 @@ static void bakeModifierGP(const bContext *C, const 
EvaluationContext *eval_ctx,
 
/* return frame state and DB to original state */
CFRA = oldframe;
-   BKE_scene_update_for_newframe(&eval_ctx_copy, bmain, scene); /* XXX: 
needed? */
+   BKE_scene_graph_update_for_newframe(&eval_ctx_copy, depsgraph, bmain, 
scene);
 }
 
 static void freeData(ModifierData *md)

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


[Bf-blender-cvs] [5d70e847dd6] blender2.8: Fix T51604: Support Auto-Smooth in Edit-Mesh and allocate loop_normals in MeshRenderData instead of CustomData

2017-11-06 Thread Germano
Commit: 5d70e847dd6f5182fa67c3b08260fbb5366009b5
Author: Germano
Date:   Mon Nov 6 14:14:07 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB5d70e847dd6f5182fa67c3b08260fbb5366009b5

Fix T51604: Support Auto-Smooth in Edit-Mesh
and allocate loop_normals in MeshRenderData instead of CustomData

Differential Revision: D2907

===

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

===

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c 
b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 615b79328b6..8cd0c13faec 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -339,6 +339,33 @@ static void mesh_cd_calc_used_gpu_layers(
}
 }
 
+
+static void mesh_render_calc_normals_loop_and_poly(const Mesh *me, const float 
split_angle, MeshRenderData *rdata)
+{
+   BLI_assert((me->flag & ME_AUTOSMOOTH) != 0);
+
+   int totloop = me->totloop;
+   int totpoly = me->totpoly;
+   float (*loop_normals)[3] = MEM_mallocN(sizeof(*loop_normals) * totloop, 
__func__);
+   float (*poly_normals)[3] = MEM_mallocN(sizeof(*poly_normals) * totpoly, 
__func__);
+   short (*clnors)[2] = CustomData_get_layer(&me->ldata, 
CD_CUSTOMLOOPNORMAL);
+
+   BKE_mesh_calc_normals_poly(
+   me->mvert, NULL, me->totvert,
+   me->mloop, me->mpoly, totloop, totpoly, poly_normals, false);
+
+   BKE_mesh_normals_loop_split(
+   me->mvert, me->totvert, me->medge, me->totedge,
+   me->mloop, loop_normals, totloop, me->mpoly, poly_normals, 
totpoly,
+   true, split_angle, NULL, clnors, NULL);
+
+   rdata->loop_len = totloop;
+   rdata->poly_len = totpoly;
+   rdata->loop_normals = loop_normals;
+   rdata->poly_normals = poly_normals;
+}
+
+
 /**
  * TODO(campbell): 'gpumat_array' may include materials linked to the object.
  * While not default, object materials should be supported.
@@ -354,6 +381,9 @@ static MeshRenderData *mesh_render_data_create_ex(
 
CustomData_reset(&rdata->cd.output.ldata);
 
+   const bool is_auto_smooth = (me->flag & ME_AUTOSMOOTH) != 0;
+   const float split_angle = is_auto_smooth ? me->smoothresh : (float)M_PI;
+
if (me->edit_btmesh) {
BMEditMesh *embm = me->edit_btmesh;
BMesh *bm = embm->bm;
@@ -374,7 +404,12 @@ static MeshRenderData *mesh_render_data_create_ex(
rdata->tri_len = embm->tottri;
}
if (types & MR_DATATYPE_LOOP) {
-   rdata->loop_len = bm->totloop;
+   int totloop = bm->totloop;
+   if (is_auto_smooth) {
+   rdata->loop_normals = 
MEM_mallocN(sizeof(*rdata->loop_normals) * totloop, __func__);
+   BM_loops_calc_normal_vcos(bm, NULL, NULL, NULL, 
true, split_angle, rdata->loop_normals, NULL, NULL, -1);
+   }
+   rdata->loop_len = totloop;
bm_ensure_types |= BM_LOOP;
}
if (types & MR_DATATYPE_POLY) {
@@ -447,12 +482,12 @@ static MeshRenderData *mesh_render_data_create_ex(
BKE_mesh_recalc_looptri(me->mloop, me->mpoly, 
me->mvert, me->totloop, me->totpoly, rdata->mlooptri);
}
if (types & MR_DATATYPE_LOOP) {
-   if (me->flag & ME_AUTOSMOOTH) {
-   BKE_mesh_calc_normals_split(me);
-   rdata->loop_normals = 
CustomData_get_layer(&me->ldata, CD_NORMAL);
-   }
rdata->loop_len = me->totloop;
rdata->mloop = CustomData_get_layer(&me->ldata, 
CD_MLOOP);
+
+   if (is_auto_smooth) {
+   mesh_render_calc_normals_loop_and_poly(me, 
split_angle, rdata);
+   }
}
if (types & MR_DATATYPE_POLY) {
rdata->poly_len = me->totpoly;
@@ -538,8 +573,6 @@ static MeshRenderData *mesh_render_data_create_ex(
rdata->orco = NULL;
}
 
-   const bool is_auto_smooth = (me->flag & ME_AUTOSMOOTH) != 0;
-
/* don't access mesh directly, instead use vars taken from 
BMesh or Mesh */
 #define me DONT_USE_THIS
 #ifdef  me /* quiet warning */
@@ -665,8 +698,10 @@ static MeshRenderData *mesh_render_data_create_ex(
BMesh *bm = em->bm;
 
if (is_auto_smooth && rdata->loop_normals == 
NULL) {
-   /* TODO: split normals, see below */
-   rdata->loop_normals = 
CustomData_get_layer(cd_ldata

[Bf-blender-cvs] [420cc7c2b50] asset-engine: Merge branch 'id_override_static' into asset-engine

2017-11-06 Thread Bastien Montagne
Commit: 420cc7c2b5069f545c31adf312b07d7e9389bc91
Author: Bastien Montagne
Date:   Mon Nov 6 17:01:25 2017 +0100
Branches: asset-engine
https://developer.blender.org/rB420cc7c2b5069f545c31adf312b07d7e9389bc91

Merge branch 'id_override_static' into asset-engine

 Conflicts:
source/blender/editors/interface/interface_regions.c

===



===

diff --cc source/blender/editors/interface/interface_region_tooltip.c
index 000,ace1afb79aa..5ecd9de5335
mode 00,100644..100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@@ -1,0 -1,756 +1,761 @@@
+ /*
+  * * BEGIN GPL LICENSE BLOCK *
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * The Original Code is Copyright (C) 2008 Blender Foundation.
+  * All rights reserved.
+  *
+  * Contributor(s): Blender Foundation
+  *
+  * * END GPL LICENSE BLOCK *
+  */
+ 
+ /** \file blender/editors/interface/interface_region_tooltip.c
+  *  \ingroup edinterface
+  *
+  * ToolTip Region and Construction
+  */
+ 
+ #include 
+ #include 
+ #include 
+ #include 
+ 
+ #include "MEM_guardedalloc.h"
+ 
+ #include "DNA_userdef_types.h"
+ 
+ #include "BLI_math.h"
+ #include "BLI_string.h"
+ #include "BLI_string_utf8.h"
+ #include "BLI_rect.h"
+ #include "BLI_utildefines.h"
+ 
+ #include "BKE_context.h"
+ #include "BKE_screen.h"
+ 
+ #include "WM_api.h"
+ #include "WM_types.h"
+ 
+ #include "RNA_access.h"
+ 
+ #include "BIF_gl.h"
+ 
+ #include "UI_interface.h"
+ 
+ #include "BLF_api.h"
+ #include "BLT_translation.h"
+ 
+ #include "ED_screen.h"
+ 
+ #include "interface_intern.h"
+ #include "interface_regions_intern.h"
+ 
+ #define UI_TIP_PAD_FAC  1.3f
+ #define UI_TIP_PADDING  (int)(UI_TIP_PAD_FAC * UI_UNIT_Y)
+ #define UI_TIP_MAXWIDTH 600
+ 
+ 
+ typedef struct uiTooltipFormat {
+   enum {
+   UI_TIP_STYLE_NORMAL = 0,
+   UI_TIP_STYLE_HEADER,
+   UI_TIP_STYLE_MONO,
+   } style : 3;
+   enum {
+   UI_TIP_LC_MAIN = 0, /* primary text */
+   UI_TIP_LC_VALUE,/* the value of buttons (also 
shortcuts) */
+   UI_TIP_LC_ACTIVE,   /* titles of active enum values */
+   UI_TIP_LC_NORMAL,   /* regular text */
+   UI_TIP_LC_PYTHON,   /* Python snippet */
+   UI_TIP_LC_ALERT,/* description of why operator can't 
run */
+   } color_id : 4;
+   int is_pad : 1;
+ } uiTooltipFormat;
+ 
+ typedef struct uiTooltipField {
+   char *text;
+   char *text_suffix;
+   struct {
+   uint x_pos; /* x cursor position at the end of the last 
line */
+   uint lines; /* number of lines, 1 or more with word-wrap */
+   } geom;
+   uiTooltipFormat format;
+ 
+ } uiTooltipField;
+ 
+ #define MAX_TOOLTIP_LINES 8
+ typedef struct uiTooltipData {
+   rcti bbox;
+   uiTooltipField *fields;
+   uintfields_len;
+   uiFontStyle fstyle;
+   int wrap_width;
+   int toth, lineh;
+ } uiTooltipData;
+ 
+ #define UI_TIP_LC_MAX 6
+ 
+ BLI_STATIC_ASSERT(UI_TIP_LC_MAX == UI_TIP_LC_ALERT + 1, "invalid lc-max");
+ BLI_STATIC_ASSERT(sizeof(uiTooltipFormat) <= sizeof(int), "oversize");
+ 
+ static uiTooltipField *text_field_add_only(
+ uiTooltipData *data)
+ {
+   data->fields_len += 1;
+   data->fields = MEM_recallocN(data->fields, sizeof(*data->fields) * 
data->fields_len);
+   return &data->fields[data->fields_len - 1];
+ }
+ 
+ static uiTooltipField *text_field_add(
+ uiTooltipData *data,
+ const uiTooltipFormat *format)
+ {
+   uiTooltipField *field = text_field_add_only(data);
+   field->format = *format;
+   return field;
+ }
+ 
+ /*  */
+ /** \name ToolTip Callbacks (Draw & Free)
+  * \{ */
+ 
+ static void rgb_tint(
+ float col[3],
+ float h, float h_strength,
+ float v, float v_strength)
+ {
+   float col_hsv_from[3];
+   float col_hsv_to[3];
+ 
+   rgb_to_hsv_v(col, col_hsv_from);
+ 
+  

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

2017-11-06 Thread Antonio Vazquez
Commit: a66cae873789ea3083ea2bc4d9837908e80ee795
Author: Antonio Vazquez
Date:   Mon Nov 6 16:56:51 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBa66cae873789ea3083ea2bc4d9837908e80ee795

Merge branch 'blender2.8' into greasepencil-object

===



===



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


[Bf-blender-cvs] [7578791ce8d] temp_cryptomatte: Cycles: Fixed Cryptomatte crash when some RenderLayers use Cryptomattes and some don't

2017-11-06 Thread Stefan Werner
Commit: 7578791ce8d4df79fc9cf8fc3deffdb75bae76d4
Author: Stefan Werner
Date:   Mon Nov 6 14:49:03 2017 +0100
Branches: temp_cryptomatte
https://developer.blender.org/rB7578791ce8d4df79fc9cf8fc3deffdb75bae76d4

Cycles: Fixed Cryptomatte crash when some RenderLayers use Cryptomattes and 
some don't

The kernel level pass_aov array was not re-initialised properly and kept the 
info from the previous RenderLayer instead

===

M   intern/cycles/render/film.cpp

===

diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index b6911bdf94b..a3a251405d4 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -430,6 +430,7 @@ void Film::device_update(Device *device, DeviceScene 
*dscene, Scene *scene)
kfilm->pass_flag = 0;
kfilm->pass_stride = 0;
kfilm->use_light_pass = use_light_visibility || use_sample_clamp;
+   ::memset(kfilm->pass_aov, 0, sizeof(kfilm->pass_aov));
 
for(size_t i = 0; i < passes.passes.size(); i++) {
Pass& pass = passes.passes[i];

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


[Bf-blender-cvs] [e2a18af69dc] greasepencil-object: Smooth new points while drawing

2017-11-06 Thread Antonio Vazquez
Commit: e2a18af69dcc9f48ca9a2bc1eca87abe91e851d4
Author: Antonio Vazquez
Date:   Mon Nov 6 16:55:50 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe2a18af69dcc9f48ca9a2bc1eca87abe91e851d4

Smooth new points while drawing

A new smooth algorithm is used for each new buffer point using the last two 
points to calculate the estimated position and average this point with the 
current mouse position.

This smooth reduce the jitter of the stroke and allows to use lower post smooth 
values to reduce stroke change after finish stroke.

Now the factor is hardcoded, but after some more testing maybe we need add a 
parameter by brush.

===

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 48766f8846b..1b1452babef 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -469,6 +469,57 @@ static void gp_brush_angle(bGPdata *gpd, bGPDbrush *brush, 
tGPspoint *pt, const
 
 }
 
+static void copy_v2int_v2float(int r[2], const float a[2])
+{
+   r[0] = (int)a[0];
+   r[1] = (int)a[1];
+}
+
+static void copy_v2float_v2int(float r[2], const int a[2])
+{
+   r[0] = (float)a[0];
+   r[1] = (float)a[1];
+}
+
+/**
+* Apply smooth to last point of buffer
+* \param gpd  Current gp datablock
+* \param inf  Amount of smoothing to apply
+*/
+static bool gp_smooth_buffer_point(bGPdata *gpd, float inf)
+{
+   tGPspoint *pt, *pta, *ptb;
+   float fpt[2], fpta[2], fptb[2];
+   float sco[2] = { 0.0f };
+
+   /* Do nothing if not enough points to smooth out */
+   if (gpd->sbuffer_size < 3) {
+   return false;
+   }
+
+   int i = gpd->sbuffer_size - 1;
+
+   /* points used as reference */
+   pta = (tGPspoint *)gpd->sbuffer + i - 2;
+   ptb = (tGPspoint *)gpd->sbuffer + i - 1;
+
+   /* current point */
+   pt = (tGPspoint *)gpd->sbuffer + i;
+
+   /* compute estimated position following last two points vector */
+   copy_v2float_v2int(fpta, &pta->x);
+   copy_v2float_v2int(fptb, &ptb->x);
+   copy_v2float_v2int(fpt, &pt->x);
+   float lambda = closest_to_line_v2(sco, fpt, fpta, fptb);
+   if (lambda > 0.0f) {
+   /* blend between original and optimal smoothed coordinate */
+   interp_v2_v2v2(fpt, fpt, sco, inf);
+   copy_v2int_v2float(&pt->x, fpt);
+   }
+   return true;
+}
+
+
 /* add current stroke-point to buffer (returns whether point was successfully 
added) */
 static short gp_stroke_addpoint(
 tGPsdata *p, const int mval[2], float pressure, double curtime)
@@ -531,6 +582,7 @@ static short gp_stroke_addpoint(
else {
pt->pressure = 1.0f;
}
+
/* Apply jitter to position */
if (brush->draw_jitter > 0.0f) {
int r_mval[2];
@@ -586,7 +638,11 @@ static short gp_stroke_addpoint(

/* increment counters */
gpd->sbuffer_size++;
-   
+
+   /* apply dynamic smooth to point */
+   /* TODO: now the influence is harcoded to 0.6, maybe need a 
parameter by brush or session? */
+   gp_smooth_buffer_point(gpd, 0.6f);
+
/* check if another operation can still occur */
if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX)
return GP_STROKEADD_FULL;

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


[Bf-blender-cvs] [0dce80ad432] id_override_static: Merge branch 'master' into id_override_static

2017-11-06 Thread Bastien Montagne
Commit: 0dce80ad4323822c95429d782c51c105b18a4e18
Author: Bastien Montagne
Date:   Mon Nov 6 16:08:23 2017 +0100
Branches: id_override_static
https://developer.blender.org/rB0dce80ad4323822c95429d782c51c105b18a4e18

Merge branch 'master' into id_override_static

Conflicts:
source/blender/editors/interface/interface_handlers.c

===



===

diff --cc source/blender/editors/interface/interface_handlers.c
index bee85fadefc,4dfb1a92bf6..2beee5a4862
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@@ -6789,14 -6790,9 +6793,8 @@@ static bool ui_but_menu(bContext *C, ui
/*bool is_idprop = RNA_property_is_idprop(prop);*/ /* XXX does 
not work as expected, not strictly needed */
bool is_set = RNA_property_is_set(ptr, prop);
  
 -  /* Set the (button_pointer, button_prop) and pointer data for 
Python access to the hovered ui element. */
 -  uiLayoutSetContextFromBut(layout, but);
 +  RNA_property_override_status(ptr, prop, -1, &is_overridable, 
NULL, NULL, NULL);
  
-   /* set the prop and pointer data for python access to the 
hovered ui element; TODO, index could be supported as well*/
-   PointerRNA temp_ptr;
-   RNA_pointer_create(NULL, &RNA_Property, but->rnaprop, 
&temp_ptr);
-   uiLayoutSetContextPointer(layout, "button_prop", &temp_ptr);
-   uiLayoutSetContextPointer(layout, "button_pointer", ptr);
- 
/* second slower test, saved people finding keyframe items in 
menus when its not possible */
if (is_anim)
is_anim = 
RNA_property_path_from_ID_check(&but->rnapoin, but->rnaprop);

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


[Bf-blender-cvs] [b28da9dbf81] master: Fix T53250: Crash when linking/appending a scene to a blend when another linked scene in this blend is currently open/active.

2017-11-06 Thread Bastien Montagne
Commit: b28da9dbf81581454ecda8197f4b23574e495729
Author: Bastien Montagne
Date:   Mon Nov 6 15:16:40 2017 +0100
Branches: master
https://developer.blender.org/rBb28da9dbf81581454ecda8197f4b23574e495729

Fix T53250: Crash when linking/appending a scene to a blend when another linked 
scene in this blend is currently open/active.

Inner DAG code would not check against NULL pointer, and in case of an
active linked scene, scene pointer will be NULL here, so we have to
check it ourself. ;)

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_files_link.c 
b/source/blender/windowmanager/intern/wm_files_link.c
index 7e6c6160b84..ad71ce1aad9 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -446,7 +446,9 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, false);
 
/* recreate dependency graph to include new objects */
-   DAG_scene_relations_rebuild(bmain, scene);
+   if (scene) {
+   DAG_scene_relations_rebuild(bmain, scene);
+   }

/* free gpu materials, some materials depend on existing objects, such 
as lamps so freeing correctly refreshes */
GPU_materials_free();

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


[Bf-blender-cvs] [7082bd1f4ca] blender2.8: Depsgraph: Cleanup, remove obsolete unused function

2017-11-06 Thread Sergey Sharybin
Commit: 7082bd1f4ca4516109dba72506d33d1c65bc2e35
Author: Sergey Sharybin
Date:   Fri Nov 3 18:15:09 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB7082bd1f4ca4516109dba72506d33d1c65bc2e35

Depsgraph: Cleanup, remove obsolete unused function

===

M   source/blender/blenkernel/BKE_scene.h
M   source/blender/blenkernel/intern/scene.c

===

diff --git a/source/blender/blenkernel/BKE_scene.h 
b/source/blender/blenkernel/BKE_scene.h
index 4c507267050..a27e743763d 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -159,7 +159,6 @@ void BKE_scene_graph_update_for_newframe(struct 
EvaluationContext *eval_ctx,
 
 /* NOTE: DO NOT USE THOSE IN NEW CODE! */
 void BKE_scene_update_tagged(struct EvaluationContext *eval_ctx, struct Main 
*bmain, struct Scene *sce);
-void BKE_scene_update_for_newframe(struct EvaluationContext *eval_ctx, struct 
Main *bmain, struct Scene *sce);
 
 struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const 
char *name);
 bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, 
struct SceneRenderLayer *srl);
diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 1e034a27e64..9583719dca9 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1681,14 +1681,6 @@ void BKE_scene_update_tagged(EvaluationContext 
*eval_ctx, Main *bmain, Scene *sc
BKE_scene_graph_update_tagged(eval_ctx, scene->depsgraph_legacy, bmain, 
scene);
 }
 
-void BKE_scene_update_for_newframe(EvaluationContext *eval_ctx, Main *bmain, 
Scene *scene)
-{
-   /* Make sure graph is allocated. This is not always guaranteed now. */
-   scene_ensure_legacy_depsgraph(bmain, scene);
-   /* Do actual graph evaluation. */
-   BKE_scene_graph_update_for_newframe(eval_ctx, scene->depsgraph_legacy, 
bmain, scene);
-}
-
 /* return default layer, also used to patch old files */
 SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
 {

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


[Bf-blender-cvs] [ad557da78ac] blender2.8: Depsgraph: Use explicit graph API for point cache

2017-11-06 Thread Sergey Sharybin
Commit: ad557da78ac9426babcfa7cf28e54471747ed4c3
Author: Sergey Sharybin
Date:   Fri Nov 3 18:04:50 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBad557da78ac9426babcfa7cf28e54471747ed4c3

Depsgraph: Use explicit graph API for point cache

===

M   source/blender/blenkernel/BKE_pointcache.h
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/editors/physics/physics_pointcache.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/source/blender/blenkernel/BKE_pointcache.h 
b/source/blender/blenkernel/BKE_pointcache.h
index 48fe8423233..ab2c3e863ef 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -188,6 +188,7 @@ typedef struct PTCacheBaker {
struct Main *main;
struct Scene *scene;
struct SceneLayer *scene_layer;
+   struct Depsgraph *depsgraph;
int bake;
int render;
int anim_init;
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index 35d65551483..4d1c2d8454b 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3543,6 +3543,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
Main *bmain = baker->main;
Scene *scene = baker->scene;
SceneLayer *scene_layer = baker->scene_layer;
+   struct Depsgraph *depsgraph = baker->depsgraph;
Scene *sce_iter; /* SETLOOPER macro only */
Base *base;
ListBase pidlist;
@@ -3661,7 +3662,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
stime = ptime = PIL_check_seconds_timer();
 
for (int fr = CFRA; fr <= endframe; fr += baker->quick_step, CFRA = fr) 
{
-   BKE_scene_update_for_newframe(G.main->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(G.main->eval_ctx, 
depsgraph, bmain, scene);
 
if (baker->update_progress) {
float progress = ((float)(CFRA - 
startframe)/(float)(endframe - startframe));
@@ -3747,7 +3748,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
CFRA = cfrao;

if (bake) { /* already on cfra unless baking */
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, 
bmain, scene);
}
 
/* TODO: call redraw all windows somehow */
diff --git a/source/blender/editors/physics/physics_pointcache.c 
b/source/blender/editors/physics/physics_pointcache.c
index 74946e3f44d..7dab98036c6 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -167,6 +167,7 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, 
wmOperator *op, bool all)
baker->main = CTX_data_main(C);
baker->scene = CTX_data_scene(C);
baker->scene_layer = CTX_data_scene_layer(C);
+   baker->depsgraph = CTX_data_depsgraph(C);
baker->bake = RNA_boolean_get(op->ptr, "bake");
baker->render = 0;
baker->anim_init = 0;
diff --git a/source/blender/render/intern/source/pipeline.c 
b/source/blender/render/intern/source/pipeline.c
index 61817f08f16..c774be672eb 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -3144,6 +3144,7 @@ static void update_physics_cache(Render *re, Scene 
*scene, SceneLayer *scene_lay
baker.main = re->main;
baker.scene = scene;
baker.scene_layer = scene_layer;
+   baker.depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
baker.bake = 0;
baker.render = 1;
baker.anim_init = 1;

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


[Bf-blender-cvs] [f5964e64294] blender2.8: epsgraph: Use explicit graph API for sequencer

2017-11-06 Thread Sergey Sharybin
Commit: f5964e6429490ef76ae0429f0e6cb88b47962bab
Author: Sergey Sharybin
Date:   Fri Nov 3 18:13:53 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBf5964e6429490ef76ae0429f0e6cb88b47962bab

epsgraph: Use explicit graph API for sequencer

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 53b32bd7df8..6097aba4518 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3262,6 +3262,14 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData 
*context, Sequence *seq
// have_seq = (scene->r.scemode & R_DOSEQ) && scene->ed && 
scene->ed->seqbase.first);  /* UNUSED */
have_comp = (scene->r.scemode & R_DOCOMP) && scene->use_nodes && 
scene->nodetree;
 
+   /* Get depsgraph and scene layer for the strip. */
+   SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene);
+   Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
+   /* TODO(sergey): This is a temporary solution. */
+   if (depsgraph == NULL) {
+   scene->depsgraph_legacy = depsgraph = DEG_graph_new();
+   }
+
orig_data.scemode = scene->r.scemode;
orig_data.cfra = scene->r.cfra;
orig_data.subframe = scene->r.subframe;
@@ -3311,10 +3319,10 @@ static ImBuf *seq_render_scene_strip(const 
SeqRenderData *context, Sequence *seq
 
/* opengl offscreen render */
context->eval_ctx->engine = 
RE_engines_find(scene->view_render.engine_id);
-   BKE_scene_update_for_newframe(context->eval_ctx, 
context->bmain, scene);
+   BKE_scene_graph_update_for_newframe(context->eval_ctx, 
depsgraph, context->bmain, scene);
ibuf = sequencer_view3d_cb(
/* set for OpenGL render (NULL when scrubbing) */
-   context->eval_ctx, scene, 
BKE_scene_layer_from_scene_get(scene), camera, width, height, IB_rect,
+   context->eval_ctx, scene, scene_layer, camera, width, 
height, IB_rect,
context->scene->r.seq_prev_type,
(context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0,
use_gpencil, use_background, scene->r.alphamode,
@@ -3344,7 +3352,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData 
*context, Sequence *seq
if (re == NULL)
re = RE_NewSceneRender(scene);
 
-   BKE_scene_update_for_newframe(context->eval_ctx, 
context->bmain, scene);
+   BKE_scene_graph_update_for_newframe(context->eval_ctx, 
depsgraph, context->bmain, scene);
RE_BlenderFrame(re, context->bmain, scene, NULL, 
camera, scene->lay, frame, false);
 
/* restore previous state after it was toggled on & off 
by RE_BlenderFrame */
@@ -3404,7 +3412,7 @@ finally:
scene->r.subframe = orig_data.subframe;
 
if (is_frame_update) {
-   BKE_scene_update_for_newframe(context->eval_ctx, 
context->bmain, scene);
+   BKE_scene_graph_update_for_newframe(context->eval_ctx, 
depsgraph, context->bmain, scene);
}
 
 #ifdef DURIAN_CAMERA_SWITCH

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


[Bf-blender-cvs] [1b402433164] blender2.8: Depsgraph: Cleanup, remove depsgraph_legacy from building routines

2017-11-06 Thread Sergey Sharybin
Commit: 1b4024331640cbbfb3b2774e09e02e6527341ab5
Author: Sergey Sharybin
Date:   Fri Nov 3 17:03:33 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB1b4024331640cbbfb3b2774e09e02e6527341ab5

Depsgraph: Cleanup, remove depsgraph_legacy from building routines

===

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

===

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc 
b/source/blender/depsgraph/intern/depsgraph_build.cc
index 70799a81835..d58f61a5077 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -52,6 +52,7 @@ extern "C" {
 #include "BKE_collision.h"
 #include "BKE_effect.h"
 #include "BKE_modifier.h"
+#include "BKE_scene.h"
 } /* extern "C" */
 
 #include "DEG_depsgraph.h"
@@ -272,12 +273,12 @@ void DEG_graph_relations_update(Depsgraph *graph, Main 
*bmain, Scene *scene)
 void DEG_relations_tag_update(Main *bmain)
 {
DEG_DEBUG_PRINTF("%s: Tagging relations for update.\n", __func__);
-   for (Scene *scene = (Scene *)bmain->scene.first;
-scene != NULL;
-scene = (Scene *)scene->id.next)
-   {
-   if (scene->depsgraph_legacy != NULL) {
-   DEG_graph_tag_relations_update(scene->depsgraph_legacy);
+   LINKLIST_FOREACH(Scene *, scene, &bmain->scene) {
+   LINKLIST_FOREACH(SceneLayer *, scene_layer, 
&scene->render_layers) {
+   Depsgraph *depsgraph = (Depsgraph 
*)BKE_scene_get_depsgraph(scene, scene_layer);
+   if (depsgraph != NULL) {
+   DEG_graph_tag_relations_update(depsgraph);
+   }
}
}
 }

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


[Bf-blender-cvs] [90738e14414] blender2.8: Depsgraph: Use explicit graph API for audio bake

2017-11-06 Thread Sergey Sharybin
Commit: 90738e14414ce979146fd20d2a31a3c5e5eebce9
Author: Sergey Sharybin
Date:   Fri Nov 3 17:59:15 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB90738e14414ce979146fd20d2a31a3c5e5eebce9

Depsgraph: Use explicit graph API for audio bake

===

M   source/blender/editors/sound/sound_ops.c

===

diff --git a/source/blender/editors/sound/sound_ops.c 
b/source/blender/editors/sound/sound_ops.c
index 3a753748d0f..0d6e0cf8e89 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -311,6 +311,7 @@ static int sound_bake_animation_exec(bContext *C, 
wmOperator *UNUSED(op))
 {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
+   struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
int oldfra = scene->r.cfra;
int cfra;
 
@@ -318,11 +319,11 @@ static int sound_bake_animation_exec(bContext *C, 
wmOperator *UNUSED(op))
 
for (cfra = (scene->r.sfra > 0) ? (scene->r.sfra - 1) : 0; cfra <= 
scene->r.efra + 1; cfra++) {
scene->r.cfra = cfra;
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, 
bmain, scene);
}
 
scene->r.cfra = oldfra;
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, 
scene);
 
return OPERATOR_FINISHED;
 }

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


[Bf-blender-cvs] [d0e9352d32f] blender2.8: Depsgraph: Use explicit graph API for OpenGL render

2017-11-06 Thread Sergey Sharybin
Commit: d0e9352d32f6f28f09f98f0edfdfeaab82ca5309
Author: Sergey Sharybin
Date:   Fri Nov 3 17:57:46 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBd0e9352d32f6f28f09f98f0edfdfeaab82ca5309

Depsgraph: Use explicit graph API for OpenGL render

===

M   source/blender/editors/render/render_opengl.c

===

diff --git a/source/blender/editors/render/render_opengl.c 
b/source/blender/editors/render/render_opengl.c
index ec293c60d67..03cffa5a384 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -96,6 +96,7 @@ typedef struct OGLRender {
Scene *scene;
WorkSpace *workspace;
SceneLayer *scene_layer;
+   Depsgraph *depsgraph;
 
View3D *v3d;
RegionView3D *rv3d;
@@ -666,6 +667,7 @@ static bool screen_opengl_render_init(bContext *C, 
wmOperator *op)
oglrender->scene = scene;
oglrender->workspace = workspace;
oglrender->scene_layer = CTX_data_scene_layer(C);
+   oglrender->depsgraph = CTX_data_depsgraph(C);
oglrender->cfrao = scene->r.cfra;
 
oglrender->write_still = is_write_still && !is_animation;
@@ -811,7 +813,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender 
*oglrender)
 
if (oglrender->timer) { /* exec will not have a timer */
scene->r.cfra = oglrender->cfrao;
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, 
oglrender->depsgraph, bmain, scene);
 
WM_event_remove_timer(oglrender->wm, oglrender->win, 
oglrender->timer);
}
@@ -1021,7 +1023,7 @@ static bool screen_opengl_render_anim_step(bContext *C, 
wmOperator *op)
if (CFRA < oglrender->nfra)
CFRA++;
while (CFRA < oglrender->nfra) {
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, 
oglrender->depsgraph, bmain, scene);
CFRA++;
}
 
@@ -1043,11 +1045,11 @@ static bool screen_opengl_render_anim_step(bContext *C, 
wmOperator *op)
 
WM_cursor_time(oglrender->win, scene->r.cfra);
 
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+   BKE_scene_graph_update_for_newframe(bmain->eval_ctx, 
oglrender->depsgraph, bmain, scene);
 
if (view_context) {
if (oglrender->rv3d->persp == RV3D_CAMOB && 
oglrender->v3d->camera && oglrender->v3d->scenelock) {
-   /* since BKE_scene_update_for_newframe() is used rather
+   /* since BKE_scene_graph_update_for_newframe() is used 
rather
 * then ED_update_for_newframe() the camera needs to be 
set */
if (BKE_scene_camera_switch_update(scene)) {
oglrender->v3d->camera = scene->camera;

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


[Bf-blender-cvs] [dd79cd189b9] blender2.8: Depsgraph: Cleanup, remove depgraph_legacy from evaluation routines

2017-11-06 Thread Sergey Sharybin
Commit: dd79cd189b9b299137e45a0fff81c4f07d64ef81
Author: Sergey Sharybin
Date:   Fri Nov 3 17:04:38 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBdd79cd189b9b299137e45a0fff81c4f07d64ef81

Depsgraph: Cleanup, remove depgraph_legacy from evaluation routines

===

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

===

diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc 
b/source/blender/depsgraph/intern/depsgraph_eval.cc
index 176466fe058..820be5179b5 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -85,8 +85,7 @@ void DEG_evaluation_context_init_from_scene(EvaluationContext 
*eval_ctx,
 eEvaluationMode mode)
 {
DEG_evaluation_context_init(eval_ctx, mode);
-   /* TODO(sergey): Use proper depsgraph here. */
-   eval_ctx->depsgraph = scene->depsgraph_legacy;
+   eval_ctx->depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
eval_ctx->scene_layer = scene_layer;
eval_ctx->engine = engine;
eval_ctx->ctime = BKE_scene_frame_get(scene);

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


[Bf-blender-cvs] [3330e518dc7] blender2.8: Depsgraph: Cleanup, remove unused function

2017-11-06 Thread Sergey Sharybin
Commit: 3330e518dc7ad941ec10e3c99eb6d051716cfefe
Author: Sergey Sharybin
Date:   Fri Nov 3 17:00:00 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB3330e518dc7ad941ec10e3c99eb6d051716cfefe

Depsgraph: Cleanup, remove unused function

===

M   source/blender/depsgraph/DEG_depsgraph_build.h
M   source/blender/depsgraph/intern/depsgraph_build.cc

===

diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h 
b/source/blender/depsgraph/DEG_depsgraph_build.h
index 92d47618cd7..06202b6196e 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -73,11 +73,6 @@ void DEG_graph_relations_update(struct Depsgraph *graph,
 /* Tag all relations in the database for update.*/
 void DEG_relations_tag_update(struct Main *bmain);
 
-/* Create new graph if didn't exist yet,
- * or update relations if graph was tagged for update.
- */
-void DEG_scene_relations_update(struct Main *bmain, struct Scene *scene);
-
 /* Add Dependencies  - */
 
 /* Handle for components to define their dependencies from callbacks.
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc 
b/source/blender/depsgraph/intern/depsgraph_build.cc
index 7dd9d1451cd..70799a81835 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -282,25 +282,6 @@ void DEG_relations_tag_update(Main *bmain)
}
 }
 
-/* Create new graph if didn't exist yet,
- * or update relations if graph was tagged for update.
- */
-void DEG_scene_relations_update(Main *bmain, Scene *scene)
-{
-   if (scene->depsgraph_legacy == NULL) {
-   /* Rebuild graph from scratch and exit. */
-   scene->depsgraph_legacy = DEG_graph_new();
-   DEG_graph_build_from_scene(scene->depsgraph_legacy, bmain, 
scene);
-   /* TODO(sergey): When we first create dependency graph we 
consider
-* it is first time became visible. This is true for viewports, 
but
-* will fail when render engines will start having their own 
graphs.
-*/
-   DEG_graph_on_visible_update(bmain, scene->depsgraph_legacy);
-   return;
-   }
-   DEG_graph_relations_update(scene->depsgraph_legacy, bmain, scene);
-}
-
 void DEG_add_collision_relations(DepsNodeHandle *handle,
  Scene *scene,
  Object *ob,

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


[Bf-blender-cvs] [45773c1a0a3] blender2.8: Update comment, reference new API function

2017-11-06 Thread Sergey Sharybin
Commit: 45773c1a0a3fe9392bb538651fd89af895b2b354
Author: Sergey Sharybin
Date:   Fri Nov 3 17:49:28 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB45773c1a0a3fe9392bb538651fd89af895b2b354

Update comment, reference new API function

===

M   source/blender/makesrna/intern/rna_scene_api.c

===

diff --git a/source/blender/makesrna/intern/rna_scene_api.c 
b/source/blender/makesrna/intern/rna_scene_api.c
index 76c210ea0ae..6b315ddf1c9 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -107,7 +107,7 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, 
int frame, float subf
 * redrawing while the data is being modified for render */
if (!G.is_rendering) {
/* cant use NC_SCENE|ND_FRAME because this causes 
wm_event_do_notifiers to call
-* BKE_scene_update_for_newframe which will loose any un-keyed 
changes [#24690] */
+* BKE_scene_graph_update_for_newframe which will loose any 
un-keyed changes [#24690] */
/* WM_main_add_notifier(NC_SCENE|ND_FRAME, scene); */

/* instead just redraw the views */

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


[Bf-blender-cvs] [5af1c892695] blender2.8: Depsgraph: Make graph to be per-scene-layer for RNA

2017-11-06 Thread Sergey Sharybin
Commit: 5af1c892695df48104337b9466cf7ded4b66e09a
Author: Sergey Sharybin
Date:   Fri Nov 3 17:27:13 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB5af1c892695df48104337b9466cf7ded4b66e09a

Depsgraph: Make graph to be per-scene-layer for RNA

New access is C.scene.render_layers.active.depsgraph. This will give depsgraph
for a given layer. In the future there will need to be some extra context to be
passed.

===

M   source/blender/makesrna/intern/rna_layer.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/makesrna/intern/rna_layer.c 
b/source/blender/makesrna/intern/rna_layer.c
index d71f42fe851..1c7ce4fecf1 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -846,6 +846,14 @@ static int 
rna_SceneLayer_objects_selected_skip(CollectionPropertyIterator *iter
return 1;
 };
 
+static PointerRNA rna_SceneLayer_depsgraph_get(PointerRNA *ptr)
+{
+   Scene *scene = (Scene *)ptr->id.data;
+   SceneLayer *scene_layer = (SceneLayer *)ptr->data;
+   Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
+   return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph);
+}
+
 static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
 {
SceneLayer *sl = (SceneLayer *)ptr->data;
@@ -954,6 +962,7 @@ static int 
rna_ViewRenderSettings_use_game_engine_get(PointerRNA *ptr)
 
return 0;
 }
+
 #else
 
 static void rna_def_scene_collections(BlenderRNA *brna, PropertyRNA *cprop)
@@ -2162,6 +2171,12 @@ void RNA_def_scene_layer(BlenderRNA *brna)
RNA_def_function_ui_description(func,
"Update data tagged to be updated from 
previous access to data or operators");
 
+   /* Dependency Graph */
+   prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
+   RNA_def_property_struct_type(prop, "Depsgraph");
+   RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the 
scene data");
+   RNA_def_property_pointer_funcs(prop, "rna_SceneLayer_depsgraph_get", 
NULL, NULL, NULL);
+
/* Nested Data  */
/* *** Non-Animated *** */
RNA_define_animate_sdna(false);
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 21159bbc240..a5645f362b9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2175,6 +2175,7 @@ static void rna_SceneLayer_remove(
RNA_POINTER_INVALIDATE(sl_ptr);
}
 }
+
 #else
 
 /* Grease Pencil Interpolation tool settings */
@@ -7324,12 +7325,6 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, 
"ColorManagedSequencerColorspaceSettings");
RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", 
"Settings of color space sequencer is working in");
 
-   /* Dependency Graph */
-   prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
-   RNA_def_property_pointer_sdna(prop, NULL, "depsgraph_legacy");
-   RNA_def_property_struct_type(prop, "Depsgraph");
-   RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the 
scene data");
-
/* Layer and Collections */
prop = RNA_def_property(srna, "render_layers", PROP_COLLECTION, 
PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "render_layers", NULL);

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


[Bf-blender-cvs] [031f4ce8a65] blender2.8: Depsgraph: Use new scene update API in preview render

2017-11-06 Thread Sergey Sharybin
Commit: 031f4ce8a65d53105ffb193aef64a82daefa7587
Author: Sergey Sharybin
Date:   Fri Nov 3 17:48:48 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB031f4ce8a65d53105ffb193aef64a82daefa7587

Depsgraph: Use new scene update API in preview render

===

M   source/blender/editors/render/render_preview.c

===

diff --git a/source/blender/editors/render/render_preview.c 
b/source/blender/editors/render/render_preview.c
index 958f1585e84..9bcc6f49b6f 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -604,10 +604,15 @@ static Scene *preview_prepare_scene(Main *bmain, Scene 
*scene, ID *id, int id_ty
}
}
 
+   Depsgraph *depsgraph = BKE_scene_get_depsgraph(sce, 
scene_layer);
+   /* TODO(sergey): This is a temporary solution. */
+   if (depsgraph == NULL) {
+   sce->depsgraph_legacy = depsgraph = DEG_graph_new();
+   }
/* TODO(sergey): Use proper flag for tagging here. */
-   DEG_id_tag_update(&sce->id, 0);
+   DEG_graph_id_tag_update(pr_main, depsgraph, &sce->id, 0);
DEG_relations_tag_update(pr_main);
-   BKE_scene_update_tagged(pr_main->eval_ctx, pr_main, sce);
+   BKE_scene_graph_update_tagged(pr_main->eval_ctx, depsgraph, 
pr_main, sce);
 
return sce;
}

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


[Bf-blender-cvs] [bb3024ef124] blender2.8: Depsgraph: Use new API for alembic C-API

2017-11-06 Thread Sergey Sharybin
Commit: bb3024ef1248f2d644a0ddde6f0e7e56c79be12f
Author: Sergey Sharybin
Date:   Fri Nov 3 17:52:26 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBbb3024ef1248f2d644a0ddde6f0e7e56c79be12f

Depsgraph: Use new API for alembic C-API

===

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

===

diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index c8735df21d5..d17182a0d65 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -274,7 +274,7 @@ static void export_startjob(void *customdata, short *stop, 
short *do_update, flo
if (CFRA != orig_frame) {
CFRA = orig_frame;
 
-   BKE_scene_update_for_newframe(data->bmain->eval_ctx, 
data->bmain, scene);
+   
BKE_scene_graph_update_for_newframe(data->bmain->eval_ctx, data->depsgraph, 
data->bmain, scene);
}
 
data->export_ok = !data->was_canceled;

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


[Bf-blender-cvs] [17395b6b08f] blender2.8: Depsgraph: Cleanup, remove depsgraph_legacy from depsgraph_tag.cc

2017-11-06 Thread Sergey Sharybin
Commit: 17395b6b08f4ae55f8b6d8122b295f8a406410d1
Author: Sergey Sharybin
Date:   Fri Nov 3 16:57:40 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB17395b6b08f4ae55f8b6d8122b295f8a406410d1

Depsgraph: Cleanup, remove depsgraph_legacy from depsgraph_tag.cc

===

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

===

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc 
b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 8c7afa89033..13f1506eadb 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -49,6 +49,7 @@ extern "C" {
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
+#include "BKE_scene.h"
 #include "BKE_workspace.h"
 
 #define new new_
@@ -350,13 +351,12 @@ void deg_graph_id_tag_update(Main *bmain, Depsgraph 
*graph, ID *id, int flag)
 void deg_id_tag_update(Main *bmain, ID *id, int flag)
 {
lib_id_recalc_tag_flag(bmain, id, flag);
-   for (Scene *scene = (Scene *)bmain->scene.first;
-scene != NULL;
-scene = (Scene *)scene->id.next)
-   {
-   if (scene->depsgraph_legacy != NULL) {
-   Depsgraph *graph = (Depsgraph *)scene->depsgraph_legacy;
-   deg_graph_id_tag_update(bmain, graph, id, flag);
+   LINKLIST_FOREACH(Scene *, scene, &bmain->scene) {
+   LINKLIST_FOREACH(SceneLayer *, scene_layer, 
&scene->render_layers) {
+   Depsgraph *depsgraph = (Depsgraph 
*)BKE_scene_get_depsgraph(scene, scene_layer);
+   if (depsgraph != NULL) {
+   deg_graph_id_tag_update(bmain, depsgraph, id, 
flag);
+   }
}
}
 }
@@ -459,12 +459,12 @@ void DEG_graph_on_visible_update(Main *bmain, Depsgraph 
*depsgraph)
 
 void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
 {
-   for (Scene *scene = (Scene *)bmain->scene.first;
-scene != NULL;
-scene = (Scene *)scene->id.next)
-   {
-   if (scene->depsgraph_legacy != NULL) {
-   DEG_graph_on_visible_update(bmain, 
scene->depsgraph_legacy);
+   LINKLIST_FOREACH(Scene *, scene, &bmain->scene) {
+   LINKLIST_FOREACH(SceneLayer *, scene_layer, 
&scene->render_layers) {
+   Depsgraph *depsgraph = (Depsgraph 
*)BKE_scene_get_depsgraph(scene, scene_layer);
+   if (depsgraph != NULL) {
+   DEG_graph_on_visible_update(bmain, depsgraph);
+   }
}
}
 }

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


[Bf-blender-cvs] [f867a560d9b] blender2.8: Depsgraph: Avoid non-requested allocation of depsgraph

2017-11-06 Thread Sergey Sharybin
Commit: f867a560d9bdad066650f853f520302d76aac4fa
Author: Sergey Sharybin
Date:   Fri Nov 3 16:49:57 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBf867a560d9bdad066650f853f520302d76aac4fa

Depsgraph: Avoid non-requested allocation of depsgraph

===

M   source/blender/blenkernel/intern/scene.c
M   source/blender/editors/scene/scene_edit.c
M   source/blender/makesrna/intern/rna_scene_api.c

===

diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 6ae826a20b1..1e034a27e64 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2464,8 +2464,5 @@ void BKE_scene_free_depsgraph_hash(Scene *scene)
 Depsgraph *BKE_scene_get_depsgraph(Scene *scene, SceneLayer *scene_layer)
 {
(void) scene_layer;
-   if (scene->depsgraph_legacy == NULL) {
-   scene->depsgraph_legacy = DEG_graph_new();
-   }
return scene->depsgraph_legacy;
 }
diff --git a/source/blender/editors/scene/scene_edit.c 
b/source/blender/editors/scene/scene_edit.c
index 1bbc6b3e91a..3799fed8ac2 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -125,6 +125,10 @@ void ED_scene_changed_update(Main *bmain, bContext *C, 
Scene *scene_new, const b
 * per window-workspace combination (using WorkSpaceDataRelation) */
SceneLayer *layer_new = BLI_findlink(&scene_new->render_layers, 
scene_new->active_layer);
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene_new, layer_new);
+   /* TODO(sergey): This is a temporary solution. */
+   if (depsgraph == NULL) {
+   scene_new->depsgraph_legacy = depsgraph = DEG_graph_new();
+   }
 
CTX_data_scene_set(C, scene_new);
BKE_workspace_render_layer_set(CTX_wm_workspace(C), layer_new);
diff --git a/source/blender/makesrna/intern/rna_scene_api.c 
b/source/blender/makesrna/intern/rna_scene_api.c
index 0ce8cc205b5..76c210ea0ae 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -90,6 +90,10 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, 
int frame, float subf
 scene_layer = scene_layer->next)
{
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, 
scene_layer);
+   /* TODO(sergey): This is a temporary solution. */
+   if (depsgraph == NULL) {
+   scene->depsgraph_legacy = depsgraph = DEG_graph_new();
+   }
BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, 
bmain, scene);
}
 
@@ -136,6 +140,10 @@ static void rna_Scene_update_tagged(Scene *scene, Main 
*bmain)
 scene_layer = scene_layer->next)
{
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, 
scene_layer);
+   /* TODO(sergey): This is a temporary solution. */
+   if (depsgraph == NULL) {
+   scene->depsgraph_legacy = depsgraph = DEG_graph_new();
+   }
BKE_scene_graph_update_tagged(bmain->eval_ctx, depsgraph, 
bmain, scene);
}

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