Blender V5.3
geometry_nodes_gizmos.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLI_listbase.hh"
10
13#include "BKE_context.hh"
14#include "BKE_node.hh"
16#include "BKE_node_runtime.hh"
18#include "BKE_object.hh"
19#include "BKE_workspace.hh"
20
23#include "NOD_partial_eval.hh"
25
26#include "DNA_layer_types.h"
27#include "DNA_modifier_types.h"
28#include "DNA_space_types.h"
30
31#include "ED_node.hh"
32
33#include "RNA_access.hh"
34#include "RNA_prototypes.hh"
35
36namespace blender::nodes::gizmos {
37
43
47static ie::ElemVariant get_gizmo_socket_elem(const bNode &node, const bNodeSocket &socket)
48{
49 switch (node.type_legacy) {
51 return {ie::FloatElem::all()};
52 }
54 return {ie::FloatElem::all()};
55 }
57 const auto &storage = *static_cast<const NodeGeometryTransformGizmo *>(node.storage);
58 ie::MatrixElem elem;
60 elem.translation = ie::VectorElem::all();
61 }
62 if (storage.flag &
64 {
65 elem.rotation = ie::RotationElem::all();
66 elem.scale = ie::VectorElem::all();
67 }
68 return {elem};
69 }
70 }
71 const eNodeSocketDatatype socket_type = socket.type;
72 if (std::optional<ie::ElemVariant> elem = ie::get_elem_variant_for_socket_type(socket_type)) {
73 elem->set_all();
74 return *elem;
75 }
77 return {};
78}
79
81{
82 BLI_assert(!tree.has_available_link_cycle());
83
84 TreeGizmoPropagation gizmo_propagation;
85
86 struct GizmoInput {
87 const bNodeSocket *gizmo_socket;
88 /* For multi-input sockets we start propagation at the origin socket. */
89 const bNodeSocket *propagation_start_socket;
90 ie::ElemVariant elem;
91 };
92
93 /* Gather all gizmo inputs so that we can find their inverse evaluation targets afterwards. */
94 Vector<GizmoInput> all_gizmo_inputs;
95 for (const bNode *node : tree.all_nodes()) {
96 if (node->is_muted()) {
97 continue;
98 }
99 if (node->is_group()) {
100 if (!node->id) {
101 continue;
102 }
103 const bNodeTree &group = *reinterpret_cast<const bNodeTree *>(node->id);
104 if (!group.runtime->gizmo_propagation) {
105 continue;
106 }
107 const TreeGizmoPropagation &group_gizmo_propagation = *group.runtime->gizmo_propagation;
108 for (const ie::GroupInputElem &group_input_elem :
109 group_gizmo_propagation.gizmo_inputs_by_group_inputs.keys())
110 {
111 const bNodeSocket &input_socket = node->input_socket(group_input_elem.group_input_index);
112 all_gizmo_inputs.append({&input_socket, &input_socket, group_input_elem.elem});
113 }
114 }
116 gizmo_propagation.gizmo_nodes.append(node);
117 const bNodeSocket &gizmo_input_socket = node->input_socket(0);
118 gizmo_propagation.gizmo_endpoint_sockets.add(&gizmo_input_socket);
119 const ie::ElemVariant elem = get_gizmo_socket_elem(*node, gizmo_input_socket);
120 for (const bNodeLink *link : gizmo_input_socket.directly_linked_links()) {
121 if (!link->is_used()) {
122 continue;
123 }
124 all_gizmo_inputs.append({&gizmo_input_socket, link->fromsock, elem});
125 }
126 }
127 }
128
129 /* Find the local gizmo targets for all gizmo inputs. */
130 for (const GizmoInput &gizmo_input : all_gizmo_inputs) {
131 gizmo_propagation.gizmo_endpoint_sockets.add(gizmo_input.gizmo_socket);
132 const ie::SocketElem gizmo_input_socket_elem{gizmo_input.gizmo_socket, gizmo_input.elem};
133 /* The conversion is necessary when e.g. connecting a Rotation directly to the matrix input of
134 * the Transform Gizmo node. */
135 const std::optional<ie::ElemVariant> converted_elem = ie::convert_socket_elem(
136 *gizmo_input.gizmo_socket, *gizmo_input.propagation_start_socket, gizmo_input.elem);
137 if (!converted_elem) {
138 continue;
139 }
140 const ie::LocalInverseEvalTargets targets = ie::find_local_inverse_eval_targets(
141 tree, {gizmo_input.propagation_start_socket, *converted_elem});
142 const bool has_target = !targets.input_sockets.is_empty() ||
143 !targets.group_inputs.is_empty() || !targets.value_nodes.is_empty();
144 if (!has_target) {
145 continue;
146 }
147 /* Remember all the gizmo targets for quick lookup later on. */
148 for (const ie::SocketElem &input_socket : targets.input_sockets) {
149 gizmo_propagation.gizmo_inputs_by_node_inputs.add(input_socket, gizmo_input_socket_elem);
150 gizmo_propagation.gizmo_endpoint_sockets.add(input_socket.socket);
151 }
152 for (const ie::ValueNodeElem &value_node : targets.value_nodes) {
153 gizmo_propagation.gizmo_inputs_by_value_nodes.add(value_node, gizmo_input_socket_elem);
154 gizmo_propagation.gizmo_endpoint_sockets.add(&value_node.node->output_socket(0));
155 }
156 for (const ie::GroupInputElem &group_input : targets.group_inputs) {
157 gizmo_propagation.gizmo_inputs_by_group_inputs.add(group_input, gizmo_input_socket_elem);
158 for (const bNode *group_input_node : tree.group_input_nodes()) {
159 gizmo_propagation.gizmo_endpoint_sockets.add(
160 &group_input_node->output_socket(group_input.group_input_index));
161 }
162 }
163 }
164
165 return gizmo_propagation;
166}
167
169{
170 tree.ensure_topology_cache();
171
172 if (tree.has_available_link_cycle()) {
173 const bool changed = tree.runtime->gizmo_propagation != nullptr;
174 tree.runtime->gizmo_propagation.reset();
175 return changed;
176 }
177
178 TreeGizmoPropagation new_gizmo_propagation = build_tree_gizmo_propagation(tree);
179 const bool changed = tree.runtime->gizmo_propagation ?
180 *tree.runtime->gizmo_propagation != new_gizmo_propagation :
181 true;
182 tree.runtime->gizmo_propagation = std::make_unique<TreeGizmoPropagation>(
183 std::move(new_gizmo_propagation));
184 return changed;
185}
186
187static void foreach_gizmo_for_input(const ie::SocketElem &input_socket,
188 bke::ComputeContextCache &compute_context_cache,
189 const ComputeContext *compute_context,
190 const bNodeTree &tree,
192
194 const ie::GroupInputElem &group_input,
195 bke::ComputeContextCache &compute_context_cache,
196 const ComputeContext *compute_context,
198{
199 const TreeGizmoPropagation &gizmo_propagation = *tree.runtime->gizmo_propagation;
200 for (const ie::SocketElem &gizmo_input :
201 gizmo_propagation.gizmo_inputs_by_group_inputs.lookup(group_input))
202 {
203 foreach_gizmo_for_input(gizmo_input, compute_context_cache, compute_context, tree, fn);
204 }
205}
206
207static void foreach_gizmo_for_input(const ie::SocketElem &input_socket,
208 bke::ComputeContextCache &compute_context_cache,
209 const ComputeContext *compute_context,
210 const bNodeTree &tree,
212{
213 const bke::bNodeTreeZones *zones = tree.zones();
214 if (!zones) {
215 /* There are invalid zones. */
216 return;
217 }
218 const bNode &node = input_socket.socket->owner_node();
219 if (zones->get_zone_by_node(node.identifier) != nullptr) {
220 /* Gizmos in zones are not supported yet. */
221 return;
222 }
224 if (node.is_muted()) {
225 return;
226 }
227 /* Found an actual built-in gizmo node. */
228 fn(*compute_context, node, *input_socket.socket);
229 return;
230 }
231 if (node.is_group()) {
232 const bNodeTree &group = *reinterpret_cast<const bNodeTree *>(node.id);
233 group.ensure_topology_cache();
234 const ComputeContext &group_compute_context = compute_context_cache.for_group_node(
235 compute_context, node.identifier, &tree);
237 group,
238 ie::GroupInputElem{input_socket.socket->index(), input_socket.elem},
239 compute_context_cache,
240 &group_compute_context,
241 fn);
242 }
243}
244
246 const SpaceNode &snode,
247 const Object *object_filter,
248 const NodesModifierData *nmd_filter,
249 bke::ComputeContextCache &compute_context_cache,
250 const ForeachGizmoFn fn)
251{
252 if (snode.nodetree == nullptr) {
253 return;
254 }
255 if (snode.edittree == nullptr || !snode.edittree->runtime->gizmo_propagation) {
256 return;
257 }
258 const std::optional<ed::space_node::ObjectAndModifier> object_and_modifier =
260 if (!object_and_modifier) {
261 return;
262 }
263 if (object_filter) {
264 if (object_and_modifier->object != object_filter) {
265 return;
266 }
267 }
268 if (nmd_filter) {
269 if (object_and_modifier->nmd != nmd_filter) {
270 return;
271 }
272 }
273
274 const Object &object = *object_and_modifier->object;
275 const NodesModifierData &nmd = *object_and_modifier->nmd;
276
277 if (!(nmd.modifier.mode & eModifierMode_Realtime)) {
278 /* Disabled modifiers can't have gizmos currently. */
279 return;
280 }
281
282 const ComputeContext *current_compute_context = ed::space_node::compute_context_for_edittree(
283 snode, compute_context_cache);
284 if (!current_compute_context) {
285 return;
286 }
287
288 snode.edittree->ensure_topology_cache();
289 const TreeGizmoPropagation &gizmo_propagation = *snode.edittree->runtime->gizmo_propagation;
290 Set<ie::SocketElem> used_gizmo_inputs;
291
292 /* Check gizmos on value nodes. */
293 for (auto &&item : gizmo_propagation.gizmo_inputs_by_value_nodes.items()) {
294 const bNode &node = *item.key.node;
295 const bNodeSocket &output_socket = node.output_socket(0);
296 if (node.is_selected() || (output_socket.flag & SOCK_GIZMO_PIN)) {
297 used_gizmo_inputs.add_multiple(item.value);
298 continue;
299 }
300 for (const ie::SocketElem &socket_elem : item.value) {
301 if (socket_elem.socket->owner_node().is_selected()) {
302 used_gizmo_inputs.add(socket_elem);
303 }
304 }
305 }
306 /* Check gizmos on input sockets. */
307 for (auto &&item : gizmo_propagation.gizmo_inputs_by_node_inputs.items()) {
308 const bNodeSocket &socket = *item.key.socket;
309 if (socket.is_inactive()) {
310 continue;
311 }
312 const bNode &node = socket.owner_node();
313 if (node.is_selected() || (socket.flag & SOCK_GIZMO_PIN)) {
314 used_gizmo_inputs.add_multiple(item.value);
315 continue;
316 }
317 for (const ie::SocketElem &socket_elem : item.value) {
318 if (socket_elem.socket->owner_node().is_selected()) {
319 used_gizmo_inputs.add(socket_elem);
320 }
321 }
322 }
323 /* Check built-in gizmo nodes. */
324 for (const bNode *gizmo_node : gizmo_propagation.gizmo_nodes) {
325 if (gizmo_node->is_muted()) {
326 continue;
327 }
328 const bNodeSocket &gizmo_input_socket = gizmo_node->input_socket(0);
329 if (gizmo_node->is_selected() || (gizmo_input_socket.flag & SOCK_GIZMO_PIN)) {
330 used_gizmo_inputs.add(
331 {&gizmo_input_socket, *ie::get_elem_variant_for_socket_type(gizmo_input_socket.type)});
332 }
333 }
334 for (const ie::SocketElem &gizmo_input : used_gizmo_inputs) {
335 foreach_gizmo_for_input(gizmo_input,
336 compute_context_cache,
337 current_compute_context,
338 *snode.edittree,
339 [&](const ComputeContext &compute_context,
340 const bNode &gizmo_node,
341 const bNodeSocket &gizmo_socket) {
342 fn(object, nmd, compute_context, gizmo_node, gizmo_socket);
343 });
344 }
345}
346
348 const Object *object_filter,
349 const NodesModifierData *nmd_filter,
350 bke::ComputeContextCache &compute_context_cache,
351 const ForeachGizmoFn fn)
352{
353 for (const wmWindow &window : wm.windows) {
354 const bScreen *active_screen = BKE_workspace_active_screen_get(window.workspace_hook);
355 Vector<const bScreen *> screens = {active_screen};
356 if (ELEM(active_screen->state, SCREENMAXIMIZED, SCREENFULL)) {
357 const ScrArea *area = active_screen->areabase.first();
358 screens.append(area->full);
359 }
360 for (const bScreen *screen : screens) {
361 for (const ScrArea &area : screen->areabase) {
362 const SpaceLink *sl = area.spacedata.first_as<SpaceLink>();
363 if (sl == nullptr) {
364 continue;
365 }
366 if (sl->spacetype != SPACE_NODE) {
367 continue;
368 }
369 const SpaceNode &snode = *reinterpret_cast<const SpaceNode *>(sl);
371 snode, object_filter, nmd_filter, compute_context_cache, fn);
372 }
373 }
374 }
375}
376
378 const Object &object,
379 const NodesModifierData &nmd,
380 bke::ComputeContextCache &compute_context_cache,
382{
383 if (!nmd.node_group || ID_MISSING(nmd.node_group)) {
384 return;
385 }
386 const bNodeTree &tree = *nmd.node_group;
387 if (!tree.runtime->gizmo_propagation) {
388 return;
389 }
390
391 tree.ensure_interface_cache();
393 const_cast<ID *>(&object.id), RNA_NodesModifier, const_cast<NodesModifierData *>(&nmd));
394 PointerRNA properties_ptr = RNA_pointer_get(&nmd_ptr, "properties");
395
396 ResourceScope scope;
398 *nmd.node_group, properties_ptr, scope);
399
400 const auto get_input_value = [&](const int group_input_i) {
401 return input_values[group_input_i];
402 };
403 SocketValueInferencer value_inferencer{
404 *nmd.node_group, scope, compute_context_cache, get_input_value};
406 *nmd.node_group, scope, value_inferencer, compute_context_cache);
407
408 const ComputeContext &object_context = compute_context_cache.for_data_block(nullptr, object.id);
409 const ComputeContext &root_compute_context = compute_context_cache.for_geometry_nodes_modifier(
410 &object_context, nmd);
411 for (auto &&item : tree.runtime->gizmo_propagation->gizmo_inputs_by_group_inputs.items()) {
412 const ie::GroupInputElem &group_input_elem = item.key;
413 if (item.value.is_empty()) {
414 continue;
415 }
416 if (!usage_inferencer.is_group_input_used(group_input_elem.group_input_index)) {
417 continue;
418 }
419 for (const ie::SocketElem &socket_elem : item.value) {
420 foreach_gizmo_for_input(socket_elem, compute_context_cache, &root_compute_context, tree, fn);
421 }
422 }
423}
424
426 const NodesModifierData &nmd,
427 const wmWindowManager &wm,
428 bke::ComputeContextCache &compute_context_cache,
430{
431 if (!nmd.node_group || ID_MISSING(nmd.node_group)) {
432 return;
433 }
434
436 &object,
437 &nmd,
438 compute_context_cache,
439 [&](const Object &object_with_gizmo,
440 const NodesModifierData &nmd_with_gizmo,
441 const ComputeContext &compute_context,
442 const bNode &gizmo_node,
443 const bNodeSocket &gizmo_socket) {
444 BLI_assert(&object == &object_with_gizmo);
445 BLI_assert(&nmd == &nmd_with_gizmo);
446 UNUSED_VARS_NDEBUG(object_with_gizmo, nmd_with_gizmo);
447 fn(compute_context, gizmo_node, gizmo_socket);
448 });
449
450 foreach_active_gizmo_exposed_to_modifier(object, nmd, compute_context_cache, fn);
451}
452
454 bke::ComputeContextCache &compute_context_cache,
455 const ForeachGizmoFn fn)
456{
458 if (!wm) {
459 return;
460 }
461 foreach_active_gizmo_in_open_editors(*wm, nullptr, nullptr, compute_context_cache, fn);
462
463 if (const Base *active_base = CTX_data_active_base(&C)) {
464 if (!(active_base->flag & BASE_SELECTED)) {
465 return;
466 }
467 Object *active_object = active_base->object;
468
469 if (const ModifierData *md = BKE_object_active_modifier(active_object)) {
470 if (!(md->mode & eModifierMode_Realtime)) {
471 return;
472 }
473 if (md->type == eModifierType_Nodes) {
474 const NodesModifierData &nmd = *reinterpret_cast<const NodesModifierData *>(md);
476 *active_object,
477 nmd,
478 compute_context_cache,
479 [&](const ComputeContext &compute_context,
480 const bNode &gizmo_node,
481 const bNodeSocket &gizmo_socket) {
482 fn(*active_object, nmd, compute_context, gizmo_node, gizmo_socket);
483 });
484 }
485 }
486 }
487}
488
490 const bNode &gizmo_node,
491 const bNodeSocket &gizmo_socket,
492 FunctionRef<void(const ComputeContext &context)> fn)
493{
494 ie::foreach_element_on_inverse_eval_path(
495 gizmo_context, {&gizmo_socket, get_gizmo_socket_elem(gizmo_node, gizmo_socket)}, fn, {});
496}
497
499 const ComputeContext &gizmo_context,
500 const bNode &gizmo_node,
501 const bNodeSocket &gizmo_socket,
502 FunctionRef<void(
503 const ComputeContext &context, const bNodeSocket &socket, const ie::ElemVariant &elem)> fn)
504{
505 ie::foreach_element_on_inverse_eval_path(
506 gizmo_context, {&gizmo_socket, get_gizmo_socket_elem(gizmo_node, gizmo_socket)}, {}, fn);
507}
508
509ie::ElemVariant get_editable_gizmo_elem(const ComputeContext &gizmo_context,
510 const bNode &gizmo_node,
511 const bNodeSocket &gizmo_socket)
512{
513 std::optional<ie::ElemVariant> found_elem = ie::get_elem_variant_for_socket_type(
514 gizmo_socket.type);
515 BLI_assert(found_elem.has_value());
516
517 ie::foreach_element_on_inverse_eval_path(
518 gizmo_context,
519 {&gizmo_socket, get_gizmo_socket_elem(gizmo_node, gizmo_socket)},
520 {},
521 [&](const ComputeContext &context, const bNodeSocket &socket, const ie::ElemVariant &elem) {
522 if (context.hash() == gizmo_context.hash() && &socket == &gizmo_socket) {
523 found_elem->merge(elem);
524 }
525 });
526
527 return *found_elem;
528}
529
531 bContext &C,
532 Object &object,
535 const ComputeContext &gizmo_context,
536 const bNodeSocket &gizmo_socket,
537 const FunctionRef<void(bke::SocketValueVariant &value)> apply_on_gizmo_value_fn)
538{
539 Vector<ie::SocketToUpdate> sockets_to_update;
540
541 const bNodeTree &gizmo_node_tree = gizmo_socket.owner_tree();
542 eval_log::NodeTreeLog &gizmo_tree_log = eval_log.get_tree_log(gizmo_context.hash());
543
544 /* Gather all sockets to update together with their new values. */
545 for (const bNodeLink *link : gizmo_socket.directly_linked_links()) {
546 gizmo_node_tree.ensure_topology_cache();
547 if (!link->is_used()) {
548 continue;
549 }
550 if (link->fromnode->is_dangling_reroute()) {
551 continue;
552 }
553 const std::optional<bke::SocketValueVariant> old_value = ie::get_logged_socket_value(
554 gizmo_tree_log, *link->fromsock);
555 if (!old_value) {
556 continue;
557 }
558 const std::optional<bke::SocketValueVariant> old_value_converted =
559 ie::convert_single_socket_value(*link->fromsock, *link->tosock, *old_value);
560 if (!old_value_converted) {
561 continue;
562 }
563 bke::SocketValueVariant new_value = *old_value_converted;
564 apply_on_gizmo_value_fn(new_value);
565
566 sockets_to_update.append({&gizmo_context, &gizmo_socket, link, new_value});
567 }
568
569 /* Actually backpropagate the socket values. */
570 ie::backpropagate_socket_values(C, object, nmd, eval_log, sockets_to_update);
571}
572
573bool value_node_has_gizmo(const bNodeTree &tree, const bNode &node)
574{
576 if (!tree.runtime->gizmo_propagation) {
577 return false;
578 }
579 return tree.runtime->gizmo_propagation->gizmo_endpoint_sockets.contains(&node.output_socket(0));
580}
581
582} // namespace blender::nodes::gizmos
#define GEO_NODE_GIZMO_LINEAR
#define GEO_NODE_GIZMO_DIAL
#define GEO_NODE_GIZMO_TRANSFORM
General operations, lookup, etc. for blender objects.
#define ID_MISSING(_id)
Definition DNA_ID.h:695
#define GEO_NODE_TRANSFORM_GIZMO_USE_ROTATION_ALL
#define GEO_NODE_TRANSFORM_GIZMO_USE_TRANSLATION_ALL
#define GEO_NODE_TRANSFORM_GIZMO_USE_SCALE_ALL
#define C
Definition RandGen.cpp:29
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
#define ELEM(...)
const ComputeContextHash & hash() const
MapType::KeyIterator keys() const
Span< Value > lookup(const Key &key) const
MapType::ItemIterator items() const
void add(const Key &key, const Value &value)
bool add(const Key &key)
Definition BLI_set.hh:248
void add_multiple(Span< Key > keys)
Definition BLI_set.hh:287
void append(const T &value)
const GeometryNodesModifierComputeContext & for_geometry_nodes_modifier(const ComputeContext *parent, const NodesModifierData &nmd)
const GroupNodeComputeContext & for_group_node(const ComputeContext *parent, int32_t node_id, const bNodeTree *tree=nullptr)
const DataBlockComputeContext & for_data_block(const ComputeContext *parent, const uint32_t orig_session_uid, const ID *id=nullptr)
std::unique_ptr< nodes::gizmos::TreeGizmoPropagation > gizmo_propagation
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
#define storage(slot, qualifiers)
std::optional< ObjectAndModifier > get_geometry_nodes_modifier_for_node_editor(const SpaceNode &snode)
const ComputeContext * compute_context_for_edittree(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
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)
bool is_builtin_gizmo_node(const bNode &node)
ie::ElemVariant get_editable_gizmo_elem(const ComputeContext &gizmo_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket)
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)
static ie::ElemVariant get_gizmo_socket_elem(const bNode &node, const bNodeSocket &socket)
static TreeGizmoPropagation build_tree_gizmo_propagation(bNodeTree &tree)
void foreach_active_gizmo(const bContext &C, 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)
void foreach_active_gizmo_in_modifier(const Object &object, const NodesModifierData &nmd, const wmWindowManager &wm, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoInModifierFn fn)
void apply_gizmo_change(bContext &C, Object &object, NodesModifierData &nmd, eval_log::NodesEvalLog &eval_log, const ComputeContext &gizmo_context, const bNodeSocket &gizmo_socket, const FunctionRef< void(bke::SocketValueVariant &value)> apply_on_gizmo_value_fn)
FunctionRef< void(const Object &object, const NodesModifierData &nmd, const ComputeContext &compute_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket)> ForeachGizmoFn
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)
bool value_node_has_gizmo(const bNodeTree &tree, const bNode &node)
static void foreach_active_gizmo_exposed_to_modifier(const Object &object, const NodesModifierData &nmd, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoInModifierFn fn)
FunctionRef< void(const ComputeContext &compute_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket)> ForeachGizmoInModifierFn
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)
bool is_supported_value_node(const bNode &node)
Vector< InferenceValue > get_geometry_nodes_input_inference_values(const bNodeTree &btree, const PointerRNA &properties_ptr, ResourceScope &scope)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:684
Base * CTX_data_active_base(const bContext *C)
ModifierData * BKE_object_active_modifier(const Object *ob)
Definition object.cc:1427
wmWindowManager * CTX_wm_manager(const bContext *C)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
ListBaseT< SpaceLink > spacedata
struct bNodeTree * edittree
struct bNodeTree * nodetree
eNodeSocketDatatype type
bke::bNodeTreeRuntime * runtime
eScreen_State state
ListBaseT< struct ScrArea > areabase
MultiValueMap< ie::SocketElem, ie::SocketElem > gizmo_inputs_by_node_inputs
MultiValueMap< ie::GroupInputElem, ie::SocketElem > gizmo_inputs_by_group_inputs
MultiValueMap< ie::ValueNodeElem, ie::SocketElem > gizmo_inputs_by_value_nodes
struct WorkSpaceInstanceHook * workspace_hook