diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-23 03:23:09 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-23 03:23:09 +0400 |
commit | caa27f09fd19a5d37ae7775b8c80246bd7befe13 (patch) | |
tree | 5e66085ed3e2047f461f250152fcb1f4a9b36524 /source/blender/makesrna/intern/rna_key.c | |
parent | e8af794441bbce7ef49d872e8c3b2c2b7971e0e6 (diff) |
Bugfixes:
* The python 'math' library is now included in the py-namespace used to evaluate button expressions. So it is now possible to do 'radians(somevalue)' to get a rotation value that Blender can understand...
* Shapekey path getting function now uses the appropriate wrapper for grabbing the pointer to the ID block for the ShapeKey
* Made the Graph Editor's minimum zoom size finer...
Diffstat (limited to 'source/blender/makesrna/intern/rna_key.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_key.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 433e5a7e4a3..ca36da5d03b 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -50,6 +50,17 @@ #include "WM_api.h" #include "WM_types.h" +static Key *rna_ShapeKey_find_key(ID *id) +{ + switch(GS(id->name)) { + case ID_CU: return ((Curve*)id)->key; + case ID_KE: return (Key*)id; + case ID_LT: return ((Lattice*)id)->key; + case ID_ME: return ((Mesh*)id)->key; + default: return NULL; + } +} + void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) { KeyBlock *kb= ptr->data; @@ -63,7 +74,7 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) /* make sure the name is truly unique */ if (ptr->id.data) { - Key *key= ptr->id.data; + Key *key= rna_ShapeKey_find_key(ptr->id.data); BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), 32); } @@ -86,17 +97,6 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max) *max= data->slidermax; } -static Key *rna_ShapeKey_find_key(ID *id) -{ - switch(GS(id->name)) { - case ID_CU: return ((Curve*)id)->key; - case ID_KE: return (Key*)id; - case ID_LT: return ((Lattice*)id)->key; - case ID_ME: return ((Mesh*)id)->key; - default: return NULL; - } -} - static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) { Key *key= rna_ShapeKey_find_key(ptr->id.data); |