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

Depsgraph: Remove subgraph nodes

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

===================================================================

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

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 03e6fa4d9e8..ef94dec4b61 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -321,41 +321,6 @@ void DepsgraphNodeBuilder::build_group(Scene *scene,
        }
 }
 
-SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
-{
-       /* sanity checks */
-       if (!group)
-               return NULL;
-
-       /* create new subgraph's data */
-       Depsgraph *subgraph = reinterpret_cast<Depsgraph *>(DEG_graph_new());
-
-       DepsgraphNodeBuilder subgraph_builder(m_bmain, subgraph);
-
-       /* add group objects */
-       LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
-               /*Object *ob = go->ob;*/
-
-               /* Each "group object" is effectively a separate instance of the
-                * underlying object data. When the group is evaluated, the 
transform
-                * results and/or some other attributes end up getting 
overridden by
-                * the group.
-                */
-       }
-
-       /* Create a node for representing subgraph. */
-       SubgraphDepsNode *subgraph_node = 
m_graph->add_subgraph_node(&group->id);
-       subgraph_node->graph = subgraph;
-
-       /* Make a copy of the data this node will need? */
-       /* XXX: do we do this now, or later? */
-       /* TODO: need API function which queries graph's ID's hash, and 
duplicates
-        * those blocks thoroughly with all outside links removed.
-        */
-
-       return subgraph_node;
-}
-
 void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 {
        const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 93a8c6c6015..5774d8b6aed 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -62,7 +62,6 @@ namespace DEG {
 struct Depsgraph;
 struct DepsNode;
 struct RootDepsNode;
-struct SubgraphDepsNode;
 struct IDDepsNode;
 struct TimeSourceDepsNode;
 struct ComponentDepsNode;
@@ -125,7 +124,6 @@ struct DepsgraphNodeBuilder {
                                               int name_tag = -1);
 
        void build_scene(Main *bmain, Scene *scene);
-       SubgraphDepsNode *build_subgraph(Group *group);
        void build_group(Scene *scene, Base *base, Group *group);
        void build_object(Scene *scene, Base *base, Object *ob);
        void build_object_transform(Scene *scene, Object *ob);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index ace629e471d..411f3be4036 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -78,7 +78,6 @@ struct Depsgraph;
 struct DepsNode;
 struct DepsNodeHandle;
 struct RootDepsNode;
-struct SubgraphDepsNode;
 struct IDDepsNode;
 struct TimeSourceDepsNode;
 struct ComponentDepsNode;
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc 
b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
index 0d56ce71c7d..3df4ee0c3dd 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
@@ -80,17 +80,16 @@ static const int deg_debug_node_type_color_map[][2] = {
     {DEPSNODE_TYPE_ROOT,         0},
     {DEPSNODE_TYPE_TIMESOURCE,   1},
     {DEPSNODE_TYPE_ID_REF,       2},
-    {DEPSNODE_TYPE_SUBGRAPH,     3},
 
     /* Outer Types */
-    {DEPSNODE_TYPE_PARAMETERS,   4},
-    {DEPSNODE_TYPE_PROXY,        5},
-    {DEPSNODE_TYPE_ANIMATION,    6},
-    {DEPSNODE_TYPE_TRANSFORM,    7},
-    {DEPSNODE_TYPE_GEOMETRY,     8},
-    {DEPSNODE_TYPE_SEQUENCER,    9},
-    {DEPSNODE_TYPE_SHADING,      10},
-    {DEPSNODE_TYPE_CACHE,        11},
+    {DEPSNODE_TYPE_PARAMETERS,   3},
+    {DEPSNODE_TYPE_PROXY,        4},
+    {DEPSNODE_TYPE_ANIMATION,    5},
+    {DEPSNODE_TYPE_TRANSFORM,    6},
+    {DEPSNODE_TYPE_GEOMETRY,     7},
+    {DEPSNODE_TYPE_SEQUENCER,    8},
+    {DEPSNODE_TYPE_SHADING,      9},
+    {DEPSNODE_TYPE_CACHE,        10},
     {-1,                         0}
 };
 #endif
@@ -380,19 +379,6 @@ static void deg_debug_graphviz_node(const DebugContext 
&ctx,
                        }
                        break;
                }
-               case DEPSNODE_TYPE_SUBGRAPH:
-               {
-                       SubgraphDepsNode *sub_node = (SubgraphDepsNode *)node;
-                       if (sub_node->graph) {
-                               deg_debug_graphviz_node_cluster_begin(ctx, 
node);
-                               deg_debug_graphviz_graph_nodes(ctx, 
sub_node->graph);
-                               deg_debug_graphviz_node_cluster_end(ctx);
-                       }
-                       else {
-                               deg_debug_graphviz_node_single(ctx, node);
-                       }
-                       break;
-               }
                case DEPSNODE_TYPE_PARAMETERS:
                case DEPSNODE_TYPE_ANIMATION:
                case DEPSNODE_TYPE_TRANSFORM:
@@ -432,11 +418,6 @@ static bool deg_debug_graphviz_is_cluster(const DepsNode 
*node)
                        const IDDepsNode *id_node = (const IDDepsNode *)node;
                        return BLI_ghash_size(id_node->components) > 0;
                }
-               case DEPSNODE_TYPE_SUBGRAPH:
-               {
-                       SubgraphDepsNode *sub_node = (SubgraphDepsNode *)node;
-                       return sub_node->graph != NULL;
-               }
                case DEPSNODE_TYPE_PARAMETERS:
                case DEPSNODE_TYPE_ANIMATION:
                case DEPSNODE_TYPE_TRANSFORM:
