Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/node_shader_tree.c
| Show All 33 Lines | |||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "DNA_linestyle_types.h" | #include "DNA_linestyle_types.h" | ||||
| #include "DNA_workspace_types.h" | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_threads.h" | #include "BLI_threads.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| Show All 12 Lines | |||||
| #include "node_common.h" | #include "node_common.h" | ||||
| #include "node_exec.h" | #include "node_exec.h" | ||||
| #include "node_util.h" | #include "node_util.h" | ||||
| #include "node_shader_util.h" | #include "node_shader_util.h" | ||||
| static int shader_tree_poll(const bContext *C, bNodeTreeType *UNUSED(treetype)) | static int shader_tree_poll(const bContext *C, bNodeTreeType *UNUSED(treetype)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| WorkSpace *workspace = CTX_wm_workspace(C); | |||||
| const char *engine = BKE_render_engine_get(scene, workspace); | |||||
| /* allow empty engine string too, this is from older versions that didn't have registerable engines yet */ | /* allow empty engine string too, this is from older versions that didn't have registerable engines yet */ | ||||
| return (scene->r.engine[0] == '\0' || | return (engine[0] == '\0' || | ||||
| STREQ(scene->r.engine, RE_engine_id_BLENDER_RENDER) || | STREQ(engine, RE_engine_id_BLENDER_RENDER) || | ||||
| STREQ(scene->r.engine, RE_engine_id_BLENDER_GAME) || | STREQ(engine, RE_engine_id_BLENDER_GAME) || | ||||
| STREQ(scene->r.engine, RE_engine_id_CYCLES) || | STREQ(engine, RE_engine_id_CYCLES) || | ||||
| !BKE_scene_use_shading_nodes_custom(scene)); | !BKE_render_use_shading_nodes_custom(scene, workspace)); | ||||
| } | } | ||||
| static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(treetype), bNodeTree **r_ntree, ID **r_id, ID **r_from) | static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(treetype), bNodeTree **r_ntree, ID **r_id, ID **r_from) | ||||
| { | { | ||||
| SpaceNode *snode = CTX_wm_space_node(C); | SpaceNode *snode = CTX_wm_space_node(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | SceneLayer *sl = CTX_data_scene_layer(C); | ||||
| Object *ob = OBACT_NEW(sl); | Object *ob = OBACT_NEW(sl); | ||||
| ▲ Show 20 Lines • Show All 589 Lines • Show Last 20 Lines | |||||