don't police data type connections between nodes

Nodes were previously written to be "strongly typed" in that a parameter's
"type" enforced whether it could be connected to another. All code related
to that has now been removed since not only is it hard to maintain and
likely unnecessary, it's possible the nodes will work differently later on
anyway.
This commit is contained in:
itsmattkc
2019-10-25 00:44:14 +11:00
parent 076f2699c5
commit 4d96ac9e39
24 changed files with 83 additions and 249 deletions
+7 -19
View File
@@ -47,21 +47,16 @@ public:
*/
virtual Type type() override;
/**
* @brief Add a data type that this input accepts
*
* While an input will usually only accept one data type, NodeInput supports several. Use this to add a data type that
* this input can accept.
*/
void add_data_input(const DataType& data_type);
virtual QString name() override;
/**
* @brief Return whether an input can accept a certain type based on its list of data types
* @brief The data type this parameter outputs
*
* The input checks its list of acceptable data types (added by add_data_input()) to determine whether a certain
* data type can be connected to this input.
* This can be used in conjunction with NodeInput::can_accept_type() to determine whether this parameter can be
* connected to it.
*/
bool can_accept_type(const DataType& data_type);
const DataType& data_type();
void set_data_type(const DataType& type);
/**
* @brief If this input is connected to an output, retrieve the output parameter
@@ -132,13 +127,6 @@ public:
bool has_maximum();
void set_maximum(const QVariant& max);
virtual DataType data_type() override;
/**
* @brief A list of input data types accepted by this parameter
*/
const QList<DataType>& inputs();
/**
* @brief Copy all values including keyframe information and connections from another NodeInput
*/
@@ -153,7 +141,7 @@ private:
*
* Use can_accept_type() to check if a type is in this list
*/
QList<DataType> inputs_;
DataType data_type_;
/**
* @brief Internal keyframe array