Functions: minor improvements
This commit is contained in:
parent
404486e66c
commit
838b1742fb
|
@ -73,6 +73,11 @@ class MultiFunction {
|
|||
return false;
|
||||
}
|
||||
|
||||
uint param_amount() const
|
||||
{
|
||||
return signature_.param_types.size();
|
||||
}
|
||||
|
||||
IndexRange param_indices() const
|
||||
{
|
||||
return signature_.param_types.index_range();
|
||||
|
|
|
@ -144,6 +144,11 @@ class MFParamType {
|
|||
return ELEM(interface_type_, Output, Mutable);
|
||||
}
|
||||
|
||||
bool is_output() const
|
||||
{
|
||||
return interface_type_ == Output;
|
||||
}
|
||||
|
||||
friend bool operator==(const MFParamType &a, const MFParamType &b);
|
||||
friend bool operator!=(const MFParamType &a, const MFParamType &b);
|
||||
};
|
||||
|
|
|
@ -344,6 +344,11 @@ class GVSpan : public VSpanBase<void> {
|
|||
return GVSpan::FromSingle(type, value, UINT32_MAX);
|
||||
}
|
||||
|
||||
static GVSpan FromDefault(const CPPType &type)
|
||||
{
|
||||
return GVSpan::FromSingleWithMaxSize(type, type.default_value());
|
||||
}
|
||||
|
||||
static GVSpan FromFullPointerArray(const CPPType &type, const void *const *values, uint size)
|
||||
{
|
||||
GVSpan ref;
|
||||
|
|
|
@ -106,30 +106,30 @@ MFNetworkEvaluator::MFNetworkEvaluator(Vector<const MFOutputSocket *> inputs,
|
|||
BLI_assert(outputs_.size() > 0);
|
||||
MFSignatureBuilder signature = this->get_builder("Function Tree");
|
||||
|
||||
for (auto socket : inputs_) {
|
||||
for (const MFOutputSocket *socket : inputs_) {
|
||||
BLI_assert(socket->node().is_dummy());
|
||||
|
||||
MFDataType type = socket->data_type();
|
||||
switch (type.category()) {
|
||||
case MFDataType::Single:
|
||||
signature.single_input("Input", type.single_type());
|
||||
signature.single_input(socket->name(), type.single_type());
|
||||
break;
|
||||
case MFDataType::Vector:
|
||||
signature.vector_input("Input", type.vector_base_type());
|
||||
signature.vector_input(socket->name(), type.vector_base_type());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto socket : outputs_) {
|
||||
for (const MFInputSocket *socket : outputs_) {
|
||||
BLI_assert(socket->node().is_dummy());
|
||||
|
||||
MFDataType type = socket->data_type();
|
||||
switch (type.category()) {
|
||||
case MFDataType::Single:
|
||||
signature.single_output("Output", type.single_type());
|
||||
signature.single_output(socket->name(), type.single_type());
|
||||
break;
|
||||
case MFDataType::Vector:
|
||||
signature.vector_output("Output", type.vector_base_type());
|
||||
signature.vector_output(socket->name(), type.vector_base_type());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue