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:
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r--source/blender/editors/space_node/space_node.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index fc8d880080d..1271bf51c5f 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -793,7 +793,9 @@ static void node_region_listener(
}
}
-const char *node_context_dir[] = {"selected_nodes", "active_node", NULL};
+const char *node_context_dir[] = {
+ "selected_nodes", "active_node", "light", "material", "world", NULL
+};
static int node_context(const bContext *C, const char *member, bContextDataResult *result)
{
@@ -833,6 +835,24 @@ static int node_context(const bContext *C, const char *member, bContextDataResul
CTX_data_type_set(result, CTX_DATA_TYPE_POINTER);
return 1;
}
+ else if (CTX_data_equals(member, "material")) {
+ if (snode->id && GS(snode->id->name) == ID_MA) {
+ CTX_data_id_pointer_set(result, snode->id);
+ }
+ return 1;
+ }
+ else if (CTX_data_equals(member, "light")) {
+ if (snode->id && GS(snode->id->name) == ID_LA) {
+ CTX_data_id_pointer_set(result, snode->id);
+ }
+ return 1;
+ }
+ else if (CTX_data_equals(member, "world")) {
+ if (snode->id && GS(snode->id->name) == ID_WO) {
+ CTX_data_id_pointer_set(result, snode->id);
+ }
+ return 1;
+ }
return 0;
}