From cb79780abeea5b99923fab1de9bf1aaee3320dd3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Aug 2007 14:52:17 +0000 Subject: [PATCH] added a 2 error messages when the user tries to join objects that dont support joining and when there is no active object --- source/blender/src/space.c | 45 ++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/source/blender/src/space.c b/source/blender/src/space.c index d44a4d5c85e..114af87d673 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -904,21 +904,30 @@ static void select_object_grouped_menu(void) void join_menu(void) { Object *ob= OBACT; - if (ob && !G.obedit) { - if(ob->type == OB_MESH) { - if(okee("Join selected meshes")==0) return; - join_mesh(); - } else if(ob->type == OB_CURVE) { - if(okee("Join selected curves")==0) return; - join_curve(OB_CURVE); - } else if(ob->type == OB_SURF) { - if(okee("Join selected NURBS")==0) return; - join_curve(OB_SURF); - } else if(ob->type == OB_ARMATURE) { - /* Make sure the user wants to continue*/ - if(okee("Join selected armatures")==0) return; - join_armature (); - } + if (G.obedit) { + error("This data does not support joining in editmode"); + return; + } + if (!ob) { + error("Can't join unless there is an active object"); + return; + } + + if(ob->type == OB_MESH) { + if(okee("Join selected meshes")==0) return; + join_mesh(); + } else if(ob->type == OB_CURVE) { + if(okee("Join selected curves")==0) return; + join_curve(OB_CURVE); + } else if(ob->type == OB_SURF) { + if(okee("Join selected NURBS")==0) return; + join_curve(OB_SURF); + } else if(ob->type == OB_ARMATURE) { + /* Make sure the user wants to continue*/ + if(okee("Join selected armatures")==0) return; + join_armature (); + } else { + error("This object type doesn't support joining"); } } @@ -1976,8 +1985,12 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if( ob ) { join_menu(); } - else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF)) + else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF)) { addsegment_nurb(); + } else { + error("Can't join unless there is an active object"); + } + } else if(G.obedit) { if(G.obedit->type==OB_MESH) {