[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26987] trunk/blender/source/blender: Animation Editors: DopeSheet filter for Object-level animation
Joshua Leung
aligorith at gmail.com
Wed Feb 17 13:03:25 CET 2010
Revision: 26987
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26987
Author: aligorith
Date: 2010-02-17 13:03:23 +0100 (Wed, 17 Feb 2010)
Log Message:
-----------
Animation Editors: DopeSheet filter for Object-level animation
Added a new option to filter the out Object-level (i.e. transforms, object visibility/settings, and also bone animation) animation data from the channels list. As most of these settings are transforms, I've used the transform manipulator icon and named the RNA setting display_transforms.
This is useful when trying to filter out only material animation data for example, as requested by Colin.
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/makesdna/DNA_anim_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-02-17 11:35:20 UTC (rev 26986)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c 2010-02-17 12:03:23 UTC (rev 26987)
@@ -1667,7 +1667,7 @@
return items;
/* Action, Drivers, or NLA */
- if (ob->adt) {
+ if (ob->adt && !(ads->filterflag & ADS_FILTER_NOOBJ)) {
adt= ob->adt;
ANIMDATA_FILTER_CASES(ob,
{ /* AnimData blocks - do nothing... */ },
@@ -2168,19 +2168,22 @@
/* check filters for datatypes */
/* object */
actOk= 0;
+ if (!(ads->filterflag & ADS_FILTER_NOOBJ)) {
+ ANIMDATA_FILTER_CASES(ob,
+ {
+ /* for the special AnimData blocks only case, we only need to add
+ * the block if it is valid... then other cases just get skipped (hence ok=0)
+ */
+ ANIMDATA_ADD_ANIMDATA(ob);
+ actOk=0;
+ },
+ actOk= 1;,
+ actOk= 1;,
+ actOk= 1;)
+ }
+
keyOk= 0;
- ANIMDATA_FILTER_CASES(ob,
- {
- /* for the special AnimData blocks only case, we only need to add
- * the block if it is valid... then other cases just get skipped (hence ok=0)
- */
- ANIMDATA_ADD_ANIMDATA(ob);
- actOk=0;
- },
- actOk= 1;,
- actOk= 1;,
- actOk= 1;)
- if (key) {
+ if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) {
/* shapekeys */
ANIMDATA_FILTER_CASES(key,
{
Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c 2010-02-17 11:35:20 UTC (rev 26986)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c 2010-02-17 12:03:23 UTC (rev 26987)
@@ -77,26 +77,23 @@
ScrArea *sa= CTX_wm_area(C);
uiLayout *row= layout;
short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA));
-
+
/* more 'generic' filtering options */
- if (nlaActive)
- row= uiLayoutRow(layout, 1);
-
+ row= uiLayoutRow(layout, 1);
+
uiItemR(row, "", 0, ptr, "only_selected", 0);
-
+ uiItemR(row, "", 0, ptr, "display_transforms", 0); // xxx: include in another position instead?
+
if (nlaActive)
uiItemR(row, "", 0, ptr, "include_missing_nla", 0);
-
- if (nlaActive)
- row= layout;
-
+
/* datatype based - only available datatypes are shown */
row= uiLayoutRow(layout, 1);
uiItemR(row, "", 0, ptr, "display_scene", 0);
uiItemR(row, "", 0, ptr, "display_world", 0);
uiItemR(row, "", 0, ptr, "display_node", 0);
-
+
if (mainptr && mainptr->mesh.first)
uiItemR(row, "", 0, ptr, "display_mesh", 0);
if (mainptr && mainptr->key.first)
Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h 2010-02-17 11:35:20 UTC (rev 26986)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h 2010-02-17 12:03:23 UTC (rev 26987)
@@ -526,6 +526,7 @@
/* datatype-based filtering */
ADS_FILTER_NOSHAPEKEYS = (1<<6),
ADS_FILTER_NOMESH = (1<<7),
+ ADS_FILTER_NOOBJ = (1<<8), /* for animdata on object level, if we only want to concentrate on materials/etc. */
// NOTE: there are a few more spaces for datablock filtering here...
ADS_FILTER_NOCAM = (1<<10),
ADS_FILTER_NOMAT = (1<<11),
Modified: trunk/blender/source/blender/makesdna/DNA_anim_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_anim_types.h 2010-02-17 11:35:20 UTC (rev 26986)
+++ trunk/blender/source/blender/makesdna/DNA_anim_types.h 2010-02-17 12:03:23 UTC (rev 26987)
@@ -445,7 +445,6 @@
FCURVE_INT_VALUES = (1<<11),
/* curve can only have certain discrete-number values (no interpolation at all, for enums/booleans) */
FCURVE_DISCRETE_VALUES = (1<<12),
-
} eFCurve_Flags;
/* extrapolation modes (only simple value 'extending') */
Modified: trunk/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_action.c 2010-02-17 11:35:20 UTC (rev 26986)
+++ trunk/blender/source/blender/makesrna/intern/rna_action.c 2010-02-17 12:03:23 UTC (rev 26987)
@@ -112,6 +112,12 @@
/* General DataType Filtering Settings */
+ prop= RNA_def_property(srna, "display_transforms", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ);
+ RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)");
+ RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); // XXX?
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
prop= RNA_def_property(srna, "display_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data");
More information about the Bf-blender-cvs
mailing list