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@gmail.com>2019-03-17 19:52:05 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-17 23:53:13 +0300
commitdf96455c55110da00f0543c5895376ffbc66313b (patch)
treed1fc0a55f44d4b931362d84eea77a7662c1955a6 /source/blender/editors/space_node/space_node.c
parentf79ad428085edd8289f37027ba3d5ed3a52bce67 (diff)
UI: add light/world settings in shader node editor.
Material was already there. Implementation was changed so it's just a single line of code to adapt a panel to the node editor.
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;
}