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:
authorMatt Ebb <matt@mke3.net>2009-11-11 08:03:49 +0300
committerMatt Ebb <matt@mke3.net>2009-11-11 08:03:49 +0300
commitbf50cc8b3991f2705f3db0f7a1fb5b4b52e4cbef (patch)
treec014b34b4491d0805416fdc06fdc989992b975c5 /source/blender/editors/animation/anim_channels_defines.c
parent792c4d602db232f2c0027f4e7d2d15ef4370b5f7 (diff)
Added compositing node support to the animation editors
Now when nodes are keyed, they will show up in the dopesheet/graph editor/etc in a new 'Nodetree' category. Still a major problem left, nodes need unique names in order for the rna paths to hold animation data properly...
Diffstat (limited to 'source/blender/editors/animation/anim_channels_defines.c')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 7d4ad868b45..865e89c927a 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -55,6 +55,7 @@
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_meta_types.h"
+#include "DNA_node_types.h"
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
@@ -1735,6 +1736,79 @@ static bAnimChannelType ACF_DSARM=
acf_dsarm_setting_ptr /* pointer for setting */
};
+/* NodeTree Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dsntree_icon(bAnimListElem *ale)
+{
+ return ICON_NODETREE;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dsntree_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return NTREE_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return ADT_UI_SELECTED;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dsntree_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ bNodeTree *ntree= (bNodeTree *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(ntree->flag);
+
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (ntree->adt)
+ GET_ACF_FLAG_PTR(ntree->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* metaball expander type define */
+static bAnimChannelType ACF_DSNTREE=
+{
+acf_generic_dataexpand_backdrop,/* backdrop */
+acf_generic_indention_1, /* indent level */
+acf_generic_basic_offset, /* offset */
+
+acf_generic_idblock_name, /* name */
+acf_dsntree_icon, /* icon */
+
+acf_generic_dataexpand_setting_valid, /* has setting */
+acf_dsntree_setting_flag, /* flag for setting */
+acf_dsntree_setting_ptr /* pointer for setting */
+};
+
/* ShapeKey Entry ------------------------------------------- */
@@ -1982,6 +2056,7 @@ void ANIM_init_channel_typeinfo_data (void)
animchannelTypeInfo[type++]= &ACF_DSCUR; /* Curve Channel */
animchannelTypeInfo[type++]= &ACF_DSSKEY; /* ShapeKey Channel */
animchannelTypeInfo[type++]= &ACF_DSWOR; /* World Channel */
+ animchannelTypeInfo[type++]= &ACF_DSNTREE; /* NodeTree Channel */
animchannelTypeInfo[type++]= &ACF_DSPART; /* Particle Channel */
animchannelTypeInfo[type++]= &ACF_DSMBALL; /* MetaBall Channel */
animchannelTypeInfo[type++]= &ACF_DSARM; /* Armature Channel */