diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 21:29:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 21:29:43 +0400 |
commit | 3b996ac1b3fcc93b121a9d4ef6024d5638df780f (patch) | |
tree | cccdc4f8ea12efa3d23657d6a2a3e82b11cda828 /source/blender/editors/space_buttons/buttons_context.c | |
parent | 75621eeff97d5765ecd3cdea1873d5c40baad0d6 (diff) |
add macro OB_TYPE_SUPPORT_MATERIAL, type checks were being done inline, some comparing range, some using ELEM#(), once was missing metaball check.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 526859cecd2..4a2860335fe 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -234,7 +234,7 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture) else if(buttons_context_path_object(path)) { ob= path->ptr[path->len-1].data; - if(ob && ob->type && (ob->type<OB_LAMP)) { + if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) { ma= give_current_material(ob, ob->actcol); RNA_id_pointer_create(&ma->id, &path->ptr[path->len]); path->len++; @@ -721,7 +721,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if(ptr) { Object *ob= ptr->data; - if(ob && ob->type && (ob->type<OB_LAMP) && ob->totcol) { + if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type) && ob->totcol) { /* a valid actcol isn't ensured [#27526] */ int matnr= ob->actcol-1; if(matnr < 0) matnr= 0; |