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>2012-04-29 19:05:19 +0400
committerJoshua Leung <aligorith@gmail.com>2012-04-29 19:05:19 +0400
commit038c12895f50a97607dd372cb0780c55eb38fe22 (patch)
tree5a410ea222ea6f3bd19099c594b2cf5edf14b244
parent22de538eb1d367aa21a865ce663b9a872d31e416 (diff)
Bugfix [#28826] Show Hidden button in Dopesheet and Graph Editor doesn't quite
work Show Hidden was handled by the same filtering function as Only Selected, but the filters were being tested incorrectly (or to be precise, only Only Selected was being considered). This meant that it was only possible to show F-Curves belonging to hidden data if that data happened to be selected first.
-rw-r--r--source/blender/editors/animation/anim_filter.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 922156ebb7a..e1bf4273646 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -824,11 +824,14 @@ static bAnimListElem *make_new_animlistelem (void *data, short datatype, ID *own
/* ----------------------------------------- */
-/* 'Only Selected' selected data filtering
+/* 'Only Selected' selected data and/or 'Include Hidden' filtering
* NOTE: when this function returns true, the F-Curve is to be skipped
*/
-static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
+static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
{
+ /* hidden items should be skipped if we only care about visible data, but we aren't interested in hidden stuff */
+ short skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN);
+
if (GS(owner_id->name) == ID_OB) {
Object *ob= (Object *)owner_id;
@@ -845,17 +848,22 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner
/* check whether to continue or skip */
if ((pchan) && (pchan->bone)) {
/* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */
- if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
+ if (skip_hidden) {
bArmature *arm= (bArmature *)ob->data;
+ /* skipping - not visible on currently visible layers */
if ((arm->layer & pchan->bone->layer) == 0)
return 1;
- // TODO: manually hidden using flags
+ /* skipping - is currently hidden */
+ if (pchan->bone->flag & BONE_HIDDEN_P)
+ return 1;
}
/* can only add this F-Curve if it is selected */
- if ((pchan->bone->flag & BONE_SELECTED) == 0)
- return 1;
+ if (ads->filterflag & ADS_FILTER_ONLYSEL) {
+ if ((pchan->bone->flag & BONE_SELECTED) == 0)
+ return 1;
+ }
}
}
}
@@ -874,14 +882,16 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner
if (seq_name) MEM_freeN(seq_name);
/* can only add this F-Curve if it is selected */
- if (seq==NULL || (seq->flag & SELECT)==0)
- return 1;
+ if (ads->filterflag & ADS_FILTER_ONLYSEL) {
+ if ((seq == NULL) || (seq->flag & SELECT)==0)
+ return 1;
+ }
}
}
else if (GS(owner_id->name) == ID_NT) {
bNodeTree *ntree = (bNodeTree *)owner_id;
- /* check for selected nodes */
+ /* check for selected nodes */
if ((fcu->rna_path) && strstr(fcu->rna_path, "nodes")) {
bNode *node;
char *node_name;
@@ -892,8 +902,10 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner
if (node_name) MEM_freeN(node_name);
/* can only add this F-Curve if it is selected */
- if ((node) && (node->flag & NODE_SELECT)==0)
- return 1;
+ if (ads->filterflag & ADS_FILTER_ONLYSEL) {
+ if ((node) && (node->flag & NODE_SELECT)==0)
+ return 1;
+ }
}
}
return 0;
@@ -940,17 +952,19 @@ static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGr
*/
for (fcu= first; ((fcu) && (fcu->grp==grp)); fcu= fcu->next) {
/* special exception for Pose-Channel/Sequence-Strip/Node Based F-Curves:
- * - the 'Only Selected' data filter should be applied to Pose-Channel data too, but those are
- * represented as F-Curves. The way the filter for objects worked was to be the first check
- * after 'normal' visibility, so this is done first here too...
+ * - the 'Only Selected' and 'Include Hidden' data filters should be applied to sub-ID data which
+ * can be independently selected/hidden, such as Pose-Channels, Sequence Strips, and Nodes.
+ * Since these checks were traditionally done as first check for objects, we do the same here
* - we currently use an 'approximate' method for getting these F-Curves that doesn't require
* carefully checking the entire path
* - 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(ads, fcu, owner_id, filter_mode))
- continue;
- }
+ if (ads && owner_id) {
+ if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN)==0) {
+ if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode))
+ continue;
+ }
+ }
/* only include if visible (Graph Editor check, not channels check) */
if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || (fcu->flag & FCURVE_VISIBLE)) {