From 849e77b1f957b25ac9223a3dc510e234f4467fd1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 22 May 2017 17:11:55 +0200 Subject: Fix T51318: Non-update of preview when switching from world to lamp panel. Lamp preview panel is in DATA buttons context... --- source/blender/makesrna/intern/rna_space.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index c71af054c02..f2e856bf1ba 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1130,7 +1130,8 @@ static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C), static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { SpaceButs *sbuts = (SpaceButs *)(ptr->data); - if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE)) { + /* XXX BCONTEXT_DATA is ugly, but required for lamps... See T51318. */ + if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE, BCONTEXT_DATA)) { sbuts->preview = 1; } } -- cgit v1.2.3 From 8cc4c3da8cbe8da197928fa821e140f4b2615c4c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 22 May 2017 17:12:13 +0200 Subject: Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha Brightness/contrast node was changing color but did not modify alpha or ensured colors are premultiplied on the output. This was giving artifacts later on unless alpha was manually converted. Compositor is supposed to work in premultiplied alpha (except of some really corner cases) so it makes sense to ensure premultiplied alpha after brightness/contrast node. This is now done as an option enabled by default, so we: (a) Keep compatibility with old files. (b) Have correct behavior for newly created files. Later on we can get rid of this option. --- source/blender/makesrna/intern/rna_nodetree.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 60b75fca689..22d07d739cd 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -5239,6 +5239,16 @@ static void def_cmp_luma_matte(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } +static void def_cmp_brightcontrast(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); + RNA_def_property_ui_text(prop, "Convert Premul", "Keep output image premultiplied alpha"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_cmp_chroma_matte(StructRNA *srna) { PropertyRNA *prop; -- cgit v1.2.3