[Bf-blender-cvs] [b318795] master: Fix T45051: Curve parent bug.

Bastien Montagne noreply at git.blender.org
Tue Jun 23 17:37:10 CEST 2015


Commit: b318795c3b3dc3bc274dfb445b4eb11b1fd6257e
Author: Bastien Montagne
Date:   Tue Jun 23 17:35:55 2015 +0200
Branches: master
https://developer.blender.org/rBb318795c3b3dc3bc274dfb445b4eb11b1fd6257e

Fix T45051: Curve parent bug.

PARCURVE is deprecated parting type, should never have been exposed to user!

Not a regression, but safe enough for final 2.75 imho.

===================================================================

M	source/blender/editors/include/ED_object.h
M	source/blender/editors/object/object_relations.c
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesrna/intern/rna_object.c

===================================================================

diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 43f1757..c62bdc1 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -77,7 +77,7 @@ typedef enum eParentType {
 	PAR_PATH_CONST,
 	PAR_LATTICE,
 	PAR_VERTEX,
-	PAR_VERTEX_TRI
+	PAR_VERTEX_TRI,
 } eParentType;
 
 #ifdef __RNA_TYPES_H__
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 19648c2..c2d2bff 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -571,6 +571,9 @@ void ED_object_parent(Object *ob, Object *par, const int type, const char *subst
 		return;
 	}
 
+	/* Other partypes are deprecated, do not use here! */
+	BLI_assert(ELEM(type & PARTYPE, PAROBJECT, PARSKEL, PARVERT1, PARVERT3, PARBONE));
+
 	/* this could use some more checks */
 
 	ob->parent = par;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 50f94aa..978a97f 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -378,8 +378,8 @@ enum {
 enum {
 	PARTYPE       = (1 << 4) - 1,
 	PAROBJECT     = 0,
-	PARCURVE      = 1,
-	PARKEY        = 2,
+	PARCURVE      = 1,  /* Deprecated. */
+	PARKEY        = 2,  /* XXX Unused, deprecated? */
 
 	PARSKEL       = 4,
 	PARVERT1      = 5,
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index c6a6136..3113b70 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -87,8 +87,6 @@ EnumPropertyItem object_empty_drawtype_items[] = {
 
 static EnumPropertyItem parent_type_items[] = {
 	{PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"},
-	{PARCURVE, "CURVE", 0, "Curve", "The object is parented to a curve"},
-	{PARKEY, "KEY", 0, "Key", ""},
 	{PARSKEL, "ARMATURE", 0, "Armature", ""},
 	{PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, /* PARSKEL reuse will give issues */
 	{PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"},
@@ -467,10 +465,7 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), Point
 	if (ob->parent) {
 		Object *par = ob->parent;
 		
-		if (par->type == OB_CURVE) {
-			RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARCURVE);
-		}
-		else if (par->type == OB_LATTICE) {
+		if (par->type == OB_LATTICE) {
 			/* special hack: prevents this overriding others */
 			RNA_enum_items_add_value(&item, &totitem, &parent_type_items[4], PARSKEL);
 		}




More information about the Bf-blender-cvs mailing list