65 td2d.loc2d = td2d.
loc;
91 if (
node->is_selected()) {
107 if (
node->is_frame()) {
110 const bool is_parent = !
node->direct_children_in_frame().is_empty();
112 if (is_parent && shrinking) {
121 const bool parent_transformed = transformed_nodes.
contains(
node);
123 if (parent_transformed && !parent_shrinking) {
137 const bool node_selected =
node->is_selected();
139 return (!node_selected && !parent_selected);
158 view2d_edge_pan_init(t->
context,
179 custom_data->data =
nullptr;
188 if (
nodes.is_empty()) {
196 for (
const int i :
nodes.index_range()) {
226 for (
const int i :
IndexRange(tc->data_len)) {
244 const float2 offset = target_location - inital_location;
246 const float2 snapped_inital_location =
math::round(inital_location / grid_size) * grid_size;
248 const float2 snapped_target_location = snapped_inital_location + snapped_offset;
257 for (
bNode *child :
node.direct_children_in_frame()) {
258 child->location[0] += delta.x;
259 child->location[1] += delta.y;
260 if (child->is_frame()) {
268 for (
bNode *parent =
node.parent; parent; parent = parent->parent) {
269 if (parent->is_selected()) {
285 view2d_edge_pan_cancel(t->
context, &customdata->edgepan_data);
297 float offset[2] = {0.0f, 0.0f};
313 if (!
node->is_selected()) {
322 customdata->old_parent_by_detached_node.add(
node,
node->parent);
340 for (
int i = 0; i < tc->data_len; i++) {
350 if (
node->is_frame()) {
355 node->location[0] = loc.x;
356 node->location[1] = loc.y;
360 if (tc->data_len == 1 && t->
region) {
393 for (
bNode &
node : ntree->nodes.items_mutable()) {
394 if (
node.is_selected()) {
#define NODE_EDGE_PAN_OUTSIDE_PAD
#define NODE_EDGE_PAN_INSIDE_PAD
#define NODE_EDGE_PAN_MAX_SPEED
#define NODE_EDGE_PAN_DELAY
#define NODE_EDGE_PAN_ZOOM_INFLUENCE
#define NODE_EDGE_PAN_SPEED_RAMP
Read Blender memory allocation and freeing.
constexpr IndexRange()=default
bool contains(const Key &key) const
void append(const T &value)
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(SpaceNode &snode, ARegion ®ion, 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)
void view2d_edge_pan_apply(bContext *C, View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void WM_operator_properties_free(PointerRNA *ptr)
MINLINE void copy_v2_v2(float r[2], const float a[2])
PointerRNA WM_operator_properties_create_ptr(wmOperatorType *ot)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
BMesh const char void * data
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
void ED_node_post_apply_transform(bContext *C, bNodeTree *ntree)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
Main * CTX_data_main(const bContext *C)
void unit_m3(float m[3][3])
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
ListBaseT< SpaceLink > spacedata
struct bNodeTree * edittree