Blender V4.5
blender::nodes::gizmos Namespace Reference

Classes

struct  TreeGizmoPropagation

Typedefs

using ForeachGizmoFn
using ForeachGizmoInModifierFn

Functions

bool is_builtin_gizmo_node (const bNode &node)
static ie::ElemVariant get_gizmo_socket_elem (const bNode &node, const bNodeSocket &socket)
static TreeGizmoPropagation build_tree_gizmo_propagation (bNodeTree &tree)
bool update_tree_gizmo_propagation (bNodeTree &tree)
static void foreach_gizmo_for_input (const ie::SocketElem &input_socket, bke::ComputeContextCache &compute_context_cache, const ComputeContext *compute_context, const bNodeTree &tree, const ForeachGizmoInModifierFn fn)
static void foreach_gizmo_for_group_input (const bNodeTree &tree, const ie::GroupInputElem &group_input, bke::ComputeContextCache &compute_context_cache, const ComputeContext *compute_context, const ForeachGizmoInModifierFn fn)
static void foreach_active_gizmo_in_open_node_editor (const SpaceNode &snode, const Object *object_filter, const NodesModifierData *nmd_filter, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoFn fn)
static void foreach_active_gizmo_in_open_editors (const wmWindowManager &wm, const Object *object_filter, const NodesModifierData *nmd_filter, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoFn fn)
static void foreach_active_gizmo_exposed_to_modifier (const NodesModifierData &nmd, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoInModifierFn fn)
void foreach_active_gizmo_in_modifier (const Object &object, const NodesModifierData &nmd, const wmWindowManager &wm, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoInModifierFn fn)
void foreach_active_gizmo (const bContext &C, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoFn fn)
void foreach_compute_context_on_gizmo_path (const ComputeContext &gizmo_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket, FunctionRef< void(const ComputeContext &context)> fn)
void foreach_socket_on_gizmo_path (const ComputeContext &gizmo_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket, FunctionRef< void(const ComputeContext &context, const bNodeSocket &socket, const ie::ElemVariant &elem)> fn)
ie::ElemVariant get_editable_gizmo_elem (const ComputeContext &gizmo_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket)
void apply_gizmo_change (bContext &C, Object &object, NodesModifierData &nmd, geo_eval_log::GeoNodesLog &eval_log, const ComputeContext &gizmo_context, const bNodeSocket &gizmo_socket, const FunctionRef< void(bke::SocketValueVariant &value)> apply_on_gizmo_value_fn)
bool value_node_has_gizmo (const bNodeTree &tree, const bNode &node)
void apply_gizmo_change (bContext &C, Object &object, NodesModifierData &nmd, geo_eval_log::GeoNodesLog &eval_log, const ComputeContext &gizmo_context, const bNodeSocket &gizmo_socket, FunctionRef< void(bke::SocketValueVariant &value)> apply_on_gizmo_value_fn)

Typedef Documentation

◆ ForeachGizmoFn

◆ ForeachGizmoInModifierFn

Initial value:
FunctionRef<void(const ComputeContext &compute_context,
const bNode &gizmo_node,
const bNodeSocket &gizmo_socket)>

Definition at line 70 of file NOD_geometry_nodes_gizmos.hh.

Function Documentation

◆ apply_gizmo_change() [1/2]

◆ apply_gizmo_change() [2/2]

void blender::nodes::gizmos::apply_gizmo_change ( bContext & C,
Object & object,
NodesModifierData & nmd,
geo_eval_log::GeoNodesLog & eval_log,
const ComputeContext & gizmo_context,
const bNodeSocket & gizmo_socket,
FunctionRef< void(bke::SocketValueVariant &value)> apply_on_gizmo_value_fn )

Should be called when a gizmo is moved and the change should be propagated back to the right place.

Parameters
CThe context the gizmo is changed in. Required for propagating updates correctly.
objectThe object with the modifier that the gizmo belongs to.
nmdThe modifier that the gizmo belongs to.
eval_logThe logged evaluation data that should be used to compute the backpropagated value. This may not be the most recent logged data, because generally the same logged data is used while interacting with a gizmo.
gizmo_contextThe compute context of the gizmo node whose gizmo is modified.
gizmo_socketThe gizmo socket whose gizmo is modified.
apply_on_gizmo_value_fnApplies the change done to the gizmo to the value in the gizmo node. For example, if an arrow gizmo is moved, the distance it's moved is added to the socket value. This is a callback because gizmo sockets are multi-inputs and thus multiple values need to change.

