Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/functions/intern/multi_function_procedure.cc')
-rw-r--r--source/blender/functions/intern/multi_function_procedure.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/functions/intern/multi_function_procedure.cc b/source/blender/functions/intern/multi_function_procedure.cc
index 2aa760a494f..fa95e8de71e 100644
--- a/source/blender/functions/intern/multi_function_procedure.cc
+++ b/source/blender/functions/intern/multi_function_procedure.cc
@@ -325,7 +325,14 @@ bool MFProcedure::validate_all_instruction_pointers_set() const
bool MFProcedure::validate_all_params_provided() const
{
for (const MFCallInstruction *instruction : call_instructions_) {
- for (const MFVariable *variable : instruction->params_) {
+ const MultiFunction &fn = instruction->fn();
+ for (const int param_index : fn.param_indices()) {
+ const MFParamType param_type = fn.param_type(param_index);
+ if (param_type.category() == MFParamType::SingleOutput) {
+ /* Single outputs are optional. */
+ continue;
+ }
+ const MFVariable *variable = instruction->params_[param_index];
if (variable == nullptr) {
return false;
}
@@ -351,6 +358,9 @@ bool MFProcedure::validate_same_variables_in_one_call() const
for (const int param_index : fn.param_indices()) {
const MFParamType param_type = fn.param_type(param_index);
const MFVariable *variable = instruction->params_[param_index];
+ if (variable == nullptr) {
+ continue;
+ }
for (const int other_param_index : fn.param_indices()) {
if (other_param_index == param_index) {
continue;
@@ -681,7 +691,9 @@ class MFProcedureDotExport {
if (instruction.prev().size() != 1) {
return true;
}
- if (instruction.prev()[0].type() == MFInstructionCursor::Type::Branch) {
+ if (ELEM(instruction.prev()[0].type(),
+ MFInstructionCursor::Type::Branch,
+ MFInstructionCursor::Type::Entry)) {
return true;
}
return false;