diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-07-14 23:01:40 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-07-14 23:01:40 +0400 |
commit | f588c49cb55b5787085e2b5a65991efd31ce2dee (patch) | |
tree | f4ad4fd5b7a9b0c21c0c65fa357e68a3d8f97f31 /source/blender/editors/animation/keyframing.c | |
parent | 8d131d519bf448bcccddb833c263bc36af22d6b5 (diff) | |
parent | d4b04fac044b2fe0b6295f271a78c73d57ef0533 (diff) |
Merged changes in the trunk up to revision 30335.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 882fb3e91dc..f60181d7f6c 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -817,15 +817,21 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag) { PointerRNA id_ptr, ptr; - PropertyRNA *prop; + PropertyRNA *prop = NULL; FCurve *fcu; int array_index_max= array_index+1; int ret= 0; /* validate pointer first - exit if failure */ + if (id == NULL) { + printf("Insert Key: no ID-block to insert keyframe in (Path = %s) \n", rna_path); + return 0; + } + RNA_id_pointer_create(id, &id_ptr); if ((RNA_path_resolve(&id_ptr, rna_path, &ptr, &prop) == 0) || (prop == NULL)) { - printf("Insert Key: Could not insert keyframe, as RNA Path is invalid for the given ID (ID = %s, Path = %s)\n", id->name, rna_path); + printf("Insert Key: Could not insert keyframe, as RNA Path is invalid for the given ID (ID = %s, Path = %s)\n", + (id)? id->name : "<Missing ID-Block>", rna_path); return 0; } @@ -922,7 +928,7 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ if ELEM(NULL, id, adt) { printf("ERROR: no ID-block and/or AnimData to delete keyframe from \n"); return 0; - } + } /* validate pointer first - exit if failure */ RNA_id_pointer_create(id, &id_ptr); |