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.
This commit is contained in:
Bastien Montagne 2015-06-23 17:35:55 +02:00 committed by Sergey Sharybin
parent 07aa5a4b26
commit 3ece175da3
Notes: blender-bot 2023-02-14 09:00:24 +01:00
Referenced by issue #45051, Curve parent bug
4 changed files with 7 additions and 9 deletions

View File

@ -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__

View File

@ -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;

View File

@ -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,

View File

@ -88,8 +88,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"},
@ -469,10 +467,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);
}