[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11573] trunk/blender/source/blender/src/ space.c: added a 2 error messages when the user tries to join objects that dont support joining and when there is no active object
Campbell Barton
cbarton at metavr.com
Mon Aug 13 16:52:17 CEST 2007
Revision: 11573
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11573
Author: campbellbarton
Date: 2007-08-13 16:52:17 +0200 (Mon, 13 Aug 2007)
Log Message:
-----------
added a 2 error messages when the user tries to join objects that dont support joining and when there is no active object
Modified Paths:
--------------
trunk/blender/source/blender/src/space.c
Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c 2007-08-13 13:20:32 UTC (rev 11572)
+++ trunk/blender/source/blender/src/space.c 2007-08-13 14:52:17 UTC (rev 11573)
@@ -904,22 +904,31 @@
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");
+ }
}
static unsigned short convert_for_nonumpad(unsigned short event)
@@ -1976,8 +1985,12 @@
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) {
More information about the Bf-blender-cvs
mailing list