diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-24 21:21:22 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-24 21:21:22 +0400 |
commit | da4028d4a8265b7d4ba608729127604ea0f87a21 (patch) | |
tree | 275c79b31aaaf8c5dbf8a98e0a5ecf97b2483827 /source/blender/makesrna/intern/rna_image.c | |
parent | 623f3b3e3a69625add367b670108ed6477443d92 (diff) |
Fix #33953: blender crash after few steps with .exr image in compositor
Issue was caused by FILE multilayer ImBuf sharing buffers with render
result, and SEQUENCE multilayer ImBufs duplicating buffers. Which is
nice by it's own. But, changing image source wouldn't remove any loaded
image buffers, meaning if you've got loaded FILE multilayers they'll
likely became invalid.
That behavior of handling multilayers on changing source was done as
a fix for #24976, which is now actually not needed (removing check
for multilayer doesn't change behavior at all).
Just to be sure added check to RNA, so signal wouldn't be fired if
source wasn't actually changed form a menu.
Diffstat (limited to 'source/blender/makesrna/intern/rna_image.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 14 |
1 files changed, 9 insertions, 5 deletions
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); |