Fix T88498: 'Clear Parent' does not clear parent_bone

Clearing the parent from the UI using the X (or from python) clears the
`parsubstr` and set `partype` back to `PAROBJECT`.

Using the Clear Parent operator would leave the `parsubstr` (and thus
`parent_bone`) untouched even though this operator claims to "clear
parenting relationship completely" (it also removes parent deform
modifiers for example).

So now, also clear `parsubstr` and set back to `PAROBJECT` [which is
default].

Maniphest Tasks: T88498

Differential Revision: https://developer.blender.org/D11503
This commit is contained in:
Philipp Oeser 2021-06-04 16:39:12 +02:00 committed by Jeroen Bakker
parent 47618781d8
commit 60dbbaac42
Notes: blender-bot 2023-02-14 11:42:40 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #88498, bpy.types.Object.parent_bone not reset when clearing a bone parent
1 changed files with 2 additions and 0 deletions

View File

@ -571,6 +571,8 @@ void ED_object_parent_clear(Object *ob, const int type)
/* clear parenting relationship completely */
ob->parent = NULL;
ob->partype = PAROBJECT;
ob->parsubstr[0] = 0;
break;
}
case CLEAR_PARENT_KEEP_TRANSFORM: {