Commit: 95e153a319b48a3a8d4fcb013b7be24fe1f07af3
Author: Brecht Van Lommel
Date:   Wed Jan 29 19:02:32 2014 +0100
https://developer.blender.org/rB95e153a319b48a3a8d4fcb013b7be24fe1f07af3

Fix T37661: color ramps and curve mapping editing not disabled for linked data.

===================================================================

M       source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 0aa9368..2fb0b6b 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1550,6 +1550,7 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA 
*ptr, const char *propname
        PointerRNA cptr;
        RNAUpdateCb *cb;
        uiBlock *block;
+       ID *id;
        rctf rect;
 
        if (!prop || RNA_property_type(prop) != PROP_POINTER)
@@ -1567,8 +1568,14 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA 
*ptr, const char *propname
        rect.ymin = 0; rect.ymax = 19.5f * UI_UNIT_X;
 
        block = uiLayoutAbsoluteBlock(layout);
+
+       id = cptr.id.data;
+       uiBlockSetButLock(block, (id && id->lib), ERROR_LIBDATA_MESSAGE);
+
        colorband_buttons_layout(layout, block, cptr.data, &rect, cb, expand);
 
+       uiBlockClearButLock(block);
+
        MEM_freeN(cb);
 }
 
@@ -2174,6 +2181,8 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA 
*ptr, const char *propn
        RNAUpdateCb *cb;
        PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
        PointerRNA cptr;
+       ID *id;
+       uiBlock *block = uiLayoutGetBlock(layout);
 
        if (!prop) {
                RNA_warning("curve property not found: %s.%s",
@@ -2195,8 +2204,13 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA 
*ptr, const char *propn
        cb->ptr = *ptr;
        cb->prop = prop;
 
+       id = cptr.id.data;
+       uiBlockSetButLock(block, (id && id->lib), ERROR_LIBDATA_MESSAGE);
+
        curvemap_buttons_layout(layout, &cptr, type, levels, brush, cb);
 
+       uiBlockClearButLock(block);
+
        MEM_freeN(cb);
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to