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:
authorJoshua Leung <aligorith@gmail.com>2010-07-05 08:37:30 +0400
committerJoshua Leung <aligorith@gmail.com>2010-07-05 08:37:30 +0400
commit05eb72ff141ad74b57504b7cf28b81548162d650 (patch)
tree5409a9949d46e79870ddb3880205c4f0d80f3208
parentfaf1c9a4bb27dfdd843cc745707d15ab47ce8683 (diff)
Bugfix #22030: Animation Editors and Layer Animation
Added new filtering option for animation editors (indicated as the 'ghost' toggle beside the 'select'(-ed only) toggle), which will include objects/bones that aren't visible (i.e. are hidden or on a hidden layer). This should make it possible to edit such types of animation, and also prevent flickering as these channels come in/out of view.
-rw-r--r--source/blender/editors/animation/anim_filter.c14
-rw-r--r--source/blender/editors/interface/interface_templates.c8
-rw-r--r--source/blender/makesdna/DNA_action_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_action.c6
4 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index fc960ffb402..a9c9830f07f 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -797,7 +797,7 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
/* ----------------------------------------- */
/* NOTE: when this function returns true, the F-Curve is to be skipped */
-static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode)
+static int skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
{
if (GS(owner_id->name) == ID_OB) {
Object *ob= (Object *)owner_id;
@@ -814,9 +814,8 @@ static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode)
/* check whether to continue or skip */
if ((pchan) && (pchan->bone)) {
- /* if only visible channels, skip if bone not visible */
- // TODO: should we just do this always?
- if (filter_mode & ANIMFILTER_VISIBLE) {
+ /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */
+ if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
bArmature *arm= (bArmature *)ob->data;
if ((arm->layer & pchan->bone->layer) == 0)
@@ -887,7 +886,7 @@ static FCurve *animdata_filter_fcurve_next (bDopeSheet *ads, FCurve *first, bAct
* - this will also affect things like Drivers, and also works for Bone Constraints
*/
if ( ((ads) && (ads->filterflag & ADS_FILTER_ONLYSEL)) && (owner_id) ) {
- if (skip_fcurve_selected_data(fcu, owner_id, filter_mode))
+ if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode))
continue;
}
@@ -2112,11 +2111,14 @@ static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDo
/* firstly, check if object can be included, by the following factors:
* - if only visible, must check for layer and also viewport visibility
+ * --> while tools may demand only visible, user setting takes priority
+ * as user option controls whether sets of channels get included while
+ * tool-flag takes into account collapsed/open channels too
* - if only selected, must check if object is selected
* - there must be animation data to edit
*/
// TODO: if cache is implemented, just check name here, and then
- if (filter_mode & ANIMFILTER_VISIBLE) {
+ if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
/* layer visibility - we check both object and base, since these may not be in sync yet */
if ((sce->lay & (ob->lay|base->lay))==0) continue;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 261f83f9bbc..ae5f81a56a9 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -80,11 +80,15 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr)
uiLayout *row= layout;
short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA));
- /* more 'generic' filtering options */
+ /* most 'generic' filtering options */
row= uiLayoutRow(layout, 1);
uiItemR(row, ptr, "only_selected", 0, "", 0);
- uiItemR(row, ptr, "display_transforms", 0, "", 0); // xxx: include in another position instead?
+ uiItemR(row, ptr, "display_hidden", 0, "", 0);
+
+ /* object-level filtering options */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, ptr, "display_transforms", 0, "", 0);
if (nlaActive)
uiItemR(row, ptr, "include_missing_nla", 0, "", 0);
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 210bb6a9af0..d0f15b78ada 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -550,6 +550,9 @@ typedef enum eDopeSheet_FilterFlag {
/* NLA-specific filters */
ADS_FILTER_NLA_NOACT = (1<<25), /* if the AnimData block has no NLA data, don't include to just show Action-line */
+ /* general filtering 3 */
+ ADS_FILTER_INCL_HIDDEN = (1<<26), /* include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
+
/* combination filters (some only used at runtime) */
ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART|ADS_FILTER_NOARM),
} eDopeSheet_FilterFlag;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index bc83af7a279..1f542e2babe 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -171,6 +171,12 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+ prop= RNA_def_property(srna, "display_hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN);
+ RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible");
+ RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+
/* Object Group Filtering Settings */
prop= RNA_def_property(srna, "only_group_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);