[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21748] branches/blender2.5/blender/source /blender/editors: 2.5 - Constraint (Re)Naming

Joshua Leung aligorith at gmail.com
Tue Jul 21 04:54:04 CEST 2009


Revision: 21748
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21748
Author:   aligorith
Date:     2009-07-21 04:54:02 +0200 (Tue, 21 Jul 2009)

Log Message:
-----------
2.5 - Constraint (Re)Naming

* Names for newly added constraints are now derived from the type of constraint, making it easier to identify the type of constraint

* Fixed crash when renaming constraints (due to invalid pointer being passed for the 'old' string name)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/interface_templates.c
    branches/blender2.5/blender/source/blender/editors/object/editconstraint.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_templates.c	2009-07-21 01:57:46 UTC (rev 21747)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_templates.c	2009-07-21 02:54:02 UTC (rev 21748)
@@ -764,7 +764,7 @@
 	
 	if(proxy_protected == 0) {
 		but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", xco+120, yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); 
-		uiButSetFunc(but, verify_constraint_name_func, con, NULL);
+		uiButSetFunc(but, verify_constraint_name_func, con, con->name);
 	}
 	else
 		uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); 

Modified: branches/blender2.5/blender/source/blender/editors/object/editconstraint.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/object/editconstraint.c	2009-07-21 01:57:46 UTC (rev 21747)
+++ branches/blender2.5/blender/source/blender/editors/object/editconstraint.c	2009-07-21 02:54:02 UTC (rev 21748)
@@ -200,8 +200,7 @@
 	/* Set up a generic constraint datablock */
 	con->type = type;
 	con->flag |= CONSTRAINT_EXPAND;
-	con->enforce = 1.0F;
-	strcpy(con->name, "Const");
+	con->enforce = 1.0f;
 	
 	/* Load the data for it */
 	cti = constraint_get_typeinfo(con);
@@ -211,7 +210,12 @@
 		/* only constraints that change any settings need this */
 		if (cti->new_data)
 			cti->new_data(con->data);
+			
+		/* set the name based on the type of constraint */
+		strcpy(con->name, cti->name); 
 	}
+	else
+		strcpy(con->name, "Const");
 	
 	return con;
 }





More information about the Bf-blender-cvs mailing list