Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.c
| Show First 20 Lines • Show All 902 Lines • ▼ Show 20 Lines | else if (ima->source != IMA_SRC_GENERATED) { | ||||
| uiTemplateImageInfo(layout, C, ima, iuserptr.data); | uiTemplateImageInfo(layout, C, ima, iuserptr.data); | ||||
| } | } | ||||
| uiItemR(layout, ptr, "color_space", 0, IFACE_("Color Space"), ICON_NONE); | uiItemR(layout, ptr, "color_space", 0, IFACE_("Color Space"), ICON_NONE); | ||||
| uiItemR(layout, ptr, "interpolation", 0, IFACE_("Interpolation"), ICON_NONE); | uiItemR(layout, ptr, "interpolation", 0, IFACE_("Interpolation"), ICON_NONE); | ||||
| uiItemR(layout, ptr, "projection", 0, IFACE_("Projection"), ICON_NONE); | uiItemR(layout, ptr, "projection", 0, IFACE_("Projection"), ICON_NONE); | ||||
| } | } | ||||
| static void node_shader_buts_tex_udim(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| PointerRNA imaptr = RNA_pointer_get(ptr, "image"); | |||||
| PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user"); | |||||
| uiLayoutSetContextPointer(layout, "image_user", &iuserptr); | |||||
| uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL); | |||||
| uiItemR(layout, ptr, "color_space", 0, "", ICON_NONE); | |||||
| uiItemR(layout, ptr, "interpolation", 0, "", ICON_NONE); | |||||
| uiItemR(layout, ptr, "extension", 0, "", ICON_NONE); | |||||
| uiLayout *col = uiLayoutColumn(layout, true); | |||||
| uiItemR(col, ptr, "start_tile", 0, NULL, ICON_NONE); | |||||
| uiItemR(col, ptr, "tiles_per_row", 0, NULL, ICON_NONE); | |||||
| 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); | |||||
| } | |||||
| /* note: image user properties used directly here, unlike compositor image node, | |||||
| * which redefines them in the node struct RNA to get proper updates. | |||||
| */ | |||||
| node_buts_image_user(layout, C, &iuserptr, &imaptr, &iuserptr); | |||||
| } | |||||
| static void node_shader_buts_tex_udim_ex(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user"); | |||||
| uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 0); | |||||
| } | |||||
| static void node_shader_buts_tex_sky(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void node_shader_buts_tex_sky(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "sky_type", 0, "", ICON_NONE); | uiItemR(layout, ptr, "sky_type", 0, "", ICON_NONE); | ||||
| uiItemR(layout, ptr, "sun_direction", 0, "", ICON_NONE); | uiItemR(layout, ptr, "sun_direction", 0, "", ICON_NONE); | ||||
| uiItemR(layout, ptr, "turbidity", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "turbidity", 0, NULL, ICON_NONE); | ||||
| if (RNA_enum_get(ptr, "sky_type") == SHD_SKY_NEW) | if (RNA_enum_get(ptr, "sky_type") == SHD_SKY_NEW) | ||||
| uiItemR(layout, ptr, "ground_albedo", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "ground_albedo", 0, NULL, ICON_NONE); | ||||
| ▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | switch (ntype->type) { | ||||
| case SH_NODE_TEX_IMAGE: | case SH_NODE_TEX_IMAGE: | ||||
| ntype->draw_buttons = node_shader_buts_tex_image; | ntype->draw_buttons = node_shader_buts_tex_image; | ||||
| ntype->draw_buttons_ex = node_shader_buts_tex_image_ex; | ntype->draw_buttons_ex = node_shader_buts_tex_image_ex; | ||||
| break; | break; | ||||
| case SH_NODE_TEX_ENVIRONMENT: | case SH_NODE_TEX_ENVIRONMENT: | ||||
| ntype->draw_buttons = node_shader_buts_tex_environment; | ntype->draw_buttons = node_shader_buts_tex_environment; | ||||
| ntype->draw_buttons_ex = node_shader_buts_tex_environment_ex; | ntype->draw_buttons_ex = node_shader_buts_tex_environment_ex; | ||||
| break; | break; | ||||
| case SH_NODE_TEX_UDIM: | |||||
| ntype->draw_buttons = node_shader_buts_tex_udim; | |||||
| ntype->draw_buttons_ex = node_shader_buts_tex_udim_ex; | |||||
| break; | |||||
| case SH_NODE_TEX_GRADIENT: | case SH_NODE_TEX_GRADIENT: | ||||
| ntype->draw_buttons = node_shader_buts_tex_gradient; | ntype->draw_buttons = node_shader_buts_tex_gradient; | ||||
| break; | break; | ||||
| case SH_NODE_TEX_MAGIC: | case SH_NODE_TEX_MAGIC: | ||||
| ntype->draw_buttons = node_shader_buts_tex_magic; | ntype->draw_buttons = node_shader_buts_tex_magic; | ||||
| break; | break; | ||||
| case SH_NODE_TEX_BRICK: | case SH_NODE_TEX_BRICK: | ||||
| ntype->draw_buttons = node_shader_buts_tex_brick; | ntype->draw_buttons = node_shader_buts_tex_brick; | ||||
| ▲ Show 20 Lines • Show All 2,449 Lines • Show Last 20 Lines | |||||