[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26976] trunk/blender/source/blender/ editors/object/object_relations.c: fix for make proxy, was checking dupligroup when it wasnt needed.

Campbell Barton ideasman42 at gmail.com
Tue Feb 16 20:41:44 CET 2010


Revision: 26976
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26976
Author:   campbellbarton
Date:     2010-02-16 20:41:44 +0100 (Tue, 16 Feb 2010)

Log Message:
-----------
fix for make proxy, was checking dupligroup when it wasnt needed.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_relations.c

Modified: trunk/blender/source/blender/editors/object/object_relations.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_relations.c	2010-02-16 19:27:38 UTC (rev 26975)
+++ trunk/blender/source/blender/editors/object/object_relations.c	2010-02-16 19:41:44 UTC (rev 26976)
@@ -302,23 +302,22 @@
 
 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 @@
 		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;
 }





More information about the Bf-blender-cvs mailing list