|
Blender V5.3
|
Classes | |
| class | InverseEvalParams |
| struct | LocalInverseEvalTargets |
| struct | SocketToUpdate |
| class | SocketValueVariant |
Typedefs | |
| using | RNAValueVariant = std::variant<float, int, bool> |
| using blender::nodes::inverse_eval::RNAValueVariant = std::variant<float, int, bool> |
Definition at line 367 of file inverse_eval.cc.
| bool blender::nodes::inverse_eval::backpropagate_socket_values | ( | bContext & | C, |
| Object & | object, | ||
| NodesModifierData & | nmd, | ||
| eval_log::NodesEvalLog & | eval_log, | ||
| Span< SocketToUpdate > | sockets_to_update ) |
Try to change socket/node/modifier values so that the given sockets will have a specific value.
Definition at line 701 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), backpropagate_socket_values(), backpropagate_socket_values_through_node(), blender::BLI_assert(), C, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), convert_single_socket_value(), blender::nodes::partial_eval::eval_upstream(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), blender::nodes::NodeInContext::node, blender::NodesModifierData::node_group, set_modifier_value(), set_socket_value(), set_value_node_value(), blender::nodes::SocketInContext::socket, blender::nodes::partial_eval::UpstreamEvalTargets::sockets, and blender::nodes::partial_eval::UpstreamEvalTargets::value_nodes.
Referenced by backpropagate_socket_values().
|
static |
Definition at line 642 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), backpropagate_socket_values_through_node(), blender::nodes::NodeInContext::context, blender::nodes::eval_log::NodeTreeLog::ensure_socket_values(), blender::bke::bNodeType::eval_inverse, get_logged_socket_value(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), blender::nodes::NodeInContext::node, and node.
Referenced by backpropagate_socket_values(), and backpropagate_socket_values_through_node().
| std::optional< bke::SocketValueVariant > blender::nodes::inverse_eval::convert_single_socket_value | ( | const bNodeSocket & | old_socket, |
| const bNodeSocket & | new_socket, | ||
| const bke::SocketValueVariant & | old_value ) |
Performs implicit conversion from the old to the new socket on the given value, if possible.
Definition at line 48 of file inverse_eval.cc.
References blender::bke::SocketValueVariant::allocate_single(), blender::bke::bNodeSocketType::base_cpp_type, convert_single_socket_value(), blender::bke::DataTypeConversions::convert_to_uninitialized(), blender::bke::SocketValueVariant::get_if(), blender::bke::get_implicit_type_conversions(), blender::bke::DataTypeConversions::is_convertible(), blender::bNodeSocket::type, and blender::bNodeSocket::typeinfo.
Referenced by backpropagate_socket_values(), and convert_single_socket_value().
|
static |
Definition at line 212 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::nodes::NodeInContext::context, blender::bke::bNodeType::eval_elem, evaluate_node_elem_downstream_filtered(), blender::nodes::value_elem::ElemVariant::intersect(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), blender::nodes::NodeInContext::node, and node.
Referenced by evaluate_node_elem_downstream_filtered(), and foreach_element_on_inverse_eval_path().
|
static |
Definition at line 77 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::nodes::NodeInContext::context, blender::bke::bNodeType::eval_inverse_elem, evaluate_node_elem_upstream(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), blender::nodes::NodeInContext::node, and node.
Referenced by evaluate_node_elem_upstream(), find_local_inverse_eval_targets(), and foreach_element_on_inverse_eval_path().
| LocalInverseEvalTargets blender::nodes::inverse_eval::find_local_inverse_eval_targets | ( | const bNodeTree & | tree, |
| const SocketElem & | initial_socket_elem ) |
Scans the node tree backwards from the given socket to figure out which values may need to change to set the given socket to a specific value.
Definition at line 135 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::BLI_assert(), blender::nodes::SocketInContext::context, blender::nodes::value_elem::SocketElem::elem, blender::nodes::partial_eval::eval_upstream(), evaluate_node_elem_upstream(), find_local_inverse_eval_targets(), blender::nodes::value_elem::get_elem_variant_for_socket_type(), get_input_elems_to_propagate(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), node, propagate_socket_elem(), blender::nodes::SocketInContext::socket, blender::nodes::value_elem::SocketElem::socket, blender::nodes::partial_eval::UpstreamEvalTargets::sockets, blender::bNodeTree::type, and blender::nodes::partial_eval::UpstreamEvalTargets::value_nodes.
Referenced by find_local_inverse_eval_targets().
| void blender::nodes::inverse_eval::foreach_element_on_inverse_eval_path | ( | const ComputeContext & | initial_context, |
| const SocketElem & | initial_socket_elem, | ||
| FunctionRef< void(const ComputeContext &context)> | foreach_context_fn, | ||
| FunctionRef< void(const ComputeContext &context, const bNodeSocket &socket, const ElemVariant &elem)> | foreach_socket_fn ) |
Traverses the inverse evaluation path that starts at the given socket in a specific compute context.
| initial_context | Compute context where the inverse evaluation starts (e.g. may be deep in some nested node group). |
| initial_socket_elem | Socket and value element that is propagated backwards. |
| foreach_context_fn | If provided, it is called for each compute context that is touched by the inverse evaluation path. |
| foreach_socket_fn | If provided, it is called for each socket on the inverse evaluation path. |
Definition at line 281 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::BLI_assert(), blender::nodes::value_elem::SocketElem::elem, blender::nodes::partial_eval::eval_downstream(), blender::nodes::partial_eval::eval_upstream(), evaluate_node_elem_downstream_filtered(), evaluate_node_elem_upstream(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), foreach_element_on_inverse_eval_path(), get_input_elems_to_propagate(), blender::nodes::partial_eval::UpstreamEvalTargets::group_inputs, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), propagate_socket_elem(), propagate_value_elem_filtered(), blender::nodes::value_elem::SocketElem::socket, blender::nodes::partial_eval::UpstreamEvalTargets::sockets, and blender::nodes::partial_eval::UpstreamEvalTargets::value_nodes.
Referenced by foreach_element_on_inverse_eval_path().
|
static |
Definition at line 124 of file inverse_eval.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), get_input_elems_to_propagate(), and blender::nodes::NodeInContext::node.
Referenced by find_local_inverse_eval_targets(), foreach_element_on_inverse_eval_path(), and get_input_elems_to_propagate().
| std::optional< SocketValueVariant > blender::nodes::inverse_eval::get_logged_socket_value | ( | eval_log::NodeTreeLog & | tree_log, |
| const bNodeSocket & | socket ) |
Attempts to get the value for a specific socket from the log.
Definition at line 591 of file inverse_eval.cc.
References blender::nodes::eval_log::NodeTreeLog::find_primitive_socket_value(), get_logged_socket_value(), blender::SOCK_BOOLEAN, blender::SOCK_FLOAT, blender::SOCK_INT, blender::SOCK_MATRIX, blender::SOCK_ROTATION, blender::SOCK_VECTOR, and blender::bNodeSocket::type.
Referenced by backpropagate_socket_values_through_node(), and get_logged_socket_value().
|
static |
Definition at line 106 of file inverse_eval.cc.
References blender::nodes::value_elem::convert_socket_elem(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), propagate_socket_elem(), and blender::nodes::SocketInContext::socket.
Referenced by find_local_inverse_eval_targets(), foreach_element_on_inverse_eval_path(), and propagate_socket_elem().
|
static |
Definition at line 250 of file inverse_eval.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::nodes::value_elem::convert_socket_elem(), blender::nodes::value_elem::ElemVariant::intersect(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), propagate_value_elem_filtered(), and blender::nodes::SocketInContext::socket.
Referenced by foreach_element_on_inverse_eval_path(), and propagate_value_elem_filtered().
|
static |
Definition at line 551 of file inverse_eval.cc.
References blender::BLI_str_escape(), C, blender::bke::SocketValueVariant::copy_as(), blender::DEG_id_tag_update(), blender::ID_RECALC_GEOMETRY, blender::bNodeTreeInterfaceSocket::identifier, blender::NodesModifierData::modifier, blender::ModifierData::name, set_modifier_value(), set_rna_property(), set_rna_property_float3(), blender::SOCK_BOOLEAN, blender::SOCK_FLOAT, blender::SOCK_INT, blender::SOCK_ROTATION, blender::SOCK_VECTOR, and blender::math::to_euler().
Referenced by backpropagate_socket_values(), and set_modifier_value().
|
static |
Definition at line 369 of file inverse_eval.cc.
References blender::AUTOKEY_FLAG_INSERTAVAILABLE, blender::animrig::autokeyframe_property(), C, blender::RenderData::cfra, blender::CTX_data_scene(), float, ID_IS_EDITABLE, blender::animrig::is_keying_flag(), blender::PROP_BOOLEAN, blender::PROP_FLOAT, blender::PROP_INT, blender::Scene::r, blender::RNA_id_pointer_create(), blender::RNA_path_resolve_property_full(), blender::RNA_property_array_length(), blender::RNA_property_boolean_set(), blender::RNA_property_boolean_set_index(), blender::RNA_property_float_set(), blender::RNA_property_float_set_index(), blender::RNA_property_float_ui_range(), blender::RNA_property_int_set(), blender::RNA_property_int_set_index(), blender::RNA_property_int_ui_range(), blender::RNA_property_type(), blender::RNA_property_update(), set_rna_property(), step, and blender::v.
Referenced by set_modifier_value(), set_rna_property(), set_rna_property_float3(), set_socket_value(), and set_value_node_value().
|
static |
Definition at line 463 of file inverse_eval.cc.
References C, blender::IndexRange::IndexRange(), set_rna_property(), and set_rna_property_float3().
Referenced by set_modifier_value(), set_rna_property_float3(), set_socket_value(), and set_value_node_value().
|
static |
Definition at line 476 of file inverse_eval.cc.
References blender::BLI_str_escape(), C, blender::bke::SocketValueVariant::copy_as(), blender::bNodeTree::id, node, set_rna_property(), set_rna_property_float3(), set_socket_value(), blender::SOCK_BOOLEAN, blender::SOCK_FLOAT, blender::SOCK_INT, blender::SOCK_ROTATION, blender::SOCK_VECTOR, blender::math::to_euler(), and blender::bNodeSocket::type.
Referenced by backpropagate_socket_values(), and set_socket_value().
|
static |
Definition at line 514 of file inverse_eval.cc.
References blender::BLI_str_escape(), C, blender::bke::SocketValueVariant::copy_as(), FN_NODE_INPUT_BOOL, FN_NODE_INPUT_INT, FN_NODE_INPUT_ROTATION, FN_NODE_INPUT_VECTOR, blender::bNodeTree::id, node, set_rna_property(), set_rna_property_float3(), set_value_node_value(), SH_NODE_VALUE, and blender::math::to_euler().
Referenced by backpropagate_socket_values(), and set_value_node_value().