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:
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 53c9fc4d82c..1e7c18dc6ac 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -531,7 +531,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
bConstraint *con= NULL;
short searchtype= VISUALKEY_NONE;
short has_parent = FALSE;
- char *identifier= NULL;
+ const char *identifier= NULL;
/* validate data */
// TODO: this check is probably not needed, but it won't hurt
@@ -548,7 +548,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
Object *ob= (Object *)ptr->data;
con= ob->constraints.first;
- identifier= (char *)RNA_property_identifier(prop);
+ identifier= RNA_property_identifier(prop);
has_parent= (ob->parent != NULL);
}
else if (ptr->type == &RNA_PoseBone) {
@@ -556,7 +556,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
bPoseChannel *pchan= (bPoseChannel *)ptr->data;
con= pchan->constraints.first;
- identifier= (char *)RNA_property_identifier(prop);
+ identifier= RNA_property_identifier(prop);
has_parent= (pchan->parent != NULL);
}
@@ -565,12 +565,18 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
return 0;
/* location or rotation identifiers only... */
- if (strstr(identifier, "location"))
+ if(identifier == NULL) {
+ printf("%s failed: NULL identifier\n", __func__);
+ return 0;
+ }
+ else if (strstr(identifier, "location")) {
searchtype= VISUALKEY_LOC;
- else if (strstr(identifier, "rotation"))
+ }
+ else if (strstr(identifier, "rotation")) {
searchtype= VISUALKEY_ROT;
+ }
else {
- printf("visualkey_can_use() failed: identifier - '%s' \n", identifier);
+ printf("%s failed: identifier - '%s' \n", __func__, identifier);
return 0;
}