[Bf-blender-cvs] [dc8844f8ef6] master: Fix T88498: 'Clear Parent' does not clear parent_bone

Philipp Oeser noreply at git.blender.org
Thu Aug 12 16:37:31 CEST 2021


Commit: dc8844f8ef6a5cfa2be1035162d39e6d83c83d7c
Author: Philipp Oeser
Date:   Fri Jun 4 16:39:12 2021 +0200
Branches: master
https://developer.blender.org/rBdc8844f8ef6a5cfa2be1035162d39e6d83c83d7c

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

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

M	source/blender/editors/object/object_relations.c

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

diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index c0b954f3cff..ec72ff11683 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -570,6 +570,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: {



More information about the Bf-blender-cvs mailing list