Blender
V3.3
|
Namespaces | |
CustomMF_presets | |
detail | |
materialize_detail | |
multi_function_procedure_types | |
multi_function_types | |
procedure_optimization | |
tests | |
Typedefs | |
using | ExecutionHints = MultiFunction::ExecutionHints |
using | IndicesSplitVectors = std::array< Vector< int64_t >, 2 > |
Enumerations | |
enum class | FieldNodeType { Input , Operation , Constant } |
enum class | MFParamCategory { SingleInput , VectorInput , SingleOutput , VectorOutput , SingleMutable , VectorMutable } |
enum class | MFInstructionType { Call , Branch , Destruct , Dummy , Return } |
Variables | |
template<typename T > | |
static constexpr bool | is_field_v |
using blender::fn::ExecutionHints = typedef MultiFunction::ExecutionHints |
Definition at line 10 of file multi_function.cc.
using blender::fn::IndicesSplitVectors = typedef std::array<Vector<int64_t>, 2> |
Definition at line 21 of file multi_function_procedure_executor.cc.
|
strong |
Have a fixed set of base node types, because all code that works with field nodes has to understand those.
Enumerator | |
---|---|
Input | |
Operation | |
Constant |
Definition at line 52 of file FN_field.hh.
|
strong |
Every instruction has exactly one of these types.
Enumerator | |
---|---|
Call | |
Branch | |
Destruct | |
Dummy | |
Return |
Definition at line 23 of file FN_multi_function_procedure.hh.
|
strong |
Enumerator | |
---|---|
SingleInput | |
VectorInput | |
SingleOutput | |
VectorOutput | |
SingleMutable | |
VectorMutable |
Definition at line 25 of file FN_multi_function_param_type.hh.
|
static |
Builds the #procedure so that it computes the fields.
Definition at line 144 of file field.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BLI_assert, BLI_assert_unreachable, Constant, blender::ResourceScope::construct(), blender::fn::MFProcedure::construct_function(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::Span< T >::contains(), blender::fn::FieldInput::cpp_type(), blender::fn::MFParamType::data_type(), blender::fn::MFVariable::data_type(), blender::fn::FieldInput::debug_name(), blender::fn::FieldTreeInfo::deduplicated_field_inputs, blender::fn::FieldTreeInfo::field_users, blender::fn::MFDataType::ForSingle(), blender::GPointer::get(), Input, blender::fn::MFParamType::Input, blender::fn::FieldOperation::inputs(), blender::fn::MFParamType::interface_type(), blender::Stack< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), blender::fn::procedure_optimization::move_destructs_up(), blender::fn::FieldOperation::multi_function(), blender::fn::MFProcedure::new_variable(), blender::fn::GFieldBase< NodePtr >::node(), blender::fn::FieldNode::node_type(), Operation, blender::fn::MFParamType::Output, blender::fn::MultiFunction::param_amount(), blender::fn::MultiFunction::param_indices(), blender::fn::MultiFunction::param_type(), blender::Stack< T, InlineBufferCapacity, Allocator >::peek(), blender::Stack< T, InlineBufferCapacity, Allocator >::pop(), blender::Stack< T, InlineBufferCapacity, Allocator >::push(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::Span< T >::size(), blender::fn::FieldConstant::type(), blender::fn::MFProcedure::validate(), blender::fn::FieldConstant::value(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values().
Referenced by evaluate_fields().
|
static |
Returns the field inputs used by all the provided fields. This tries to reuse an existing #FieldInputs whenever possible to avoid copying it.
Definition at line 599 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty().
Referenced by blender::fn::FieldOperation::FieldOperation().
|
static |
Definition at line 37 of file multi_function.cc.
References blender::fn::MultiFunction::ExecutionHints::allocates_array, BLI_system_thread_count(), mask(), max, min, blender::fn::MultiFunction::ExecutionHints::min_grain_size, and blender::fn::MultiFunction::ExecutionHints::uniform_execution_time.
Referenced by blender::fn::MultiFunction::call_auto().
|
static |
Definition at line 977 of file multi_function_procedure_executor.cc.
References blender::fn::MultiFunction::depends_on_context(), mask(), blender::IndexMask::size(), and state.
Referenced by execute_call_instruction().
Definition at line 482 of file FN_field.hh.
References evaluate_constant_field(), and T.
Definition at line 494 of file field.cc.
References blender::compositor::context, blender::fn::GFieldBase< NodePtr >::cpp_type(), blender::fn::FieldNode::depends_on_input(), evaluate_fields(), blender::fn::GFieldBase< NodePtr >::node(), and type.
Referenced by blender::fn::ValueOrField< T >::as_value(), blender::ed::space_node::create_inspection_string_for_gfield(), evaluate_constant_field(), make_field_constant_if_possible(), and blender::nodes::node_geo_switch_cc::switch_fields().
Vector< GVArray > blender::fn::evaluate_fields | ( | ResourceScope & | scope, |
Span< GFieldRef > | fields_to_evaluate, | ||
IndexMask | mask, | ||
const FieldContext & | context, | ||
Span< GVMutableArray > | dst_varrays = {} |
||
) |
Evaluate fields in the given context. If possible, multiple fields should be evaluated together, because that can be more efficient when they share common sub-fields.
scope | The resource scope that owns data that makes up the output virtual arrays. Make sure the scope is not destructed when the output virtual arrays are still used. |
fields_to_evaluate | The fields that should be evaluated together. |
mask | Determines which indices are computed. The mask may be referenced by the returned virtual arrays. So the underlying indices (if applicable) should live longer then #scope. |
context | The context that the field is evaluated in. Used to retrieve data from each #FieldInput in the field network. |
dst_varrays | If provided, the computed data will be written into those virtual arrays instead of into newly created ones. That allows making the computed data live longer than #scope and is more efficient when the data will be written into those virtual arrays later anyway. |
Definition at line 278 of file field.cc.
References blender::ResourceScope::add_destruct_call(), blender::LinearAllocator< Allocator >::allocate(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, buffer, build_multi_function_procedure_for_fields(), Constant, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::compositor::context, blender::fn::GFieldBase< NodePtr >::cpp_type(), blender::GMutableSpan::data(), blender::fn::FieldTreeInfo::deduplicated_field_inputs, find_varying_fields(), blender::GVArray::ForEmpty(), blender::GVArray::ForSingleRef(), blender::GVArray::ForSpan(), blender::GPointer::get(), get_field_context_inputs(), blender::GVMutableArray::get_internal_span(), blender::Span< T >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), Input, blender::Span< T >::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::GVArrayCommon::is_span(), blender::ResourceScope::linear_allocator(), mask(), blender::fn::GFieldBase< NodePtr >::node(), blender::fn::FieldNode::node_type(), Operation, blender::threading::parallel_for(), preprocess_field_tree(), blender::GVArrayCommon::size(), blender::Span< T >::size(), blender::GVArrayCommon::type(), blender::fn::FieldConstant::type(), type, and blender::fn::FieldConstant::value().
Referenced by blender::fn::FieldEvaluator::evaluate(), evaluate_constant_field(), evaluate_selection(), and blender::fn::tests::TEST().
|
static |
Definition at line 750 of file field.cc.
References blender::compositor::context, evaluate_fields(), and index_mask_from_selection().
Referenced by blender::fn::FieldEvaluator::evaluate().
|
static |
Definition at line 1049 of file multi_function_procedure_executor.cc.
References BLI_assert_unreachable, blender::fn::MultiFunction::call(), blender::fn::MultiFunction::call_auto(), blender::compositor::context, evaluate_as_one(), fill_params(), fill_params__one(), blender::fn::MFCallInstruction::fn(), blender::fn::VariableStates::full_mask(), gather_parameter_variable_states(), mask(), blender::fn::MultiFunction::param_amount(), params, and blender::Vector< T, InlineBufferCapacity, Allocator >::resize().
Referenced by blender::fn::MFProcedureExecutor::call().
|
static |
Definition at line 1031 of file multi_function_procedure_executor.cc.
References blender::fn::VariableStates::add_as_param(), mask(), blender::fn::MultiFunction::param_indices(), blender::fn::MultiFunction::param_type(), and params.
Referenced by execute_call_instruction().
|
static |
Definition at line 1013 of file multi_function_procedure_executor.cc.
References blender::fn::VariableStates::add_as_param__one(), mask(), blender::fn::MultiFunction::param_indices(), blender::fn::MultiFunction::param_type(), and params.
Referenced by execute_call_instruction().
|
static |
Definition at line 106 of file field.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::fn::FieldTreeInfo::deduplicated_field_inputs, blender::fn::FieldTreeInfo::field_users, blender::Span< T >::index_range(), blender::Stack< T, InlineBufferCapacity, Allocator >::is_empty(), blender::GVArrayCommon::is_single(), blender::Stack< T, InlineBufferCapacity, Allocator >::pop(), blender::Stack< T, InlineBufferCapacity, Allocator >::push(), and users.
Referenced by evaluate_fields().
|
static |
Definition at line 996 of file multi_function_procedure_executor.cc.
References blender::fn::VariableStates::get_variable_state(), blender::fn::MultiFunction::param_indices(), and blender::fn::MFCallInstruction::params().
Referenced by execute_call_instruction().
|
static |
Retrieves the data from the context that is passed as input into the field.
Definition at line 84 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::compositor::context, blender::GVArray::ForSingleDefault(), mask(), and type.
Referenced by evaluate_fields().
|
static |
Definition at line 710 of file field.cc.
References blender::ResourceScope::construct(), and blender::index_mask_ops::find_indices_from_virtual_array().
Referenced by evaluate_selection(), and blender::fn::FieldEvaluator::get_evaluated_as_mask().
Definition at line 521 of file field.cc.
References Freestyle::a.
Referenced by blender::nodes::node_geo_delete_geometry_cc::node_geo_exec(), blender::nodes::node_geo_separate_geometry_cc::node_geo_exec(), and blender::nodes::separate_geometry().
Definition at line 529 of file field.cc.
References type.
Referenced by blender::fn::ValueOrField< T >::as_field(), blender::ed::spreadsheet::find_fields_to_evaluate(), make_constant_field(), and make_field_constant_if_possible().
Definition at line 494 of file FN_field.hh.
References make_constant_field().
If the field depends on some input, the same field is returned. Otherwise the field is evaluated and a new field is created that just computes this constant.
Making the field constant has two benefits:
Definition at line 508 of file field.cc.
References buffer, BUFFER_FOR_CPP_TYPE_VALUE, blender::fn::GFieldBase< NodePtr >::cpp_type(), blender::fn::FieldNode::depends_on_input(), evaluate_constant_field(), make_constant_field(), blender::fn::GFieldBase< NodePtr >::node(), and type.
|
inline |
Definition at line 610 of file FN_field.hh.
References Freestyle::a, and usdtokens::b().
|
inline |
Definition at line 108 of file FN_multi_function_data_type.hh.
|
inline |
Definition at line 154 of file FN_multi_function_param_type.hh.
Definition at line 605 of file FN_field.hh.
References Freestyle::a, and usdtokens::b().
|
inline |
Definition at line 103 of file FN_multi_function_data_type.hh.
|
inline |
Definition at line 149 of file FN_multi_function_param_type.hh.
|
static |
Collects some information from the field tree that is required by later steps.
Definition at line 40 of file field.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), Constant, blender::fn::FieldTreeInfo::deduplicated_field_inputs, blender::fn::FieldTreeInfo::field_users, Input, blender::fn::FieldOperation::inputs(), blender::Stack< T, InlineBufferCapacity, Allocator >::is_empty(), blender::fn::GFieldBase< NodePtr >::node(), blender::fn::FieldNode::node_type(), Operation, blender::Stack< T, InlineBufferCapacity, Allocator >::pop(), and blender::Stack< T, InlineBufferCapacity, Allocator >::push().
Referenced by evaluate_fields().
|
static |
Definition at line 22 of file multi_function.cc.
References blender::fn::MFParamType::data_type(), ELEM, blender::fn::MFParamType::interface_type(), blender::fn::MFDataType::is_vector(), Output, blender::fn::MultiFunction::param_indices(), and blender::fn::MultiFunction::param_type().
Referenced by blender::fn::MultiFunction::call_auto().
|
staticconstexpr |
True when T is any Field<...> type.
Definition at line 198 of file FN_field.hh.