diff --git a/source/blender/depsgraph/intern/depsgraph.cc 
b/source/blender/depsgraph/intern/depsgraph.cc
index 8054c33817b..808e3f80bef 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -75,7 +75,6 @@ Depsgraph::Depsgraph()
 {
        BLI_spin_init(&lock);
        id_hash = BLI_ghash_ptr_new("Depsgraph id hash");
-       subgraphs = BLI_gset_ptr_new("Depsgraph subgraphs");
        entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags");
 }
 
@@ -83,9 +82,7 @@ Depsgraph::~Depsgraph()
 {
        /* Free root node - it won't have been freed yet... */
        clear_id_nodes();
-       clear_subgraph_nodes();
        BLI_ghash_free(id_hash, NULL, NULL);
-       BLI_gset_free(subgraphs, NULL);
        BLI_gset_free(entry_tags, NULL);
        if (this->root_node != NULL) {
                OBJECT_GUARDED_DELETE(this->root_node, RootDepsNode);
@@ -293,34 +290,6 @@ TimeSourceDepsNode *Depsgraph::find_time_source(const ID 
*id) const
        return NULL;
 }
 
-SubgraphDepsNode *Depsgraph::add_subgraph_node(const ID *id)
-{
-       DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_SUBGRAPH);
-       SubgraphDepsNode *subgraph_node =
-               (SubgraphDepsNode *)factory->create_node(id, "", id->name + 2);
-
-       /* Add to subnodes list. */
-       BLI_gset_insert(subgraphs, subgraph_node);
-
-       return subgraph_node;
-}
-
-void Depsgraph::remove_subgraph_node(SubgraphDepsNode *subgraph_node)
-{
-       BLI_gset_remove(subgraphs, subgraph_node, NULL);
-       OBJECT_GUARDED_DELETE(subgraph_node, SubgraphDepsNode);
-}
-
-void Depsgraph::clear_subgraph_nodes()
-{
-       GSET_FOREACH_BEGIN(SubgraphDepsNode *, subgraph_node, subgraphs)
-       {
-               OBJECT_GUARDED_DELETE(subgraph_node, SubgraphDepsNode);
-       }
-       GSET_FOREACH_END();
-       BLI_gset_clear(subgraphs, NULL);
-}
-
 IDDepsNode *Depsgraph::find_id_node(const ID *id) const
 {
        return reinterpret_cast<IDDepsNode *>(BLI_ghash_lookup(id_hash, id));
@@ -458,7 +427,6 @@ void Depsgraph::add_entry_tag(OperationDepsNode *node)
 void Depsgraph::clear_all_nodes()
 {
        clear_id_nodes();
-       clear_subgraph_nodes();
        BLI_ghash_clear(id_hash, NULL, NULL);
        if (this->root_node) {
                OBJECT_GUARDED_DELETE(this->root_node, RootDepsNode);
diff --git a/source/blender/depsgraph/intern/depsgraph.h 
b/source/blender/depsgraph/intern/depsgraph.h
index eefae4133f9..8622d378472 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -52,7 +52,6 @@ struct DepsNode;
 struct RootDepsNode;
 struct TimeSourceDepsNode;
 struct IDDepsNode;
-struct SubgraphDepsNode;
 struct ComponentDepsNode;
 struct OperationDepsNode;
 
@@ -113,10 +112,6 @@ struct Depsgraph {
 
        TimeSourceDepsNode *find_time_source(const ID *id = NULL) const;
 
-       SubgraphDepsNode *add_subgraph_node(const ID *id);
-       void remove_subgraph_node(SubgraphDepsNode *subgraph_node);
-       void clear_subgraph_nodes();
-
        IDDepsNode *find_id_node(const ID *id) const;
        IDDepsNode *add_id_node(ID *id, const char *name = "");
        void remove_id_node(const ID *id);
@@ -146,9 +141,6 @@ struct Depsgraph {
        /* "root" node - the one where all evaluation enters from. */
        RootDepsNode *root_node;
 
-       /* Subgraphs referenced in tree. */
-       GSet *subgraphs;
-
        /* Indicates whether relations needs to be updated. */
        bool need_update;
 
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h 
b/source/blender/depsgraph/intern/depsgraph_types.h
index d03d598084e..3c74ecfc52c 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -96,10 +96,6 @@ typedef enum eDepsNode_Type {
         * but not usually part of main graph.
         */
        DEPSNODE_TYPE_ID_REF,
-       /* Isolated sub-graph - used for keeping instanced data separate from
-        * instances using them.
-        */
-       DEPSNODE_TYPE_SUBGRAPH,
 
        /* **** Outer Types **** */
 
@@ -107,9 +103,7 @@ typedef enum eDepsNode_Type {
         * (i.e. just SDNA property setting).
         */
        DEPSNODE_TYPE_PARAMETERS,
-       /* Generic "Proxy-Inherit" Component
-        * XXX: Also for instancing of subgraphs?
-        */
+       /* Generic "Proxy-Inherit" Component. */
        DEPSNODE_TYPE_PROXY,
        /* Animation Component
         *
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc 
b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index d64fdd83d39..89a61ecaca9 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -170,7 +170,6 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
                                                case DEPSNODE_TYPE_ROOT:
                                                case DEPSNODE_TYPE_TIMESOURCE:
                                                case DEPSNODE_TYPE_ID_REF:
-                                               case DEPSNODE_TYPE_SUBGRAPH:
                                                case DEPSNODE_TYPE_PARAMETERS:
                                                case DEPSNODE_TYPE_SEQUENCER:
                                                        /* Ignore, does not 
translate to object component. */
diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc 
b/source/blender/depsgraph/intern/nodes/deg_node.cc
index b1d5b538e25..dc2d1a4e0ae 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node.cc
+++ b/source/blender/depsgraph/intern/nodes/deg_n

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to