OLD | NEW |
1 /* | 1 /* |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 #include "DNA_node_types.h" | 36 #include "DNA_node_types.h" |
37 #include "DNA_object_types.h" | 37 #include "DNA_object_types.h" |
38 #include "DNA_anim_types.h" | 38 #include "DNA_anim_types.h" |
39 | 39 |
40 #include "BLI_listbase.h" | 40 #include "BLI_listbase.h" |
41 #include "BLI_string.h" | 41 #include "BLI_string.h" |
42 #include "BLI_rect.h" | 42 #include "BLI_rect.h" |
43 #include "BLI_math.h" | 43 #include "BLI_math.h" |
44 | 44 |
45 #include "BLF_translation.h" | |
46 | |
47 #include "BKE_action.h" | 45 #include "BKE_action.h" |
48 #include "BKE_animsys.h" | 46 #include "BKE_animsys.h" |
49 #include "BKE_context.h" | 47 #include "BKE_context.h" |
50 #include "BKE_global.h" | 48 #include "BKE_global.h" |
51 #include "BKE_library.h" | 49 #include "BKE_library.h" |
52 #include "BKE_main.h" | 50 #include "BKE_main.h" |
53 #include "BKE_report.h" | 51 #include "BKE_report.h" |
54 | 52 |
55 #include "ED_node.h" /* own include */ | 53 #include "ED_node.h" /* own include */ |
56 #include "ED_screen.h" | 54 #include "ED_screen.h" |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 ntreeUpdateTree(snode->nodetree); | 782 ntreeUpdateTree(snode->nodetree); |
785 | 783 |
786 snode_notify(C, snode); | 784 snode_notify(C, snode); |
787 snode_dag_update(C, snode); | 785 snode_dag_update(C, snode); |
788 | 786 |
789 return OPERATOR_FINISHED; | 787 return OPERATOR_FINISHED; |
790 } | 788 } |
791 | 789 |
792 static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), wmEve
nt *UNUSED(event)) | 790 static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), wmEve
nt *UNUSED(event)) |
793 { | 791 { |
794 » uiPopupMenu *pup = uiPupMenuBegin(C, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR
_DEFAULT, "Separate"), ICON_NONE); | 792 » uiPopupMenu *pup = uiPupMenuBegin(C, "Separate", ICON_NONE); |
795 uiLayout *layout = uiPupMenuLayout(pup); | 793 uiLayout *layout = uiPupMenuLayout(pup); |
796 | 794 |
797 uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); | 795 uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); |
798 uiItemEnumO(layout, "NODE_OT_group_separate", NULL, 0, "type", NODE_GS_C
OPY); | 796 uiItemEnumO(layout, "NODE_OT_group_separate", NULL, 0, "type", NODE_GS_C
OPY); |
799 uiItemEnumO(layout, "NODE_OT_group_separate", NULL, 0, "type", NODE_GS_M
OVE); | 797 uiItemEnumO(layout, "NODE_OT_group_separate", NULL, 0, "type", NODE_GS_M
OVE); |
800 | 798 |
801 uiPupMenuEnd(C, pup); | 799 uiPupMenuEnd(C, pup); |
802 | 800 |
803 return OPERATOR_CANCELLED; | 801 return OPERATOR_CANCELLED; |
804 } | 802 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 snode_notify(C, snode); | 1141 snode_notify(C, snode); |
1144 snode_dag_update(C, snode); | 1142 snode_dag_update(C, snode); |
1145 | 1143 |
1146 return OPERATOR_FINISHED; | 1144 return OPERATOR_FINISHED; |
1147 } | 1145 } |
1148 | 1146 |
1149 static int node_group_make_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *
UNUSED(event)) | 1147 static int node_group_make_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *
UNUSED(event)) |
1150 { | 1148 { |
1151 SpaceNode *snode = CTX_wm_space_node(C); | 1149 SpaceNode *snode = CTX_wm_space_node(C); |
1152 bNode *act = nodeGetActive(snode->edittree); | 1150 bNode *act = nodeGetActive(snode->edittree); |
1153 » uiPopupMenu *pup = uiPupMenuBegin(C, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR
_DEFAULT, "Make Group"), ICON_NONE); | 1151 » uiPopupMenu *pup = uiPupMenuBegin(C, "Make Group", ICON_NONE); |
1154 uiLayout *layout = uiPupMenuLayout(pup); | 1152 uiLayout *layout = uiPupMenuLayout(pup); |
1155 | 1153 |
1156 uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); | 1154 uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); |
1157 uiItemEnumO(layout, "NODE_OT_group_make", NULL, 0, "type", NODE_GM_NEW); | 1155 uiItemEnumO(layout, "NODE_OT_group_make", NULL, 0, "type", NODE_GM_NEW); |
1158 | 1156 |
1159 /* if active node is a group, add insert option */ | 1157 /* if active node is a group, add insert option */ |
1160 if (act && act->type == NODE_GROUP) { | 1158 if (act && act->type == NODE_GROUP) { |
1161 uiItemEnumO(layout, "NODE_OT_group_make", NULL, 0, "type", NODE_
GM_INSERT); | 1159 uiItemEnumO(layout, "NODE_OT_group_make", NULL, 0, "type", NODE_
GM_INSERT); |
1162 } | 1160 } |
1163 | 1161 |
(...skipping 12 matching lines...) Expand all Loading... |
1176 /* api callbacks */ | 1174 /* api callbacks */ |
1177 ot->invoke = node_group_make_invoke; | 1175 ot->invoke = node_group_make_invoke; |
1178 ot->exec = node_group_make_exec; | 1176 ot->exec = node_group_make_exec; |
1179 ot->poll = ED_operator_node_active; | 1177 ot->poll = ED_operator_node_active; |
1180 | 1178 |
1181 /* flags */ | 1179 /* flags */ |
1182 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | 1180 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |
1183 | 1181 |
1184 RNA_def_enum(ot->srna, "type", node_group_make_types, NODE_GM_NEW, "Type
", ""); | 1182 RNA_def_enum(ot->srna, "type", node_group_make_types, NODE_GM_NEW, "Type
", ""); |
1185 } | 1183 } |
OLD | NEW |