[Bf-blender-cvs] [3d7e0aa] master: bpy.ops.object.add_named() doesnt provide error when failed (related to T38689)
Dalai Felinto
noreply at git.blender.org
Mon Feb 17 23:28:06 CET 2014
Commit: 3d7e0aae52c9d30739a001826c3f6b3331270f36
Author: Dalai Felinto
Date: Mon Feb 17 19:22:43 2014 -0300
https://developer.blender.org/rB3d7e0aae52c9d30739a001826c3f6b3331270f36
bpy.ops.object.add_named() doesnt provide error when failed (related to T38689)
===================================================================
M source/blender/editors/object/object_add.c
===================================================================
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 315b18a..a210171 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2170,8 +2170,11 @@ static int add_named_exec(bContext *C, wmOperator *op)
/* find object, create fake base */
RNA_string_get(op->ptr, "name", name);
ob = (Object *)BKE_libblock_find_name(ID_OB, name);
- if (ob == NULL)
+
+ if (ob == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Object not found");
return OPERATOR_CANCELLED;
+ }
base = MEM_callocN(sizeof(Base), "duplibase");
base->object = ob;
@@ -2185,6 +2188,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
if (basen == NULL) {
MEM_freeN(base);
+ BKE_report(op->reports, RPT_ERROR, "Object could not be duplicated");
return OPERATOR_CANCELLED;
}
More information about the Bf-blender-cvs
mailing list