Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.c
| Show First 20 Lines • Show All 867 Lines • ▼ Show 20 Lines | static void node_shader_buts_tex_coord(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| uiItemR(layout, ptr, "from_dupli", 0, NULL, 0); | uiItemR(layout, ptr, "from_dupli", 0, NULL, 0); | ||||
| } | } | ||||
| static void node_shader_buts_bump(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void node_shader_buts_bump(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "invert", 0, NULL, 0); | uiItemR(layout, ptr, "invert", 0, NULL, 0); | ||||
| } | } | ||||
| static void node_shader_buts_uvmap(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| uiItemR(layout, ptr, "from_dupli", 0, NULL, 0); | |||||
| if(!RNA_boolean_get(ptr, "from_dupli")) { | |||||
| PointerRNA obptr = CTX_data_pointer_get(C, "active_object"); | |||||
| if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { | |||||
| PointerRNA dataptr = RNA_pointer_get(&obptr, "data"); | |||||
| uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_textures", "", ICON_NONE); | |||||
| } | |||||
| } | |||||
| } | |||||
| static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRNA *ptr) | static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "space", 0, "", 0); | uiItemR(layout, ptr, "space", 0, "", 0); | ||||
| if (RNA_enum_get(ptr, "space") == SHD_NORMAL_MAP_TANGENT) { | if (RNA_enum_get(ptr, "space") == SHD_NORMAL_MAP_TANGENT) { | ||||
| PointerRNA obptr = CTX_data_pointer_get(C, "active_object"); | PointerRNA obptr = CTX_data_pointer_get(C, "active_object"); | ||||
| if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { | if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { | ||||
| ▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | case SH_NODE_BSDF_TOON: | ||||
| break; | break; | ||||
| case SH_NODE_BSDF_HAIR: | case SH_NODE_BSDF_HAIR: | ||||
| ntype->draw_buttons = node_shader_buts_hair; | ntype->draw_buttons = node_shader_buts_hair; | ||||
| break; | break; | ||||
| case SH_NODE_SCRIPT: | case SH_NODE_SCRIPT: | ||||
| ntype->draw_buttons = node_shader_buts_script; | ntype->draw_buttons = node_shader_buts_script; | ||||
| ntype->draw_buttons_ex = node_shader_buts_script_ex; | ntype->draw_buttons_ex = node_shader_buts_script_ex; | ||||
| break; | break; | ||||
| case SH_NODE_UVMAP: | |||||
| ntype->draw_buttons = node_shader_buts_uvmap; | |||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ | /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ | ||||
| static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) | static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| bNode *node = ptr->data; | bNode *node = ptr->data; | ||||
| ▲ Show 20 Lines • Show All 2,360 Lines • Show Last 20 Lines | |||||