Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-03 21:29:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-03 21:29:43 +0400
commit3b996ac1b3fcc93b121a9d4ef6024d5638df780f (patch)
treecccdc4f8ea12efa3d23657d6a2a3e82b11cda828 /source/blender/editors/space_buttons
parent75621eeff97d5765ecd3cdea1873d5c40baad0d6 (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')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c4
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;