diff options
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 11 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 14 |
2 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c56091ead62..82b0d231869 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2205,9 +2205,20 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal) } } +#if 0 /* force reload on first use, but not for multilayer, that makes nodes and buttons in ui drawing fail */ if (ima->type != IMA_TYPE_MULTILAYER) image_free_buffers(ima); +#else + /* image buffers for non-sequence multilayer will share buffers with RenderResult, + * however sequence multilayer will own buffers. Such logic makes switching from + * single multilayer file to sequence completely instable + * since changes in nodes seems this workaround isn't needed anymore, all sockets + * are nicely detecting anyway, but freeing buffers always here makes multilayer + * sequences behave stable + */ + image_free_buffers(ima); +#endif ima->ok = 1; if (iuser) diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 180a5a180fd..72e27ba9240 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -88,11 +88,15 @@ static int rna_Image_dirty_get(PointerRNA *ptr) return 0; } -static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Image_source_set(PointerRNA *ptr, int value) { Image *ima = ptr->id.data; - BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE); - DAG_id_tag_update(&ima->id, 0); + + if (value != ima->source) { + ima->source = value; + BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE); + DAG_id_tag_update(&ima->id, 0); + } } static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -527,9 +531,9 @@ static void rna_def_image(BlenderRNA *brna) prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, image_source_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf"); + RNA_def_property_enum_funcs(prop, NULL, "rna_Image_source_set", "rna_Image_source_itemf"); RNA_def_property_ui_text(prop, "Source", "Where the image comes from"); - RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_source_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); |