diff options
author | Matt Ebb <matt@mke3.net> | 2010-06-28 03:18:04 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-06-28 03:18:04 +0400 |
commit | 32f83b91a42a2d8332a371b00637dca8d9f01393 (patch) | |
tree | 1a436b1bce293b3b3898327c8006eb64ff9381e3 /source/blender/editors/object/object_relations.c | |
parent | 5cc2e136ec48d901c097bf1a5724a8ac1df32376 (diff) |
Partial fix for [#22666] TWO BUGS of LIGHT
fixed: number 1- can't link light data by using control+l "object data"
cleaned up code a bit here too
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 28eb919dbe7..91f054f7209 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1191,24 +1191,25 @@ enum { /* Return 1 if make link data is allow, zero otherwise */ static int allow_make_links_data(int ev, Object *ob, Object *obt) { - if (ev == MAKE_LINKS_OBDATA) { - if (ob->type == OB_MESH && obt->type == OB_MESH) - return(1); + switch(ev) { + case MAKE_LINKS_OBDATA: + if (ob->type == obt->type && ob->type != OB_EMPTY) + return 1; + break; + case MAKE_LINKS_MATERIALS: + if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL) && + ELEM5(obt->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL)) + return 1; + break; + case MAKE_LINKS_ANIMDATA: + case MAKE_LINKS_DUPLIGROUP: + return 1; + case MAKE_LINKS_MODIFIERS: + if (ob->type != OB_EMPTY && obt->type != OB_EMPTY) + return 1; + break; } - else if (ev == MAKE_LINKS_MATERIALS) { - if ((ob->type == OB_MESH || ob->type == OB_CURVE || ob->type == OB_FONT || ob->type == OB_SURF || ob->type == OB_MBALL) && - (obt->type == OB_MESH || obt->type == OB_CURVE || obt->type == OB_FONT || obt->type == OB_SURF || obt->type == OB_MBALL)) - return(1); - } - else if (ev == MAKE_LINKS_ANIMDATA) - return(1); - else if (ev == MAKE_LINKS_DUPLIGROUP) - return(1); - else if (ev == MAKE_LINKS_MODIFIERS) { - if (ob->type != OB_EMPTY && obt->type != OB_EMPTY) - return(1); - } - return(0); + return 0; } static int make_links_data_exec(bContext *C, wmOperator *op) |