Show full image node detail buttons in the sidebar. The image nodes in compositor, cycles and texture nodes were showing a very reduced version of the image data block UI, based on the idea of fitting it

into the confined space of a node. However, in the side bar panel there is no reason to limit the buttons. In fact it is very helpful to have this UI available, otherwise users have to have an image
editor or (BI) texture buttons window next to the node editor to access these image details.
This commit is contained in:
Lukas Toenne
2013-07-22 08:56:51 +00:00
parent 7398c49776
commit e8b02626f2

View File

@@ -783,6 +783,12 @@ static void node_shader_buts_tex_image(uiLayout *layout, bContext *C, PointerRNA
node_buts_image_user(layout, C, &iuserptr, &imaptr, &iuserptr);
}
static void node_shader_buts_tex_image_details(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0);
}
static void node_shader_buts_tex_environment(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
PointerRNA imaptr = RNA_pointer_get(ptr, "image");
@@ -983,6 +989,7 @@ static void node_shader_set_butfunc(bNodeType *ntype)
break;
case SH_NODE_TEX_IMAGE:
ntype->uifunc = node_shader_buts_tex_image;
ntype->uifuncbut = node_shader_buts_tex_image_details;
break;
case SH_NODE_TEX_ENVIRONMENT:
ntype->uifunc = node_shader_buts_tex_environment;
@@ -1052,19 +1059,10 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
static void node_composit_buts_image_details(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = ptr->data;
PointerRNA imaptr;
PointerRNA iuserptr;
node_composit_buts_image(layout, C, ptr);
uiItemR(layout, ptr, "use_straight_alpha_output", 0, NULL, 0);
if (!node->id)
return;
imaptr = RNA_pointer_get(ptr, "image");
uiTemplateColorspaceSettings(layout, &imaptr, "colorspace_settings");
uiItemR(layout, &imaptr, "alpha_mode", 0, NULL, 0);
RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr);
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0);
}
static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -2539,6 +2537,15 @@ static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *p
uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL);
}
static void node_texture_buts_image_details(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = ptr->data;
PointerRNA iuserptr;
RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr);
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0);
}
static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "filepath", 0, "", ICON_NONE);
@@ -2583,6 +2590,7 @@ static void node_texture_set_butfunc(bNodeType *ntype)
case TEX_NODE_IMAGE:
ntype->uifunc = node_texture_buts_image;
ntype->uifuncbut = node_texture_buts_image_details;
break;
case TEX_NODE_OUTPUT: