Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-19 22:03:38 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-19 22:03:38 +0300
commit1b94cb752ca18aac122b444261e76dc63022f99f (patch)
treec0d4ec35be53898e07462f41bb50f7629a3d323e /source/blender/editors/space_node
parent77e0199dc386c26aa106a884f24b336fce82d351 (diff)
Context
* Made it based on string lookups rather than fixed enum, to make it extensible by python scripts. * Context callbacks now also have to specify RNA type when returning pointers or collections. For non-RNA wrapped data, UnknownType can be used. * RNA wrapped context. The WM entries are fixed, for data context only main and scene are defined properties. Other data entries have to be dynamically looked up. * I've added some special code in python for the dynamic context lookups. Tried to hide it behind RNA but didn't find a clean way to do it yet. Still unused/untested. * Also minor fix for warning about propertional edit property in transform code, and fix for usage of operator poll with checking if it was NULL.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/space_node.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 1d2aa148e18..493ef6954b5 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -60,6 +60,8 @@
#include "UI_resources.h"
#include "UI_view2d.h"
+#include "RNA_access.h"
+
#include "node_intern.h" // own include
/* ******************** default callbacks for node space ***************** */
@@ -277,16 +279,16 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
}
}
-static int node_context(const bContext *C, bContextDataMember member, bContextDataResult *result)
+static int node_context(const bContext *C, const char *member, bContextDataResult *result)
{
SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C);
- if(member == CTX_DATA_SELECTED_NODES) {
+ if(CTX_data_equals(member, "selected_nodes")) {
bNode *node;
for(next_node(snode->edittree); (node=next_node(NULL));) {
if(node->flag & SELECT) {
- CTX_data_list_add(result, node);
+ CTX_data_list_add(result, &snode->edittree->id, &RNA_Node, node);
}
}
return 1;