Commit: 73351062061f4951792c1730d60d34138f66db7e
Author: Lukas Tönne
Date:   Thu Dec 31 15:05:25 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB73351062061f4951792c1730d60d34138f66db7e

Output values in node graphs are unused, removed.

In fact there is no per-output data in node instances at all, so the
OutputInstance data was removed entirely. All the connectivity and
value information is in the inputs.

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

M       source/blender/blenvm/compile/bvm_nodegraph.cc
M       source/blender/blenvm/compile/bvm_nodegraph.h

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

diff --git a/source/blender/blenvm/compile/bvm_nodegraph.cc 
b/source/blender/blenvm/compile/bvm_nodegraph.cc
index c221468..d8ec060 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.cc
+++ b/source/blender/blenvm/compile/bvm_nodegraph.cc
@@ -247,11 +247,6 @@ NodeInstance::~NodeInstance()
                if (input.value)
                        delete input.value;
        }
-       for (OutputMap::const_iterator it = outputs.begin(); it != 
outputs.end(); ++it) {
-               const OutputInstance &output = it->second;
-               if (output.value)
-                       delete output.value;
-       }
 }
 
 SocketPair NodeInstance::input(const string &name)
@@ -357,18 +352,6 @@ const Value *NodeInstance::find_input_value(int index) 
const
        return socket ? find_input_value(socket->name) : NULL;
 }
 
-const Value *NodeInstance::find_output_value(const string &name) const
-{
-       OutputMap::const_iterator it = outputs.find(name);
-       return (it != outputs.end()) ? it->second.value : NULL;
-}
-
-const Value *NodeInstance::find_output_value(int index) const
-{
-       const NodeOutput *socket = type->find_output(index);
-       return socket ? find_output_value(socket->name) : NULL;
-}
-
 bool NodeInstance::set_input_value(const string &name, Value *value)
 {
        InputInstance &input = inputs[name];
@@ -450,32 +433,6 @@ bool NodeInstance::is_input_function(int index) const
        return socket ? socket->value_type == INPUT_FUNCTION : false;
 }
 
-bool NodeInstance::set_output_value(const string &name, Value *value)
-{
-       OutputInstance &output = outputs[name];
-       if (output.value)
-               return false;
-       output.value = value;
-       return true;
-}
-
-bool NodeInstance::has_output_value(const string &name) const
-{
-       OutputMap::const_iterator it = outputs.find(name);
-       if (it != outputs.end()) {
-               const OutputInstance &output = it->second;
-               return (output.value);
-       }
-       else
-               return false;
-}
-
-bool NodeInstance::has_output_value(int index) const
-{
-       const NodeOutput *socket = type->find_output(index);
-       return socket ? has_output_value(socket->name) : false;
-}
-
 /* ------------------------------------------------------------------------- */
 
 NodeGraph::NodeTypeMap NodeGraph::node_types;
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.h 
b/source/blender/blenvm/compile/bvm_nodegraph.h
index 341816e..98bbce2 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.h
+++ b/source/blender/blenvm/compile/bvm_nodegraph.h
@@ -210,18 +210,8 @@ struct NodeInstance {
                Value *value;
        };
        
-       struct OutputInstance {
-               OutputInstance() :
-                   value(NULL)
-               {}
-               
-               Value *value;
-       };
-       
        typedef std::map<string, InputInstance> InputMap;
        typedef std::pair<string, InputInstance> InputPair;
-       typedef std::map<string, OutputInstance> OutputMap;
-       typedef std::pair<string, OutputInstance> OutputPair;
        
        NodeInstance(const NodeType *type, const string &name);
        ~NodeInstance();
@@ -246,12 +236,9 @@ struct NodeInstance {
        const NodeOutput *find_input_link_socket(int index) const;
        const Value *find_input_value(const string &name) const;
        const Value *find_input_value(int index) const;
-       const Value *find_output_value(const string &name) const;
-       const Value *find_output_value(int index) const;
        
        bool set_input_value(const string &name, Value *value);
        bool set_input_link(const string &name, NodeInstance *from_node, const 
NodeOutput *from_socket);
-       bool set_output_value(const string &name, Value *value);
        
        template <typename T>
        bool set_input_value(const string &name, const T &value)
@@ -260,13 +247,6 @@ struct NodeInstance {
                return socket ? set_input_value(name, 
Value::create(socket->typedesc, value)) : false;
        }
        
-       template <typename T>
-       bool set_output_value(const string &name, const T &value)
-       {
-               const NodeInput *socket = type->find_output(name);
-               return socket ? set_output_value(name, 
Value::create(socket->typedesc, value)) : false;
-       }
-       
        bool has_input_link(const string &name) const;
        bool has_input_link(int index) const;
        bool has_input_value(const string &name) const;
@@ -275,13 +255,10 @@ struct NodeInstance {
        bool is_input_constant(int index) const;
        bool is_input_function(const string &name) const;
        bool is_input_function(int index) const;
-       bool has_output_value(const string &name) const;
-       bool has_output_value(int index) const;
        
        const NodeType *type;
        string name;
        InputMap inputs;
-       OutputMap outputs;
 
        MEM_CXX_CLASS_ALLOC_FUNCS("BVM:NodeInstance")
 };

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to