From df4d7b041e8339003da2d3c1ebd0eeaf66d4eb59 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Feb 2010 19:41:44 +0000 Subject: fix for make proxy, was checking dupligroup when it wasnt needed. --- source/blender/editors/object/object_relations.c | 31 +++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 46cf914755d..1eeae97b312 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -302,23 +302,22 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt) static int make_proxy_exec (bContext *C, wmOperator *op) { - Object *ob, *gob; + Object *ob, *gob= CTX_data_active_object(C); GroupObject *go; Scene *scene= CTX_data_scene(C); + + if (gob->dup_group != NULL) + { + go= BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "type")); + ob= go->ob; + } + else + { + ob= gob; + gob = NULL; + } - if(!(gob=CTX_data_active_object(C))) { - BKE_report(op->reports, RPT_ERROR, "No active object"); - return OPERATOR_CANCELLED; - } else if(gob->dup_group==NULL) { - BKE_report(op->reports, RPT_ERROR, "Active obhect has no dupligroup"); - return OPERATOR_CANCELLED; - } else if(!(go= BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "type")))) { - BKE_report(op->reports, RPT_ERROR, "Active objects dupligroup could not be found"); - return OPERATOR_CANCELLED; - } else if (!(ob= go->ob)) { - BKE_report(op->reports, RPT_ERROR, "Group has no object to make the proxy with"); - return OPERATOR_CANCELLED; - } else { + if (ob) { Object *newob; Base *newbase, *oldbase= BASACT; char name[32]; @@ -350,6 +349,10 @@ static int make_proxy_exec (bContext *C, wmOperator *op) DAG_id_flush_update(&newob->id, OB_RECALC); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, newob); } + else { + BKE_report(op->reports, RPT_ERROR, "No object to make proxy for"); + return OPERATOR_CANCELLED; + } return OPERATOR_FINISHED; } -- cgit v1.2.3