Muliview: Minor UI-tweaks

* Don't grey multiview options in file browser and in Node Editor Properties out if multi-view is disabled, hide them completely (I think greying out single buttons is fine, but in case of entire blocks we should just hide to save space)
* Move multiview settings in Node Editor Properties above alpha settings to prevent the alpha buttons from appearing above multiview settings if multiview is enabled and Stereo 3D format is chosen (making them appear below is much nicer)
This commit is contained in:
Julian Eisel 2015-04-08 00:28:03 +02:00
parent 796c3c7748
commit 7e52d810f3
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by issue #44757, light doesn't appear in camera ray
1 changed files with 23 additions and 31 deletions

View File

@ -896,6 +896,14 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
BKE_image_release_ibuf(ima, ibuf, NULL);
}
if ((scene->r.scemode & R_MULTIVIEW) != 0) {
uiItemR(layout, &imaptr, "use_multiview", 0, NULL, ICON_NONE);
if (RNA_boolean_get(&imaptr, "use_multiview")) {
uiTemplateImageViews(layout, &imaptr);
}
}
if (has_alpha) {
col = uiLayoutColumn(layout, false);
uiItemR(col, &imaptr, "use_alpha", 0, NULL, ICON_NONE);
@ -904,24 +912,11 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
uiItemR(row, &imaptr, "alpha_mode", 0, IFACE_("Alpha"), ICON_NONE);
}
if ((scene->r.scemode & R_MULTIVIEW) != 0) {
uiItemS(layout);
col = uiLayoutColumn(layout, false);
uiItemR(col, &imaptr, "use_multiview", 0, NULL, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiLayoutSetActive(col, RNA_boolean_get(&imaptr, "use_multiview"));
uiTemplateImageViews(col, &imaptr);
}
if (ima->source == IMA_SRC_MOVIE) {
col = uiLayoutColumn(layout, false);
uiItemR(col, &imaptr, "use_deinterlace", 0, IFACE_("Deinterlace"), ICON_NONE);
}
uiItemS(layout);
split = uiLayoutSplit(layout, 0.0f, false);
col = uiLayoutColumn(split, false);
@ -1155,28 +1150,25 @@ void uiTemplateImageViews(uiLayout *layout, PointerRNA *imaptr)
void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr)
{
ImageFormatData *imf = imfptr->data;
uiLayout *col;
if (ptr) {
uiItemR(layout, ptr, "use_multiview", 0, NULL, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_multiview"));
}
else {
col = uiLayoutColumn(layout, false);
}
if (ptr == NULL)
return;
if (imf->imtype != R_IMF_IMTYPE_MULTILAYER) {
PropertyRNA *prop;
PointerRNA stereo3d_format_ptr;
uiItemR(layout, ptr, "use_multiview", 0, NULL, ICON_NONE);
prop = RNA_struct_find_property(imfptr, "stereo_3d_format");
stereo3d_format_ptr = RNA_property_pointer_get(imfptr, prop);
if (RNA_boolean_get(ptr, "use_multiview")) {
if (imf->imtype != R_IMF_IMTYPE_MULTILAYER) {
PropertyRNA *prop;
PointerRNA stereo3d_format_ptr;
uiTemplateViewsFormat(col, imfptr, &stereo3d_format_ptr);
}
else {
uiTemplateViewsFormat(col, imfptr, NULL);
prop = RNA_struct_find_property(imfptr, "stereo_3d_format");
stereo3d_format_ptr = RNA_property_pointer_get(imfptr, prop);
uiTemplateViewsFormat(layout, imfptr, &stereo3d_format_ptr);
}
else {
uiTemplateViewsFormat(layout, imfptr, NULL);
}
}
}