90 while ((node = node->
parent)) {
107 if (node->is_frame()) {
110 const bool is_parent = !node->direct_children_in_frame().is_empty();
112 if (is_parent && shrinking) {
118 while ((node = node->
parent)) {
121 const bool parent_transformed = transformed_nodes.
contains(node);
123 if (parent_transformed && !parent_shrinking) {
139 return (!node_selected && !parent_selected);
177 custom_data->data =
nullptr;
186 if (
nodes.is_empty()) {
194 for (
const int i :
nodes.index_range()) {
242 const float2 offset = target_location - inital_location;
244 const float2 snapped_inital_location =
math::round(inital_location / grid_size) * grid_size;
246 const float2 snapped_target_location = snapped_inital_location + snapped_offset;
255 for (
bNode *child : node.direct_children_in_frame()) {
256 child->location[0] += delta.x;
257 child->location[1] += delta.y;
258 if (child->is_frame()) {
295 float offset[2] = {0.0f, 0.0f};
319 nodes_to_detach.
append(node);
326 for (
bNode *node : nodes_to_detach) {
336 for (
int i = 0;
i < tc->data_len;
i++) {
346 if (node->is_frame()) {
356 if (tc->data_len == 1) {
Main * CTX_data_main(const bContext *C)
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void unit_m3(float m[3][3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
#define NODE_EDGE_PAN_OUTSIDE_PAD
#define NODE_EDGE_PAN_INSIDE_PAD
#define NODE_EDGE_PAN_MAX_SPEED
void ED_node_post_apply_transform(bContext *C, bNodeTree *ntree)
#define NODE_EDGE_PAN_DELAY
#define NODE_EDGE_PAN_ZOOM_INFLUENCE
#define NODE_EDGE_PAN_SPEED_RAMP
Read Guarded memory(de)allocation.
void UI_view2d_edge_pan_cancel(bContext *C, View2DEdgePanData *vpd)
void UI_view2d_edge_pan_init(bContext *C, View2DEdgePanData *vpd, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void UI_view2d_edge_pan_apply(bContext *C, View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
BMesh const char void * data
bool add(const Key &key, const Value &value)
ItemIterator items() const &
bool contains(const Key &key) const
void append(const T &value)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void node_attach_node(bNodeTree &ntree, bNode &node, bNode &parent)
void node_remove_node(Main *bmain, bNodeTree &ntree, bNode &node, bool do_id_user, bool remove_animation=true)
void node_detach_node(bNodeTree &ntree, bNode &node)
void node_insert_on_link_flags_set(SpaceNode &snode, const ARegion ®ion, bool attach_enabled, bool is_new_node)
void node_insert_on_frame_flag_set(bContext &C, SpaceNode &snode, const int2 &cursor)
void node_insert_on_link_flags_clear(bNodeTree &node_tree)
void node_insert_on_frame_flag_clear(SpaceNode &snode)
void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
struct bNodeTree * edittree
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)