diff options
author | Michael Fox <mfoxdogg@gmail.com> | 2009-01-21 05:24:12 +0300 |
---|---|---|
committer | Michael Fox <mfoxdogg@gmail.com> | 2009-01-21 05:24:12 +0300 |
commit | 4cb1302ee288030dadeb837b17e7cef6f0c01241 (patch) | |
tree | 491f0a99c46a197913d149e622d232d0a4dd1d8f | |
parent | 8d4a9081cc65ab262448287c2875f534bc76f6aa (diff) |
2.5
*******
just a small commit, addeed a few more error, warning reports
-rw-r--r-- | source/blender/editors/object/object_edit.c | 43 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 6 |
2 files changed, 29 insertions, 20 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f76edc40f53..a1ed0746644 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -100,6 +100,7 @@ #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_property.h" +#include "BKE_report.h" #include "BKE_sca.h" #include "BKE_scene.h" #include "BKE_softbody.h" @@ -1109,8 +1110,10 @@ static EnumPropertyItem prop_clear_track_types[] = { /* note, poll should check for editable scene */ static int object_clear_track_exec(bContext *C, wmOperator *op) { - if(CTX_data_edit_object(C)) return OPERATOR_CANCELLED; - + if(CTX_data_edit_object(C)) { + BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); + return OPERATOR_CANCELLED; + } CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { ob->track= NULL; ob->recalc |= OB_RECALC; @@ -1216,7 +1219,10 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) ob= OBACT; - if(ob==0) return OPERATOR_CANCELLED; + if(ob==0){ + BKE_report(op->reports, RPT_ERROR, "No Active Object"); + return OPERATOR_CANCELLED; + } if(nr==1) { // XXX old animation system @@ -2485,9 +2491,14 @@ static int object_set_center_exec(bContext *C, wmOperator *op) int tot_change=0, tot_lib_error=0, tot_multiuser_arm_error=0; MVert *mvert; - if(scene->id.lib || v3d==NULL) return OPERATOR_CANCELLED; - if (obedit && centermode > 0) return OPERATOR_CANCELLED; - + if(scene->id.lib || v3d==NULL){ + BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed on Lib data"); + return OPERATOR_CANCELLED; + } + if (obedit && centermode > 0) { + BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); + return OPERATOR_CANCELLED; + } cent[0]= cent[1]= cent[2]= 0.0; if(obedit) { @@ -2768,23 +2779,19 @@ static int object_set_center_exec(bContext *C, wmOperator *op) } CTX_DATA_END; -if (tot_change) { - ED_anim_dag_flush_update(C); - allqueue(REDRAWVIEW3D, 0); - ED_undo_push(C,"Do Center"); - } + if (tot_change) { + ED_anim_dag_flush_update(C); + allqueue(REDRAWVIEW3D, 0); + ED_undo_push(C,"Do Center"); + } /* Warn if any errors occured */ if (tot_lib_error+tot_multiuser_arm_error) { - char err[512]; - sprintf(err, "Warning %i Object(s) Not Centered, %i Changed:", tot_lib_error+tot_multiuser_arm_error, tot_change); - + BKE_reportf(op->reports, RPT_WARNING, "%i Object(s) Not Centered, %i Changed:",tot_lib_error+tot_multiuser_arm_error, tot_change); if (tot_lib_error) - sprintf(err+strlen(err), "|%i linked library objects", tot_lib_error); + BKE_reportf(op->reports, RPT_WARNING, "|%i linked library objects",tot_lib_error); if (tot_multiuser_arm_error) - sprintf(err+strlen(err), "|%i multiuser armature object(s)", tot_multiuser_arm_error); - - error(err); + BKE_reportf(op->reports, RPT_WARNING, "|%i multiuser armature object(s)",tot_multiuser_arm_error); } return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index b264ae6447f..3bece21acf1 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -54,6 +54,7 @@ #include "BKE_depsgraph.h" #include "BKE_object.h" #include "BKE_global.h" +#include "BKE_report.h" #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_utildefines.h" @@ -1185,9 +1186,10 @@ static int view3d_border_zoom_exec(bContext *C, wmOperator *op) double p_corner[3]; /* no depths to use, we cant do anything! */ - if (depth_close==MAXFLOAT) + if (depth_close==MAXFLOAT){ + BKE_report(op->reports, RPT_ERROR, "Depth Too Large"); return OPERATOR_CANCELLED; - + } /* convert border to 3d coordinates */ if (( !gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, (GLint *)mats.viewport, &p[0], &p[1], &p[2])) || ( !gluUnProject((double)rect.xmin, (double)rect.ymin, depth_close, mats.modelview, mats.projection, (GLint *)mats.viewport, &p_corner[0], &p_corner[1], &p_corner[2]))) |