diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-03-06 05:44:12 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-03-06 05:44:12 +0400 |
commit | 8ebd5ddd0e9c3be35a5da1b9b5e06ea2e0393761 (patch) | |
tree | 3c81d51d1055f35c4d58d5a272d47cb3267d86fd | |
parent | 11dbadb4424a28d53873323d0e29ce1971fd2ef7 (diff) |
Experimental Feature: Ctrl-Click on the "name" of a broken F-Curve now allows
you to fix the RNA Path in-place
For F-Curves that are disabled or marked as having errors because their paths
are invalid (indicated with a red line underneath their names), it is now
possible to use the Ctrl-Click renaming functionality to bring up a textbox for
fixing the offending RNA Path "in place" (i.e. in the channels list) without
having to bring up the properties region first.
This makes it easier to fix the paths if you know what you're doing. However,
caution is still advised for most people. In particular, be aware that this uses
a separate "RNA Array Index" for indexing into array properties (i.e. location,
rotation, color) which will not be shown here, and can only be edited from the
panel (or datablocks editor/scripts).
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index ad6098010f8..2d154ec7273 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -893,6 +893,23 @@ static void acf_fcurve_name(bAnimListElem *ale, char *name) getname_anim_fcurve(name, ale->id, ale->data); } +/* "name" property for fcurve entries */ +static short acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop) +{ + FCurve *fcu = (FCurve *)ale->data; + + /* Ctrl-Click Usability Convenience Hack: + * For disabled F-Curves, allow access to the RNA Path + * as our "name" so that user can perform quick fixes + */ + if (fcu->flag & FCURVE_DISABLED) { + RNA_pointer_create(ale->id, &RNA_FCurve, ale->data, ptr); + *prop = RNA_struct_find_property(ptr, "data_path"); + } + + return (*prop != NULL); +} + /* check if some setting exists for this channel */ static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) { @@ -964,7 +981,7 @@ static bAnimChannelType ACF_FCURVE = acf_generic_group_offset, /* offset */ acf_fcurve_name, /* name */ - NULL, /* name prop */ + acf_fcurve_name_prop, /* name prop */ NULL, /* icon */ acf_fcurve_setting_valid, /* has setting */ |