4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
21 * All rights reserved.
23 * Contributor(s): Joshua Leung
25 * ***** END GPL LICENSE BLOCK *****
37 #include "MEM_guardedalloc.h"
39 #include "BLI_blenlib.h"
40 #include "BLI_arithb.h"
42 #include "DNA_listBase.h"
43 #include "DNA_anim_types.h"
44 #include "DNA_action_types.h"
45 #include "DNA_armature_types.h"
46 #include "DNA_camera_types.h"
47 #include "DNA_curve_types.h"
48 #include "DNA_object_types.h"
49 #include "DNA_particle_types.h"
50 #include "DNA_screen_types.h"
51 #include "DNA_scene_types.h"
52 #include "DNA_space_types.h"
53 #include "DNA_constraint_types.h"
54 #include "DNA_key_types.h"
55 #include "DNA_lamp_types.h"
56 #include "DNA_material_types.h"
57 #include "DNA_meta_types.h"
58 #include "DNA_userdef_types.h"
59 #include "DNA_gpencil_types.h"
60 #include "DNA_windowmanager_types.h"
61 #include "DNA_world_types.h"
63 #include "RNA_access.h"
64 #include "RNA_define.h"
66 #include "BKE_animsys.h"
67 #include "BKE_action.h"
68 #include "BKE_depsgraph.h"
69 #include "BKE_fcurve.h"
71 #include "BKE_material.h"
72 #include "BKE_object.h"
73 #include "BKE_context.h"
74 #include "BKE_utildefines.h"
76 #include "UI_interface.h"
77 #include "UI_interface_icons.h"
78 #include "UI_resources.h"
79 #include "UI_view2d.h"
81 #include "ED_anim_api.h"
82 #include "ED_keyframing.h"
83 #include "ED_keyframes_edit.h" // XXX move the select modes out of there!
84 #include "ED_screen.h"
85 #include "ED_space_api.h"
92 /* *********************************************** */
93 // XXX constant defines to be moved elsewhere?
95 /* extra padding for lengths (to go under scrollers) */
96 #define EXTRA_SCROLL_PAD 100.0f
98 /* size of indent steps */
99 #define INDENT_STEP_SIZE 7
101 /* macros used for type defines */
102 /* get the pointer used for some flag */
103 #define GET_ACF_FLAG_PTR(ptr) \
105 *type= sizeof((ptr)); \
111 extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
112 extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
115 /* *********************************************** */
116 /* Generic Functions (Type independent) */
118 /* Draw Backdrop ---------------------------------- */
120 /* backdrop for top-level widgets (Scene and Object only) */
121 static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
123 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
124 View2D *v2d= &ac->ar->v2d;
125 short expanded= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
126 short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
128 /* darker blue for top-level widgets */
129 UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
131 /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
132 uiSetRoundBox((expanded)? (1):(1|8));
133 gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
136 /* backdrop for data expanders under top-level Scene/Object */
137 static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
139 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
140 View2D *v2d= &ac->ar->v2d;
141 short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
143 /* lighter color than top-level widget */
144 UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
146 /* no rounded corner - just rectangular box */
147 glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
150 /* backdrop for generic channels */
151 static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
153 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
154 View2D *v2d= &ac->ar->v2d;
155 SpaceAction *saction = NULL;
156 bActionGroup *grp = NULL;
157 short indent= (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
158 short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
160 /* get context info needed... */
161 if ((ac->sa) && (ac->sa->spacetype == SPACE_ACTION))
162 saction= (SpaceAction *)ac->sa->spacedata.first;
164 if (ale->type == ANIMTYPE_FCURVE) {
165 FCurve *fcu= (FCurve *)ale->data;
169 /* set color for normal channels
170 * - use 3 shades of color group/standard color for 3 indention level
171 * - only use group colors if allowed to, and if actually feasible
173 if ( (saction && !(saction->flag & SACTION_NODRAWGCOLORS)) &&
174 ((grp) && (grp->customCol)) )
179 VECCOPY(cp, grp->cs.solid);
181 else if (indent == 1) {
182 VECCOPY(cp, grp->cs.select);
185 VECCOPY(cp, grp->cs.active);
188 glColor3ub(cp[0], cp[1], cp[2]);
190 else // FIXME: what happens when the indention is 1 greater than what it should be (due to grouping)?
191 UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
193 /* no rounded corners - just rectangular box */
194 glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
197 /* Indention + Offset ------------------------------------------- */
199 /* indention level is always the value in the name */
200 static short acf_generic_indention_0(bAnimContext *ac, bAnimListElem *ale)
204 static short acf_generic_indention_1(bAnimContext *ac, bAnimListElem *ale)
208 #if 0 // XXX not used
209 static short acf_generic_indention_2(bAnimContext *ac, bAnimListElem *ale)
215 /* indention which varies with the grouping status */
216 static short acf_generic_indention_flexible(bAnimContext *ac, bAnimListElem *ale)
221 /* special exception for materials and particles */
222 if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
226 /* grouped F-Curves need extra level of indention */
227 if (ale->type == ANIMTYPE_FCURVE) {
228 FCurve *fcu= (FCurve *)ale->data;
230 // TODO: we need some way of specifying that the indention color should be one less...
239 /* basic offset for channels derived from indention */
240 static short acf_generic_basic_offset(bAnimContext *ac, bAnimListElem *ale)
242 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
244 if (acf && acf->get_indent_level)
245 return acf->get_indent_level(ac, ale) * INDENT_STEP_SIZE;
250 /* offset for groups + grouped entities */
251 static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
253 short offset= acf_generic_basic_offset(ac, ale);
256 /* special exception for materials and particles */
257 if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
260 /* if not in Action Editor mode, groupings must carry some offset too... */
261 else if (ac->datatype != ANIMCONT_ACTION)
265 /* offset is just the normal type - i.e. based on indention */
269 /* Name ------------------------------------------- */
271 /* name for ID block entries */
272 static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
274 ID *id= (ID *)ale->data; /* data pointed to should be an ID block */
276 /* just copy the name... */
278 strcpy(name, id->name+2);
281 /* Settings ------------------------------------------- */
284 /* channel type has no settings */
285 static short acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
291 /* check if some setting exists for this object-based data-expander (category only) */
292 static short acf_generic_dsexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
295 /* only expand supported */
296 case ACHANNEL_SETTING_EXPAND:
299 /* visible - only available in Graph Editor */
300 case ACHANNEL_SETTING_VISIBLE:
301 return ((ac) && (ac->spacetype == SPACE_IPO));
308 /* get pointer to the setting (category only) */
309 static void *acf_generic_dsexpand_setting_ptr(bAnimListElem *ale, int setting, short *type)
311 Object *ob= (Object *)ale->data;
313 /* clear extra return data first */
317 case ACHANNEL_SETTING_EXPAND: /* expanded */
318 GET_ACF_FLAG_PTR(ob->nlaflag); // XXX
320 default: /* unsupported */
325 /* check if some setting exists for this object-based data-expander (datablock only) */
326 static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
329 /* expand is always supported */
330 case ACHANNEL_SETTING_EXPAND:
333 /* mute is only supported for NLA */
334 case ACHANNEL_SETTING_MUTE:
335 return ((ac) && (ac->spacetype == SPACE_NLA));
337 /* other flags are never supported */
343 /* *********************************************** */
344 /* Type Specific Functions + Defines */
346 /* Animation Summary ----------------------------------- */
348 /* backdrop for summary widget */
349 static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
351 View2D *v2d= &ac->ar->v2d;
353 // FIXME: hardcoded color - same as the 'action' line in NLA
354 glColor3f(0.8f, 0.2f, 0.0f); // reddish color
356 /* rounded corners on LHS only
358 * - special hack: make the top a bit higher, since we are first...
360 uiSetRoundBox((1|8));
361 gl_round_box(GL_POLYGON, 0, yminc-2, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
364 /* name for summary entries */
365 static void acf_summary_name(bAnimListElem *ale, char *name)
368 strcpy(name, "DopeSheet Summary");
371 // TODO: this is really a temp icon I think
372 static int acf_summary_icon(bAnimListElem *ale)
374 return ICON_BORDERMOVE;
377 /* check if some setting exists for this channel */
378 static short acf_summary_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
380 /* only expanded is supported, as it is used for hiding all stuff which the summary covers */
381 return (setting == ACHANNEL_SETTING_EXPAND);
384 /* get the appropriate flag(s) for the setting when it is valid */
385 static int acf_summary_setting_flag(int setting, short *neg)
387 if (setting == ACHANNEL_SETTING_EXPAND) {
390 return ADS_FLAG_SUMMARY_COLLAPSED;
399 /* get pointer to the setting */
400 static void *acf_summary_setting_ptr(bAnimListElem *ale, int setting, short *type)
402 bAnimContext *ac= (bAnimContext *)ale->data;
404 /* if data is valid, return pointer to active dopesheet's relevant flag
405 * - this is restricted to DopeSheet/Action Editor only
407 if ((ac->sa) && (ac->spacetype == SPACE_ACTION) && (setting == ACHANNEL_SETTING_EXPAND)) {
408 SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first;
409 bDopeSheet *ads= &saction->ads;
411 /* return pointer to DopeSheet's flag */
412 GET_ACF_FLAG_PTR(ads->flag);
415 /* can't return anything useful - unsupported */
421 /* all animation summary (DopeSheet only) type define */
422 static bAnimChannelType ACF_SUMMARY =
424 acf_summary_backdrop, /* backdrop */
425 acf_generic_indention_0, /* indent level */
428 acf_summary_name, /* name */
429 acf_summary_icon, /* icon */
431 acf_summary_setting_valid, /* has setting */
432 acf_summary_setting_flag, /* flag for setting */
433 acf_summary_setting_ptr /* pointer for setting */
436 /* Scene ------------------------------------------- */
438 // TODO: just get this from RNA?
439 static int acf_scene_icon(bAnimListElem *ale)
441 return ICON_SCENE_DATA;
444 /* check if some setting exists for this channel */
445 static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
448 /* muted only in NLA */
449 case ACHANNEL_SETTING_MUTE:
450 return ((ac) && (ac->spacetype == SPACE_NLA));
452 /* visible only in Graph Editor */
453 case ACHANNEL_SETTING_VISIBLE:
454 return ((ac) && (ac->spacetype == SPACE_IPO));
456 /* only select and expand supported otherwise */
457 case ACHANNEL_SETTING_SELECT:
458 case ACHANNEL_SETTING_EXPAND:
466 /* get the appropriate flag(s) for the setting when it is valid */
467 static int acf_scene_setting_flag(int setting, short *neg)
469 /* clear extra return data first */
473 case ACHANNEL_SETTING_SELECT: /* selected */
474 return SCE_DS_SELECTED;
476 case ACHANNEL_SETTING_EXPAND: /* expanded */
478 return SCE_DS_COLLAPSED;
480 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
481 return ADT_NLA_EVAL_OFF;
483 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
485 return ADT_CURVES_NOT_VISIBLE;
487 default: /* unsupported */
492 /* get pointer to the setting */
493 static void *acf_scene_setting_ptr(bAnimListElem *ale, int setting, short *type)
495 Scene *scene= (Scene *)ale->data;
497 /* clear extra return data first */
501 case ACHANNEL_SETTING_SELECT: /* selected */
502 GET_ACF_FLAG_PTR(scene->flag);
504 case ACHANNEL_SETTING_EXPAND: /* expanded */
505 GET_ACF_FLAG_PTR(scene->flag);
507 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
508 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
510 GET_ACF_FLAG_PTR(scene->adt->flag)
514 default: /* unsupported */
519 /* scene type define */
520 static bAnimChannelType ACF_SCENE =
522 acf_generic_root_backdrop, /* backdrop */
523 acf_generic_indention_0, /* indent level */
526 acf_generic_idblock_name, /* name */
527 acf_scene_icon, /* icon */
529 acf_scene_setting_valid, /* has setting */
530 acf_scene_setting_flag, /* flag for setting */
531 acf_scene_setting_ptr /* pointer for setting */
534 /* Object ------------------------------------------- */
536 static int acf_object_icon(bAnimListElem *ale)
538 Base *base= (Base *)ale->data;
539 Object *ob= base->object;
541 /* icon depends on object-type */
542 if (ob->type == OB_ARMATURE)
543 return ICON_ARMATURE_DATA;
545 return ICON_OBJECT_DATA;
548 /* name for object */
549 static void acf_object_name(bAnimListElem *ale, char *name)
551 Base *base= (Base *)ale->data;
552 Object *ob= base->object;
554 /* just copy the name... */
556 strcpy(name, ob->id.name+2);
559 /* check if some setting exists for this channel */
560 static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
562 Base *base= (Base *)ale->data;
563 Object *ob= base->object;
566 /* muted only in NLA */
567 case ACHANNEL_SETTING_MUTE:
568 return ((ac) && (ac->spacetype == SPACE_NLA));
570 /* visible only in Graph Editor */
571 case ACHANNEL_SETTING_VISIBLE:
572 return ((ac) && (ac->spacetype == SPACE_IPO) && (ob->adt));
574 /* only select and expand supported otherwise */
575 case ACHANNEL_SETTING_SELECT:
576 case ACHANNEL_SETTING_EXPAND:
584 /* get the appropriate flag(s) for the setting when it is valid */
585 static int acf_object_setting_flag(int setting, short *neg)
587 /* clear extra return data first */
591 case ACHANNEL_SETTING_SELECT: /* selected */
594 case ACHANNEL_SETTING_EXPAND: /* expanded */
596 return OB_ADS_COLLAPSED;
598 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
599 return ADT_NLA_EVAL_OFF;
601 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
603 return ADT_CURVES_NOT_VISIBLE;
605 default: /* unsupported */
610 /* get pointer to the setting */
611 static void *acf_object_setting_ptr(bAnimListElem *ale, int setting, short *type)
613 Base *base= (Base *)ale->data;
614 Object *ob= base->object;
616 /* clear extra return data first */
620 case ACHANNEL_SETTING_SELECT: /* selected */
621 GET_ACF_FLAG_PTR(ob->flag);
623 case ACHANNEL_SETTING_EXPAND: /* expanded */
624 GET_ACF_FLAG_PTR(ob->nlaflag); // xxx
626 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
627 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
629 GET_ACF_FLAG_PTR(ob->adt->flag)
633 default: /* unsupported */
638 /* object type define */
639 static bAnimChannelType ACF_OBJECT =
641 acf_generic_root_backdrop, /* backdrop */
642 acf_generic_indention_0, /* indent level */
645 acf_object_name, /* name */
646 acf_object_icon, /* icon */
648 acf_object_setting_valid, /* has setting */
649 acf_object_setting_flag, /* flag for setting */
650 acf_object_setting_ptr /* pointer for setting */
653 /* Group ------------------------------------------- */
655 /* backdrop for group widget */
656 static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
658 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
659 View2D *v2d= &ac->ar->v2d;
660 short expanded= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
661 short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
663 /* only for action group channels */
664 if (ale->flag & AGRP_ACTIVE)
665 UI_ThemeColorShade(TH_GROUP_ACTIVE, 10);
667 UI_ThemeColorShade(TH_GROUP, 20);
669 /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
670 uiSetRoundBox((expanded)? (1):(1|8));
671 gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
674 /* name for group entries */
675 static void acf_group_name(bAnimListElem *ale, char *name)
677 bActionGroup *agrp= (bActionGroup *)ale->data;
679 /* just copy the name... */
681 strcpy(name, agrp->name);
684 /* check if some setting exists for this channel */
685 static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
687 /* for now, all settings are supported, though some are only conditionally */
689 case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
690 return ((ac->sa) && (ac->sa->spacetype==SPACE_IPO));
692 default: /* always supported */
697 /* get the appropriate flag(s) for the setting when it is valid */
698 static int acf_group_setting_flag(int setting, short *neg)
700 /* clear extra return data first */
704 case ACHANNEL_SETTING_SELECT: /* selected */
705 return AGRP_SELECTED;
707 case ACHANNEL_SETTING_EXPAND: /* expanded */
708 return AGRP_EXPANDED;
710 case ACHANNEL_SETTING_MUTE: /* muted */
713 case ACHANNEL_SETTING_PROTECT: /* protected */
714 //*neg= 1; - if we change this to edtiability
715 return AGRP_PROTECTED;
717 case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
719 return AGRP_NOTVISIBLE;
722 /* this shouldn't happen */
726 /* get pointer to the setting */
727 static void *acf_group_setting_ptr(bAnimListElem *ale, int setting, short *type)
729 bActionGroup *agrp= (bActionGroup *)ale->data;
731 /* all flags are just in agrp->flag for now... */
732 GET_ACF_FLAG_PTR(agrp->flag);
735 /* group type define */
736 static bAnimChannelType ACF_GROUP =
738 acf_group_backdrop, /* backdrop */
739 acf_generic_indention_0, /* indent level */
740 acf_generic_group_offset, /* offset */
742 acf_group_name, /* name */
745 acf_group_setting_valid, /* has setting */
746 acf_group_setting_flag, /* flag for setting */
747 acf_group_setting_ptr /* pointer for setting */
750 /* F-Curve ------------------------------------------- */
752 /* name for fcurve entries */
753 static void acf_fcurve_name(bAnimListElem *ale, char *name)
755 getname_anim_fcurve(name, ale->id, ale->data);
758 /* check if some setting exists for this channel */
759 static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
761 FCurve *fcu= (FCurve *)ale->data;
765 case ACHANNEL_SETTING_EXPAND: /* F-Curves are not containers */
768 /* conditionally available */
769 case ACHANNEL_SETTING_PROTECT: /* Protection is only valid when there's keyframes */
773 return 0; // NOTE: in this special case, we need to draw ICON_ZOOMOUT
775 case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
776 return ((ac->sa) && (ac->sa->spacetype==SPACE_IPO));
778 /* always available */
784 /* get the appropriate flag(s) for the setting when it is valid */
785 static int acf_fcurve_setting_flag(int setting, short *neg)
787 /* clear extra return data first */
791 case ACHANNEL_SETTING_SELECT: /* selected */
792 return FCURVE_SELECTED;
794 case ACHANNEL_SETTING_MUTE: /* muted */
797 case ACHANNEL_SETTING_PROTECT: /* protected */
798 //*neg= 1; - if we change this to edtiability
799 return FCURVE_PROTECTED;
801 case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
802 return FCURVE_VISIBLE;
804 default: /* unsupported */
809 /* get pointer to the setting */
810 static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int setting, short *type)
812 FCurve *fcu= (FCurve *)ale->data;
814 /* all flags are just in agrp->flag for now... */
815 GET_ACF_FLAG_PTR(fcu->flag);
818 /* fcurve type define */
819 static bAnimChannelType ACF_FCURVE =
821 acf_generic_channel_backdrop, /* backdrop */
822 acf_generic_indention_flexible, /* indent level */ // xxx rename this to f-curves only?
823 acf_generic_group_offset, /* offset */
825 acf_fcurve_name, /* name */
828 acf_fcurve_setting_valid, /* has setting */
829 acf_fcurve_setting_flag, /* flag for setting */
830 acf_fcurve_setting_ptr /* pointer for setting */
833 /* Object Action Expander ------------------------------------------- */
835 // TODO: just get this from RNA?
836 static int acf_fillactd_icon(bAnimListElem *ale)
841 /* check if some setting exists for this channel */
842 static short acf_fillactd_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
845 /* only select and expand supported */
846 case ACHANNEL_SETTING_SELECT:
847 case ACHANNEL_SETTING_EXPAND:
855 /* get the appropriate flag(s) for the setting when it is valid */
856 static int acf_fillactd_setting_flag(int setting, short *neg)
858 /* clear extra return data first */
862 case ACHANNEL_SETTING_SELECT: /* selected */
863 return ADT_UI_SELECTED;
865 case ACHANNEL_SETTING_EXPAND: /* expanded */
867 return ACT_COLLAPSED;
869 default: /* unsupported */
874 /* get pointer to the setting */
875 static void *acf_fillactd_setting_ptr(bAnimListElem *ale, int setting, short *type)
877 bAction *act= (bAction *)ale->data;
878 AnimData *adt= ale->adt;
880 /* clear extra return data first */
884 case ACHANNEL_SETTING_SELECT: /* selected */
886 GET_ACF_FLAG_PTR(adt->flag);
891 case ACHANNEL_SETTING_EXPAND: /* expanded */
892 GET_ACF_FLAG_PTR(act->flag);
894 default: /* unsupported */
899 /* object action expander type define */
900 static bAnimChannelType ACF_FILLACTD =
902 acf_generic_dataexpand_backdrop,/* backdrop */
903 acf_generic_indention_1, /* indent level */
904 acf_generic_basic_offset, /* offset */
906 acf_generic_idblock_name, /* name */
907 acf_fillactd_icon, /* icon */
909 acf_fillactd_setting_valid, /* has setting */
910 acf_fillactd_setting_flag, /* flag for setting */
911 acf_fillactd_setting_ptr /* pointer for setting */
914 /* Drivers Expander ------------------------------------------- */
916 // TODO: just get this from RNA?
917 static int acf_filldrivers_icon(bAnimListElem *ale)
919 return ICON_ANIM_DATA;
922 static void acf_filldrivers_name(bAnimListElem *ale, char *name)
924 strcpy(name, "Drivers");
927 /* check if some setting exists for this channel */
928 // TODO: this could be made more generic
929 static short acf_filldrivers_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
932 /* only expand supported */
933 case ACHANNEL_SETTING_EXPAND:
941 /* get the appropriate flag(s) for the setting when it is valid */
942 static int acf_filldrivers_setting_flag(int setting, short *neg)
944 /* clear extra return data first */
948 case ACHANNEL_SETTING_EXPAND: /* expanded */
950 return ADT_DRIVERS_COLLAPSED;
952 default: /* unsupported */
957 /* get pointer to the setting */
958 static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, int setting, short *type)
960 AnimData *adt= (AnimData *)ale->data;
962 /* clear extra return data first */
966 case ACHANNEL_SETTING_EXPAND: /* expanded */
967 GET_ACF_FLAG_PTR(adt->flag);
969 default: /* unsupported */
974 /* drivers expander type define */
975 static bAnimChannelType ACF_FILLDRIVERS =
977 acf_generic_dataexpand_backdrop,/* backdrop */
978 acf_generic_indention_1, /* indent level */
979 acf_generic_basic_offset, /* offset */
981 acf_filldrivers_name, /* name */
982 acf_filldrivers_icon, /* icon */
984 acf_filldrivers_setting_valid, /* has setting */
985 acf_filldrivers_setting_flag, /* flag for setting */
986 acf_filldrivers_setting_ptr /* pointer for setting */
989 /* Materials Expander ------------------------------------------- */
991 // TODO: just get this from RNA?
992 static int acf_fillmatd_icon(bAnimListElem *ale)
994 return ICON_MATERIAL_DATA;
997 static void acf_fillmatd_name(bAnimListElem *ale, char *name)
999 strcpy(name, "Materials");
1002 /* get the appropriate flag(s) for the setting when it is valid */
1003 static int acf_fillmatd_setting_flag(int setting, short *neg)
1005 /* clear extra return data first */
1009 case ACHANNEL_SETTING_EXPAND: /* expanded */
1010 return OB_ADS_SHOWMATS;
1012 default: /* unsupported */
1017 /* materials expander type define */
1018 static bAnimChannelType ACF_FILLMATD=
1020 acf_generic_dataexpand_backdrop,/* backdrop */
1021 acf_generic_indention_1, /* indent level */
1022 acf_generic_basic_offset, /* offset */
1024 acf_fillmatd_name, /* name */
1025 acf_fillmatd_icon, /* icon */
1027 acf_generic_dsexpand_setting_valid, /* has setting */
1028 acf_fillmatd_setting_flag, /* flag for setting */
1029 acf_generic_dsexpand_setting_ptr /* pointer for setting */
1032 /* Particles Expander ------------------------------------------- */
1034 // TODO: just get this from RNA?
1035 static int acf_fillpartd_icon(bAnimListElem *ale)
1037 return ICON_PARTICLE_DATA;
1040 static void acf_fillpartd_name(bAnimListElem *ale, char *name)
1042 strcpy(name, "Particles");
1045 /* get the appropriate flag(s) for the setting when it is valid */
1046 static int acf_fillpartd_setting_flag(int setting, short *neg)
1048 /* clear extra return data first */
1052 case ACHANNEL_SETTING_EXPAND: /* expanded */
1053 return OB_ADS_SHOWPARTS;
1055 default: /* unsupported */
1060 /* particles expander type define */
1061 static bAnimChannelType ACF_FILLPARTD=
1063 acf_generic_dataexpand_backdrop,/* backdrop */
1064 acf_generic_indention_1, /* indent level */
1065 acf_generic_basic_offset, /* offset */
1067 acf_fillpartd_name, /* name */
1068 acf_fillpartd_icon, /* icon */
1070 acf_generic_dsexpand_setting_valid, /* has setting */
1071 acf_fillpartd_setting_flag, /* flag for setting */
1072 acf_generic_dsexpand_setting_ptr /* pointer for setting */
1075 /* Material Expander ------------------------------------------- */
1077 // TODO: just get this from RNA?
1078 static int acf_dsmat_icon(bAnimListElem *ale)
1080 return ICON_MATERIAL_DATA;
1083 /* offset for material expanders */
1084 static short acf_dsmat_offset(bAnimContext *ac, bAnimListElem *ale)
1089 /* get the appropriate flag(s) for the setting when it is valid */
1090 static int acf_dsmat_setting_flag(int setting, short *neg)
1092 /* clear extra return data first */
1096 case ACHANNEL_SETTING_EXPAND: /* expanded */
1097 return MA_DS_EXPAND;
1099 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1100 return ADT_NLA_EVAL_OFF;
1102 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1104 return ADT_CURVES_NOT_VISIBLE;
1106 case ACHANNEL_SETTING_SELECT: /* selected */
1107 return ADT_UI_SELECTED;
1109 default: /* unsupported */
1114 /* get pointer to the setting */
1115 static void *acf_dsmat_setting_ptr(bAnimListElem *ale, int setting, short *type)
1117 Material *ma= (Material *)ale->data;
1119 /* clear extra return data first */
1123 case ACHANNEL_SETTING_EXPAND: /* expanded */
1124 GET_ACF_FLAG_PTR(ma->flag);
1126 case ACHANNEL_SETTING_SELECT: /* selected */
1127 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1128 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1130 GET_ACF_FLAG_PTR(ma->adt->flag)
1134 default: /* unsupported */
1139 /* material expander type define */
1140 static bAnimChannelType ACF_DSMAT=
1142 acf_generic_channel_backdrop, /* backdrop */
1143 acf_generic_indention_0, /* indent level */
1144 acf_dsmat_offset, /* offset */
1146 acf_generic_idblock_name, /* name */
1147 acf_dsmat_icon, /* icon */
1149 acf_generic_dataexpand_setting_valid, /* has setting */
1150 acf_dsmat_setting_flag, /* flag for setting */
1151 acf_dsmat_setting_ptr /* pointer for setting */
1154 /* Lamp Expander ------------------------------------------- */
1156 // TODO: just get this from RNA?
1157 static int acf_dslam_icon(bAnimListElem *ale)
1159 return ICON_LAMP_DATA;
1162 /* get the appropriate flag(s) for the setting when it is valid */
1163 static int acf_dslam_setting_flag(int setting, short *neg)
1165 /* clear extra return data first */
1169 case ACHANNEL_SETTING_EXPAND: /* expanded */
1170 return LA_DS_EXPAND;
1172 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1173 return ADT_NLA_EVAL_OFF;
1175 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1177 return ADT_CURVES_NOT_VISIBLE;
1179 case ACHANNEL_SETTING_SELECT: /* selected */
1180 return ADT_UI_SELECTED;
1182 default: /* unsupported */
1187 /* get pointer to the setting */
1188 static void *acf_dslam_setting_ptr(bAnimListElem *ale, int setting, short *type)
1190 Lamp *la= (Lamp *)ale->data;
1192 /* clear extra return data first */
1196 case ACHANNEL_SETTING_EXPAND: /* expanded */
1197 GET_ACF_FLAG_PTR(la->flag);
1199 case ACHANNEL_SETTING_SELECT: /* selected */
1200 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1201 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1203 GET_ACF_FLAG_PTR(la->adt->flag)
1207 default: /* unsupported */
1212 /* lamp expander type define */
1213 static bAnimChannelType ACF_DSLAM=
1215 acf_generic_dataexpand_backdrop,/* backdrop */
1216 acf_generic_indention_1, /* indent level */
1217 acf_generic_basic_offset, /* offset */
1219 acf_generic_idblock_name, /* name */
1220 acf_dslam_icon, /* icon */
1222 acf_generic_dataexpand_setting_valid, /* has setting */
1223 acf_dslam_setting_flag, /* flag for setting */
1224 acf_dslam_setting_ptr /* pointer for setting */
1227 /* Camera Expander ------------------------------------------- */
1229 // TODO: just get this from RNA?
1230 static int acf_dscam_icon(bAnimListElem *ale)
1232 return ICON_CAMERA_DATA;
1235 /* get the appropriate flag(s) for the setting when it is valid */
1236 static int acf_dscam_setting_flag(int setting, short *neg)
1238 /* clear extra return data first */
1242 case ACHANNEL_SETTING_EXPAND: /* expanded */
1243 return CAM_DS_EXPAND;
1245 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1246 return ADT_NLA_EVAL_OFF;
1248 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1250 return ADT_CURVES_NOT_VISIBLE;
1252 case ACHANNEL_SETTING_SELECT: /* selected */
1253 return ADT_UI_SELECTED;
1255 default: /* unsupported */
1260 /* get pointer to the setting */
1261 static void *acf_dscam_setting_ptr(bAnimListElem *ale, int setting, short *type)
1263 Camera *ca= (Camera *)ale->data;
1265 /* clear extra return data first */
1269 case ACHANNEL_SETTING_EXPAND: /* expanded */
1270 GET_ACF_FLAG_PTR(ca->flag);
1272 case ACHANNEL_SETTING_SELECT: /* selected */
1273 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1274 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1276 GET_ACF_FLAG_PTR(ca->adt->flag)
1280 default: /* unsupported */
1285 /* camera expander type define */
1286 static bAnimChannelType ACF_DSCAM=
1288 acf_generic_dataexpand_backdrop,/* backdrop */
1289 acf_generic_indention_1, /* indent level */
1290 acf_generic_basic_offset, /* offset */
1292 acf_generic_idblock_name, /* name */
1293 acf_dscam_icon, /* icon */
1295 acf_generic_dataexpand_setting_valid, /* has setting */
1296 acf_dscam_setting_flag, /* flag for setting */
1297 acf_dscam_setting_ptr /* pointer for setting */
1300 /* Curve Expander ------------------------------------------- */
1302 // TODO: just get this from RNA?
1303 static int acf_dscur_icon(bAnimListElem *ale)
1305 return ICON_CURVE_DATA;
1308 /* get the appropriate flag(s) for the setting when it is valid */
1309 static int acf_dscur_setting_flag(int setting, short *neg)
1311 /* clear extra return data first */
1315 case ACHANNEL_SETTING_EXPAND: /* expanded */
1316 return CU_DS_EXPAND;
1318 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1319 return ADT_NLA_EVAL_OFF;
1321 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1323 return ADT_CURVES_NOT_VISIBLE;
1325 case ACHANNEL_SETTING_SELECT: /* selected */
1326 return ADT_UI_SELECTED;
1328 default: /* unsupported */
1333 /* get pointer to the setting */
1334 static void *acf_dscur_setting_ptr(bAnimListElem *ale, int setting, short *type)
1336 Curve *cu= (Curve *)ale->data;
1338 /* clear extra return data first */
1342 case ACHANNEL_SETTING_EXPAND: /* expanded */
1343 GET_ACF_FLAG_PTR(cu->flag);
1345 case ACHANNEL_SETTING_SELECT: /* selected */
1346 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1347 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1349 GET_ACF_FLAG_PTR(cu->adt->flag)
1353 default: /* unsupported */
1358 /* curve expander type define */
1359 static bAnimChannelType ACF_DSCUR=
1361 acf_generic_dataexpand_backdrop,/* backdrop */
1362 acf_generic_indention_1, /* indent level */
1363 acf_generic_basic_offset, /* offset */
1365 acf_generic_idblock_name, /* name */
1366 acf_dscur_icon, /* icon */
1368 acf_generic_dataexpand_setting_valid, /* has setting */
1369 acf_dscur_setting_flag, /* flag for setting */
1370 acf_dscur_setting_ptr /* pointer for setting */
1373 /* Shape Key Expander ------------------------------------------- */
1375 // TODO: just get this from RNA?
1376 static int acf_dsskey_icon(bAnimListElem *ale)
1378 return ICON_SHAPEKEY_DATA;
1381 /* get the appropriate flag(s) for the setting when it is valid */
1382 static int acf_dsskey_setting_flag(int setting, short *neg)
1384 /* clear extra return data first */
1388 case ACHANNEL_SETTING_EXPAND: /* expanded */
1389 return KEYBLOCK_DS_EXPAND;
1391 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1392 return ADT_NLA_EVAL_OFF;
1394 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1396 return ADT_CURVES_NOT_VISIBLE;
1398 case ACHANNEL_SETTING_SELECT: /* selected */
1399 return ADT_UI_SELECTED;
1401 default: /* unsupported */
1406 /* get pointer to the setting */
1407 static void *acf_dsskey_setting_ptr(bAnimListElem *ale, int setting, short *type)
1409 Key *key= (Key *)ale->data;
1411 /* clear extra return data first */
1415 case ACHANNEL_SETTING_EXPAND: /* expanded */
1416 GET_ACF_FLAG_PTR(key->flag);
1418 case ACHANNEL_SETTING_SELECT: /* selected */
1419 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1420 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1422 GET_ACF_FLAG_PTR(key->adt->flag)
1426 default: /* unsupported */
1431 /* shapekey expander type define */
1432 static bAnimChannelType ACF_DSSKEY=
1434 acf_generic_dataexpand_backdrop,/* backdrop */
1435 acf_generic_indention_1, /* indent level */
1436 acf_generic_basic_offset, /* offset */
1438 acf_generic_idblock_name, /* name */
1439 acf_dsskey_icon, /* icon */
1441 acf_generic_dataexpand_setting_valid, /* has setting */
1442 acf_dsskey_setting_flag, /* flag for setting */
1443 acf_dsskey_setting_ptr /* pointer for setting */
1446 /* World Expander ------------------------------------------- */
1448 // TODO: just get this from RNA?
1449 static int acf_dswor_icon(bAnimListElem *ale)
1451 return ICON_WORLD_DATA;
1454 /* get the appropriate flag(s) for the setting when it is valid */
1455 static int acf_dswor_setting_flag(int setting, short *neg)
1457 /* clear extra return data first */
1461 case ACHANNEL_SETTING_EXPAND: /* expanded */
1462 return WO_DS_EXPAND;
1464 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1465 return ADT_NLA_EVAL_OFF;
1467 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1469 return ADT_CURVES_NOT_VISIBLE;
1471 case ACHANNEL_SETTING_SELECT: /* selected */
1472 return ADT_UI_SELECTED;
1474 default: /* unsupported */
1479 /* get pointer to the setting */
1480 static void *acf_dswor_setting_ptr(bAnimListElem *ale, int setting, short *type)
1482 World *wo= (World *)ale->data;
1484 /* clear extra return data first */
1488 case ACHANNEL_SETTING_EXPAND: /* expanded */
1489 GET_ACF_FLAG_PTR(wo->flag);
1491 case ACHANNEL_SETTING_SELECT: /* selected */
1492 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1493 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1495 GET_ACF_FLAG_PTR(wo->adt->flag)
1499 default: /* unsupported */
1504 /* world expander type define */
1505 static bAnimChannelType ACF_DSWOR=
1507 acf_generic_dataexpand_backdrop,/* backdrop */
1508 acf_generic_indention_1, /* indent level */
1509 acf_generic_basic_offset, /* offset */
1511 acf_generic_idblock_name, /* name */
1512 acf_dswor_icon, /* icon */
1514 acf_generic_dataexpand_setting_valid, /* has setting */
1515 acf_dswor_setting_flag, /* flag for setting */
1516 acf_dswor_setting_ptr /* pointer for setting */
1519 /* Particle Expander ------------------------------------------- */
1521 // TODO: just get this from RNA?
1522 static int acf_dspart_icon(bAnimListElem *ale)
1524 return ICON_PARTICLE_DATA;
1527 /* get the appropriate flag(s) for the setting when it is valid */
1528 static int acf_dspart_setting_flag(int setting, short *neg)
1530 /* clear extra return data first */
1534 case ACHANNEL_SETTING_EXPAND: /* expanded */
1535 return PART_DS_EXPAND;
1537 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1538 return ADT_NLA_EVAL_OFF;
1540 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1542 return ADT_CURVES_NOT_VISIBLE;
1544 case ACHANNEL_SETTING_SELECT: /* selected */
1545 return ADT_UI_SELECTED;
1547 default: /* unsupported */
1552 /* get pointer to the setting */
1553 static void *acf_dspart_setting_ptr(bAnimListElem *ale, int setting, short *type)
1555 ParticleSettings *part= (ParticleSettings *)ale->data;
1557 /* clear extra return data first */
1561 case ACHANNEL_SETTING_EXPAND: /* expanded */
1562 GET_ACF_FLAG_PTR(part->flag);
1564 case ACHANNEL_SETTING_SELECT: /* selected */
1565 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1566 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1568 GET_ACF_FLAG_PTR(part->adt->flag)
1572 default: /* unsupported */
1577 /* particle expander type define */
1578 static bAnimChannelType ACF_DSPART=
1580 acf_generic_dataexpand_backdrop,/* backdrop */
1581 acf_generic_indention_1, /* indent level */
1582 acf_generic_basic_offset, /* offset */
1584 acf_generic_idblock_name, /* name */
1585 acf_dspart_icon, /* icon */
1587 acf_generic_dataexpand_setting_valid, /* has setting */
1588 acf_dspart_setting_flag, /* flag for setting */
1589 acf_dspart_setting_ptr /* pointer for setting */
1592 /* MetaBall Expander ------------------------------------------- */
1594 // TODO: just get this from RNA?
1595 static int acf_dsmball_icon(bAnimListElem *ale)
1597 return ICON_META_DATA;
1600 /* get the appropriate flag(s) for the setting when it is valid */
1601 static int acf_dsmball_setting_flag(int setting, short *neg)
1603 /* clear extra return data first */
1607 case ACHANNEL_SETTING_EXPAND: /* expanded */
1608 return MB_DS_EXPAND;
1610 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1611 return ADT_NLA_EVAL_OFF;
1613 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1615 return ADT_CURVES_NOT_VISIBLE;
1617 case ACHANNEL_SETTING_SELECT: /* selected */
1618 return ADT_UI_SELECTED;
1620 default: /* unsupported */
1625 /* get pointer to the setting */
1626 static void *acf_dsmball_setting_ptr(bAnimListElem *ale, int setting, short *type)
1628 MetaBall *mb= (MetaBall *)ale->data;
1630 /* clear extra return data first */
1634 case ACHANNEL_SETTING_EXPAND: /* expanded */
1635 GET_ACF_FLAG_PTR(mb->flag);
1637 case ACHANNEL_SETTING_SELECT: /* selected */
1638 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1639 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1641 GET_ACF_FLAG_PTR(mb->adt->flag)
1645 default: /* unsupported */
1650 /* metaball expander type define */
1651 static bAnimChannelType ACF_DSMBALL=
1653 acf_generic_dataexpand_backdrop,/* backdrop */
1654 acf_generic_indention_1, /* indent level */
1655 acf_generic_basic_offset, /* offset */
1657 acf_generic_idblock_name, /* name */
1658 acf_dsmball_icon, /* icon */
1660 acf_generic_dataexpand_setting_valid, /* has setting */
1661 acf_dsmball_setting_flag, /* flag for setting */
1662 acf_dsmball_setting_ptr /* pointer for setting */
1665 /* Armature Expander ------------------------------------------- */
1667 // TODO: just get this from RNA?
1668 static int acf_dsarm_icon(bAnimListElem *ale)
1670 return ICON_ARMATURE_DATA;
1673 /* get the appropriate flag(s) for the setting when it is valid */
1674 static int acf_dsarm_setting_flag(int setting, short *neg)
1676 /* clear extra return data first */
1680 case ACHANNEL_SETTING_EXPAND: /* expanded */
1681 return ARM_DS_EXPAND;
1683 case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1684 return ADT_NLA_EVAL_OFF;
1686 case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1688 return ADT_CURVES_NOT_VISIBLE;
1690 case ACHANNEL_SETTING_SELECT: /* selected */
1691 return ADT_UI_SELECTED;
1693 default: /* unsupported */
1698 /* get pointer to the setting */
1699 static void *acf_dsarm_setting_ptr(bAnimListElem *ale, int setting, short *type)
1701 bArmature *arm= (bArmature *)ale->data;
1703 /* clear extra return data first */
1707 case ACHANNEL_SETTING_EXPAND: /* expanded */
1708 GET_ACF_FLAG_PTR(arm->flag);
1710 case ACHANNEL_SETTING_SELECT: /* selected */
1711 case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1712 case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1714 GET_ACF_FLAG_PTR(arm->adt->flag)
1718 default: /* unsupported */
1723 /* metaball expander type define */
1724 static bAnimChannelType ACF_DSARM=
1726 acf_generic_dataexpand_backdrop,/* backdrop */
1727 acf_generic_indention_1, /* indent level */
1728 acf_generic_basic_offset, /* offset */
1730 acf_generic_idblock_name, /* name */
1731 acf_dsarm_icon, /* icon */
1733 acf_generic_dataexpand_setting_valid, /* has setting */
1734 acf_dsarm_setting_flag, /* flag for setting */
1735 acf_dsarm_setting_ptr /* pointer for setting */
1739 /* ShapeKey Entry ------------------------------------------- */
1740 // XXX ... this is currently obsolete...
1743 static void dummy_olddraw_shapekeys ()
1745 case ANIMTYPE_SHAPEKEY: /* shapekey channel */
1747 KeyBlock *kb = (KeyBlock *)ale->data;
1752 offset= (ale->id) ? 21 : 0;
1754 if (kb->name[0] == '\0')
1755 sprintf(name, "Key %d", ale->index);
1757 strcpy(name, kb->name);
1763 /* Grease Pencil entries ------------------------------------------- */
1764 // XXX ... this is currently not restored yet
1767 static void dummy_olddraw_gpencil ()
1769 /* determine what needs to be drawn */
1770 switch (ale->type) {
1771 case ANIMTYPE_GPDATABLOCK: /* gpencil datablock */
1773 bGPdata *gpd = (bGPdata *)ale->data;
1774 ScrArea *sa = (ScrArea *)ale->owner;
1779 /* only show expand if there are any channels */
1780 if (gpd->layers.first) {
1781 if (gpd->flag & GP_DATA_EXPAND)
1782 expand = ICON_TRIA_DOWN;
1784 expand = ICON_TRIA_RIGHT;
1787 switch (sa->spacetype) {
1790 /* this shouldn't cause any overflow... */
1791 //sprintf(name, "3DView:%s", view3d_get_name(sa->spacedata.first)); // XXX missing func..
1792 strcpy(name, "3dView");
1793 special= ICON_VIEW3D;
1798 SpaceNode *snode= sa->spacedata.first;
1801 if (snode->treetype == 1)
1802 strcpy(treetype, "Composite");
1804 strcpy(treetype, "Material");
1805 sprintf(name, "Nodes:%s", treetype);
1812 SpaceSeq *sseq= sa->spacedata.first;
1813 char imgpreview[10];
1815 switch (sseq->mainb) {
1816 case 1: sprintf(imgpreview, "Image..."); break;
1817 case 2: sprintf(imgpreview, "Luma..."); break;
1818 case 3: sprintf(imgpreview, "Chroma..."); break;
1819 case 4: sprintf(imgpreview, "Histogram"); break;
1821 default: sprintf(imgpreview, "Sequence"); break;
1823 sprintf(name, "Sequencer:%s", imgpreview);
1825 special= ICON_SEQUENCE;
1830 SpaceImage *sima= sa->spacedata.first;
1833 sprintf(name, "Image:%s", sima->image->id.name+2);
1835 strcpy(name, "Image:<None>");
1837 special= ICON_IMAGE_COL;
1843 sprintf(name, "<Unknown GP-Data Source>");
1850 case ANIMTYPE_GPLAYER: /* gpencil layer */
1852 bGPDlayer *gpl = (bGPDlayer *)ale->data;
1859 if (EDITABLE_GPL(gpl))
1860 protect = ICON_UNLOCKED;
1862 protect = ICON_LOCKED;
1864 if (gpl->flag & GP_LAYER_HIDE)
1865 mute = ICON_MUTE_IPO_ON;
1867 mute = ICON_MUTE_IPO_OFF;
1870 BLI_snprintf(name, 32, gpl->info);
1876 /* only for gp-data channels */
1877 UI_ThemeColorShade(TH_GROUP, 20);
1878 uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
1879 gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
1884 /* *********************************************** */
1885 /* Type Registration and General Access */
1887 /* These globals only ever get directly accessed in this file */
1888 static bAnimChannelType *animchannelTypeInfo[ANIMTYPE_NUM_TYPES];
1889 static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */
1891 /* Initialise type info definitions */
1892 void ANIM_init_channel_typeinfo_data (void)
1896 /* start initialising if necessary... */
1900 animchannelTypeInfo[type++]= NULL; /* None */
1901 animchannelTypeInfo[type++]= NULL; /* AnimData */
1902 animchannelTypeInfo[type++]= NULL; /* Special */
1904 animchannelTypeInfo[type++]= &ACF_SUMMARY; /* Motion Summary */
1906 animchannelTypeInfo[type++]= &ACF_SCENE; /* Scene */
1907 animchannelTypeInfo[type++]= &ACF_OBJECT; /* Object */
1908 animchannelTypeInfo[type++]= &ACF_GROUP; /* Group */
1909 animchannelTypeInfo[type++]= &ACF_FCURVE; /* F-Curve */
1911 animchannelTypeInfo[type++]= &ACF_FILLACTD; /* Object Action Expander */
1912 animchannelTypeInfo[type++]= &ACF_FILLDRIVERS; /* Drivers Expander */
1913 animchannelTypeInfo[type++]= &ACF_FILLMATD; /* Materials Expander */
1914 animchannelTypeInfo[type++]= &ACF_FILLPARTD; /* Particles Expander */
1916 animchannelTypeInfo[type++]= &ACF_DSMAT; /* Material Channel */
1917 animchannelTypeInfo[type++]= &ACF_DSLAM; /* Lamp Channel */
1918 animchannelTypeInfo[type++]= &ACF_DSCAM; /* Camera Channel */
1919 animchannelTypeInfo[type++]= &ACF_DSCUR; /* Curve Channel */
1920 animchannelTypeInfo[type++]= &ACF_DSSKEY; /* ShapeKey Channel */
1921 animchannelTypeInfo[type++]= &ACF_DSWOR; /* World Channel */
1922 animchannelTypeInfo[type++]= &ACF_DSPART; /* Particle Channel */
1923 animchannelTypeInfo[type++]= &ACF_DSMBALL; /* MetaBall Channel */
1924 animchannelTypeInfo[type++]= &ACF_DSARM; /* Armature Channel */
1926 animchannelTypeInfo[type++]= NULL; /* ShapeKey */ // XXX this is no longer used for now...
1928 // XXX not restored yet
1929 animchannelTypeInfo[type++]= NULL; /* Grease Pencil Datablock */
1930 animchannelTypeInfo[type++]= NULL; /* Grease Pencil Layer */
1932 // TODO: these types still need to be implemented!!!
1933 // probably need a few extra flags for these special cases...
1934 animchannelTypeInfo[type++]= NULL; /* NLA Track */
1935 animchannelTypeInfo[type++]= NULL; /* NLA Action */
1939 /* Get type info from given channel type */
1940 bAnimChannelType *ANIM_channel_get_typeinfo (bAnimListElem *ale)
1946 /* init the typeinfo if not available yet... */
1947 ANIM_init_channel_typeinfo_data();
1949 /* check if type is in bounds... */
1950 if ((ale->type >= 0) && (ale->type < ANIMTYPE_NUM_TYPES))
1951 return animchannelTypeInfo[ale->type];
1956 /* --------------------------- */
1958 /* Check if some setting for a channel is enabled
1959 * Returns: 1 = On, 0 = Off, -1 = Invalid
1961 short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int setting)
1963 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
1965 /* 1) check that the setting exists for the current context */
1966 if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
1968 /* 2) get pointer to check for flag in, and the flag to check for */
1969 short negflag, ptrsize;
1973 flag= acf->setting_flag(setting, &negflag);
1974 ptr= acf->setting_ptr(ale, setting, &ptrsize);
1976 /* check if flag is enabled */
1979 case sizeof(int): /* integer pointer for setting */
1981 int *val= (int *)ptr;
1984 return ((*val) & flag) == 0;
1986 return ((*val) & flag) != 0;
1990 case sizeof(short): /* short pointer for setting */
1992 short *val= (short *)ptr;
1995 return ((*val) & flag) == 0;
1997 return ((*val) & flag) != 0;
2001 case sizeof(char): /* char pointer for setting */
2003 char *val= (char *)ptr;
2006 return ((*val) & flag) == 0;
2008 return ((*val) & flag) != 0;
2020 /* quick macro for use in ANIM_channel_setting_set - set flag for setting according the mode given */
2021 #define ACF_SETTING_SET(sval, sflag, smode) \
2024 if (smode == ACHANNEL_SETFLAG_TOGGLE) (sval) ^= (sflag); \
2025 else if (smode == ACHANNEL_SETFLAG_ADD) (sval) &= ~(sflag); \
2026 else (sval) |= (sflag); \
2029 if (smode == ACHANNEL_SETFLAG_TOGGLE) (sval) ^= (sflag); \
2030 else if (smode == ACHANNEL_SETFLAG_ADD) (sval) |= (sflag); \
2031 else (sval) &= ~(sflag); \
2035 /* Change value of some setting for a channel
2036 * - setting: eAnimChannel_Settings
2037 * - mode: eAnimChannels_SetFlag
2039 void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting, short mode)
2041 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
2043 /* 1) check that the setting exists for the current context */
2044 if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
2046 /* 2) get pointer to check for flag in, and the flag to check for */
2047 short negflag, ptrsize;
2051 flag= acf->setting_flag(setting, &negflag);
2052 ptr= acf->setting_ptr(ale, setting, &ptrsize);
2054 /* check if flag is enabled */
2057 case sizeof(int): /* integer pointer for setting */
2059 int *val= (int *)ptr;
2060 ACF_SETTING_SET(*val, flag, mode);
2064 case sizeof(short): /* short pointer for setting */
2066 short *val= (short *)ptr;
2067 ACF_SETTING_SET(*val, flag, mode);
2071 case sizeof(char): /* char pointer for setting */
2073 char *val= (char *)ptr;
2074 ACF_SETTING_SET(*val, flag, mode);
2082 /* --------------------------- */
2084 // XXX hardcoded size of icons
2085 #define ICON_WIDTH 17
2086 // XXX hardcoded width of sliders
2087 #define SLIDER_WIDTH 70
2089 /* Draw the given channel */
2090 // TODO: make this use UI controls for the buttons
2091 void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
2093 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
2094 short selected, offset;
2095 float y, ymid, ytext;
2097 /* sanity checks - don't draw anything */
2098 if ELEM(NULL, acf, ale)
2101 /* get initial offset */
2102 if (acf->get_offset)
2103 offset= acf->get_offset(ac, ale);
2107 /* calculate appropriate y-coordinates for icon buttons
2108 * 7 is hardcoded factor for half-height of icons
2110 y= (ymaxc - yminc)/2 + yminc;
2112 /* y-coordinates for text is only 4 down from middle */
2115 /* check if channel is selected */
2116 if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
2117 selected= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
2121 /* set blending again, as may not be set in previous step */
2122 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2125 /* step 1) draw backdrop ........................................... */
2126 if (acf->draw_backdrop)
2127 acf->draw_backdrop(ac, ale, yminc, ymaxc);
2129 /* step 2) draw expand widget ....................................... */
2130 if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
2131 /* just skip - drawn as widget now */
2132 offset += ICON_WIDTH;
2135 /* step 3) draw icon ............................................... */
2137 UI_icon_draw(offset, ymid, acf->icon(ale));
2138 offset += ICON_WIDTH;
2141 /* step 4) draw special toggles .................................
2142 * - in Graph Editor, checkboxes for visibility in curves area
2143 * - in NLA Editor, glowing dots for solo/not solo...
2146 if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
2147 /* for F-Curves, draw color-preview of curve behind checkbox */
2148 if (ale->type == ANIMTYPE_FCURVE) {
2149 FCurve *fcu= (FCurve *)ale->data;
2151 /* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever
2152 * color the curve has stored
2154 glColor3fv(fcu->color);
2156 /* just a solid color rect
2157 * hardcoded 17 pixels width is slightly wider than icon width, so that
2158 * there's a slight border around it
2160 glRectf(offset, yminc, offset+17, ymaxc);
2163 /* icon is drawn as widget now... */
2164 offset += ICON_WIDTH;
2166 else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
2167 /* just skip - drawn as widget now */
2168 offset += ICON_WIDTH;
2172 /* step 5) draw name ............................................... */
2174 char name[256]; /* hopefully this will be enough! */
2176 /* set text color */
2178 UI_ThemeColor(TH_TEXT_HI);
2180 UI_ThemeColor(TH_TEXT);
2183 acf->name(ale, name);
2186 UI_DrawString(offset, ytext, name);
2190 /* ------------------ */
2192 /* callback for (normal) widget settings - send notifiers */
2193 static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2)
2195 WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
2198 /* callback for widget sliders - insert keyframes */
2199 static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
2201 ID *id= (ID *)id_poin;
2202 FCurve *fcu= (FCurve *)fcu_poin;
2204 Scene *scene= CTX_data_scene(C);
2205 PointerRNA id_ptr, ptr;
2207 short flag=0, done=0;
2210 /* get current frame */
2211 // NOTE: this will do for now...
2214 /* get flags for keyframing */
2215 if (IS_AUTOKEY_FLAG(INSERTNEEDED))
2216 flag |= INSERTKEY_NEEDED;
2217 if (IS_AUTOKEY_FLAG(AUTOMATKEY))
2218 flag |= INSERTKEY_MATRIX;
2219 if (IS_AUTOKEY_MODE(scene, EDITKEYS))
2220 flag |= INSERTKEY_REPLACE;
2223 /* get RNA pointer, and resolve the path */
2224 RNA_id_pointer_create(id, &id_ptr);
2226 /* try to resolve the path stored in the F-Curve */
2227 if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
2228 /* set the special 'replace' flag if on a keyframe */
2229 if (fcurve_frame_has_keyframe(fcu, cfra, 0))
2230 flag |= INSERTKEY_REPLACE;
2232 /* insert a keyframe for this F-Curve */
2233 done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
2236 WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
2242 /* Draw a widget for some setting */
2243 static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting)
2245 short negflag, ptrsize, enabled, butType;
2251 /* get the flag and the pointer to that flag */
2252 flag= acf->setting_flag(setting, &negflag);
2253 ptr= acf->setting_ptr(ale, setting, &ptrsize);
2254 enabled= ANIM_channel_setting_get(ac, ale, setting);
2256 /* get the base icon for the setting */
2258 case ACHANNEL_SETTING_VISIBLE: /* visibility checkboxes */
2259 //icon= ((enabled)? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT);
2260 icon= ICON_CHECKBOX_DEHLT;
2262 if (ale->type == ANIMTYPE_FCURVE)
2263 tooltip= "F-Curve is visible in Graph Editor for editing.";
2265 tooltip= "F-Curve(s) are visible in Graph Editor for editing.";
2268 case ACHANNEL_SETTING_EXPAND: /* expanded triangle */
2269 //icon= ((enabled)? ICON_TRIA_DOWN : ICON_TRIA_RIGHT);
2270 icon= ICON_TRIA_RIGHT;
2271 tooltip= "Make channels grouped under this channel visible.";
2274 case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */
2275 //icon= ((enabled)? ICON_LAYER_ACTIVE : ICON_LAYER_USED);
2276 icon= ICON_LAYER_USED;
2277 tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to.";
2282 case ACHANNEL_SETTING_PROTECT: /* protected lock */
2283 // TODO: what about when there's no protect needed?
2284 //icon= ((enabled)? ICON_LOCKED : ICON_UNLOCKED);
2285 icon= ICON_UNLOCKED;
2286 tooltip= "Editability of keyframes for this channel.";
2289 case ACHANNEL_SETTING_MUTE: /* muted eye */
2290 //icon= ((enabled)? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF);
2291 icon= ICON_MUTE_IPO_OFF;
2293 if (ale->type == ALE_FCURVE)
2294 tooltip= "Does F-Curve contribute to result.";
2296 tooltip= "Do channels contribute to result.";
2305 /* type of button */
2311 /* draw button for setting */
2314 case sizeof(int): /* integer pointer for setting */
2315 but= uiDefIconButBitI(block, butType, flag, 0, icon,
2316 xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
2319 case sizeof(short): /* short pointer for setting */
2320 but= uiDefIconButBitS(block, butType, flag, 0, icon,
2321 xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
2324 case sizeof(char): /* char pointer for setting */
2325 but= uiDefIconButBitC(block, butType, flag, 0, icon,
2326 xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
2330 /* set call to send relevant notifiers */
2331 // NOTE: for now, we only need to send 'edited'
2333 uiButSetFunc(but, achannel_setting_widget_cb, NULL, NULL);
2337 /* Draw UI widgets the given channel */
2338 // TODO: make this use UI controls for the buttons
2339 void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *block, float yminc, float ymaxc)
2341 bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
2342 View2D *v2d= &ac->ar->v2d;
2343 float y, ymid, ytext;
2346 /* sanity checks - don't draw anything */
2347 if ELEM3(NULL, acf, ale, block)
2350 /* get initial offset */
2351 if (acf->get_offset)
2352 offset= acf->get_offset(ac, ale);
2356 /* calculate appropriate y-coordinates for icon buttons
2357 * 7 is hardcoded factor for half-height of icons
2359 y= (ymaxc - yminc)/2 + yminc;
2361 /* y-coordinates for text is only 4 down from middle */
2364 /* no button backdrop behind icons */
2365 uiBlockSetEmboss(block, UI_EMBOSSN);
2367 /* step 1) draw expand widget ....................................... */
2368 if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
2369 draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_EXPAND);
2370 offset += ICON_WIDTH;
2373 /* step 2) draw icon ............................................... */
2375 /* icon is not drawn here (not a widget) */
2376 offset += ICON_WIDTH;
2379 /* step 3) draw special toggles .................................
2380 * - in Graph Editor, checkboxes for visibility in curves area
2381 * - in NLA Editor, glowing dots for solo/not solo...
2384 if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
2385 /* visibility toggle */
2386 draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_VISIBLE);
2387 offset += ICON_WIDTH;
2389 else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
2390 /* 'solo' setting for NLA Tracks */
2391 draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_SOLO);
2392 offset += ICON_WIDTH;
2396 /* step 4) draw text... */
2397 /* NOTE: this is not done here, since nothing to be clicked on... */
2399 /* step 5) draw mute+protection toggles + (sliders) ....................... */
2400 /* reset offset - now goes from RHS of panel */
2403 // TODO: when drawing sliders, make those draw instead of these toggles if not enough space
2406 short draw_sliders = 0;
2408 /* check if we need to show the sliders */
2409 if ((ac->sa) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_IPO)) {
2410 switch (ac->spacetype) {
2413 SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first;
2414 draw_sliders= (saction->flag & SACTION_SLIDERS);
2419 SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
2420 draw_sliders= (sipo->flag & SIPO_SLIDERS);
2426 /* check if there's enough space for the toggles if the sliders are drawn too */
2427 if ( !(draw_sliders) || ((v2d->mask.xmax-v2d->mask.xmin) > ACHANNEL_BUTTON_WIDTH/2) ) {
2429 if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
2430 offset += ICON_WIDTH;
2431 draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_PROTECT);
2434 if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) {
2435 offset += ICON_WIDTH;
2436 draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE);
2441 * - even if we can draw sliders for this view, we must also check that the channel-type supports them
2442 * (only only F-Curves really can support them for now)
2443 * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately,
2444 * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
2445 * and wouldn't be able to auto-keyframe...
2446 * - slider should start before the toggles (if they're visible) to keep a clean line down the side
2448 if ((draw_sliders) && (ale->type == ANIMTYPE_FCURVE)) {
2450 offset += SLIDER_WIDTH;
2452 /* need backdrop behind sliders... */
2453 uiBlockSetEmboss(block, UI_EMBOSS);
2455 if (ale->id) { /* Slider using RNA Access -------------------- */
2456 FCurve *fcu= (FCurve *)ale->data;
2457 PointerRNA id_ptr, ptr;
2460 /* get RNA pointer, and resolve the path */
2461 RNA_id_pointer_create(ale->id, &id_ptr);
2463 /* try to resolve the path */
2464 if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
2467 /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */
2468 but= uiDefAutoButR(block, &ptr, prop, fcu->array_index, "", 0, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc);
2469 uiButSetFunc(but, achannel_setting_slider_cb, ale->id, fcu);
2472 else { /* Special Slider for stuff without RNA Access ---------- */
2473 // TODO: only implement this case when we really need it...
2479 /* *********************************************** */