Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2022-08-24 14:39:22 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-08-25 10:22:55 +0300
commit714a3739da95f867a85c83abe9185d3a0964190a (patch)
tree09428143206b6ee992e663ca265236301b2a5513 /source/blender/makesrna
parent3a1ea04d46de8cbddecc018bfc07d3600dd45d5e (diff)
Fix T100599: dont reset parent inverse setting parent type the same
Since rBb100bdca25b1 the parent inverse was always reset in ED_object_parent (also for just changing the parent type). This does make sense (since there is no point keeping it when e.g changing from "Bone" to "Object" or "Vertex" to "Object", for this to really make sense it would have to be properly recalculated anyways which does not happen afaict). The reported issue was that setting the prop to the same value as it was before (e.g. from "Object" to "Object") would still reset the parent inverse which was really unexpected since from a user standpoint, nothing has changed here. So in case the value does not really change, we now just early out and skip `ED_object_parent`. Maniphest Tasks: T100599 Differential Revision: https://developer.blender.org/D15771
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 103c77fa808..f15ca63268b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -687,6 +687,11 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->data;
+ /* Skip if type did not change (otherwise we loose parent inverse in ED_object_parent). */
+ if (ob->partype == value) {
+ return;
+ }
+
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}