[Bf-blender-cvs] [9674ed1] soc-2014-shapekey: It's now forbidden to set a shape key to be relative to itself

Grigory Revzin noreply at git.blender.org
Tue May 13 14:07:31 CEST 2014


Commit: 9674ed1b22db35091407c839a76235a9a740aef7
Author: Grigory Revzin
Date:   Sun May 4 22:39:56 2014 +0400
https://developer.blender.org/rB9674ed1b22db35091407c839a76235a9a740aef7

It's now forbidden to set a shape key to be relative to itself

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

M	source/blender/makesrna/intern/rna_key.c

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

diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 950c369..fe1e723 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -186,9 +186,12 @@ static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr)
 
 static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value)
 {
-	KeyBlock *kb = (KeyBlock *)ptr->data;
-
-	kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative);
+	KeyBlock *kb = ptr->data;
+	KeyBlock *basis_can = value.data;
+	if (kb != basis_can)
+		kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative);
+	else
+		printf("RNA warning: can't make a shape key %s to be relative to itself.\n");
 }
 
 static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values)




More information about the Bf-blender-cvs mailing list