[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29964] trunk/blender/source/blender: Bugfix #22030: Animation Editors and Layer Animation
Joshua Leung
aligorith at gmail.com
Mon Jul 5 06:37:31 CEST 2010
Revision: 29964
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29964
Author: aligorith
Date: 2010-07-05 06:37:30 +0200 (Mon, 05 Jul 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/editors/animation/anim_filter.c
trunk/blender/source/blender/editors/interface/interface_templates.c
trunk/blender/source/blender/makesdna/DNA_action_types.h
trunk/blender/source/blender/makesrna/intern/rna_action.c
Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c 2010-07-05 03:55:48 UTC (rev 29963)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c 2010-07-05 04:37:30 UTC (rev 29964)
@@ -797,7 +797,7 @@
/* ----------------------------------------- */
/* 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 @@
/* 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 @@
* - 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 @@
/* 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;
Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c 2010-07-05 03:55:48 UTC (rev 29963)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c 2010-07-05 04:37:30 UTC (rev 29964)
@@ -80,12 +80,16 @@
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);
Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h 2010-07-05 03:55:48 UTC (rev 29963)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h 2010-07-05 04:37:30 UTC (rev 29964)
@@ -550,6 +550,9 @@
/* 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;
Modified: trunk/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_action.c 2010-07-05 03:55:48 UTC (rev 29963)
+++ trunk/blender/source/blender/makesrna/intern/rna_action.c 2010-07-05 04:37:30 UTC (rev 29964)
@@ -171,6 +171,12 @@
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);
More information about the Bf-blender-cvs
mailing list