diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-03-08 06:15:08 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-03-08 06:15:08 +0400 |
commit | bed8efb8e8893427fdb02e23c10bf0c631e7ff86 (patch) | |
tree | 8aff454739fc45562ff5e6a94188d7f4bd9713f4 | |
parent | 7f7f32d768d0486621a3832487dd569b8245c05a (diff) |
Improving warnings when keyframing fails for IKEY over a button
Now, instead of silently failing, an error message saying that the property
cannot be animated is displayed
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 22 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 2 |
2 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 532c711d3ab..45082e4235e 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1623,17 +1623,21 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) success += insert_keyframe_direct(op->reports, ptr, prop, fcu, cfra, 0); } else { - if (G.debug & G_DEBUG) - printf("Button Insert-Key: no path to property\n"); - BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property, try using a keying set instead"); + BKE_report(op->reports, RPT_WARNING, + "Failed to resolve path to property, try manually specifying this using a Keying Set instead"); } } - else if (G.debug & G_DEBUG) { - printf("ptr.data = %p, prop = %p,", (void *)ptr.data, (void *)prop); - if (prop) - printf("animatable = %d\n", RNA_property_animateable(&ptr, prop)); - else - printf("animatable = NULL\n"); + else { + if (prop && !RNA_property_animateable(&ptr, prop)) { + BKE_reportf(op->reports, RPT_WARNING, + "\"%s\" property cannot be animated", + RNA_property_identifier(prop)); + } + else { + BKE_reportf(op->reports, RPT_WARNING, + "Button doesn't appear to have any property information attached (ptr.data = %p, prop = %p)", + (void *)ptr.data, (void *)prop); + } } if (success) { diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 4e8d7bdafe5..24b1ade7599 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -879,7 +879,7 @@ short ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks) if (ksi == NULL) return MODIFYKEY_MISSING_TYPEINFO; /* TODO: check for missing callbacks! */ - + /* check if it can be used in the current context */ if (ksi->poll(ksi, C)) { /* if a list of data sources are provided, run a special iterator over them, |