References apply_gizmo_change(), C, and value_node_has_gizmo().

◆ build_tree_gizmo_propagation()

◆ foreach_active_gizmo()

void blender::nodes::gizmos::foreach_active_gizmo ( const bContext & C,
bke::ComputeContextCache & compute_context_cache,
ForeachGizmoFn fn )

◆ foreach_active_gizmo_exposed_to_modifier()

◆ foreach_active_gizmo_in_modifier()

void blender::nodes::gizmos::foreach_active_gizmo_in_modifier ( const Object & object,
const NodesModifierData & nmd,
const wmWindowManager & wm,
bke::ComputeContextCache & compute_context_cache,
ForeachGizmoInModifierFn fn )

◆ foreach_active_gizmo_in_open_editors()

◆ foreach_active_gizmo_in_open_node_editor()

◆ foreach_compute_context_on_gizmo_path()

void blender::nodes::gizmos::foreach_compute_context_on_gizmo_path ( const ComputeContext & gizmo_context,
const bNode & gizmo_node,
const bNodeSocket & gizmo_socket,
FunctionRef< void(const ComputeContext &context)> fn )

Iterates over all compute contexts that are touched by a specific gizmo back-propagation path. This is used to make sure that all sockets on the path are logged.

Definition at line 463 of file geometry_nodes_gizmos.cc.

References foreach_compute_context_on_gizmo_path(), and get_gizmo_socket_elem().

Referenced by blender::find_side_effect_nodes_for_active_gizmos(), and foreach_compute_context_on_gizmo_path().

◆ foreach_gizmo_for_group_input()

void blender::nodes::gizmos::foreach_gizmo_for_group_input ( const bNodeTree & tree,
const ie::GroupInputElem & group_input,
bke::ComputeContextCache & compute_context_cache,
const ComputeContext * compute_context,
const ForeachGizmoInModifierFn fn )
static

◆ foreach_gizmo_for_input()

◆ foreach_socket_on_gizmo_path()

void blender::nodes::gizmos::foreach_socket_on_gizmo_path ( const ComputeContext & gizmo_context,
const bNode & gizmo_node,
const bNodeSocket & gizmo_socket,
FunctionRef< void(const ComputeContext &context, const bNodeSocket &socket, const ie::ElemVariant &elem)> fn )

Iterates over all sockets that propagate values modified by gizmos backwards. This is used to draw the links between those sockets in a special way.

Definition at line 472 of file geometry_nodes_gizmos.cc.

References foreach_socket_on_gizmo_path(), and get_gizmo_socket_elem().

Referenced by blender::ed::space_node::find_sockets_on_active_gizmo_paths(), and foreach_socket_on_gizmo_path().

◆ get_editable_gizmo_elem()

ie::ElemVariant blender::nodes::gizmos::get_editable_gizmo_elem ( const ComputeContext & gizmo_context,
const bNode & gizmo_node,
const bNodeSocket & gizmo_socket )

Get the value element of a gizmo socket that can be affected by a gizmo. E.g. for the Transform Gizmo node this may report that only the rotation component can be controlled with the gizmo.

Definition at line 483 of file geometry_nodes_gizmos.cc.

References BLI_assert, get_editable_gizmo_elem(), get_gizmo_socket_elem(), blender::ComputeContext::hash(), and bNodeSocket::type.

Referenced by get_editable_gizmo_elem(), and blender::ed::view3d::geometry_nodes_gizmos::WIDGETGROUP_geometry_nodes_refresh().

◆ get_gizmo_socket_elem()

◆ is_builtin_gizmo_node()

◆ update_tree_gizmo_propagation()

bool blender::nodes::gizmos::update_tree_gizmo_propagation ( bNodeTree & tree)

Updates the TreeGizmoPropagation cached on the node-tree.

Returns
False, if the propagation changed.

Definition at line 160 of file geometry_nodes_gizmos.cc.

References build_tree_gizmo_propagation(), bNodeTree::runtime, and update_tree_gizmo_propagation().

Referenced by update_tree_gizmo_propagation().

◆ value_node_has_gizmo()