[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32968] branches/particles-2010/source/ blender: Reverted last commit.
Lukas Toenne
lukas.toenne at googlemail.com
Tue Nov 9 16:56:26 CET 2010
Revision: 32968
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32968
Author: lukastoenne
Date: 2010-11-09 16:56:26 +0100 (Tue, 09 Nov 2010)
Log Message:
-----------
Reverted last commit. The submenus were perceived as "polluting, confusing and potentially a mess" (quote ZanQdo). As an alternative for quick RNA type selection a search box with autocompletion will be added in the n-panel.
Modified Paths:
--------------
branches/particles-2010/source/blender/blenkernel/BKE_node.h
branches/particles-2010/source/blender/editors/space_node/node_header.c
Modified: branches/particles-2010/source/blender/blenkernel/BKE_node.h
===================================================================
--- branches/particles-2010/source/blender/blenkernel/BKE_node.h 2010-11-09 15:03:09 UTC (rev 32967)
+++ branches/particles-2010/source/blender/blenkernel/BKE_node.h 2010-11-09 15:56:26 UTC (rev 32968)
@@ -597,8 +597,6 @@
/* TO BE REMOVED: debugging stuff, testing, etc. */
#define SIM_NODE_DEBUGPRINT 900
-/* XXX NODE_GROUP_MENU is 1000, this is getting dangerously close if more categories are added this way ... */
-
/* API */
void ntreeSimulationCompileProgram(struct bNodeTree *ntree, int force);
void ntreeSimulationReleaseProgram(struct bNodeTree *ntree);
Modified: branches/particles-2010/source/blender/editors/space_node/node_header.c
===================================================================
--- branches/particles-2010/source/blender/editors/space_node/node_header.c 2010-11-09 15:03:09 UTC (rev 32967)
+++ branches/particles-2010/source/blender/editors/space_node/node_header.c 2010-11-09 15:56:26 UTC (rev 32968)
@@ -43,7 +43,6 @@
#include "BKE_node.h"
#include "BKE_main.h"
-#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -84,70 +83,6 @@
snode_notify(C, snode);
}
-static struct StructRNA *data_node_types[] = {
- &RNA_Object,
- &RNA_Lamp,
- &RNA_NParticle,
- NULL /* terminator */
-};
-
-static void do_data_node_add(bContext *C, void *arg_type, int event)
-{
- SpaceNode *snode= CTX_wm_space_node(C);
- int type= GET_INT_FROM_POINTER(arg_type);
- /* here the event is not the node type, but the data type */
- struct StructRNA *datatype= data_node_types[event];
- bNode *node;
-
- /* store selection in temp test flag */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_SELECT) node->flag |= NODE_TEST;
- else node->flag &= ~NODE_TEST;
- }
-
- node= node_add_node(snode, CTX_data_scene(C), type, snode->mx, snode->my);
- /* set the data type for this item */
- if (datatype) {
- if (type == SIM_NODE_GETDATA)
- sim_getdata_type_set(snode->edittree, node, datatype);
- else if (type == SIM_NODE_SETDATA)
- sim_setdata_type_set(snode->edittree, node, datatype);
- }
-
- /* select previous selection before autoconnect */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_TEST) node->flag |= NODE_SELECT;
- }
-
- snode_autoconnect(snode, 1, 0);
-
- /* deselect after autoconnection */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
- }
-
- snode_notify(C, snode);
-}
-
-static void data_node_add_menu(bContext *C, uiLayout *layout, void *arg_type)
-{
- SpaceNode *snode= CTX_wm_space_node(C);
- bNodeTree *ntree= snode->nodetree;
- int i;
-
- if(!ntree) {
- uiItemS(layout);
- return;
- }
-
- uiLayoutSetFunc(layout, do_data_node_add, arg_type);
-
- for (i=0; data_node_types[i] != NULL; ++i) {
- uiItemV(layout, (char*)RNA_struct_ui_name(data_node_types[i]), RNA_struct_ui_icon(data_node_types[i]), i);
- }
- uiItemV(layout, "custom", 0, i);
-}
-
static void node_auto_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
{
Main *bmain= CTX_data_main(C);
@@ -206,12 +141,6 @@
uiItemV(layout, type->name, 0, NODE_DYNAMIC_MENU+script);
script++;
}
- else if(type->type == SIM_NODE_GETDATA) {
- uiItemMenuF(layout, "Get Data", 0, data_node_add_menu, SET_INT_IN_POINTER(SIM_NODE_GETDATA));
- }
- else if(type->type == SIM_NODE_SETDATA) {
- uiItemMenuF(layout, "Set Data", 0, data_node_add_menu, SET_INT_IN_POINTER(SIM_NODE_SETDATA));
- }
else
uiItemV(layout, type->name, 0, type->type);
More information about the Bf-blender-cvs
mailing list