Fix T64969: changing color space in image texture node loses changes

Don't allow changing it for painted images until they have been saved, similar
to sidebar panels. This could be solved better, for now the important thing is
not to lose changes.
This commit is contained in:
Brecht Van Lommel 2019-05-22 10:06:31 +02:00
parent 2e350b4034
commit d9f4071ac6
Notes: blender-bot 2023-02-14 08:59:10 +01:00
Referenced by issue #64969, information from texture paint is lost if the color space of the image is changed in the image texture node
1 changed files with 5 additions and 0 deletions

View File

@ -713,6 +713,11 @@ static void node_buts_image_user(uiLayout *layout,
PointerRNA colorspace_settings_ptr = RNA_pointer_get(imaptr, "colorspace_settings");
uiItemL(split, IFACE_("Color Space"), ICON_NONE);
uiItemR(split, &colorspace_settings_ptr, "name", 0, "", ICON_NONE);
/* Avoid losing changes image is painted. */
if (BKE_image_is_dirty(imaptr->data)) {
uiLayoutSetEnabled(split, false);
}
}
static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)