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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-04-09 15:36:12 +0400
committerJoshua Leung <aligorith@gmail.com>2009-04-09 15:36:12 +0400
commit84f3e7d94d8ebb9d8daac9c1d7c0e9239c686dfc (patch)
tree5b0d07c6db397a75e74cefbf2864d3f623d57e3b /source
parenta59ee83916bf8c38f138775be4a48b4d26bd07fc (diff)
2.5 Bugfix: Trying to insert/delete keyframes on old-style buttons would crash
Fixed the problems with using uninitialised vars in the calls for inserting keyframes from buttons. Oldstyle buttons (i.e. those without any RNA links, such as the 3D-View header buttons) would crash otherwise.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/animation/keyframing.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 34af48b4c63..5cee5b6249c 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -2386,8 +2386,8 @@ void ANIM_OT_delete_keyframe_old (wmOperatorType *ot)
static int insert_key_button_exec (bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr;
- PropertyRNA *prop;
+ PointerRNA ptr = {0};
+ PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
short success= 0;
@@ -2395,23 +2395,23 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
/* try to insert keyframe using property retrieved from UI */
uiAnimContextProperty(C, &ptr, &prop, &index);
-
+
if(ptr.data && prop && RNA_property_animateable(ptr.data, prop)) {
path= RNA_path_from_ID_to_property(&ptr, prop);
-
+
if(path) {
if(all) {
length= RNA_property_array_length(&ptr, prop);
-
+
if(length) index= 0;
else length= 1;
}
else
length= 1;
-
+
for(a=0; a<length; a++)
success+= insertkey(ptr.id.data, NULL, path, index+a, cfra, 0);
-
+
MEM_freeN(path);
}
}
@@ -2449,8 +2449,8 @@ void ANIM_OT_insert_keyframe_button (wmOperatorType *ot)
static int delete_key_button_exec (bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr;
- PropertyRNA *prop;
+ PointerRNA ptr = {0};
+ PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
short success= 0;
@@ -2461,20 +2461,20 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
if(ptr.data && prop) {
path= RNA_path_from_ID_to_property(&ptr, prop);
-
+
if(path) {
if(all) {
length= RNA_property_array_length(&ptr, prop);
-
+
if(length) index= 0;
else length= 1;
}
else
length= 1;
-
+
for(a=0; a<length; a++)
success+= deletekey(ptr.id.data, NULL, path, index+a, cfra, 0);
-
+
MEM_freeN(path);
}
}