80 "GeometryNodeTree")) {
115 return "ShaderNodeGroup";
118 return "CompositorNodeGroup";
121 return "TextureNodeGroup";
124 return "GeometryNodeGroup";
157 if (gnode && !exit) {
201 const char *dst_basepath)
206 return basepath_change;
250 const char *old_animation_basepath =
NULL;
297 waction = wgroup->adt->action = (
bAction *)
BKE_id_copy(bmain, &wgroup->adt->action->id);
310 wgroup->adt->action =
NULL;
320 if (glinks_first !=
NULL) {
323 const char *identifier = link->fromsock->identifier;
324 int num_external_links = 0;
328 tlink = tlink->
next) {
329 if (tlink->tonode == gnode &&
STREQ(tlink->tosock->identifier, identifier)) {
330 nodeAddLink(
ntree, tlink->fromnode, tlink->fromsock, link->tonode, link->tosock);
331 num_external_links++;
337 if (num_external_links == 0) {
344 ntree, link->tosock->new_sock, link->tonode->new_node,
ntree, sock, gnode);
355 if (link->fromnode == gnode) {
356 const char *identifier = link->fromsock->identifier;
357 int num_internal_links = 0;
361 tlink = tlink->
next) {
364 if (
STREQ(tlink->tosock->identifier, identifier)) {
365 nodeAddLink(
ntree, tlink->fromnode, tlink->fromsock, link->tonode, link->tosock);
366 num_internal_links++;
373 if (num_internal_links == 0) {
379 nodeSocketCopy(
ntree, link->tosock, link->tonode,
ntree, sock, gnode);
386 while (nodes_delayed_free) {
431 ot->
idname =
"NODE_OT_group_ungroup";
513 newnode->
locx += offx;
514 newnode->
locy += offy;
520 const bool fromselect = (link->fromnode && (link->fromnode->flag &
NODE_SELECT));
521 const bool toselect = (link->tonode && (link->tonode->flag &
NODE_SELECT));
525 if (fromselect && toselect) {
527 link->fromnode->new_node,
528 link->fromsock->new_sock,
529 link->tonode->new_node,
530 link->tosock->new_sock);
535 if (fromselect && toselect) {
539 else if (fromselect || toselect) {
572 {
NODE_GS_COPY,
"COPY", 0,
"Copy",
"Copy to parent node tree, keep group intact"},
573 {
NODE_GS_MOVE,
"MOVE", 0,
"Move",
"Move to parent node tree, remove from group"},
643 ot->
description =
"Separate selected nodes from the node group";
644 ot->
idname =
"NODE_OT_group_separate";
671 const char *ntree_idname,
682 const char *disabled_hint =
NULL;
683 if (
node->typeinfo->poll_instance &&
684 !
node->typeinfo->poll_instance(
node, ngroup, &disabled_hint)) {
688 "Can not add node '%s' in a group:\n %s",
714 link->tonode->done |= 1;
717 link->fromnode->done |= 2;
740 loc[0] +=
node->width;
741 loc[1] -=
node->height;
749 if (totselect == 0) {
760 bool expose_visible =
false;
763 static const float offsetx = 200;
764 static const float offsety = 0.0f;
776 float real_min[2], real_max[2];
780 if (totselect == 1) {
781 expose_visible =
true;
833 input_node->
locx = real_min[0] -
center[0] - offsetx;
834 input_node->
locy = -offsety;
838 output_node->
locx = real_max[0] -
center[0] + offsetx * 0.25f;
839 output_node->
locy = -offsety;
846 if ((fromselect && link->tonode == gnode) || (toselect && link->fromnode == gnode)) {
852 else if (toselect && !fromselect) {
866 nodeAddLink(ngroup, input_node, input_sock, link->tonode, link->tosock);
869 link->tonode = gnode;
872 else if (fromselect && !toselect) {
875 bool connected =
false;
877 if (olink->fromsock == link->fromsock && olink->tonode == output_node) {
879 olink->tosock->identifier);
880 link->fromnode = gnode;
881 link->fromsock = output_sock;
890 &
ntree->
links, link->fromnode, link->fromsock, &link_node, &link_sock);
901 nodeAddLink(ngroup, link->fromnode, link->fromsock, output_node, output_sock);
904 link->fromnode = gnode;
915 if (fromselect && toselect) {
930 if (expose_visible) {
936 if (link->tosock == sock) {
960 if (link->fromsock == sock) {
993 const char *ntreetype)
1000 if (totselect == 0) {
1009 gnode->
id = (
ID *)ngroup;
1094 if (!gnode || !gnode->
id) {
1120 ot->
name =
"Group Insert";
1121 ot->
description =
"Insert selected nodes into a node group";
1122 ot->
idname =
"NODE_OT_group_insert";
Blender kernel action and pose functionality.
void BKE_animdata_transfer_by_basepath(struct Main *bmain, struct ID *srcID, struct ID *dstID, struct ListBase *basepaths)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct ID * BKE_id_copy(struct Main *bmain, const struct ID *id)
void BKE_id_free(struct Main *bmain, void *idv)
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node)
void ntreeFreeCache(struct bNodeTree *ntree)
void ntreeFreeTree(struct bNodeTree *ntree)
struct bNode * nodeGetActive(struct bNodeTree *ntree)
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
struct bNodeSocket * ntreeAddSocketInterfaceFromSocket(struct bNodeTree *ntree, struct bNode *from_node, struct bNodeSocket *from_sock)
void nodeRemoveNode(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool do_id_user)
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree)
struct bNode * BKE_node_copy_store_new_pointers(struct bNodeTree *ntree, struct bNode *node_src, const int flag)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
struct bNode * nodeAddNode(const struct bContext *C, struct bNodeTree *ntree, const char *idname)
void nodeSetSelected(struct bNode *node, bool select)
struct bNodeTree * ntreeCopyTree_ex_new_pointers(const struct bNodeTree *ntree, struct Main *bmain, const bool do_id_user)
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
void nodeToView(const struct bNode *node, float x, float y, float *rx, float *ry)
void nodeDetachNode(struct bNode *node)
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void void void * BLI_linklist_pop(LinkNode **listp) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void mul_v2_fl(float r[2], float f)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
#define INIT_MINMAX2(min, max)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_relations_tag_update(struct Main *bmain)
bool ED_node_is_compositor(struct SpaceNode *snode)
bool ED_node_is_texture(struct SpaceNode *snode)
void ED_node_tree_push(struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *gnode)
bool ED_node_is_geometry(struct SpaceNode *snode)
bool ED_node_is_shader(struct SpaceNode *snode)
struct bNodeTree * ED_node_tree_get(struct SpaceNode *snode, int level)
void ED_node_tree_pop(struct SpaceNode *snode)
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain)
bool ED_operator_node_active(struct bContext *C)
bool ED_operator_node_editable(struct bContext *C)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
bNodeSocket * node_group_output_find_socket(bNode *node, const char *identifier)
void node_group_update(struct bNodeTree *ntree, struct bNode *node)
void node_group_input_update(bNodeTree *ntree, bNode *node)
bNodeSocket * node_group_find_output_socket(bNode *groupnode, const char *identifier)
bNodeSocket * node_group_input_find_socket(bNode *node, const char *identifier)
bNodeSocket * node_group_find_input_socket(bNode *groupnode, const char *identifier)
void node_group_output_update(bNodeTree *ntree, bNode *node)
void snode_dag_update(bContext *C, SpaceNode *snode)
void snode_notify(bContext *C, SpaceNode *snode)
static AnimationBasePathChange * animation_basepath_change_new(const char *src_basepath, const char *dst_basepath)
static int node_get_selected_minmax(bNodeTree *ntree, bNode *gnode, float *min, float *max, bool use_size)
const char * node_group_idname(bContext *C)
static const char * group_ntree_idname(bContext *C)
static int node_group_edit_exec(bContext *C, wmOperator *op)
static bool node_group_make_use_node(bNode *node, bNode *gnode)
static int node_group_insert_exec(bContext *C, wmOperator *op)
static bNode * node_group_get_active(bContext *C, const char *node_idname)
static const EnumPropertyItem node_group_separate_types[]
static int node_group_make_exec(bContext *C, wmOperator *op)
static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, bNode *gnode)
static void animation_basepath_change_free(AnimationBasePathChange *basepath_change)
static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
static bNode * node_group_make_from_selected(const bContext *C, bNodeTree *ntree, const char *ntype, const char *ntreetype)
static int node_group_ungroup_exec(bContext *C, wmOperator *op)
static bool node_group_operator_editable(bContext *C)
static bool node_group_operator_active_poll(bContext *C)
static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
static bool node_group_make_test_selected(bNodeTree *ntree, bNode *gnode, const char *ntree_idname, struct ReportList *reports)
void NODE_OT_group_insert(wmOperatorType *ot)
static int node_group_separate_exec(bContext *C, wmOperator *op)
void NODE_OT_group_make(wmOperatorType *ot)
static int node_group_separate_selected(Main *bmain, bNodeTree *ntree, bNodeTree *ngroup, float offx, float offy, int make_copy)
void NODE_OT_group_ungroup(wmOperatorType *ot)
void NODE_OT_group_separate(wmOperatorType *ot)
void NODE_OT_group_edit(wmOperatorType *ot)
void space_node_group_offset(struct SpaceNode *snode, float *x, float *y)
void sort_multi_input_socket_links(struct SpaceNode *snode, struct bNode *node, struct bNodeLink *drag_link, float cursor[2])
void node_socket_skip_reroutes(ListBase *links, bNode *node, bNodeSocket *socket, bNode **r_node, bNodeSocket **r_socket)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
char * RNA_path_from_ID_to_struct(PointerRNA *ptr)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const char * dst_basepath
const char * src_basepath
struct bNodeTree * edittree
struct bNodeTree * nodetree
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)