diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-01-29 22:02:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-01-29 22:02:32 +0400 |
commit | 95e153a319b48a3a8d4fcb013b7be24fe1f07af3 (patch) | |
tree | 0cbe28be25ae7d97ef25e41d0afb3e18bb25488e /source/blender/editors/interface | |
parent | 8ba9702284a7c0457a9053e8cae027f83d6b6a3b (diff) |
Fix T37661: color ramps and curve mapping editing not disabled for linked data.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0aa9368fc5f..2fb0b6b7e06 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); } |