Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-16 22:41:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-16 22:41:44 +0300
commitdf4d7b041e8339003da2d3c1ebd0eeaf66d4eb59 (patch)
treef81cd14a617c5a88740f5c5d090cde883e9d3037
parent0b3dfc441eddb0d4840205d9afe7d53026f2ab9c (diff)
fix for make proxy, was checking dupligroup when it wasnt needed.
-rw-r--r--source/blender/editors/object/object_relations.c31
1 files 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;
}