diff options
author | Dan Eicher <dan@eu.phorio.us> | 2012-06-14 03:04:32 +0400 |
---|---|---|
committer | Dan Eicher <dan@eu.phorio.us> | 2012-06-14 03:04:32 +0400 |
commit | 906b9e0584b93094b1c45514fbf6fd8c62e6d015 (patch) | |
tree | 7c2ecd7ff0a3625d8e206169656f56666799d685 /source | |
parent | fd212cd4bc1e82ad8b61f54ec75d09747f7a9536 (diff) |
[#26630] Several problems with API constraint_orientation
Added a check to TRANSFORM_OT_create_orientation so it throws an exception instead of crashing blender (due to invalid view3d)
Can still create an orientation from the console just can't set it to active with the 'use' parameter
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index f00e2418ad9..81a4c082dcc 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -40,6 +40,7 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_armature.h" +#include "BKE_report.h" #include "WM_api.h" #include "WM_types.h" @@ -282,6 +283,11 @@ static int create_orientation_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "name", name); + if (use && !CTX_wm_view3d(C)) { + BKE_report(op->reports, RPT_ERROR, "Create Orientation \"use\" parameter only valid in a 3dView context"); + return OPERATOR_CANCELLED; + } + BIF_createTransformOrientation(C, op->reports, name, use, overwrite); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); |