Blender  V2.93
anim_channels_defines.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
17  * All rights reserved.
18  */
19 
24 #include <stdio.h>
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "BLI_blenlib.h"
29 #include "BLI_math.h"
30 #include "BLI_utildefines.h"
31 
32 #include "BLT_translation.h"
33 
34 #include "DNA_anim_types.h"
35 #include "DNA_armature_types.h"
36 #include "DNA_cachefile_types.h"
37 #include "DNA_camera_types.h"
38 #include "DNA_gpencil_types.h"
39 #include "DNA_hair_types.h"
40 #include "DNA_key_types.h"
41 #include "DNA_lattice_types.h"
42 #include "DNA_light_types.h"
43 #include "DNA_linestyle_types.h"
44 #include "DNA_mask_types.h"
45 #include "DNA_material_types.h"
46 #include "DNA_mesh_types.h"
47 #include "DNA_meta_types.h"
48 #include "DNA_node_types.h"
49 #include "DNA_object_types.h"
50 #include "DNA_particle_types.h"
51 #include "DNA_pointcloud_types.h"
52 #include "DNA_scene_types.h"
53 #include "DNA_screen_types.h"
54 #include "DNA_simulation_types.h"
55 #include "DNA_space_types.h"
56 #include "DNA_speaker_types.h"
57 #include "DNA_userdef_types.h"
58 #include "DNA_volume_types.h"
59 #include "DNA_world_types.h"
60 
61 #include "RNA_access.h"
62 
63 #include "BKE_anim_data.h"
64 #include "BKE_animsys.h"
65 #include "BKE_context.h"
66 #include "BKE_curve.h"
67 #include "BKE_gpencil.h"
68 #include "BKE_key.h"
69 #include "BKE_main.h"
70 #include "BKE_nla.h"
71 
72 #include "GPU_immediate.h"
73 #include "GPU_state.h"
74 
75 #include "DEG_depsgraph.h"
76 
77 #include "UI_interface.h"
78 #include "UI_interface_icons.h"
79 #include "UI_resources.h"
80 #include "UI_view2d.h"
81 
82 #include "ED_anim_api.h"
83 #include "ED_keyframing.h"
84 
85 #include "WM_api.h"
86 #include "WM_types.h"
87 
88 /* *********************************************** */
89 /* XXX constant defines to be moved elsewhere? */
90 
91 /* extra padding for lengths (to go under scrollers) */
92 #define EXTRA_SCROLL_PAD 100.0f
93 
94 /* size of indent steps */
95 #define INDENT_STEP_SIZE (0.35f * U.widget_unit)
96 
97 /* size of string buffers used for animation channel displayed names */
98 #define ANIM_CHAN_NAME_SIZE 256
99 
100 /* get the pointer used for some flag */
101 #define GET_ACF_FLAG_PTR(ptr, type) ((*(type) = sizeof((ptr))), &(ptr))
102 
103 /* *********************************************** */
104 /* Generic Functions (Type independent) */
105 
106 /* Draw Backdrop ---------------------------------- */
107 
108 /* get backdrop color for top-level widgets (Scene and Object only) */
110  bAnimListElem *UNUSED(ale),
111  float r_color[3])
112 {
113  /* darker blue for top-level widgets */
115 }
116 
117 /* backdrop for top-level widgets (Scene and Object only) */
119  bAnimListElem *ale,
120  float yminc,
121  float ymaxc)
122 {
124  View2D *v2d = &ac->region->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;
127  float color[3];
128 
129  /* set backdrop drawing color */
130  acf->get_backdrop_color(ac, ale, color);
131 
132  /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
136  &(const rctf){
137  .xmin = offset,
138  .xmax = v2d->cur.xmax + EXTRA_SCROLL_PAD,
139  .ymin = yminc,
140  .ymax = ymaxc,
141  },
142  true,
143  8,
144  color,
145  1.0f);
146 }
147 
148 /* get backdrop color for data expanders under top-level Scene/Object */
150  bAnimListElem *UNUSED(ale),
151  float r_color[3])
152 {
153  /* lighter color than top-level widget */
155 }
156 
157 /* backdrop for data expanders under top-level Scene/Object */
159  bAnimListElem *ale,
160  float yminc,
161  float ymaxc)
162 {
164  View2D *v2d = &ac->region->v2d;
165  short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
166  float color[3];
167 
169 
170  /* set backdrop drawing color */
171  acf->get_backdrop_color(ac, ale, color);
172 
174  immUniformColor3fv(color);
175 
176  /* no rounded corner - just rectangular box */
177  immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
178 
180 }
181 
182 /* helper method to test if group colors should be drawn */
183 static bool acf_show_channel_colors(void)
184 {
185  return (U.animation_flag & USER_ANIM_SHOW_CHANNEL_GROUP_COLORS) != 0;
186 }
187 
188 /* get backdrop color for generic channels */
189 static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
190 {
192  bActionGroup *grp = NULL;
193  short indent = (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
194  bool showGroupColors = acf_show_channel_colors();
195 
196  if (ale->type == ANIMTYPE_FCURVE) {
197  FCurve *fcu = (FCurve *)ale->data;
198  grp = fcu->grp;
199  }
200 
201  /* set color for normal channels
202  * - use 3 shades of color group/standard color for 3 indention level
203  * - only use group colors if allowed to, and if actually feasible
204  */
205  if (showGroupColors && (grp) && (grp->customCol)) {
206  uchar cp[3];
207 
208  if (indent == 2) {
209  copy_v3_v3_uchar(cp, grp->cs.solid);
210  }
211  else if (indent == 1) {
212  copy_v3_v3_uchar(cp, grp->cs.select);
213  }
214  else {
215  copy_v3_v3_uchar(cp, grp->cs.active);
216  }
217 
218  /* copy the colors over, transforming from bytes to floats */
219  rgb_uchar_to_float(r_color, cp);
220  }
221  else {
222  /* FIXME: what happens when the indention is 1 greater than what it should be
223  * (due to grouping)? */
224  int colOfs = 10 - 10 * indent;
225  UI_GetThemeColorShade3fv(TH_SHADE2, colOfs, r_color);
226  }
227 }
228 
229 /* get backdrop color for grease pencil channels */
230 static void acf_gpencil_channel_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
231 {
233  short indent = (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
234  bool showGroupColors = acf_show_channel_colors();
235 
236  if ((showGroupColors) && (ale->type == ANIMTYPE_GPLAYER)) {
237  bGPDlayer *gpl = (bGPDlayer *)ale->data;
238  copy_v3_v3(r_color, gpl->color);
239  }
240  else {
241  int colOfs = 10 - 10 * indent;
242  UI_GetThemeColorShade3fv(TH_SHADE2, colOfs, r_color);
243  }
244 }
245 
246 /* backdrop for generic channels */
248  bAnimListElem *ale,
249  float yminc,
250  float ymaxc)
251 {
253  View2D *v2d = &ac->region->v2d;
254  short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
255  float color[3];
256 
258 
259  /* set backdrop drawing color */
260  acf->get_backdrop_color(ac, ale, color);
261 
263  immUniformColor3fv(color);
264 
265  /* no rounded corners - just rectangular box */
266  immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
267 
269 }
270 
271 /* Indention + Offset ------------------------------------------- */
272 
273 /* indention level is always the value in the name */
275 {
276  return 0;
277 }
279 {
280  return 1;
281 }
282 #if 0 /* XXX not used */
283 static short acf_generic_indention_2(bAnimContext *ac, bAnimListElem *ale)
284 {
285  return 2;
286 }
287 #endif
288 
289 /* indention which varies with the grouping status */
291 {
292  short indent = 0;
293 
294  /* grouped F-Curves need extra level of indention */
295  if (ale->type == ANIMTYPE_FCURVE) {
296  FCurve *fcu = (FCurve *)ale->data;
297 
298  /* TODO: we need some way of specifying that the indention color should be one less. */
299  if (fcu->grp) {
300  indent++;
301  }
302  }
303 
304  /* no indention */
305  return indent;
306 }
307 
308 /* basic offset for channels derived from indention */
310 {
312 
313  if (acf && acf->get_indent_level) {
314  return acf->get_indent_level(ac, ale) * INDENT_STEP_SIZE;
315  }
316  return 0;
317 }
318 
319 /* offset based on nodetree type */
321 {
322  if (ntree) {
323  switch (ntree->type) {
324  case NTREE_SHADER:
325  /* 1 additional level (i.e. is indented one level in from material,
326  * so shift all right by one step)
327  */
328  return INDENT_STEP_SIZE;
329 
330  case NTREE_COMPOSIT:
331  /* no additional levels needed */
332  return 0;
333 
334  case NTREE_TEXTURE:
335  /* 2 additional levels */
336  return INDENT_STEP_SIZE * 2;
337  }
338  }
339 
340  /* unknown */
341  return 0;
342 }
343 
344 /* offset for groups + grouped entities */
346 {
347  short offset = acf_generic_basic_offset(ac, ale);
348 
349  if (ale->id) {
350  /* texture animdata */
351  if (GS(ale->id->name) == ID_TE) {
352  offset += U.widget_unit;
353  }
354  /* materials and particles animdata */
355  else if (ELEM(GS(ale->id->name), ID_MA, ID_PA)) {
356  offset += (short)(0.7f * U.widget_unit);
357 
358  /* If not in Action Editor mode, action-groups (and their children)
359  * must carry some offset too. */
360  }
361  else if (ac->datatype != ANIMCONT_ACTION) {
362  offset += (short)(0.7f * U.widget_unit);
363  }
364 
365  /* nodetree animdata */
366  if (GS(ale->id->name) == ID_NT) {
367  offset += acf_nodetree_rootType_offset((bNodeTree *)ale->id);
368  }
369  }
370 
371  /* offset is just the normal type - i.e. based on indention */
372  return offset;
373 }
374 
375 /* Name ------------------------------------------- */
376 
377 /* name for ID block entries */
378 static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
379 {
380  ID *id = (ID *)ale->data; /* data pointed to should be an ID block */
381 
382  /* just copy the name... */
383  if (id && name) {
384  BLI_strncpy(name, id->name + 2, ANIM_CHAN_NAME_SIZE);
385  }
386 }
387 
388 /* name property for ID block entries */
390 {
393 
394  return (*prop != NULL);
395 }
396 
397 /* name property for ID block entries which are just subheading "fillers" */
399 {
400  /* actual ID we're representing is stored in ale->data not ale->id, as id gives the owner */
403 
404  return (*prop != NULL);
405 }
406 
407 /* Settings ------------------------------------------- */
408 
409 #if 0
410 /* channel type has no settings */
411 static bool acf_generic_none_setting_valid(bAnimContext *ac,
412  bAnimListElem *ale,
413  eAnimChannel_Settings setting)
414 {
415  return false;
416 }
417 #endif
418 
419 /* check if some setting exists for this object-based data-expander (datablock only) */
421  bAnimListElem *UNUSED(ale),
422  eAnimChannel_Settings setting)
423 {
424  switch (setting) {
425  /* expand is always supported */
427  return true;
428 
429  /* mute is only supported for NLA */
431  return ((ac) && (ac->spacetype == SPACE_NLA));
432 
433  /* Select is ok for most `ds*` channels (e.g. `dsmat`) */
435  return true;
436 
438  return true;
439 
440  /* other flags are never supported */
441  default:
442  return false;
443  }
444 }
445 
446 /* *********************************************** */
447 /* Type Specific Functions + Defines */
448 
449 /* Animation Summary ----------------------------------- */
450 
451 /* get backdrop color for summary widget */
453  bAnimListElem *UNUSED(ale),
454  float r_color[3])
455 {
456  /* reddish color - same as the 'action' line in NLA */
458 }
459 
460 /* backdrop for summary widget */
461 static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
462 {
464  View2D *v2d = &ac->region->v2d;
465  float color[3];
466 
467  /* set backdrop drawing color */
468  acf->get_backdrop_color(ac, ale, color);
469 
470  /* rounded corners on LHS only
471  * - top and bottom
472  * - special hack: make the top a bit higher, since we are first...
473  */
476  &(const rctf){
477  .xmin = 0,
478  .xmax = v2d->cur.xmax + EXTRA_SCROLL_PAD,
479  .ymin = yminc - 2,
480  .ymax = ymaxc,
481  },
482  true,
483  8,
484  color,
485  1.0f);
486 }
487 
488 /* name for summary entries */
489 static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name)
490 {
491  if (name) {
492  BLI_strncpy(name, IFACE_("Summary"), ANIM_CHAN_NAME_SIZE);
493  }
494 }
495 
496 /* check if some setting exists for this channel */
498  bAnimListElem *UNUSED(ale),
499  eAnimChannel_Settings setting)
500 {
501  /* only expanded is supported, as it is used for hiding all stuff which the summary covers */
502  return (setting == ACHANNEL_SETTING_EXPAND);
503 }
504 
505 /* get the appropriate flag(s) for the setting when it is valid */
507  eAnimChannel_Settings setting,
508  bool *neg)
509 {
510  if (setting == ACHANNEL_SETTING_EXPAND) {
511  /* expanded */
512  *neg = true;
514  }
515 
516  /* unsupported */
517  *neg = false;
518  return 0;
519 }
520 
521 /* get pointer to the setting */
523  eAnimChannel_Settings setting,
524  short *type)
525 {
526  bAnimContext *ac = (bAnimContext *)ale->data;
527 
528  /* if data is valid, return pointer to active dopesheet's relevant flag
529  * - this is restricted to DopeSheet/Action Editor only
530  */
531  if ((ac->sl) && (ac->spacetype == SPACE_ACTION) && (setting == ACHANNEL_SETTING_EXPAND)) {
532  SpaceAction *saction = (SpaceAction *)ac->sl;
533  bDopeSheet *ads = &saction->ads;
534 
535  /* return pointer to DopeSheet's flag */
536  return GET_ACF_FLAG_PTR(ads->flag, type);
537  }
538 
539  /* can't return anything useful - unsupported */
540  *type = 0;
541  return NULL;
542 }
543 
544 /* all animation summary (DopeSheet only) type define */
546  "Summary", /* type name */
547  ACHANNEL_ROLE_EXPANDER, /* role */
548 
549  acf_summary_color, /* backdrop color */
550  acf_summary_backdrop, /* backdrop */
551  acf_generic_indention_0, /* indent level */
552  NULL, /* offset */
553 
554  acf_summary_name, /* name */
555  NULL, /* name prop */
556  NULL, /* icon */
557 
558  acf_summary_setting_valid, /* has setting */
559  acf_summary_setting_flag, /* flag for setting */
560  acf_summary_setting_ptr, /* pointer for setting */
561 };
562 
563 /* Scene ------------------------------------------- */
564 
565 /* TODO: just get this from RNA? */
567 {
568  return ICON_SCENE_DATA;
569 }
570 
571 /* check if some setting exists for this channel */
573  bAnimListElem *UNUSED(ale),
574  eAnimChannel_Settings setting)
575 {
576  switch (setting) {
577  /* muted only in NLA */
579  return ((ac) && (ac->spacetype == SPACE_NLA));
580 
581  /* visible only in Graph Editor */
583  return ((ac) && (ac->spacetype == SPACE_GRAPH));
584 
585  /* only select and expand supported otherwise */
588  return true;
589 
591  return false;
592 
593  default:
594  return false;
595  }
596 }
597 
598 /* get the appropriate flag(s) for the setting when it is valid */
600  eAnimChannel_Settings setting,
601  bool *neg)
602 {
603  /* clear extra return data first */
604  *neg = false;
605 
606  switch (setting) {
607  case ACHANNEL_SETTING_SELECT: /* selected */
608  return SCE_DS_SELECTED;
609 
610  case ACHANNEL_SETTING_EXPAND: /* expanded */
611  *neg = true;
612  return SCE_DS_COLLAPSED;
613 
614  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
615  return ADT_NLA_EVAL_OFF;
616 
617  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
618  *neg = true;
619  return ADT_CURVES_NOT_VISIBLE;
620 
621  default: /* unsupported */
622  return 0;
623  }
624 }
625 
626 /* get pointer to the setting */
628 {
629  Scene *scene = (Scene *)ale->data;
630 
631  /* clear extra return data first */
632  *type = 0;
633 
634  switch (setting) {
635  case ACHANNEL_SETTING_SELECT: /* selected */
636  return GET_ACF_FLAG_PTR(scene->flag, type);
637 
638  case ACHANNEL_SETTING_EXPAND: /* expanded */
639  return GET_ACF_FLAG_PTR(scene->flag, type);
640 
641  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
642  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
643  if (scene->adt) {
644  return GET_ACF_FLAG_PTR(scene->adt->flag, type);
645  }
646  return NULL;
647 
648  default: /* unsupported */
649  return NULL;
650  }
651 }
652 
653 /* scene type define */
655  "Scene", /* type name */
656  ACHANNEL_ROLE_EXPANDER, /* role */
657 
658  acf_generic_root_color, /* backdrop color */
659  acf_generic_root_backdrop, /* backdrop */
660  acf_generic_indention_0, /* indent level */
661  NULL, /* offset */
662 
663  acf_generic_idblock_name, /* name */
664  acf_generic_idblock_name_prop, /* name prop */
665  acf_scene_icon, /* icon */
666 
667  acf_scene_setting_valid, /* has setting */
668  acf_scene_setting_flag, /* flag for setting */
669  acf_scene_setting_ptr, /* pointer for setting */
670 };
671 
672 /* Object ------------------------------------------- */
673 
675 {
676  Base *base = (Base *)ale->data;
677  Object *ob = base->object;
678 
679  /* icon depends on object-type */
680  switch (ob->type) {
681  case OB_LAMP:
682  return ICON_OUTLINER_OB_LIGHT;
683  case OB_MESH:
684  return ICON_OUTLINER_OB_MESH;
685  case OB_CAMERA:
686  return ICON_OUTLINER_OB_CAMERA;
687  case OB_CURVE:
688  return ICON_OUTLINER_OB_CURVE;
689  case OB_MBALL:
690  return ICON_OUTLINER_OB_META;
691  case OB_LATTICE:
692  return ICON_OUTLINER_OB_LATTICE;
693  case OB_SPEAKER:
694  return ICON_OUTLINER_OB_SPEAKER;
695  case OB_LIGHTPROBE:
696  return ICON_OUTLINER_OB_LIGHTPROBE;
697  case OB_ARMATURE:
698  return ICON_OUTLINER_OB_ARMATURE;
699  case OB_FONT:
700  return ICON_OUTLINER_OB_FONT;
701  case OB_SURF:
702  return ICON_OUTLINER_OB_SURFACE;
703  case OB_HAIR:
704  return ICON_OUTLINER_OB_HAIR;
705  case OB_POINTCLOUD:
706  return ICON_OUTLINER_OB_POINTCLOUD;
707  case OB_VOLUME:
708  return ICON_OUTLINER_OB_VOLUME;
709  case OB_EMPTY:
710  return ICON_OUTLINER_OB_EMPTY;
711  case OB_GPENCIL:
712  return ICON_OUTLINER_OB_GREASEPENCIL;
713  default:
714  return ICON_OBJECT_DATA;
715  }
716 }
717 
718 /* name for object */
719 static void acf_object_name(bAnimListElem *ale, char *name)
720 {
721  Base *base = (Base *)ale->data;
722  Object *ob = base->object;
723 
724  /* just copy the name... */
725  if (ob && name) {
726  BLI_strncpy(name, ob->id.name + 2, ANIM_CHAN_NAME_SIZE);
727  }
728 }
729 
730 /* name property for object */
732 {
735 
736  return (*prop != NULL);
737 }
738 
739 /* check if some setting exists for this channel */
741  bAnimListElem *ale,
742  eAnimChannel_Settings setting)
743 {
744  Base *base = (Base *)ale->data;
745  Object *ob = base->object;
746 
747  switch (setting) {
748  /* muted only in NLA */
750  return ((ac) && (ac->spacetype == SPACE_NLA));
751 
752  /* visible only in Graph Editor */
754  return ((ac) && (ac->spacetype == SPACE_GRAPH) && (ob->adt));
755 
756  /* only select and expand supported otherwise */
759  return true;
760 
762  return ((ac) && (ac->spacetype == SPACE_GRAPH) && (ob->adt));
763 
764  default:
765  return false;
766  }
767 }
768 
769 /* get the appropriate flag(s) for the setting when it is valid */
771  eAnimChannel_Settings setting,
772  bool *neg)
773 {
774  /* clear extra return data first */
775  *neg = false;
776 
777  switch (setting) {
778  case ACHANNEL_SETTING_SELECT: /* selected */
779  return BASE_SELECTED;
780 
781  case ACHANNEL_SETTING_EXPAND: /* expanded */
782  *neg = 1;
783  return OB_ADS_COLLAPSED;
784 
785  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
786  return ADT_NLA_EVAL_OFF;
787 
788  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
789  *neg = true;
790  return ADT_CURVES_NOT_VISIBLE;
791 
794 
795  default: /* unsupported */
796  return 0;
797  }
798 }
799 
800 /* get pointer to the setting */
802 {
803  Base *base = (Base *)ale->data;
804  Object *ob = base->object;
805 
806  /* clear extra return data first */
807  *type = 0;
808 
809  switch (setting) {
810  case ACHANNEL_SETTING_SELECT: /* selected */
811  return GET_ACF_FLAG_PTR(base->flag, type);
812 
813  case ACHANNEL_SETTING_EXPAND: /* expanded */
814  return GET_ACF_FLAG_PTR(ob->nlaflag, type); /* XXX */
815 
816  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
817  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
819  if (ob->adt) {
820  return GET_ACF_FLAG_PTR(ob->adt->flag, type);
821  }
822  return NULL;
823 
824  default: /* unsupported */
825  return NULL;
826  }
827 }
828 
829 /* object type define */
831  "Object", /* type name */
832  ACHANNEL_ROLE_EXPANDER, /* role */
833 
834  acf_generic_root_color, /* backdrop color */
835  acf_generic_root_backdrop, /* backdrop */
836  acf_generic_indention_0, /* indent level */
837  NULL, /* offset */
838 
839  acf_object_name, /* name */
840  acf_object_name_prop, /* name prop */
841  acf_object_icon, /* icon */
842 
843  acf_object_setting_valid, /* has setting */
844  acf_object_setting_flag, /* flag for setting */
845  acf_object_setting_ptr, /* pointer for setting */
846 };
847 
848 /* Group ------------------------------------------- */
849 
850 /* get backdrop color for group widget */
851 static void acf_group_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
852 {
853  bActionGroup *agrp = (bActionGroup *)ale->data;
854  bool showGroupColors = acf_show_channel_colors();
855 
856  if (showGroupColors && agrp->customCol) {
857  uchar cp[3];
858 
859  /* highlight only for active */
860  if (ale->flag & AGRP_ACTIVE) {
861  copy_v3_v3_uchar(cp, agrp->cs.select);
862  }
863  else {
864  copy_v3_v3_uchar(cp, agrp->cs.solid);
865  }
866 
867  /* copy the colors over, transforming from bytes to floats */
868  rgb_uchar_to_float(r_color, cp);
869  }
870  else {
871  /* highlight only for active */
872  if (ale->flag & AGRP_ACTIVE) {
874  }
875  else {
876  UI_GetThemeColor3fv(TH_GROUP, r_color);
877  }
878  }
879 }
880 
881 /* backdrop for group widget */
882 static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
883 {
885  View2D *v2d = &ac->region->v2d;
886  short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
887  short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
888  float color[3];
889 
890  /* set backdrop drawing color */
891  acf->get_backdrop_color(ac, ale, color);
892 
893  /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
896  &(const rctf){
897  .xmin = offset,
898  .xmax = v2d->cur.xmax + EXTRA_SCROLL_PAD,
899  .ymin = yminc,
900  .ymax = ymaxc,
901  },
902  true,
903  8,
904  color,
905  1.0f);
906 }
907 
908 /* name for group entries */
909 static void acf_group_name(bAnimListElem *ale, char *name)
910 {
911  bActionGroup *agrp = (bActionGroup *)ale->data;
912 
913  /* just copy the name... */
914  if (agrp && name) {
915  BLI_strncpy(name, agrp->name, ANIM_CHAN_NAME_SIZE);
916  }
917 }
918 
919 /* name property for group entries */
921 {
924 
925  return (*prop != NULL);
926 }
927 
928 /* check if some setting exists for this channel */
930  bAnimListElem *UNUSED(ale),
931  eAnimChannel_Settings setting)
932 {
933  /* for now, all settings are supported, though some are only conditionally */
934  switch (setting) {
935  /* unsupported */
936  case ACHANNEL_SETTING_SOLO: /* Only available in NLA Editor for tracks */
937  case ACHANNEL_SETTING_PINNED: /* Only for NLA actions */
938  return false;
939 
940  /* conditionally supported */
941  case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
942  return (ac->spacetype == SPACE_GRAPH);
943 
945  return (ac->spacetype == SPACE_GRAPH);
946 
947  default: /* always supported */
948  return true;
949  }
950 }
951 
952 /* get the appropriate flag(s) for the setting when it is valid */
953 static int acf_group_setting_flag(bAnimContext *ac, eAnimChannel_Settings setting, bool *neg)
954 {
955  /* clear extra return data first */
956  *neg = false;
957 
958  switch (setting) {
959  case ACHANNEL_SETTING_SELECT: /* selected */
960  return AGRP_SELECTED;
961 
962  case ACHANNEL_SETTING_EXPAND: /* expanded */
963  {
964  /* NOTE: Graph Editor uses a different flag to everywhere else for this,
965  * allowing different collapsing of groups there, since sharing the flag
966  * proved to be a hazard for workflows...
967  */
968  return (ac->spacetype == SPACE_GRAPH) ? AGRP_EXPANDED_G : /* Graph Editor case */
969  AGRP_EXPANDED; /* DopeSheet and elsewhere */
970  }
971 
972  case ACHANNEL_SETTING_MUTE: /* muted */
973  return AGRP_MUTED;
974 
975  case ACHANNEL_SETTING_MOD_OFF: /* muted */
976  *neg = 1;
977  return AGRP_MODIFIERS_OFF;
978 
979  case ACHANNEL_SETTING_PROTECT: /* protected */
980  return AGRP_PROTECTED;
981 
982  case ACHANNEL_SETTING_VISIBLE: /* visibility - graph editor */
983  *neg = 1;
984  return AGRP_NOTVISIBLE;
985 
988 
989  default:
990  /* this shouldn't happen */
991  return 0;
992  }
993 }
994 
995 /* get pointer to the setting */
997  eAnimChannel_Settings UNUSED(setting),
998  short *type)
999 {
1000  bActionGroup *agrp = (bActionGroup *)ale->data;
1001 
1002  /* all flags are just in agrp->flag for now... */
1003  return GET_ACF_FLAG_PTR(agrp->flag, type);
1004 }
1005 
1006 /* group type define */
1008  "Group", /* type name */
1009  ACHANNEL_ROLE_CHANNEL, /* role */
1010 
1011  acf_group_color, /* backdrop color */
1012  acf_group_backdrop, /* backdrop */
1013  acf_generic_indention_0, /* indent level */
1014  acf_generic_group_offset, /* offset */
1015 
1016  acf_group_name, /* name */
1017  acf_group_name_prop, /* name prop */
1018  NULL, /* icon */
1019 
1020  acf_group_setting_valid, /* has setting */
1021  acf_group_setting_flag, /* flag for setting */
1022  acf_group_setting_ptr, /* pointer for setting */
1023 };
1024 
1025 /* F-Curve ------------------------------------------- */
1026 
1027 /* name for fcurve entries */
1028 static void acf_fcurve_name(bAnimListElem *ale, char *name)
1029 {
1030  getname_anim_fcurve(name, ale->id, ale->data);
1031 }
1032 
1033 /* "name" property for fcurve entries */
1035 {
1036  FCurve *fcu = (FCurve *)ale->data;
1037 
1038  /* Ctrl-Click Usability Convenience Hack:
1039  * For disabled F-Curves, allow access to the RNA Path
1040  * as our "name" so that user can perform quick fixes
1041  */
1042  if (fcu->flag & FCURVE_DISABLED) {
1044  *prop = RNA_struct_find_property(ptr, "data_path");
1045  }
1046  else {
1047  /* for "normal" F-Curves - no editable name, but *prop may not be set properly yet... */
1048  *prop = NULL;
1049  }
1050 
1051  return (*prop != NULL);
1052 }
1053 
1054 /* check if some setting exists for this channel */
1056  bAnimListElem *ale,
1057  eAnimChannel_Settings setting)
1058 {
1059  FCurve *fcu = (FCurve *)ale->data;
1060 
1061  switch (setting) {
1062  /* unsupported */
1063  case ACHANNEL_SETTING_SOLO: /* Solo Flag is only for NLA */
1064  case ACHANNEL_SETTING_EXPAND: /* F-Curves are not containers */
1065  case ACHANNEL_SETTING_PINNED: /* This is only for NLA Actions */
1066  return false;
1067 
1068  /* conditionally available */
1069  case ACHANNEL_SETTING_PROTECT: /* Protection is only valid when there's keyframes */
1070  if (fcu->bezt) {
1071  return true;
1072  }
1073  else {
1074  return false; /* NOTE: in this special case, we need to draw ICON_ZOOMOUT */
1075  }
1076 
1077  case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
1078  return (ac->spacetype == SPACE_GRAPH);
1079 
1081  return false;
1082 
1083  /* always available */
1084  default:
1085  return true;
1086  }
1087 }
1088 
1089 /* get the appropriate flag(s) for the setting when it is valid */
1091  eAnimChannel_Settings setting,
1092  bool *neg)
1093 {
1094  /* clear extra return data first */
1095  *neg = false;
1096 
1097  switch (setting) {
1098  case ACHANNEL_SETTING_SELECT: /* selected */
1099  return FCURVE_SELECTED;
1100 
1101  case ACHANNEL_SETTING_MUTE: /* muted */
1102  return FCURVE_MUTED;
1103 
1104  case ACHANNEL_SETTING_PROTECT: /* protected */
1105  return FCURVE_PROTECTED;
1106 
1107  case ACHANNEL_SETTING_VISIBLE: /* visibility - graph editor */
1108  return FCURVE_VISIBLE;
1109 
1111  *neg = 1;
1112  return FCURVE_MOD_OFF;
1113 
1114  default: /* unsupported */
1115  return 0;
1116  }
1117 }
1118 
1119 /* get pointer to the setting */
1121  eAnimChannel_Settings UNUSED(setting),
1122  short *type)
1123 {
1124  FCurve *fcu = (FCurve *)ale->data;
1125 
1126  /* all flags are just in agrp->flag for now... */
1127  return GET_ACF_FLAG_PTR(fcu->flag, type);
1128 }
1129 
1130 /* fcurve type define */
1132  "F-Curve", /* type name */
1133  ACHANNEL_ROLE_CHANNEL, /* role */
1134 
1135  acf_generic_channel_color, /* backdrop color */
1136  acf_generic_channel_backdrop, /* backdrop */
1138  /* indent level */ /* XXX rename this to f-curves only? */
1139  acf_generic_group_offset, /* offset */
1140 
1141  acf_fcurve_name, /* name */
1142  acf_fcurve_name_prop, /* name prop */
1143  NULL, /* icon */
1144 
1145  acf_fcurve_setting_valid, /* has setting */
1146  acf_fcurve_setting_flag, /* flag for setting */
1147  acf_fcurve_setting_ptr, /* pointer for setting */
1148 };
1149 
1150 /* NLA Control FCurves Expander ----------------------- */
1151 
1152 /* get backdrop color for nla controls widget */
1154  bAnimListElem *UNUSED(ale),
1155  float r_color[3])
1156 {
1157  /* TODO: give this its own theme setting? */
1158  UI_GetThemeColorShade3fv(TH_GROUP, 55, r_color);
1159 }
1160 
1161 /* backdrop for nla controls expander widget */
1163  bAnimListElem *ale,
1164  float yminc,
1165  float ymaxc)
1166 {
1167  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
1168  View2D *v2d = &ac->region->v2d;
1169  short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
1170  short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
1171  float color[3];
1172 
1173  /* set backdrop drawing color */
1174  acf->get_backdrop_color(ac, ale, color);
1175 
1176  /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
1179  &(const rctf){
1180  .xmin = offset,
1181  .xmax = v2d->cur.xmax + EXTRA_SCROLL_PAD,
1182  .ymin = yminc,
1183  .ymax = ymaxc,
1184  },
1185  true,
1186  5,
1187  color,
1188  1.0f);
1189 }
1190 
1191 /* name for nla controls expander entries */
1192 static void acf_nla_controls_name(bAnimListElem *UNUSED(ale), char *name)
1193 {
1194  BLI_strncpy(name, IFACE_("NLA Strip Controls"), ANIM_CHAN_NAME_SIZE);
1195 }
1196 
1197 /* check if some setting exists for this channel */
1199  bAnimListElem *UNUSED(ale),
1200  eAnimChannel_Settings setting)
1201 {
1202  /* for now, all settings are supported, though some are only conditionally */
1203  switch (setting) {
1204  /* supported */
1206  return true;
1207 
1208  /* TODO: selected? */
1209 
1210  default: /* unsupported */
1211  return false;
1212  }
1213 }
1214 
1215 /* get the appropriate flag(s) for the setting when it is valid */
1217  eAnimChannel_Settings setting,
1218  bool *neg)
1219 {
1220  /* clear extra return data first */
1221  *neg = false;
1222 
1223  switch (setting) {
1224  case ACHANNEL_SETTING_EXPAND: /* expanded */
1225  *neg = true;
1226  return ADT_NLA_SKEYS_COLLAPSED;
1227 
1228  default:
1229  /* this shouldn't happen */
1230  return 0;
1231  }
1232 }
1233 
1234 /* get pointer to the setting */
1236  eAnimChannel_Settings UNUSED(setting),
1237  short *type)
1238 {
1239  AnimData *adt = (AnimData *)ale->data;
1240 
1241  /* all flags are just in adt->flag for now... */
1242  return GET_ACF_FLAG_PTR(adt->flag, type);
1243 }
1244 
1246 {
1247  return ICON_NLA;
1248 }
1249 
1250 /* NLA Control FCurves Expander type define */
1252  "NLA Controls Expander", /* type name */
1253  ACHANNEL_ROLE_EXPANDER, /* role */
1254 
1255  acf_nla_controls_color, /* backdrop color */
1256  acf_nla_controls_backdrop, /* backdrop */
1257  acf_generic_indention_0, /* indent level */
1258  acf_generic_group_offset, /* offset */
1259 
1260  acf_nla_controls_name, /* name */
1261  NULL, /* name prop */
1262  acf_nla_controls_icon, /* icon */
1263 
1264  acf_nla_controls_setting_valid, /* has setting */
1265  acf_nla_controls_setting_flag, /* flag for setting */
1266  acf_nla_controls_setting_ptr, /* pointer for setting */
1267 };
1268 
1269 /* NLA Control F-Curve -------------------------------- */
1270 
1271 /* name for nla control fcurve entries */
1272 static void acf_nla_curve_name(bAnimListElem *ale, char *name)
1273 {
1274  NlaStrip *strip = ale->owner;
1275  FCurve *fcu = ale->data;
1276  PropertyRNA *prop;
1277 
1278  /* try to get RNA property that this shortened path (relative to the strip) refers to */
1280  if (prop) {
1281  /* "name" of this strip displays the UI identifier + the name of the NlaStrip */
1282  BLI_snprintf(name, 256, "%s (%s)", RNA_property_ui_name(prop), strip->name);
1283  }
1284  else {
1285  /* unknown property... */
1286  BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index);
1287  }
1288 }
1289 
1290 /* NLA Control F-Curve type define */
1292  "NLA Control F-Curve", /* type name */
1293  ACHANNEL_ROLE_CHANNEL, /* role */
1294 
1295  acf_generic_channel_color, /* backdrop color */
1296  acf_generic_channel_backdrop, /* backdrop */
1297  acf_generic_indention_1, /* indent level */
1298  acf_generic_group_offset, /* offset */
1299 
1300  acf_nla_curve_name, /* name */
1301  acf_fcurve_name_prop, /* name prop */
1302  NULL, /* icon */
1303 
1304  acf_fcurve_setting_valid, /* has setting */
1305  acf_fcurve_setting_flag, /* flag for setting */
1306  acf_fcurve_setting_ptr, /* pointer for setting */
1307 };
1308 
1309 /* Object Action Expander ------------------------------------------- */
1310 
1311 /* TODO: just get this from RNA? */
1313 {
1314  return ICON_ACTION;
1315 }
1316 
1317 /* check if some setting exists for this channel */
1319  bAnimListElem *UNUSED(ale),
1320  eAnimChannel_Settings setting)
1321 {
1322  switch (setting) {
1323  /* only select and expand supported */
1326  return true;
1327 
1328  default:
1329  return false;
1330  }
1331 }
1332 
1333 /* get the appropriate flag(s) for the setting when it is valid */
1335  eAnimChannel_Settings setting,
1336  bool *neg)
1337 {
1338  /* clear extra return data first */
1339  *neg = false;
1340 
1341  switch (setting) {
1342  case ACHANNEL_SETTING_SELECT: /* selected */
1343  return ADT_UI_SELECTED;
1344 
1345  case ACHANNEL_SETTING_EXPAND: /* expanded */
1346  *neg = true;
1347  return ACT_COLLAPSED;
1348 
1349  default: /* unsupported */
1350  return 0;
1351  }
1352 }
1353 
1354 /* get pointer to the setting */
1356  eAnimChannel_Settings setting,
1357  short *type)
1358 {
1359  bAction *act = (bAction *)ale->data;
1360  AnimData *adt = ale->adt;
1361 
1362  /* clear extra return data first */
1363  *type = 0;
1364 
1365  switch (setting) {
1366  case ACHANNEL_SETTING_SELECT: /* selected */
1367  if (adt) {
1368  return GET_ACF_FLAG_PTR(adt->flag, type);
1369  }
1370  return NULL;
1371 
1372  case ACHANNEL_SETTING_EXPAND: /* expanded */
1373  return GET_ACF_FLAG_PTR(act->flag, type);
1374 
1375  default: /* unsupported */
1376  return NULL;
1377  }
1378 }
1379 
1380 /* object action expander type define */
1382  "Ob-Action Filler", /* type name */
1383  ACHANNEL_ROLE_EXPANDER, /* role */
1384 
1385  acf_generic_dataexpand_color, /* backdrop color */
1386  acf_generic_dataexpand_backdrop, /* backdrop */
1387  acf_generic_indention_1, /* indent level */
1388  acf_generic_basic_offset, /* offset */
1389 
1390  acf_generic_idblock_name, /* name */
1391  acf_generic_idfill_name_prop, /* name prop */
1392  acf_fillactd_icon, /* icon */
1393 
1394  acf_fillactd_setting_valid, /* has setting */
1395  acf_fillactd_setting_flag, /* flag for setting */
1396  acf_fillactd_setting_ptr, /* pointer for setting */
1397 };
1398 
1399 /* Drivers Expander ------------------------------------------- */
1400 
1401 /* TODO: just get this from RNA? */
1403 {
1404  return ICON_DRIVER;
1405 }
1406 
1407 static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name)
1408 {
1409  BLI_strncpy(name, IFACE_("Drivers"), ANIM_CHAN_NAME_SIZE);
1410 }
1411 
1412 /* check if some setting exists for this channel */
1413 /* TODO: this could be made more generic */
1415  bAnimListElem *UNUSED(ale),
1416  eAnimChannel_Settings setting)
1417 {
1418  switch (setting) {
1419  /* only expand supported */
1421  return true;
1422 
1423  default:
1424  return false;
1425  }
1426 }
1427 
1428 /* get the appropriate flag(s) for the setting when it is valid */
1430  eAnimChannel_Settings setting,
1431  bool *neg)
1432 {
1433  /* clear extra return data first */
1434  *neg = false;
1435 
1436  switch (setting) {
1437  case ACHANNEL_SETTING_EXPAND: /* expanded */
1438  *neg = true;
1439  return ADT_DRIVERS_COLLAPSED;
1440 
1441  default: /* unsupported */
1442  return 0;
1443  }
1444 }
1445 
1446 /* get pointer to the setting */
1448  eAnimChannel_Settings setting,
1449  short *type)
1450 {
1451  AnimData *adt = (AnimData *)ale->data;
1452 
1453  /* clear extra return data first */
1454  *type = 0;
1455 
1456  switch (setting) {
1457  case ACHANNEL_SETTING_EXPAND: /* expanded */
1458  return GET_ACF_FLAG_PTR(adt->flag, type);
1459 
1460  default: /* unsupported */
1461  return NULL;
1462  }
1463 }
1464 
1465 /* drivers expander type define */
1467  "Drivers Filler", /* type name */
1468  ACHANNEL_ROLE_EXPANDER, /* role */
1469 
1470  acf_generic_dataexpand_color, /* backdrop color */
1471  acf_generic_dataexpand_backdrop, /* backdrop */
1472  acf_generic_indention_1, /* indent level */
1473  acf_generic_basic_offset, /* offset */
1474 
1475  acf_filldrivers_name, /* name */
1476  NULL, /* name prop */
1477  acf_filldrivers_icon, /* icon */
1478 
1479  acf_filldrivers_setting_valid, /* has setting */
1480  acf_filldrivers_setting_flag, /* flag for setting */
1481  acf_filldrivers_setting_ptr, /* pointer for setting */
1482 };
1483 
1484 /* Material Expander ------------------------------------------- */
1485 
1486 /* TODO: just get this from RNA? */
1488 {
1489  return ICON_MATERIAL_DATA;
1490 }
1491 
1492 /* get the appropriate flag(s) for the setting when it is valid */
1494  eAnimChannel_Settings setting,
1495  bool *neg)
1496 {
1497  /* clear extra return data first */
1498  *neg = false;
1499 
1500  switch (setting) {
1501  case ACHANNEL_SETTING_EXPAND: /* expanded */
1502  return MA_DS_EXPAND;
1503 
1504  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1505  return ADT_NLA_EVAL_OFF;
1506 
1507  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1508  *neg = true;
1509  return ADT_CURVES_NOT_VISIBLE;
1510 
1511  case ACHANNEL_SETTING_SELECT: /* selected */
1512  return ADT_UI_SELECTED;
1513 
1514  default: /* unsupported */
1515  return 0;
1516  }
1517 }
1518 
1519 /* get pointer to the setting */
1521 {
1522  Material *ma = (Material *)ale->data;
1523 
1524  /* clear extra return data first */
1525  *type = 0;
1526 
1527  switch (setting) {
1528  case ACHANNEL_SETTING_EXPAND: /* expanded */
1529  return GET_ACF_FLAG_PTR(ma->flag, type);
1530 
1531  case ACHANNEL_SETTING_SELECT: /* selected */
1532  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1533  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1534  if (ma->adt) {
1535  return GET_ACF_FLAG_PTR(ma->adt->flag, type);
1536  }
1537  return NULL;
1538 
1539  default: /* unsupported */
1540  return NULL;
1541  }
1542 }
1543 
1544 /* material expander type define */
1546  "Material Data Expander", /* type name */
1547  ACHANNEL_ROLE_EXPANDER, /* role */
1548 
1549  acf_generic_dataexpand_color, /* backdrop color */
1550  acf_generic_dataexpand_backdrop, /* backdrop */
1551  acf_generic_indention_1, /* indent level */
1552  acf_generic_basic_offset, /* offset */
1553 
1554  acf_generic_idblock_name, /* name */
1555  acf_generic_idblock_name_prop, /* name prop */
1556  acf_dsmat_icon, /* icon */
1557 
1558  acf_generic_dataexpand_setting_valid, /* has setting */
1559  acf_dsmat_setting_flag, /* flag for setting */
1560  acf_dsmat_setting_ptr, /* pointer for setting */
1561 };
1562 
1563 /* Light Expander ------------------------------------------- */
1564 
1565 /* TODO: just get this from RNA? */
1567 {
1568  return ICON_LIGHT_DATA;
1569 }
1570 
1571 /* get the appropriate flag(s) for the setting when it is valid */
1573  eAnimChannel_Settings setting,
1574  bool *neg)
1575 {
1576  /* clear extra return data first */
1577  *neg = false;
1578 
1579  switch (setting) {
1580  case ACHANNEL_SETTING_EXPAND: /* expanded */
1581  return LA_DS_EXPAND;
1582 
1583  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1584  return ADT_NLA_EVAL_OFF;
1585 
1586  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1587  *neg = true;
1588  return ADT_CURVES_NOT_VISIBLE;
1589 
1590  case ACHANNEL_SETTING_SELECT: /* selected */
1591  return ADT_UI_SELECTED;
1592 
1593  default: /* unsupported */
1594  return 0;
1595  }
1596 }
1597 
1598 /* get pointer to the setting */
1600  eAnimChannel_Settings setting,
1601  short *type)
1602 {
1603  Light *la = (Light *)ale->data;
1604 
1605  /* clear extra return data first */
1606  *type = 0;
1607 
1608  switch (setting) {
1609  case ACHANNEL_SETTING_EXPAND: /* expanded */
1610  return GET_ACF_FLAG_PTR(la->flag, type);
1611 
1612  case ACHANNEL_SETTING_SELECT: /* selected */
1613  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1614  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1615  if (la->adt) {
1616  return GET_ACF_FLAG_PTR(la->adt->flag, type);
1617  }
1618  return NULL;
1619 
1620  default: /* unsupported */
1621  return NULL;
1622  }
1623 }
1624 
1625 /* light expander type define */
1627  "Light Expander", /* type name */
1628  ACHANNEL_ROLE_EXPANDER, /* role */
1629 
1630  acf_generic_dataexpand_color, /* backdrop color */
1631  acf_generic_dataexpand_backdrop, /* backdrop */
1632  acf_generic_indention_1, /* indent level */
1633  acf_generic_basic_offset, /* offset */
1634 
1635  acf_generic_idblock_name, /* name */
1636  acf_generic_idblock_name_prop, /* name prop */
1637  acf_dslight_icon, /* icon */
1638 
1639  acf_generic_dataexpand_setting_valid, /* has setting */
1640  acf_dslight_setting_flag, /* flag for setting */
1641  acf_dslight_setting_ptr, /* pointer for setting */
1642 };
1643 
1644 /* Texture Expander ------------------------------------------- */
1645 
1646 /* TODO: just get this from RNA? */
1648 {
1649  return ICON_TEXTURE_DATA;
1650 }
1651 
1652 /* offset for texture expanders */
1653 /* FIXME: soon to be obsolete? */
1655 {
1656  return 14; /* XXX: simply include this in indention instead? */
1657 }
1658 
1659 /* get the appropriate flag(s) for the setting when it is valid */
1661  eAnimChannel_Settings setting,
1662  bool *neg)
1663 {
1664  /* clear extra return data first */
1665  *neg = false;
1666 
1667  switch (setting) {
1668  case ACHANNEL_SETTING_EXPAND: /* expanded */
1669  return TEX_DS_EXPAND;
1670 
1671  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1672  return ADT_NLA_EVAL_OFF;
1673 
1674  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1675  *neg = true;
1676  return ADT_CURVES_NOT_VISIBLE;
1677 
1678  case ACHANNEL_SETTING_SELECT: /* selected */
1679  return ADT_UI_SELECTED;
1680 
1681  default: /* unsupported */
1682  return 0;
1683  }
1684 }
1685 
1686 /* get pointer to the setting */
1688 {
1689  Tex *tex = (Tex *)ale->data;
1690 
1691  /* clear extra return data first */
1692  *type = 0;
1693 
1694  switch (setting) {
1695  case ACHANNEL_SETTING_EXPAND: /* expanded */
1696  return GET_ACF_FLAG_PTR(tex->flag, type);
1697 
1698  case ACHANNEL_SETTING_SELECT: /* selected */
1699  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1700  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1701  if (tex->adt) {
1702  return GET_ACF_FLAG_PTR(tex->adt->flag, type);
1703  }
1704  return NULL;
1705 
1706  default: /* unsupported */
1707  return NULL;
1708  }
1709 }
1710 
1711 /* texture expander type define */
1713  "Texture Data Expander", /* type name */
1714  ACHANNEL_ROLE_EXPANDER, /* role */
1715 
1716  acf_generic_dataexpand_color, /* backdrop color */
1717  acf_generic_dataexpand_backdrop, /* backdrop */
1718  acf_generic_indention_1, /* indent level */
1719  acf_dstex_offset, /* offset */
1720 
1721  acf_generic_idblock_name, /* name */
1722  acf_generic_idfill_name_prop, /* name prop */
1723  acf_dstex_icon, /* icon */
1724 
1725  acf_generic_dataexpand_setting_valid, /* has setting */
1726  acf_dstex_setting_flag, /* flag for setting */
1727  acf_dstex_setting_ptr, /* pointer for setting */
1728 };
1729 
1730 /* Camera Expander ------------------------------------------- */
1731 
1732 /* TODO: just get this from RNA? */
1734 {
1735  UNUSED_VARS(ale);
1736  return ICON_FILE;
1737 }
1738 
1739 /* get the appropriate flag(s) for the setting when it is valid */
1741 {
1742  /* clear extra return data first */
1743  *neg = false;
1744 
1745  switch (setting) {
1746  case ACHANNEL_SETTING_EXPAND: /* expanded */
1747  return CACHEFILE_DS_EXPAND;
1748 
1749  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1750  return ADT_NLA_EVAL_OFF;
1751 
1752  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1753  *neg = true;
1754  return ADT_CURVES_NOT_VISIBLE;
1755 
1756  case ACHANNEL_SETTING_SELECT: /* selected */
1757  return ADT_UI_SELECTED;
1758 
1759  default: /* unsupported */
1760  return 0;
1761  }
1762 
1763  UNUSED_VARS(ac);
1764 }
1765 
1766 /* get pointer to the setting */
1768  eAnimChannel_Settings setting,
1769  short *type)
1770 {
1771  CacheFile *cache_file = (CacheFile *)ale->data;
1772 
1773  /* clear extra return data first */
1774  *type = 0;
1775 
1776  switch (setting) {
1777  case ACHANNEL_SETTING_EXPAND: /* expanded */
1778  return GET_ACF_FLAG_PTR(cache_file->flag, type);
1779 
1780  case ACHANNEL_SETTING_SELECT: /* selected */
1781  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1782  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1783  if (cache_file->adt) {
1784  return GET_ACF_FLAG_PTR(cache_file->adt->flag, type);
1785  }
1786 
1787  return NULL;
1788 
1789  default: /* unsupported */
1790  return NULL;
1791  }
1792 }
1793 
1794 /* CacheFile expander type define. */
1796  "Cache File Expander", /* type name */
1797  ACHANNEL_ROLE_EXPANDER, /* role */
1798 
1799  acf_generic_dataexpand_color, /* backdrop color */
1800  acf_generic_dataexpand_backdrop, /* backdrop */
1801  acf_generic_indention_1, /* indent level */
1802  acf_generic_basic_offset, /* offset */
1803 
1804  acf_generic_idblock_name, /* name */
1805  acf_generic_idfill_name_prop, /* name prop */
1806  acf_dscachefile_icon, /* icon */
1807 
1808  acf_generic_dataexpand_setting_valid, /* has setting */
1809  acf_dscachefile_setting_flag, /* flag for setting */
1810  acf_dscachefile_setting_ptr, /* pointer for setting */
1811 };
1812 
1813 /* Camera Expander ------------------------------------------- */
1814 
1815 /* TODO: just get this from RNA? */
1817 {
1818  return ICON_CAMERA_DATA;
1819 }
1820 
1821 /* get the appropriate flag(s) for the setting when it is valid */
1823  eAnimChannel_Settings setting,
1824  bool *neg)
1825 {
1826  /* clear extra return data first */
1827  *neg = false;
1828 
1829  switch (setting) {
1830  case ACHANNEL_SETTING_EXPAND: /* expanded */
1831  return CAM_DS_EXPAND;
1832 
1833  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1834  return ADT_NLA_EVAL_OFF;
1835 
1836  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1837  *neg = true;
1838  return ADT_CURVES_NOT_VISIBLE;
1839 
1840  case ACHANNEL_SETTING_SELECT: /* selected */
1841  return ADT_UI_SELECTED;
1842 
1845 
1846  default: /* unsupported */
1847  return 0;
1848  }
1849 }
1850 
1851 /* get pointer to the setting */
1853 {
1854  Camera *ca = (Camera *)ale->data;
1855 
1856  /* clear extra return data first */
1857  *type = 0;
1858 
1859  switch (setting) {
1860  case ACHANNEL_SETTING_EXPAND: /* expanded */
1861  return GET_ACF_FLAG_PTR(ca->flag, type);
1862 
1863  case ACHANNEL_SETTING_SELECT: /* selected */
1864  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1865  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1867  if (ca->adt) {
1868  return GET_ACF_FLAG_PTR(ca->adt->flag, type);
1869  }
1870  return NULL;
1871 
1872  default: /* unsupported */
1873  return NULL;
1874  }
1875 }
1876 
1877 /* camera expander type define */
1879  "Camera Expander", /* type name */
1880  ACHANNEL_ROLE_EXPANDER, /* role */
1881 
1882  acf_generic_dataexpand_color, /* backdrop color */
1883  acf_generic_dataexpand_backdrop, /* backdrop */
1884  acf_generic_indention_1, /* indent level */
1885  acf_generic_basic_offset, /* offset */
1886 
1887  acf_generic_idblock_name, /* name */
1888  acf_generic_idfill_name_prop, /* name prop */
1889  acf_dscam_icon, /* icon */
1890 
1891  acf_generic_dataexpand_setting_valid, /* has setting */
1892  acf_dscam_setting_flag, /* flag for setting */
1893  acf_dscam_setting_ptr, /* pointer for setting */
1894 };
1895 
1896 /* Curve Expander ------------------------------------------- */
1897 
1898 /* TODO: just get this from RNA? */
1900 {
1901  Curve *cu = (Curve *)ale->data;
1902  short obtype = BKE_curve_type_get(cu);
1903 
1904  switch (obtype) {
1905  case OB_FONT:
1906  return ICON_FONT_DATA;
1907  case OB_SURF:
1908  return ICON_SURFACE_DATA;
1909  default:
1910  return ICON_CURVE_DATA;
1911  }
1912 }
1913 
1914 /* get the appropriate flag(s) for the setting when it is valid */
1916  eAnimChannel_Settings setting,
1917  bool *neg)
1918 {
1919  /* clear extra return data first */
1920  *neg = false;
1921 
1922  switch (setting) {
1923  case ACHANNEL_SETTING_EXPAND: /* expanded */
1924  return CU_DS_EXPAND;
1925 
1926  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
1927  return ADT_NLA_EVAL_OFF;
1928 
1929  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
1930  *neg = true;
1931  return ADT_CURVES_NOT_VISIBLE;
1932 
1933  case ACHANNEL_SETTING_SELECT: /* selected */
1934  return ADT_UI_SELECTED;
1935 
1936  default: /* unsupported */
1937  return 0;
1938  }
1939 }
1940 
1941 /* get pointer to the setting */
1943 {
1944  Curve *cu = (Curve *)ale->data;
1945 
1946  /* clear extra return data first */
1947  *type = 0;
1948 
1949  switch (setting) {
1950  case ACHANNEL_SETTING_EXPAND: /* expanded */
1951  return GET_ACF_FLAG_PTR(cu->flag, type);
1952 
1953  case ACHANNEL_SETTING_SELECT: /* selected */
1954  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
1955  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
1956  if (cu->adt) {
1957  return GET_ACF_FLAG_PTR(cu->adt->flag, type);
1958  }
1959  return NULL;
1960 
1961  default: /* unsupported */
1962  return NULL;
1963  }
1964 }
1965 
1966 /* curve expander type define */
1968  "Curve Expander", /* type name */
1969  ACHANNEL_ROLE_EXPANDER, /* role */
1970 
1971  acf_generic_dataexpand_color, /* backdrop color */
1972  acf_generic_dataexpand_backdrop, /* backdrop */
1973  acf_generic_indention_1, /* indent level */
1974  acf_generic_basic_offset, /* offset */
1975 
1976  acf_generic_idblock_name, /* name */
1977  acf_generic_idblock_name_prop, /* name prop */
1978  acf_dscur_icon, /* icon */
1979 
1980  acf_generic_dataexpand_setting_valid, /* has setting */
1981  acf_dscur_setting_flag, /* flag for setting */
1982  acf_dscur_setting_ptr, /* pointer for setting */
1983 };
1984 
1985 /* Shape Key Expander ------------------------------------------- */
1986 
1987 /* TODO: just get this from RNA? */
1989 {
1990  return ICON_SHAPEKEY_DATA;
1991 }
1992 
1993 /* check if some setting exists for this channel */
1995  bAnimListElem *UNUSED(ale),
1996  eAnimChannel_Settings setting)
1997 {
1998  switch (setting) {
2001  return true;
2002 
2003  /* mute is only supported for NLA */
2004  case ACHANNEL_SETTING_MUTE:
2005  return ((ac) && (ac->spacetype == SPACE_NLA));
2006 
2007  default:
2008  return false;
2009  }
2010 }
2011 
2012 /* get the appropriate flag(s) for the setting when it is valid */
2014  eAnimChannel_Settings setting,
2015  bool *neg)
2016 {
2017  /* clear extra return data first */
2018  *neg = false;
2019 
2020  switch (setting) {
2021  case ACHANNEL_SETTING_EXPAND: /* expanded */
2022  return KEY_DS_EXPAND;
2023 
2024  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2025  return ADT_NLA_EVAL_OFF;
2026 
2027  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2028  *neg = true;
2029  return ADT_CURVES_NOT_VISIBLE;
2030 
2031  case ACHANNEL_SETTING_SELECT: /* selected */
2032  return ADT_UI_SELECTED;
2033 
2034  default: /* unsupported */
2035  return 0;
2036  }
2037 }
2038 
2039 /* get pointer to the setting */
2041 {
2042  Key *key = (Key *)ale->data;
2043 
2044  /* clear extra return data first */
2045  *type = 0;
2046 
2047  switch (setting) {
2048  case ACHANNEL_SETTING_EXPAND: /* expanded */
2049  return GET_ACF_FLAG_PTR(key->flag, type);
2050 
2051  case ACHANNEL_SETTING_SELECT: /* selected */
2052  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2053  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2054  if (key->adt) {
2055  return GET_ACF_FLAG_PTR(key->adt->flag, type);
2056  }
2057  return NULL;
2058 
2059  default: /* unsupported */
2060  return NULL;
2061  }
2062 }
2063 
2064 /* shapekey expander type define */
2066  "Shape Key Expander", /* type name */
2067  ACHANNEL_ROLE_EXPANDER, /* role */
2068 
2069  acf_generic_dataexpand_color, /* backdrop color */
2070  acf_generic_dataexpand_backdrop, /* backdrop */
2071  acf_generic_indention_1, /* indent level */
2072  acf_generic_basic_offset, /* offset */
2073 
2074  acf_generic_idblock_name, /* name */
2075  acf_generic_idblock_name_prop, /* name prop */
2076  acf_dsskey_icon, /* icon */
2077 
2078  acf_dsskey_setting_valid, /* has setting */
2079  acf_dsskey_setting_flag, /* flag for setting */
2080  acf_dsskey_setting_ptr, /* pointer for setting */
2081 };
2082 
2083 /* World Expander ------------------------------------------- */
2084 
2085 /* TODO: just get this from RNA? */
2087 {
2088  return ICON_WORLD_DATA;
2089 }
2090 
2091 /* get the appropriate flag(s) for the setting when it is valid */
2093  eAnimChannel_Settings setting,
2094  bool *neg)
2095 {
2096  /* clear extra return data first */
2097  *neg = false;
2098 
2099  switch (setting) {
2100  case ACHANNEL_SETTING_EXPAND: /* expanded */
2101  return WO_DS_EXPAND;
2102 
2103  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2104  return ADT_NLA_EVAL_OFF;
2105 
2106  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2107  *neg = true;
2108  return ADT_CURVES_NOT_VISIBLE;
2109 
2110  case ACHANNEL_SETTING_SELECT: /* selected */
2111  return ADT_UI_SELECTED;
2112 
2113  default: /* unsupported */
2114  return 0;
2115  }
2116 }
2117 
2118 /* get pointer to the setting */
2120 {
2121  World *wo = (World *)ale->data;
2122 
2123  /* clear extra return data first */
2124  *type = 0;
2125 
2126  switch (setting) {
2127  case ACHANNEL_SETTING_EXPAND: /* expanded */
2128  return GET_ACF_FLAG_PTR(wo->flag, type);
2129 
2130  case ACHANNEL_SETTING_SELECT: /* selected */
2131  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2132  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2133  if (wo->adt) {
2134  return GET_ACF_FLAG_PTR(wo->adt->flag, type);
2135  }
2136  return NULL;
2137 
2138  default: /* unsupported */
2139  return NULL;
2140  }
2141 }
2142 
2143 /* world expander type define */
2145  "World Expander", /* type name */
2146  ACHANNEL_ROLE_EXPANDER, /* role */
2147 
2148  acf_generic_dataexpand_color, /* backdrop color */
2149  acf_generic_dataexpand_backdrop, /* backdrop */
2150  acf_generic_indention_1, /* indent level */
2151  acf_generic_basic_offset, /* offset */
2152 
2153  acf_generic_idblock_name, /* name */
2154  acf_generic_idfill_name_prop, /* name prop */
2155  acf_dswor_icon, /* icon */
2156 
2157  acf_generic_dataexpand_setting_valid, /* has setting */
2158  acf_dswor_setting_flag, /* flag for setting */
2159  acf_dswor_setting_ptr, /* pointer for setting */
2160 };
2161 
2162 /* Particle Expander ------------------------------------------- */
2163 
2164 /* TODO: just get this from RNA? */
2166 {
2167  return ICON_PARTICLE_DATA;
2168 }
2169 
2170 /* get the appropriate flag(s) for the setting when it is valid */
2172  eAnimChannel_Settings setting,
2173  bool *neg)
2174 {
2175  /* clear extra return data first */
2176  *neg = false;
2177 
2178  switch (setting) {
2179  case ACHANNEL_SETTING_EXPAND: /* expanded */
2180  return PART_DS_EXPAND;
2181 
2182  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2183  return ADT_NLA_EVAL_OFF;
2184 
2185  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2186  *neg = true;
2187  return ADT_CURVES_NOT_VISIBLE;
2188 
2189  case ACHANNEL_SETTING_SELECT: /* selected */
2190  return ADT_UI_SELECTED;
2191 
2192  default: /* unsupported */
2193  return 0;
2194  }
2195 }
2196 
2197 /* get pointer to the setting */
2199 {
2200  ParticleSettings *part = (ParticleSettings *)ale->data;
2201 
2202  /* clear extra return data first */
2203  *type = 0;
2204 
2205  switch (setting) {
2206  case ACHANNEL_SETTING_EXPAND: /* expanded */
2207  return GET_ACF_FLAG_PTR(part->flag, type);
2208 
2209  case ACHANNEL_SETTING_SELECT: /* selected */
2210  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2211  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2212  if (part->adt) {
2213  return GET_ACF_FLAG_PTR(part->adt->flag, type);
2214  }
2215  return NULL;
2216 
2217  default: /* unsupported */
2218  return NULL;
2219  }
2220 }
2221 
2222 /* particle expander type define */
2224  "Particle Data Expander", /* type name */
2225  ACHANNEL_ROLE_EXPANDER, /* role */
2226 
2227  acf_generic_dataexpand_color, /* backdrop color */
2228  acf_generic_dataexpand_backdrop, /* backdrop */
2229  acf_generic_indention_1, /* indent level */
2230  acf_generic_basic_offset, /* offset */
2231 
2232  acf_generic_idblock_name, /* name */
2233  acf_generic_idblock_name_prop, /* name prop */
2234  acf_dspart_icon, /* icon */
2235 
2236  acf_generic_dataexpand_setting_valid, /* has setting */
2237  acf_dspart_setting_flag, /* flag for setting */
2238  acf_dspart_setting_ptr, /* pointer for setting */
2239 };
2240 
2241 /* MetaBall Expander ------------------------------------------- */
2242 
2243 /* TODO: just get this from RNA? */
2245 {
2246  return ICON_META_DATA;
2247 }
2248 
2249 /* get the appropriate flag(s) for the setting when it is valid */
2251  eAnimChannel_Settings setting,
2252  bool *neg)
2253 {
2254  /* clear extra return data first */
2255  *neg = false;
2256 
2257  switch (setting) {
2258  case ACHANNEL_SETTING_EXPAND: /* expanded */
2259  return MB_DS_EXPAND;
2260 
2261  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2262  return ADT_NLA_EVAL_OFF;
2263 
2264  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2265  *neg = true;
2266  return ADT_CURVES_NOT_VISIBLE;
2267 
2268  case ACHANNEL_SETTING_SELECT: /* selected */
2269  return ADT_UI_SELECTED;
2270 
2271  default: /* unsupported */
2272  return 0;
2273  }
2274 }
2275 
2276 /* get pointer to the setting */
2278  eAnimChannel_Settings setting,
2279  short *type)
2280 {
2281  MetaBall *mb = (MetaBall *)ale->data;
2282 
2283  /* clear extra return data first */
2284  *type = 0;
2285 
2286  switch (setting) {
2287  case ACHANNEL_SETTING_EXPAND: /* expanded */
2288  return GET_ACF_FLAG_PTR(mb->flag2, type);
2289 
2290  case ACHANNEL_SETTING_SELECT: /* selected */
2291  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2292  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2293  if (mb->adt) {
2294  return GET_ACF_FLAG_PTR(mb->adt->flag, type);
2295  }
2296  return NULL;
2297 
2298  default: /* unsupported */
2299  return NULL;
2300  }
2301 }
2302 
2303 /* metaball expander type define */
2305  "Metaball Expander", /* type name */
2306  ACHANNEL_ROLE_EXPANDER, /* role */
2307 
2308  acf_generic_dataexpand_color, /* backdrop color */
2309  acf_generic_dataexpand_backdrop, /* backdrop */
2310  acf_generic_indention_1, /* indent level */
2311  acf_generic_basic_offset, /* offset */
2312 
2313  acf_generic_idblock_name, /* name */
2314  acf_generic_idblock_name_prop, /* name prop */
2315  acf_dsmball_icon, /* icon */
2316 
2317  acf_generic_dataexpand_setting_valid, /* has setting */
2318  acf_dsmball_setting_flag, /* flag for setting */
2319  acf_dsmball_setting_ptr, /* pointer for setting */
2320 };
2321 
2322 /* Armature Expander ------------------------------------------- */
2323 
2324 /* TODO: just get this from RNA? */
2326 {
2327  return ICON_ARMATURE_DATA;
2328 }
2329 
2330 /* get the appropriate flag(s) for the setting when it is valid */
2332  eAnimChannel_Settings setting,
2333  bool *neg)
2334 {
2335  /* clear extra return data first */
2336  *neg = false;
2337 
2338  switch (setting) {
2339  case ACHANNEL_SETTING_EXPAND: /* expanded */
2340  return ARM_DS_EXPAND;
2341 
2342  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2343  return ADT_NLA_EVAL_OFF;
2344 
2345  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2346  *neg = true;
2347  return ADT_CURVES_NOT_VISIBLE;
2348 
2349  case ACHANNEL_SETTING_SELECT: /* selected */
2350  return ADT_UI_SELECTED;
2351 
2352  default: /* unsupported */
2353  return 0;
2354  }
2355 }
2356 
2357 /* get pointer to the setting */
2359 {
2360  bArmature *arm = (bArmature *)ale->data;
2361 
2362  /* clear extra return data first */
2363  *type = 0;
2364 
2365  switch (setting) {
2366  case ACHANNEL_SETTING_EXPAND: /* expanded */
2367  return GET_ACF_FLAG_PTR(arm->flag, type);
2368 
2369  case ACHANNEL_SETTING_SELECT: /* selected */
2370  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2371  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2372  if (arm->adt) {
2373  return GET_ACF_FLAG_PTR(arm->adt->flag, type);
2374  }
2375  return NULL;
2376 
2377  default: /* unsupported */
2378  return NULL;
2379  }
2380 }
2381 
2382 /* metaball expander type define */
2384  "Armature Expander", /* type name */
2385  ACHANNEL_ROLE_EXPANDER, /* role */
2386 
2387  acf_generic_dataexpand_color, /* backdrop color */
2388  acf_generic_dataexpand_backdrop, /* backdrop */
2389  acf_generic_indention_1, /* indent level */
2390  acf_generic_basic_offset, /* offset */
2391 
2392  acf_generic_idblock_name, /* name */
2393  acf_generic_idblock_name_prop, /* name prop */
2394  acf_dsarm_icon, /* icon */
2395 
2396  acf_generic_dataexpand_setting_valid, /* has setting */
2397  acf_dsarm_setting_flag, /* flag for setting */
2398  acf_dsarm_setting_ptr, /* pointer for setting */
2399 };
2400 
2401 /* NodeTree Expander ------------------------------------------- */
2402 
2403 /* TODO: just get this from RNA? */
2405 {
2406  return ICON_NODETREE;
2407 }
2408 
2409 /* offset for nodetree expanders */
2411 {
2412  bNodeTree *ntree = (bNodeTree *)ale->data;
2413  short offset = acf_generic_basic_offset(ac, ale);
2414 
2416 
2417  return offset;
2418 }
2419 
2420 /* get the appropriate flag(s) for the setting when it is valid */
2422  eAnimChannel_Settings setting,
2423  bool *neg)
2424 {
2425  /* clear extra return data first */
2426  *neg = false;
2427 
2428  switch (setting) {
2429  case ACHANNEL_SETTING_EXPAND: /* expanded */
2430  return NTREE_DS_EXPAND;
2431 
2432  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2433  return ADT_NLA_EVAL_OFF;
2434 
2435  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2436  *neg = true;
2437  return ADT_CURVES_NOT_VISIBLE;
2438 
2439  case ACHANNEL_SETTING_SELECT: /* selected */
2440  return ADT_UI_SELECTED;
2441 
2442  default: /* unsupported */
2443  return 0;
2444  }
2445 }
2446 
2447 /* get pointer to the setting */
2449  eAnimChannel_Settings setting,
2450  short *type)
2451 {
2452  bNodeTree *ntree = (bNodeTree *)ale->data;
2453 
2454  /* clear extra return data first */
2455  *type = 0;
2456 
2457  switch (setting) {
2458  case ACHANNEL_SETTING_EXPAND: /* expanded */
2459  return GET_ACF_FLAG_PTR(ntree->flag, type);
2460 
2461  case ACHANNEL_SETTING_SELECT: /* selected */
2462  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2463  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2464  if (ntree->adt) {
2465  return GET_ACF_FLAG_PTR(ntree->adt->flag, type);
2466  }
2467  return NULL;
2468 
2469  default: /* unsupported */
2470  return NULL;
2471  }
2472 }
2473 
2474 /* node tree expander type define */
2476  "Node Tree Expander", /* type name */
2477  ACHANNEL_ROLE_EXPANDER, /* role */
2478 
2479  acf_generic_dataexpand_color, /* backdrop color */
2480  acf_generic_dataexpand_backdrop, /* backdrop */
2481  acf_generic_indention_1, /* indent level */
2482  acf_dsntree_offset, /* offset */
2483 
2484  acf_generic_idblock_name, /* name */
2485  acf_generic_idblock_name_prop, /* name prop */
2486  acf_dsntree_icon, /* icon */
2487 
2488  acf_generic_dataexpand_setting_valid, /* has setting */
2489  acf_dsntree_setting_flag, /* flag for setting */
2490  acf_dsntree_setting_ptr, /* pointer for setting */
2491 };
2492 
2493 /* LineStyle Expander ------------------------------------------- */
2494 
2495 /* TODO: just get this from RNA? */
2497 {
2498  return ICON_LINE_DATA;
2499 }
2500 
2501 /* get the appropriate flag(s) for the setting when it is valid */
2503  eAnimChannel_Settings setting,
2504  bool *neg)
2505 {
2506  /* clear extra return data first */
2507  *neg = false;
2508 
2509  switch (setting) {
2510  case ACHANNEL_SETTING_EXPAND: /* expanded */
2511  return LS_DS_EXPAND;
2512 
2513  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2514  return ADT_NLA_EVAL_OFF;
2515 
2516  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2517  *neg = true;
2518  return ADT_CURVES_NOT_VISIBLE;
2519 
2520  case ACHANNEL_SETTING_SELECT: /* selected */
2521  return ADT_UI_SELECTED;
2522 
2523  default: /* unsupported */
2524  return 0;
2525  }
2526 }
2527 
2528 /* get pointer to the setting */
2530  eAnimChannel_Settings setting,
2531  short *type)
2532 {
2534 
2535  /* clear extra return data first */
2536  *type = 0;
2537 
2538  switch (setting) {
2539  case ACHANNEL_SETTING_EXPAND: /* expanded */
2540  return GET_ACF_FLAG_PTR(linestyle->flag, type);
2541 
2542  case ACHANNEL_SETTING_SELECT: /* selected */
2543  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2544  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2545  if (linestyle->adt) {
2546  return GET_ACF_FLAG_PTR(linestyle->adt->flag, type);
2547  }
2548  return NULL;
2549 
2550  default: /* unsupported */
2551  return NULL;
2552  }
2553 }
2554 
2555 /* node tree expander type define */
2557  "Line Style Expander", /* type name */
2558  ACHANNEL_ROLE_EXPANDER, /* role */
2559 
2560  acf_generic_dataexpand_color, /* backdrop color */
2561  acf_generic_dataexpand_backdrop, /* backdrop */
2562  acf_generic_indention_1, /* indent level */
2563  acf_generic_basic_offset, /* offset */
2564 
2565  acf_generic_idblock_name, /* name */
2566  acf_generic_idblock_name_prop, /* name prop */
2567  acf_dslinestyle_icon, /* icon */
2568 
2569  acf_generic_dataexpand_setting_valid, /* has setting */
2570  acf_dslinestyle_setting_flag, /* flag for setting */
2571  acf_dslinestyle_setting_ptr, /* pointer for setting */
2572 };
2573 
2574 /* Mesh Expander ------------------------------------------- */
2575 
2576 /* TODO: just get this from RNA? */
2578 {
2579  return ICON_MESH_DATA;
2580 }
2581 
2582 /* get the appropriate flag(s) for the setting when it is valid */
2584  eAnimChannel_Settings setting,
2585  bool *neg)
2586 {
2587  /* clear extra return data first */
2588  *neg = false;
2589 
2590  switch (setting) {
2591  case ACHANNEL_SETTING_EXPAND: /* expanded */
2592  return ME_DS_EXPAND;
2593 
2594  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2595  return ADT_NLA_EVAL_OFF;
2596 
2597  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2598  *neg = true;
2599  return ADT_CURVES_NOT_VISIBLE;
2600 
2601  case ACHANNEL_SETTING_SELECT: /* selected */
2602  return ADT_UI_SELECTED;
2603 
2604  default: /* unsupported */
2605  return 0;
2606  }
2607 }
2608 
2609 /* get pointer to the setting */
2611 {
2612  Mesh *me = (Mesh *)ale->data;
2613 
2614  /* clear extra return data first */
2615  *type = 0;
2616 
2617  switch (setting) {
2618  case ACHANNEL_SETTING_EXPAND: /* expanded */
2619  return GET_ACF_FLAG_PTR(me->flag, type);
2620 
2621  case ACHANNEL_SETTING_SELECT: /* selected */
2622  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2623  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2624  if (me->adt) {
2625  return GET_ACF_FLAG_PTR(me->adt->flag, type);
2626  }
2627  return NULL;
2628 
2629  default: /* unsupported */
2630  return NULL;
2631  }
2632 }
2633 
2634 /* node tree expander type define */
2636  "Mesh Expander", /* type name */
2637  ACHANNEL_ROLE_EXPANDER, /* role */
2638 
2639  acf_generic_dataexpand_color, /* backdrop color */
2640  acf_generic_dataexpand_backdrop, /* backdrop */
2642  /* indent level */ /* XXX this only works for compositing */
2643  acf_generic_basic_offset, /* offset */
2644 
2645  acf_generic_idblock_name, /* name */
2646  acf_generic_idblock_name_prop, /* name prop */
2647  acf_dsmesh_icon, /* icon */
2648 
2649  acf_generic_dataexpand_setting_valid, /* has setting */
2650  acf_dsmesh_setting_flag, /* flag for setting */
2651  acf_dsmesh_setting_ptr, /* pointer for setting */
2652 };
2653 
2654 /* Lattice Expander ------------------------------------------- */
2655 
2656 /* TODO: just get this from RNA? */
2658 {
2659  return ICON_LATTICE_DATA;
2660 }
2661 
2662 /* get the appropriate flag(s) for the setting when it is valid */
2664  eAnimChannel_Settings setting,
2665  bool *neg)
2666 {
2667  /* clear extra return data first */
2668  *neg = false;
2669 
2670  switch (setting) {
2671  case ACHANNEL_SETTING_EXPAND: /* expanded */
2672  return LT_DS_EXPAND;
2673 
2674  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2675  return ADT_NLA_EVAL_OFF;
2676 
2677  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2678  *neg = true;
2679  return ADT_CURVES_NOT_VISIBLE;
2680 
2681  case ACHANNEL_SETTING_SELECT: /* selected */
2682  return ADT_UI_SELECTED;
2683 
2684  default: /* unsupported */
2685  return 0;
2686  }
2687 }
2688 
2689 /* get pointer to the setting */
2691 {
2692  Lattice *lt = (Lattice *)ale->data;
2693 
2694  /* clear extra return data first */
2695  *type = 0;
2696 
2697  switch (setting) {
2698  case ACHANNEL_SETTING_EXPAND: /* expanded */
2699  return GET_ACF_FLAG_PTR(lt->flag, type);
2700 
2701  case ACHANNEL_SETTING_SELECT: /* selected */
2702  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2703  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2704  if (lt->adt) {
2705  return GET_ACF_FLAG_PTR(lt->adt->flag, type);
2706  }
2707  return NULL;
2708 
2709  default: /* unsupported */
2710  return NULL;
2711  }
2712 }
2713 
2714 /* node tree expander type define */
2716  "Lattice Expander", /* type name */
2717  ACHANNEL_ROLE_EXPANDER, /* role */
2718 
2719  acf_generic_dataexpand_color, /* backdrop color */
2720  acf_generic_dataexpand_backdrop, /* backdrop */
2722  /* indent level */ /* XXX this only works for compositing */
2723  acf_generic_basic_offset, /* offset */
2724 
2725  acf_generic_idblock_name, /* name */
2726  acf_generic_idblock_name_prop, /* name prop */
2727  acf_dslat_icon, /* icon */
2728 
2729  acf_generic_dataexpand_setting_valid, /* has setting */
2730  acf_dslat_setting_flag, /* flag for setting */
2731  acf_dslat_setting_ptr, /* pointer for setting */
2732 };
2733 
2734 /* Speaker Expander ------------------------------------------- */
2735 
2736 /* TODO: just get this from RNA? */
2738 {
2739  return ICON_SPEAKER;
2740 }
2741 
2742 /* get the appropriate flag(s) for the setting when it is valid */
2744  eAnimChannel_Settings setting,
2745  bool *neg)
2746 {
2747  /* clear extra return data first */
2748  *neg = false;
2749 
2750  switch (setting) {
2751  case ACHANNEL_SETTING_EXPAND: /* expanded */
2752  return SPK_DS_EXPAND;
2753 
2754  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2755  return ADT_NLA_EVAL_OFF;
2756 
2757  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2758  *neg = true;
2759  return ADT_CURVES_NOT_VISIBLE;
2760 
2761  case ACHANNEL_SETTING_SELECT: /* selected */
2762  return ADT_UI_SELECTED;
2763 
2764  default: /* unsupported */
2765  return 0;
2766  }
2767 }
2768 
2769 /* get pointer to the setting */
2771 {
2772  Speaker *spk = (Speaker *)ale->data;
2773 
2774  /* clear extra return data first */
2775  *type = 0;
2776 
2777  switch (setting) {
2778  case ACHANNEL_SETTING_EXPAND: /* expanded */
2779  return GET_ACF_FLAG_PTR(spk->flag, type);
2780 
2781  case ACHANNEL_SETTING_SELECT: /* selected */
2782  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2783  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2784  if (spk->adt) {
2785  return GET_ACF_FLAG_PTR(spk->adt->flag, type);
2786  }
2787  return NULL;
2788 
2789  default: /* unsupported */
2790  return NULL;
2791  }
2792 }
2793 
2794 /* speaker expander type define */
2796  "Speaker Expander", /* type name */
2797  ACHANNEL_ROLE_EXPANDER, /* role */
2798 
2799  acf_generic_dataexpand_color, /* backdrop color */
2800  acf_generic_dataexpand_backdrop, /* backdrop */
2801  acf_generic_indention_1, /* indent level */
2802  acf_generic_basic_offset, /* offset */
2803 
2804  acf_generic_idblock_name, /* name */
2805  acf_generic_idblock_name_prop, /* name prop */
2806  acf_dsspk_icon, /* icon */
2807 
2808  acf_generic_dataexpand_setting_valid, /* has setting */
2809  acf_dsspk_setting_flag, /* flag for setting */
2810  acf_dsspk_setting_ptr, /* pointer for setting */
2811 };
2812 
2813 /* Hair Expander ------------------------------------------- */
2814 
2815 /* TODO: just get this from RNA? */
2817 {
2818  return ICON_HAIR_DATA;
2819 }
2820 
2821 /* get the appropriate flag(s) for the setting when it is valid */
2823  eAnimChannel_Settings setting,
2824  bool *neg)
2825 {
2826  /* clear extra return data first */
2827  *neg = false;
2828 
2829  switch (setting) {
2830  case ACHANNEL_SETTING_EXPAND: /* expanded */
2831  return VO_DS_EXPAND;
2832 
2833  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2834  return ADT_NLA_EVAL_OFF;
2835 
2836  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2837  *neg = true;
2838  return ADT_CURVES_NOT_VISIBLE;
2839 
2840  case ACHANNEL_SETTING_SELECT: /* selected */
2841  return ADT_UI_SELECTED;
2842 
2843  default: /* unsupported */
2844  return 0;
2845  }
2846 }
2847 
2848 /* get pointer to the setting */
2850 {
2851  Hair *hair = (Hair *)ale->data;
2852 
2853  /* clear extra return data first */
2854  *type = 0;
2855 
2856  switch (setting) {
2857  case ACHANNEL_SETTING_EXPAND: /* expanded */
2858  return GET_ACF_FLAG_PTR(hair->flag, type);
2859 
2860  case ACHANNEL_SETTING_SELECT: /* selected */
2861  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2862  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2863  if (hair->adt) {
2864  return GET_ACF_FLAG_PTR(hair->adt->flag, type);
2865  }
2866  return NULL;
2867 
2868  default: /* unsupported */
2869  return NULL;
2870  }
2871 }
2872 
2873 /* hair expander type define */
2875  "Hair Expander", /* type name */
2876  ACHANNEL_ROLE_EXPANDER, /* role */
2877 
2878  acf_generic_dataexpand_color, /* backdrop color */
2879  acf_generic_dataexpand_backdrop, /* backdrop */
2880  acf_generic_indention_1, /* indent level */
2881  acf_generic_basic_offset, /* offset */
2882 
2883  acf_generic_idblock_name, /* name */
2884  acf_generic_idblock_name_prop, /* name prop */
2885  acf_dshair_icon, /* icon */
2886 
2887  acf_generic_dataexpand_setting_valid, /* has setting */
2888  acf_dshair_setting_flag, /* flag for setting */
2889  acf_dshair_setting_ptr /* pointer for setting */
2890 };
2891 
2892 /* PointCloud Expander ------------------------------------------- */
2893 
2894 /* TODO: just get this from RNA? */
2896 {
2897  return ICON_POINTCLOUD_DATA;
2898 }
2899 
2900 /* get the appropriate flag(s) for the setting when it is valid */
2902  eAnimChannel_Settings setting,
2903  bool *neg)
2904 {
2905  /* clear extra return data first */
2906  *neg = false;
2907 
2908  switch (setting) {
2909  case ACHANNEL_SETTING_EXPAND: /* expanded */
2910  return VO_DS_EXPAND;
2911 
2912  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2913  return ADT_NLA_EVAL_OFF;
2914 
2915  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2916  *neg = true;
2917  return ADT_CURVES_NOT_VISIBLE;
2918 
2919  case ACHANNEL_SETTING_SELECT: /* selected */
2920  return ADT_UI_SELECTED;
2921 
2922  default: /* unsupported */
2923  return 0;
2924  }
2925 }
2926 
2927 /* get pointer to the setting */
2929  eAnimChannel_Settings setting,
2930  short *type)
2931 {
2932  PointCloud *pointcloud = (PointCloud *)ale->data;
2933 
2934  /* clear extra return data first */
2935  *type = 0;
2936 
2937  switch (setting) {
2938  case ACHANNEL_SETTING_EXPAND: /* expanded */
2939  return GET_ACF_FLAG_PTR(pointcloud->flag, type);
2940 
2941  case ACHANNEL_SETTING_SELECT: /* selected */
2942  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
2943  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
2944  if (pointcloud->adt) {
2945  return GET_ACF_FLAG_PTR(pointcloud->adt->flag, type);
2946  }
2947  return NULL;
2948 
2949  default: /* unsupported */
2950  return NULL;
2951  }
2952 }
2953 
2954 /* pointcloud expander type define */
2956  "PointCloud Expander", /* type name */
2957  ACHANNEL_ROLE_EXPANDER, /* role */
2958 
2959  acf_generic_dataexpand_color, /* backdrop color */
2960  acf_generic_dataexpand_backdrop, /* backdrop */
2961  acf_generic_indention_1, /* indent level */
2962  acf_generic_basic_offset, /* offset */
2963 
2964  acf_generic_idblock_name, /* name */
2965  acf_generic_idblock_name_prop, /* name prop */
2966  acf_dspointcloud_icon, /* icon */
2967 
2968  acf_generic_dataexpand_setting_valid, /* has setting */
2969  acf_dspointcloud_setting_flag, /* flag for setting */
2970  acf_dspointcloud_setting_ptr /* pointer for setting */
2971 };
2972 
2973 /* Volume Expander ------------------------------------------- */
2974 
2975 /* TODO: just get this from RNA? */
2977 {
2978  return ICON_VOLUME_DATA;
2979 }
2980 
2981 /* get the appropriate flag(s) for the setting when it is valid */
2983  eAnimChannel_Settings setting,
2984  bool *neg)
2985 {
2986  /* clear extra return data first */
2987  *neg = false;
2988 
2989  switch (setting) {
2990  case ACHANNEL_SETTING_EXPAND: /* expanded */
2991  return VO_DS_EXPAND;
2992 
2993  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
2994  return ADT_NLA_EVAL_OFF;
2995 
2996  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
2997  *neg = true;
2998  return ADT_CURVES_NOT_VISIBLE;
2999 
3000  case ACHANNEL_SETTING_SELECT: /* selected */
3001  return ADT_UI_SELECTED;
3002 
3003  default: /* unsupported */
3004  return 0;
3005  }
3006 }
3007 
3008 /* get pointer to the setting */
3010  eAnimChannel_Settings setting,
3011  short *type)
3012 {
3013  Volume *volume = (Volume *)ale->data;
3014 
3015  /* clear extra return data first */
3016  *type = 0;
3017 
3018  switch (setting) {
3019  case ACHANNEL_SETTING_EXPAND: /* expanded */
3020  return GET_ACF_FLAG_PTR(volume->flag, type);
3021 
3022  case ACHANNEL_SETTING_SELECT: /* selected */
3023  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
3024  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
3025  if (volume->adt) {
3026  return GET_ACF_FLAG_PTR(volume->adt->flag, type);
3027  }
3028  return NULL;
3029 
3030  default: /* unsupported */
3031  return NULL;
3032  }
3033 }
3034 
3035 /* volume expander type define */
3037  "Volume Expander", /* type name */
3038  ACHANNEL_ROLE_EXPANDER, /* role */
3039 
3040  acf_generic_dataexpand_color, /* backdrop color */
3041  acf_generic_dataexpand_backdrop, /* backdrop */
3042  acf_generic_indention_1, /* indent level */
3043  acf_generic_basic_offset, /* offset */
3044 
3045  acf_generic_idblock_name, /* name */
3046  acf_generic_idblock_name_prop, /* name prop */
3047  acf_dsvolume_icon, /* icon */
3048 
3049  acf_generic_dataexpand_setting_valid, /* has setting */
3050  acf_dsvolume_setting_flag, /* flag for setting */
3051  acf_dsvolume_setting_ptr /* pointer for setting */
3052 };
3053 
3054 /* Simulation Expander ----------------------------------------- */
3055 
3057 {
3058  /* TODO: Use correct icon. */
3059  return ICON_PHYSICS;
3060 }
3061 
3063  eAnimChannel_Settings setting,
3064  bool *neg)
3065 {
3066  /* clear extra return data first */
3067  *neg = false;
3068 
3069  switch (setting) {
3070  case ACHANNEL_SETTING_EXPAND: /* expanded */
3071  return SIM_DS_EXPAND;
3072 
3073  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
3074  return ADT_NLA_EVAL_OFF;
3075 
3076  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
3077  *neg = true;
3078  return ADT_CURVES_NOT_VISIBLE;
3079 
3080  case ACHANNEL_SETTING_SELECT: /* selected */
3081  return ADT_UI_SELECTED;
3082 
3083  default: /* unsupported */
3084  return 0;
3085  }
3086 }
3087 
3089  eAnimChannel_Settings setting,
3090  short *type)
3091 {
3092  Simulation *simulation = (Simulation *)ale->data;
3093 
3094  /* clear extra return data first */
3095  *type = 0;
3096 
3097  switch (setting) {
3098  case ACHANNEL_SETTING_EXPAND: /* expanded */
3100 
3101  case ACHANNEL_SETTING_SELECT: /* selected */
3102  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
3103  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
3104  if (simulation->adt) {
3106  }
3107  return NULL;
3108 
3109  default: /* unsupported */
3110  return NULL;
3111  }
3112 }
3113 
3115  "Simulation Expander", /* type name */
3116  ACHANNEL_ROLE_EXPANDER, /* role */
3117 
3118  acf_generic_dataexpand_color, /* backdrop color */
3119  acf_generic_dataexpand_backdrop, /* backdrop */
3120  acf_generic_indention_1, /* indent level */
3121  acf_generic_basic_offset, /* offset */
3122 
3123  acf_generic_idblock_name, /* name */
3124  acf_generic_idblock_name_prop, /* name prop */
3125  acf_dssimulation_icon, /* icon */
3126 
3127  acf_generic_dataexpand_setting_valid, /* has setting */
3128  acf_dssimulation_setting_flag, /* flag for setting */
3129  acf_dssimulation_setting_ptr /* pointer for setting */
3130 };
3131 
3132 /* GPencil Expander ------------------------------------------- */
3133 
3134 /* TODO: just get this from RNA? */
3136 {
3137  return ICON_GREASEPENCIL;
3138 }
3139 
3140 /* get the appropriate flag(s) for the setting when it is valid */
3142  eAnimChannel_Settings setting,
3143  bool *neg)
3144 {
3145  /* clear extra return data first */
3146  *neg = false;
3147 
3148  switch (setting) {
3149  case ACHANNEL_SETTING_EXPAND: /* expanded */
3150  return GP_DATA_EXPAND;
3151 
3152  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
3153  return ADT_NLA_EVAL_OFF;
3154 
3155  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
3156  *neg = true;
3157  return ADT_CURVES_NOT_VISIBLE;
3158 
3159  case ACHANNEL_SETTING_SELECT: /* selected */
3160  return ADT_UI_SELECTED;
3161 
3162  default: /* unsupported */
3163  return 0;
3164  }
3165 }
3166 
3167 /* get pointer to the setting */
3169  eAnimChannel_Settings setting,
3170  short *type)
3171 {
3172  bGPdata *gpd = (bGPdata *)ale->data;
3173 
3174  /* clear extra return data first */
3175  *type = 0;
3176 
3177  switch (setting) {
3178  case ACHANNEL_SETTING_EXPAND: /* expanded */
3179  return GET_ACF_FLAG_PTR(gpd->flag, type);
3180 
3181  case ACHANNEL_SETTING_SELECT: /* selected */
3182  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
3183  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
3184  if (gpd->adt) {
3185  return GET_ACF_FLAG_PTR(gpd->adt->flag, type);
3186  }
3187  return NULL;
3188 
3189  default: /* unsupported */
3190  return NULL;
3191  }
3192 }
3193 
3194 /* grease pencil expander type define */
3196  "GPencil DS Expander", /* type name */
3197  ACHANNEL_ROLE_EXPANDER, /* role */
3198 
3199  acf_generic_dataexpand_color, /* backdrop color */
3200  acf_generic_dataexpand_backdrop, /* backdrop */
3201  acf_generic_indention_1, /* indent level */
3202  acf_generic_basic_offset, /* offset */
3203 
3204  acf_generic_idblock_name, /* name */
3205  acf_generic_idblock_name_prop, /* name prop */
3206  acf_dsgpencil_icon, /* icon */
3207 
3208  acf_generic_dataexpand_setting_valid, /* has setting */
3209  acf_dsgpencil_setting_flag, /* flag for setting */
3210  acf_dsgpencil_setting_ptr, /* pointer for setting */
3211 };
3212 
3213 /* World Expander ------------------------------------------- */
3214 
3215 /* TODO: just get this from RNA? */
3217 {
3218  return ICON_SEQUENCE;
3219 }
3220 
3221 /* get the appropriate flag(s) for the setting when it is valid */
3223  eAnimChannel_Settings setting,
3224  bool *neg)
3225 {
3226  /* clear extra return data first */
3227  *neg = false;
3228 
3229  switch (setting) {
3230  case ACHANNEL_SETTING_EXPAND: /* expanded */
3231  return MCLIP_DATA_EXPAND;
3232 
3233  case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
3234  return ADT_NLA_EVAL_OFF;
3235 
3236  case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
3237  *neg = true;
3238  return ADT_CURVES_NOT_VISIBLE;
3239 
3240  case ACHANNEL_SETTING_SELECT: /* selected */
3241  return ADT_UI_SELECTED;
3242 
3243  default: /* unsupported */
3244  return 0;
3245  }
3246 }
3247 
3248 /* get pointer to the setting */
3250  eAnimChannel_Settings setting,
3251  short *type)
3252 {
3253  MovieClip *clip = (MovieClip *)ale->data;
3254 
3255  /* clear extra return data first */
3256  *type = 0;
3257 
3258  switch (setting) {
3259  case ACHANNEL_SETTING_EXPAND: /* expanded */
3260  return GET_ACF_FLAG_PTR(clip->flag, type);
3261 
3262  case ACHANNEL_SETTING_SELECT: /* selected */
3263  case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
3264  case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
3265  if (clip->adt != NULL) {
3266  return GET_ACF_FLAG_PTR(clip->adt->flag, type);
3267  }
3268  return NULL;
3269 
3270  default: /* unsupported */
3271  return NULL;
3272  }
3273 }
3274 
3275 /* world expander type define */
3277  "Movieclip Expander", /* type name */
3278  ACHANNEL_ROLE_EXPANDER, /* role */
3279 
3280  acf_generic_dataexpand_color, /* backdrop color */
3281  acf_generic_dataexpand_backdrop, /* backdrop */
3282  acf_generic_indention_1, /* indent level */
3283  acf_generic_basic_offset, /* offset */
3284 
3285  acf_generic_idblock_name, /* name */
3286  acf_generic_idfill_name_prop, /* name prop */
3287  acf_dsmclip_icon, /* icon */
3288 
3289  acf_generic_dataexpand_setting_valid, /* has setting */
3290  acf_dsmclip_setting_flag, /* flag for setting */
3291  acf_dsmclip_setting_ptr, /* pointer for setting */
3292 };
3293 
3294 /* ShapeKey Entry ------------------------------------------- */
3295 
3296 /* name for ShapeKey */
3297 static void acf_shapekey_name(bAnimListElem *ale, char *name)
3298 {
3299  KeyBlock *kb = (KeyBlock *)ale->data;
3300 
3301  /* just copy the name... */
3302  if (kb && name) {
3303  /* if the KeyBlock had a name, use it, otherwise use the index */
3304  if (kb->name[0]) {
3305  BLI_strncpy(name, kb->name, ANIM_CHAN_NAME_SIZE);
3306  }
3307  else {
3308  BLI_snprintf(name, ANIM_CHAN_NAME_SIZE, IFACE_("Key %d"), ale->index);
3309  }
3310  }
3311 }
3312 
3313 /* name property for ShapeKey entries */
3315 {
3316  KeyBlock *kb = (KeyBlock *)ale->data;
3317 
3318  /* if the KeyBlock had a name, use it, otherwise use the index */
3319  if (kb && kb->name[0]) {
3320  RNA_pointer_create(ale->id, &RNA_ShapeKey, kb, ptr);
3321  *prop = RNA_struct_name_property(ptr->type);
3322 
3323  return (*prop != NULL);
3324  }
3325 
3326  return false;
3327 }
3328 
3329 /* check if some setting exists for this channel */
3331  bAnimListElem *UNUSED(ale),
3332  eAnimChannel_Settings setting)
3333 {
3334  switch (setting) {
3335  case ACHANNEL_SETTING_SELECT: /* selected */
3336  case ACHANNEL_SETTING_MUTE: /* muted */
3337  case ACHANNEL_SETTING_PROTECT: /* protected */
3338  return true;
3339 
3340  /* nothing else is supported */
3341  default:
3342  return false;
3343  }
3344 }
3345 
3346 /* get the appropriate flag(s) for the setting when it is valid */
3348  eAnimChannel_Settings setting,
3349  bool *neg)
3350 {
3351  /* clear extra return data first */
3352  *neg = false;
3353 
3354  switch (setting) {
3355  case ACHANNEL_SETTING_MUTE: /* mute */
3356  return KEYBLOCK_MUTE;
3357 
3358  case ACHANNEL_SETTING_SELECT: /* selected */
3359  return KEYBLOCK_SEL;
3360 
3361  case ACHANNEL_SETTING_PROTECT: /* locked */
3362  return KEYBLOCK_LOCKED;
3363 
3364  default: /* unsupported */
3365  return 0;
3366  }
3367 }
3368 
3369 /* get pointer to the setting */
3371  eAnimChannel_Settings setting,
3372  short *type)
3373 {
3374  KeyBlock *kb = (KeyBlock *)ale->data;
3375 
3376  /* clear extra return data first */
3377  *type = 0;
3378 
3379  switch (setting) {
3380  case ACHANNEL_SETTING_SELECT: /* selected */
3381  case ACHANNEL_SETTING_MUTE: /* muted */
3382  case ACHANNEL_SETTING_PROTECT: /* protected */
3383  return GET_ACF_FLAG_PTR(kb->flag, type);
3384 
3385  default: /* unsupported */
3386  return NULL;
3387  }
3388 }
3389 
3390 /* shapekey expander type define */
3392  "Shape Key", /* type name */
3393  ACHANNEL_ROLE_CHANNEL, /* role */
3394 
3395  acf_generic_channel_color, /* backdrop color */
3396  acf_generic_channel_backdrop, /* backdrop */
3397  acf_generic_indention_0, /* indent level */
3398  acf_generic_basic_offset, /* offset */
3399 
3400  acf_shapekey_name, /* name */
3401  acf_shapekey_name_prop, /* name prop */
3402  NULL, /* icon */
3403 
3404  acf_shapekey_setting_valid, /* has setting */
3405  acf_shapekey_setting_flag, /* flag for setting */
3406  acf_shapekey_setting_ptr, /* pointer for setting */
3407 };
3408 
3409 /* GPencil Datablock ------------------------------------------- */
3410 
3411 /* get backdrop color for gpencil datablock widget */
3412 static void acf_gpd_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
3413 {
3414  /* these are ID-blocks, but not exactly standalone... */
3416 }
3417 
3418 /* TODO: just get this from RNA? */
3420 {
3421  return ICON_GREASEPENCIL;
3422 }
3423 
3424 /* check if some setting exists for this channel */
3426  bAnimListElem *UNUSED(ale),
3427  eAnimChannel_Settings setting)
3428 {
3429  switch (setting) {
3430  /* only select and expand supported */
3433  return true;
3434 
3435  default:
3436  return false;
3437  }
3438 }
3439 
3440 /* get the appropriate flag(s) for the setting when it is valid */
3442 {
3443  /* clear extra return data first */
3444  *neg = false;
3445 
3446  switch (setting) {
3447  case ACHANNEL_SETTING_SELECT: /* selected */
3448  return AGRP_SELECTED;
3449 
3450  case ACHANNEL_SETTING_EXPAND: /* expanded */
3451  return GP_DATA_EXPAND;
3452 
3453  default:
3454  /* these shouldn't happen */
3455  return 0;
3456  }
3457 }
3458 
3459 /* get pointer to the setting */
3461  eAnimChannel_Settings UNUSED(setting),
3462  short *type)
3463 {
3464  bGPdata *gpd = (bGPdata *)ale->data;
3465 
3466  /* all flags are just in gpd->flag for now... */
3467  return GET_ACF_FLAG_PTR(gpd->flag, type);
3468 }
3469 
3470 /* gpencil datablock type define */
3472  "GPencil Datablock", /* type name */
3473  ACHANNEL_ROLE_EXPANDER, /* role */
3474 
3475  acf_gpd_color, /* backdrop color */
3476  acf_group_backdrop, /* backdrop */
3477  acf_generic_indention_0, /* indent level */
3478  acf_generic_group_offset, /* offset */
3479 
3480  acf_generic_idblock_name, /* name */
3481  acf_generic_idfill_name_prop, /* name prop */
3482  acf_gpd_icon, /* icon */
3483 
3484  acf_gpd_setting_valid, /* has setting */
3485  acf_gpd_setting_flag, /* flag for setting */
3486  acf_gpd_setting_ptr, /* pointer for setting */
3487 };
3488 
3489 /* GPencil Layer ------------------------------------------- */
3490 
3491 /* name for grease pencil layer entries */
3492 static void acf_gpl_name(bAnimListElem *ale, char *name)
3493 {
3494  bGPDlayer *gpl = (bGPDlayer *)ale->data;
3495 
3496  if (gpl && name) {
3497  BLI_strncpy(name, gpl->info, ANIM_CHAN_NAME_SIZE);
3498  }
3499 }
3500 
3501 /* name property for grease pencil layer entries */
3503 {
3504  if (ale->data) {
3506  *prop = RNA_struct_name_property(ptr->type);
3507 
3508  return (*prop != NULL);
3509  }
3510 
3511  return false;
3512 }
3513 
3514 /* check if some setting exists for this channel */
3516  bAnimListElem *UNUSED(ale),
3517  eAnimChannel_Settings setting)
3518 {
3519  switch (setting) {
3520  /* unsupported */
3521  case ACHANNEL_SETTING_EXPAND: /* gpencil layers are more like F-Curves than groups */
3522  case ACHANNEL_SETTING_SOLO: /* nla editor only */
3524  case ACHANNEL_SETTING_PINNED: /* nla actions only */
3525  return false;
3526 
3527  /* always available */
3528  default:
3529  return true;
3530  }
3531 }
3532 
3533 /* get the appropriate flag(s) for the setting when it is valid */
3535 {
3536  /* clear extra return data first */
3537  *neg = false;
3538 
3539  switch (setting) {
3540  case ACHANNEL_SETTING_SELECT: /* selected */
3541  return GP_LAYER_SELECT;
3542 
3543  case ACHANNEL_SETTING_MUTE: /* animation muting - similar to frame lock... */
3544  return GP_LAYER_FRAMELOCK;
3545 
3546  case ACHANNEL_SETTING_VISIBLE: /* visibility of the layers (NOT muting) */
3547  *neg = true;
3548  return GP_LAYER_HIDE;
3549 
3550  case ACHANNEL_SETTING_PROTECT: /* protected */
3551  return GP_LAYER_LOCKED;
3552 
3553  default: /* unsupported */
3554  return 0;
3555  }
3556 }
3557 
3558 /* get pointer to the setting */
3560  eAnimChannel_Settings UNUSED(setting),
3561  short *type)
3562 {
3563  bGPDlayer *gpl = (bGPDlayer *)ale->data;
3564 
3565  /* all flags are just in gpl->flag for now... */
3566  return GET_ACF_FLAG_PTR(gpl->flag, type);
3567 }
3568 
3569 /* grease pencil layer type define */
3571  "GPencil Layer", /* type name */
3572  ACHANNEL_ROLE_CHANNEL, /* role */
3573 
3574  acf_gpencil_channel_color, /* backdrop color */
3575  acf_generic_channel_backdrop, /* backdrop */
3576  acf_generic_indention_flexible, /* indent level */
3577  acf_generic_group_offset, /* offset */
3578 
3579  acf_gpl_name, /* name */
3580  acf_gpl_name_prop, /* name prop */
3581  NULL, /* icon */
3582 
3583  acf_gpl_setting_valid, /* has setting */
3584  acf_gpl_setting_flag, /* flag for setting */
3585  acf_gpl_setting_ptr, /* pointer for setting */
3586 };
3587 
3588 /* Mask Datablock ------------------------------------------- */
3589 
3590 /* get backdrop color for mask datablock widget */
3591 static void acf_mask_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
3592 {
3593  /* these are ID-blocks, but not exactly standalone... */
3595 }
3596 
3597 /* TODO: just get this from RNA? */
3599 {
3600  return ICON_MOD_MASK;
3601 }
3602 
3603 /* check if some setting exists for this channel */
3605  bAnimListElem *UNUSED(ale),
3606  eAnimChannel_Settings setting)
3607 {
3608  switch (setting) {
3609  /* only select and expand supported */
3612  return true;
3613 
3614  default:
3615  return false;
3616  }
3617 }
3618 
3619 /* get the appropriate flag(s) for the setting when it is valid */
3621  eAnimChannel_Settings setting,
3622  bool *neg)
3623 {
3624  /* clear extra return data first */
3625  *neg = false;
3626 
3627  switch (setting) {
3628  case ACHANNEL_SETTING_SELECT: /* selected */
3629  return AGRP_SELECTED;
3630 
3631  case ACHANNEL_SETTING_EXPAND: /* expanded */
3632  return MASK_ANIMF_EXPAND;
3633 
3634  default:
3635  /* this shouldn't happen */
3636  return 0;
3637  }
3638 }
3639 
3640 /* get pointer to the setting */
3642  eAnimChannel_Settings UNUSED(setting),
3643  short *type)
3644 {
3645  Mask *mask = (Mask *)ale->data;
3646 
3647  /* all flags are just in mask->flag for now... */
3648  return GET_ACF_FLAG_PTR(mask->flag, type);
3649 }
3650 
3651 /* mask datablock type define */
3653  "Mask Datablock", /* type name */
3654  ACHANNEL_ROLE_EXPANDER, /* role */
3655 
3656  acf_mask_color, /* backdrop color */
3657  acf_group_backdrop, /* backdrop */
3658  acf_generic_indention_0, /* indent level */
3659  acf_generic_group_offset, /* offset */
3660 
3661  acf_generic_idblock_name, /* name */
3662  acf_generic_idfill_name_prop, /* name prop */
3663  acf_mask_icon, /* icon */
3664 
3665  acf_mask_setting_valid, /* has setting */
3666  acf_mask_setting_flag, /* flag for setting */
3667  acf_mask_setting_ptr, /* pointer for setting */
3668 };
3669 
3670 /* Mask Layer ------------------------------------------- */
3671 
3672 /* name for grease pencil layer entries */
3673 static void acf_masklay_name(bAnimListElem *ale, char *name)
3674 {
3675  MaskLayer *masklay = (MaskLayer *)ale->data;
3676 
3677  if (masklay && name) {
3678  BLI_strncpy(name, masklay->name, ANIM_CHAN_NAME_SIZE);
3679  }
3680 }
3681 
3682 /* name property for grease pencil layer entries */
3684 {
3685  if (ale->data) {
3686  RNA_pointer_create(ale->id, &RNA_MaskLayer, ale->data, ptr);
3687  *prop = RNA_struct_name_property(ptr->type);
3688 
3689  return (*prop != NULL);
3690  }
3691 
3692  return false;
3693 }
3694 
3695 /* check if some setting exists for this channel */
3697  bAnimListElem *UNUSED(ale),
3698  eAnimChannel_Settings setting)
3699 {
3700  switch (setting) {
3701  /* unsupported */
3702  case ACHANNEL_SETTING_EXPAND: /* mask layers are more like F-Curves than groups */
3703  case ACHANNEL_SETTING_VISIBLE: /* graph editor only */
3704  case ACHANNEL_SETTING_SOLO: /* nla editor only */
3706  case ACHANNEL_SETTING_PINNED: /* nla actions only */
3707  case ACHANNEL_SETTING_MUTE:
3708  return false;
3709 
3710  /* always available */
3711  default:
3712  return true;
3713  }
3714 }
3715 
3716 /* get the appropriate flag(s) for the setting when it is valid */
3718  eAnimChannel_Settings setting,
3719  bool *neg)
3720 {
3721  /* clear extra return data first */
3722  *neg = false;
3723 
3724  switch (setting) {
3725  case ACHANNEL_SETTING_SELECT: /* selected */
3726  return MASK_LAYERFLAG_SELECT;
3727 
3728  case ACHANNEL_SETTING_PROTECT: /* protected */
3729  return MASK_LAYERFLAG_LOCKED;
3730 
3731  default: /* unsupported */
3732  return 0;
3733  }
3734 }
3735 
3736 /* get pointer to the setting */
3738  eAnimChannel_Settings UNUSED(setting),
3739  short *type)
3740 {
3741  MaskLayer *masklay = (MaskLayer *)ale->data;
3742 
3743  /* all flags are just in masklay->flag for now... */
3744  return GET_ACF_FLAG_PTR(masklay->flag, type);
3745 }
3746 
3747 /* grease pencil layer type define */
3749  "Mask Layer", /* type name */
3750  ACHANNEL_ROLE_CHANNEL, /* role */
3751 
3752  acf_generic_channel_color, /* backdrop color */
3753  acf_generic_channel_backdrop, /* backdrop */
3754  acf_generic_indention_flexible, /* indent level */
3755  acf_generic_group_offset, /* offset */
3756 
3757  acf_masklay_name, /* name */
3758  acf_masklay_name_prop, /* name prop */
3759  NULL, /* icon */
3760 
3761  acf_masklay_setting_valid, /* has setting */
3762  acf_masklay_setting_flag, /* flag for setting */
3763  acf_masklay_setting_ptr, /* pointer for setting */
3764 };
3765 
3766 /* NLA Track ----------------------------------------------- */
3767 
3768 /* get backdrop color for nla track channels */
3769 static void acf_nlatrack_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
3770 {
3771  NlaTrack *nlt = (NlaTrack *)ale->data;
3772  AnimData *adt = ale->adt;
3773  bool nonSolo = false;
3774 
3775  /* is track enabled for solo drawing? */
3776  if ((adt) && (adt->flag & ADT_NLA_SOLO_TRACK)) {
3777  if ((nlt->flag & NLATRACK_SOLO) == 0) {
3778  /* tag for special non-solo handling */
3779  nonSolo = true;
3780  }
3781  }
3782 
3783  /* set color for nla track */
3784  UI_GetThemeColorShade3fv(TH_NLA_TRACK, ((nonSolo == false) ? 20 : -20), r_color);
3785 }
3786 
3787 /* name for nla track entries */
3788 static void acf_nlatrack_name(bAnimListElem *ale, char *name)
3789 {
3790  NlaTrack *nlt = (NlaTrack *)ale->data;
3791 
3792  if (nlt && name) {
3793  BLI_strncpy(name, nlt->name, ANIM_CHAN_NAME_SIZE);
3794  }
3795 }
3796 
3797 /* name property for nla track entries */
3799 {
3800  if (ale->data) {
3801  RNA_pointer_create(ale->id, &RNA_NlaTrack, ale->data, ptr);
3802  *prop = RNA_struct_name_property(ptr->type);
3803 
3804  return (*prop != NULL);
3805  }
3806 
3807  return false;
3808 }
3809 
3810 /* check if some setting exists for this channel */
3812  bAnimListElem *ale,
3813  eAnimChannel_Settings setting)
3814 {
3815  NlaTrack *nlt = (NlaTrack *)ale->data;
3816  AnimData *adt = ale->adt;
3817 
3818  /* visibility of settings depends on various states... */
3819  switch (setting) {
3820  /* always supported */
3822  case ACHANNEL_SETTING_SOLO:
3823  return true;
3824 
3825  /* conditionally supported... */
3827  case ACHANNEL_SETTING_MUTE:
3828  /* if this track is active and we're tweaking it, don't draw these toggles */
3829  if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) {
3830  /* is track enabled for solo drawing? */
3831  if ((adt) && (adt->flag & ADT_NLA_SOLO_TRACK)) {
3832  if (nlt->flag & NLATRACK_SOLO) {
3833  /* ok - we've got a solo track, and this is it */
3834  return true;
3835  }
3836  /* not ok - we've got a solo track, but this isn't it, so make it more obvious */
3837  return false;
3838  }
3839 
3840  /* ok - no tracks are solo'd, and this isn't being tweaked */
3841  return true;
3842  }
3843  /* unsupported - this track is being tweaked */
3844  return false;
3845 
3846  /* unsupported */
3847  default:
3848  return false;
3849  }
3850 }
3851 
3852 /* get the appropriate flag(s) for the setting when it is valid */
3854  eAnimChannel_Settings setting,
3855  bool *neg)
3856 {
3857  /* clear extra return data first */
3858  *neg = false;
3859 
3860  switch (setting) {
3861  case ACHANNEL_SETTING_SELECT: /* selected */
3862  return NLATRACK_SELECTED;
3863 
3864  case ACHANNEL_SETTING_MUTE: /* muted */
3865  return NLATRACK_MUTED;
3866 
3867  case ACHANNEL_SETTING_PROTECT: /* protected */
3868  return NLATRACK_PROTECTED;
3869 
3870  case ACHANNEL_SETTING_SOLO: /* solo */
3871  return NLATRACK_SOLO;
3872 
3873  default: /* unsupported */
3874  return 0;
3875  }
3876 }
3877 
3878 /* get pointer to the setting */
3880  eAnimChannel_Settings UNUSED(setting),
3881  short *type)
3882 {
3883  NlaTrack *nlt = (NlaTrack *)ale->data;
3884  return GET_ACF_FLAG_PTR(nlt->flag, type);
3885 }
3886 
3887 /* nla track type define */
3889  "NLA Track", /* type name */
3890  ACHANNEL_ROLE_CHANNEL, /* role */
3891 
3892  acf_nlatrack_color, /* backdrop color */
3893  acf_generic_channel_backdrop, /* backdrop */
3894  acf_generic_indention_flexible, /* indent level */
3896  /* offset */ /* XXX? */
3897 
3898  acf_nlatrack_name, /* name */
3899  acf_nlatrack_name_prop, /* name prop */
3900  NULL, /* icon */
3901 
3902  acf_nlatrack_setting_valid, /* has setting */
3903  acf_nlatrack_setting_flag, /* flag for setting */
3904  acf_nlatrack_setting_ptr, /* pointer for setting */
3905 };
3906 
3907 /* NLA Action ----------------------------------------------- */
3908 
3909 /* icon for action depends on whether it's in tweaking mode */
3911 {
3912  AnimData *adt = ale->adt;
3913 
3914  /* indicate tweaking-action state by changing the icon... */
3915  if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
3916  return ICON_ACTION_TWEAK;
3917  }
3918 
3919  return ICON_ACTION;
3920 }
3921 
3922 /* Backdrop color for nla action channel
3923  * Although this can't be used directly for NLA Action drawing,
3924  * it is still needed for use behind the RHS toggles
3925  */
3926 static void acf_nlaaction_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
3927 {
3928  float color[4];
3929 
3930  /* Action Line
3931  * The alpha values action_get_color returns are only useful for drawing
3932  * strips backgrounds but here we're doing channel list backgrounds instead
3933  * so we ignore that and use our own when needed
3934  */
3935  nla_action_get_color(ale->adt, (bAction *)ale->data, color);
3936 
3937  /* NOTE: since the return types only allow rgb, we cannot do the alpha-blending we'd
3938  * like for the solo-drawing case. Hence, this method isn't actually used for drawing
3939  * most of the channel...
3940  */
3941  copy_v3_v3(r_color, color);
3942 }
3943 
3944 /* backdrop for nla action channel */
3945 static void acf_nlaaction_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
3946 {
3947  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
3948  View2D *v2d = &ac->region->v2d;
3949  AnimData *adt = ale->adt;
3950  short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
3951  float color[4];
3952 
3953  /* Action Line
3954  * The alpha values action_get_color returns are only useful for drawing
3955  * strips backgrounds but here we're doing channel list backgrounds instead
3956  * so we ignore that and use our own when needed
3957  */
3958  nla_action_get_color(adt, (bAction *)ale->data, color);
3959 
3960  if (adt && (adt->flag & ADT_NLA_EDIT_ON)) {
3961  color[3] = 1.0f;
3962  }
3963  else {
3964  color[3] = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f;
3965  }
3966 
3967  /* only on top left corner, to show that this channel sits on top of the preceding ones
3968  * while still linking into the action line strip to the right
3969  */
3971 
3972  /* draw slightly shifted up vertically to look like it has more separation from other channels,
3973  * but we then need to slightly shorten it so that it doesn't look like it overlaps
3974  */
3976  &(const rctf){
3977  .xmin = offset,
3978  .xmax = (float)v2d->cur.xmax,
3979  .ymin = yminc + NLACHANNEL_SKIP,
3980  .ymax = ymaxc + NLACHANNEL_SKIP - 1,
3981  },
3982  true,
3983  8,
3984  color);
3985 }
3986 
3987 /* name for nla action entries */
3988 static void acf_nlaaction_name(bAnimListElem *ale, char *name)
3989 {
3990  bAction *act = (bAction *)ale->data;
3991 
3992  if (name) {
3993  if (act) {
3994  /* TODO: add special decoration when doing this in tweaking mode? */
3995  BLI_strncpy(name, act->id.name + 2, ANIM_CHAN_NAME_SIZE);
3996  }
3997  else {
3998  BLI_strncpy(name, "<No Action>", ANIM_CHAN_NAME_SIZE);
3999  }
4000  }
4001 }
4002 
4003 /* name property for nla action entries */
4005 {
4006  if (ale->data) {
4008  *prop = RNA_struct_name_property(ptr->type);
4009 
4010  return (*prop != NULL);
4011  }
4012 
4013  return false;
4014 }
4015 
4016 /* check if some setting exists for this channel */
4018  bAnimListElem *ale,
4019  eAnimChannel_Settings setting)
4020 {
4021  AnimData *adt = ale->adt;
4022 
4023  /* visibility of settings depends on various states... */
4024  switch (setting) {
4025  /* conditionally supported */
4026  case ACHANNEL_SETTING_PINNED: /* pinned - map/unmap */
4027  if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
4028  /* this should only appear in tweakmode */
4029  return true;
4030  }
4031  else {
4032  return false;
4033  }
4034 
4035  /* unsupported */
4036  default:
4037  return false;
4038  }
4039 }
4040 
4041 /* get the appropriate flag(s) for the setting when it is valid */
4043  eAnimChannel_Settings setting,
4044  bool *neg)
4045 {
4046  /* clear extra return data first */
4047  *neg = false;
4048 
4049  switch (setting) {
4050  case ACHANNEL_SETTING_PINNED: /* pinned - map/unmap */
4051  *neg = true; /* XXX */
4052  return ADT_NLA_EDIT_NOMAP;
4053 
4054  default: /* unsupported */
4055  return 0;
4056  }
4057 }
4058 
4059 /* get pointer to the setting */
4061  eAnimChannel_Settings UNUSED(setting),
4062  short *type)
4063 {
4064  AnimData *adt = ale->adt;
4065  return GET_ACF_FLAG_PTR(adt->flag, type);
4066 }
4067 
4068 /* nla action type define */
4070  "NLA Active Action", /* type name */
4071  ACHANNEL_ROLE_CHANNEL, /* role */
4072 
4073  acf_nlaaction_color, /* backdrop color (NOTE: the backdrop handles this too,
4074  * since it needs special hacks). */
4075  acf_nlaaction_backdrop, /* backdrop */
4076  acf_generic_indention_flexible, /* indent level */
4078  /* offset */ /* XXX? */
4079 
4080  acf_nlaaction_name, /* name */
4081  acf_nlaaction_name_prop, /* name prop */
4082  acf_nlaaction_icon, /* icon */
4083 
4084  acf_nlaaction_setting_valid, /* has setting */
4085  acf_nlaaction_setting_flag, /* flag for setting */
4086  acf_nlaaction_setting_ptr, /* pointer for setting */
4087 };
4088 
4089 /* *********************************************** */
4090 /* Type Registration and General Access */
4091 
4092 /* These globals only ever get directly accessed in this file */
4094 static short ACF_INIT = 1; /* when non-zero, the list needs to be updated */
4095 
4096 /* Initialize type info definitions */
4098 {
4099  int type = 0;
4100 
4101  /* start initializing if necessary... */
4102  if (ACF_INIT) {
4103  ACF_INIT = 0;
4104 
4105  /* NOTE: need to keep the order of these synchronized with the definition of
4106  * channel types (eAnim_ChannelType) in ED_anim_api.h
4107  */
4108  animchannelTypeInfo[type++] = NULL; /* None */
4109  animchannelTypeInfo[type++] = NULL; /* AnimData */
4110  animchannelTypeInfo[type++] = NULL; /* Special */
4111 
4112  animchannelTypeInfo[type++] = &ACF_SUMMARY; /* Motion Summary */
4113 
4114  animchannelTypeInfo[type++] = &ACF_SCENE; /* Scene */
4115  animchannelTypeInfo[type++] = &ACF_OBJECT; /* Object */
4116  animchannelTypeInfo[type++] = &ACF_GROUP; /* Group */
4117  animchannelTypeInfo[type++] = &ACF_FCURVE; /* F-Curve */
4118 
4119  animchannelTypeInfo[type++] = &ACF_NLACONTROLS; /* NLA Control FCurve Expander */
4120  animchannelTypeInfo[type++] = &ACF_NLACURVE; /* NLA Control FCurve Channel */
4121 
4122  animchannelTypeInfo[type++] = &ACF_FILLACTD; /* Object Action Expander */
4123  animchannelTypeInfo[type++] = &ACF_FILLDRIVERS; /* Drivers Expander */
4124 
4125  animchannelTypeInfo[type++] = &ACF_DSMAT; /* Material Channel */
4126  animchannelTypeInfo[type++] = &ACF_DSLIGHT; /* Light Channel */
4127  animchannelTypeInfo[type++] = &ACF_DSCAM; /* Camera Channel */
4128  animchannelTypeInfo[type++] = &ACF_DSCACHEFILE; /* CacheFile Channel */
4129  animchannelTypeInfo[type++] = &ACF_DSCUR; /* Curve Channel */
4130  animchannelTypeInfo[type++] = &ACF_DSSKEY; /* ShapeKey Channel */
4131  animchannelTypeInfo[type++] = &ACF_DSWOR; /* World Channel */
4132  animchannelTypeInfo[type++] = &ACF_DSNTREE; /* NodeTree Channel */
4133  animchannelTypeInfo[type++] = &ACF_DSPART; /* Particle Channel */
4134  animchannelTypeInfo[type++] = &ACF_DSMBALL; /* MetaBall Channel */
4135  animchannelTypeInfo[type++] = &ACF_DSARM; /* Armature Channel */
4136  animchannelTypeInfo[type++] = &ACF_DSMESH; /* Mesh Channel */
4137  animchannelTypeInfo[type++] = &ACF_DSTEX; /* Texture Channel */
4138  animchannelTypeInfo[type++] = &ACF_DSLAT; /* Lattice Channel */
4139  animchannelTypeInfo[type++] = &ACF_DSLINESTYLE; /* LineStyle Channel */
4140  animchannelTypeInfo[type++] = &ACF_DSSPK; /* Speaker Channel */
4141  animchannelTypeInfo[type++] = &ACF_DSGPENCIL; /* GreasePencil Channel */
4142  animchannelTypeInfo[type++] = &ACF_DSMCLIP; /* MovieClip Channel */
4143  animchannelTypeInfo[type++] = &ACF_DSHAIR; /* Hair Channel */
4144  animchannelTypeInfo[type++] = &ACF_DSPOINTCLOUD; /* PointCloud Channel */
4145  animchannelTypeInfo[type++] = &ACF_DSVOLUME; /* Volume Channel */
4146  animchannelTypeInfo[type++] = &ACF_DSSIMULATION; /* Simulation Channel */
4147 
4148  animchannelTypeInfo[type++] = &ACF_SHAPEKEY; /* ShapeKey */
4149 
4150  animchannelTypeInfo[type++] = &ACF_GPD; /* Grease Pencil Datablock */
4151  animchannelTypeInfo[type++] = &ACF_GPL; /* Grease Pencil Layer */
4152 
4153  animchannelTypeInfo[type++] = &ACF_MASKDATA; /* Mask Datablock */
4154  animchannelTypeInfo[type++] = &ACF_MASKLAYER; /* Mask Layer */
4155 
4156  animchannelTypeInfo[type++] = &ACF_NLATRACK; /* NLA Track */
4157  animchannelTypeInfo[type++] = &ACF_NLAACTION; /* NLA Action */
4158  }
4159 }
4160 
4161 /* Get type info from given channel type */
4163 {
4164  /* Sanity checks. */
4165  if (ale == NULL) {
4166  return NULL;
4167  }
4168 
4169  /* init the typeinfo if not available yet... */
4171 
4172  /* check if type is in bounds... */
4173  if ((ale->type >= 0) && (ale->type < ANIMTYPE_NUM_TYPES)) {
4174  return animchannelTypeInfo[ale->type];
4175  }
4176 
4177  return NULL;
4178 }
4179 
4180 /* --------------------------- */
4181 
4182 /* Print debug info string for the given channel */
4183 void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level)
4184 {
4185  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
4186 
4187  /* print indents */
4188  for (; indent_level > 0; indent_level--) {
4189  printf(" ");
4190  }
4191 
4192  /* print info */
4193  if (acf) {
4194  char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */
4195 
4196  /* get UI name */
4197  if (acf->name) {
4198  acf->name(ale, name);
4199  }
4200  else {
4201  BLI_strncpy(name, "<No name>", sizeof(name));
4202  }
4203 
4204  /* print type name + ui name */
4205  printf("ChanType: <%s> Name: \"%s\"\n", acf->channel_type_name, name);
4206  }
4207  else if (ale) {
4208  printf("ChanType: <Unknown - %d>\n", ale->type);
4209  }
4210  else {
4211  printf("<Invalid channel - NULL>\n");
4212  }
4213 }
4214 
4215 /* --------------------------- */
4216 
4217 /* Check if some setting for a channel is enabled
4218  * Returns: 1 = On, 0 = Off, -1 = Invalid
4219  */
4221 {
4222  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
4223 
4224  /* 1) check that the setting exists for the current context */
4225  if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
4226  /* 2) get pointer to check for flag in, and the flag to check for */
4227  short ptrsize;
4228  bool negflag;
4229  int flag;
4230  void *ptr;
4231 
4232  flag = acf->setting_flag(ac, setting, &negflag);
4233  ptr = acf->setting_ptr(ale, setting, &ptrsize);
4234 
4235  /* check if flag is enabled */
4236  if (ptr && flag) {
4237  switch (ptrsize) {
4238  case sizeof(int): /* integer pointer for setting */
4239  {
4240  const int *val = (int *)ptr;
4241 
4242  if (negflag) {
4243  return ((*val) & flag) == 0;
4244  }
4245  return ((*val) & flag) != 0;
4246  }
4247  case sizeof(short): /* short pointer for setting */
4248  {
4249  const short *val = (short *)ptr;
4250 
4251  if (negflag) {
4252  return ((*val) & flag) == 0;
4253  }
4254  return ((*val) & flag) != 0;
4255  }
4256  case sizeof(char): /* char pointer for setting */
4257  {
4258  const char *val = (char *)ptr;
4259 
4260  if (negflag) {
4261  return ((*val) & flag) == 0;
4262  }
4263  return ((*val) & flag) != 0;
4264  }
4265  }
4266  }
4267  }
4268 
4269  /* not found... */
4270  return -1;
4271 }
4272 
4273 /* Quick macro for use in ANIM_channel_setting_set -
4274  * set flag for setting according the mode given. */
4275 #define ACF_SETTING_SET(sval, sflag, smode) \
4276  { \
4277  if (negflag) { \
4278  if (smode == ACHANNEL_SETFLAG_INVERT) { \
4279  (sval) ^= (sflag); \
4280  } \
4281  else if (smode == ACHANNEL_SETFLAG_ADD) { \
4282  (sval) &= ~(sflag); \
4283  } \
4284  else { \
4285  (sval) |= (sflag); \
4286  } \
4287  } \
4288  else { \
4289  if (smode == ACHANNEL_SETFLAG_INVERT) { \
4290  (sval) ^= (sflag); \
4291  } \
4292  else if (smode == ACHANNEL_SETFLAG_ADD) { \
4293  (sval) |= (sflag); \
4294  } \
4295  else { \
4296  (sval) &= ~(sflag); \
4297  } \
4298  } \
4299  } \
4300  (void)0
4301 
4302 /* Change value of some setting for a channel
4303  * - setting: eAnimChannel_Settings
4304  * - mode: eAnimChannels_SetFlag
4305  */
4307  bAnimListElem *ale,
4308  eAnimChannel_Settings setting,
4309  eAnimChannels_SetFlag mode)
4310 {
4311  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
4312 
4313  /* 1) check that the setting exists for the current context */
4314  if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
4315  /* 2) get pointer to check for flag in, and the flag to check for */
4316  short ptrsize;
4317  bool negflag;
4318  int flag;
4319  void *ptr;
4320 
4321  flag = acf->setting_flag(ac, setting, &negflag);
4322  ptr = acf->setting_ptr(ale, setting, &ptrsize);
4323 
4324  /* check if flag is enabled */
4325  if (ptr && flag) {
4326  switch (ptrsize) {
4327  case sizeof(int): /* integer pointer for setting */
4328  {
4329  int *val = (int *)ptr;
4330  ACF_SETTING_SET(*val, flag, mode);
4331  break;
4332  }
4333  case sizeof(short): /* short pointer for setting */
4334  {
4335  short *val = (short *)ptr;
4336  ACF_SETTING_SET(*val, flag, mode);
4337  break;
4338  }
4339  case sizeof(char): /* char pointer for setting */
4340  {
4341  char *val = (char *)ptr;
4342  ACF_SETTING_SET(*val, flag, mode);
4343  break;
4344  }
4345  }
4346  }
4347  }
4348 }
4349 
4350 /* --------------------------- */
4351 
4352 /* size of icons */
4353 #define ICON_WIDTH (0.85f * U.widget_unit)
4354 /* width of sliders */
4355 #define SLIDER_WIDTH (4 * U.widget_unit)
4356 /* min-width of rename textboxes */
4357 #define RENAME_TEXT_MIN_WIDTH (U.widget_unit)
4358 /* width of graph editor color bands */
4359 #define GRAPH_COLOR_BAND_WIDTH (0.3f * U.widget_unit)
4360 /* extra offset for the visibility icons in the graph editor */
4361 #define GRAPH_ICON_VISIBILITY_OFFSET (GRAPH_COLOR_BAND_WIDTH * 1.5f)
4362 
4363 /* Helper - Check if a channel needs renaming */
4365  const bAnimChannelType *acf,
4366  size_t channel_index)
4367 {
4368  if (acf->name_prop && ac->ads) {
4369  /* if rename index matches, this channel is being renamed */
4370  if (ac->ads->renameIndex == channel_index + 1) {
4371  return true;
4372  }
4373  }
4374 
4375  /* not being renamed */
4376  return false;
4377 }
4378 
4379 /* Draw the given channel */
4381  bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc, size_t channel_index)
4382 {
4383  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
4384  View2D *v2d = &ac->region->v2d;
4385  short selected, offset;
4386  float y, ymid, ytext;
4387 
4388  /* sanity checks - don't draw anything */
4389  if (ELEM(NULL, acf, ale)) {
4390  return;
4391  }
4392 
4393  /* get initial offset */
4394  if (acf->get_offset) {
4395  offset = acf->get_offset(ac, ale);
4396  }
4397  else {
4398  offset = 0;
4399  }
4400 
4401  /* calculate appropriate y-coordinates for icon buttons */
4402  y = (ymaxc - yminc) / 2 + yminc;
4403  ymid = y - 0.5f * ICON_WIDTH;
4404  /* y-coordinates for text is only 4 down from middle */
4405  ytext = y - 0.2f * U.widget_unit;
4406 
4407  /* check if channel is selected */
4408  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT)) {
4410  }
4411  else {
4412  selected = 0;
4413  }
4414 
4415  /* set blending again, as may not be set in previous step */
4417 
4418  /* step 1) draw backdrop ........................................... */
4419  if (acf->draw_backdrop) {
4420  acf->draw_backdrop(ac, ale, yminc, ymaxc);
4421  }
4422 
4423  /* step 2) draw expand widget ....................................... */
4424  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
4425  /* just skip - drawn as widget now */
4426  offset += ICON_WIDTH;
4427  }
4428 
4429  /* step 3) draw icon ............................................... */
4430  if (acf->icon) {
4431  UI_icon_draw(offset, ymid, acf->icon(ale));
4432  offset += ICON_WIDTH;
4433  }
4434 
4435  /* step 4) draw special toggles .................................
4436  * - in Graph Editor, check-boxes for visibility in curves area
4437  * - in NLA Editor, glowing dots for solo/not solo...
4438  * - in Grease Pencil mode, color swatches for layer color
4439  */
4440  if (ac->sl) {
4441  if ((ac->spacetype == SPACE_GRAPH) &&
4442  (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) ||
4443  acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE))) {
4444  /* for F-Curves, draw color-preview of curve left to the visibility icon */
4446  FCurve *fcu = (FCurve *)ale->data;
4449 
4451 
4452  /* F-Curve channels need to have a special 'color code' box drawn,
4453  * which is colored with whatever color the curve has stored.
4454  */
4455 
4456  /* If the curve is hidden, make the rect less opaque. */
4457  float rect_alpha = (fcu->flag & FCURVE_VISIBLE) ? 1 : 0.3f;
4458  immUniformColor3fvAlpha(fcu->color, rect_alpha);
4459 
4460  immRectf(pos, offset, yminc, offset + GRAPH_COLOR_BAND_WIDTH, ymaxc);
4461  immUnbindProgram();
4462  }
4463 
4464  /* turn off blending, since not needed anymore... */
4466 
4467  /* icon is drawn as widget now... */
4468  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
4471  }
4472  else {
4473  offset += ICON_WIDTH;
4474  }
4475  }
4476  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE)) {
4477  offset += ICON_WIDTH;
4478  }
4479  }
4480  else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
4481  /* just skip - drawn as widget now */
4482  offset += ICON_WIDTH;
4483  }
4484  }
4485 
4486  /* step 5) draw name ............................................... */
4487  /* Don't draw this if renaming... */
4488  if (acf->name && !achannel_is_being_renamed(ac, acf, channel_index)) {
4489  const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
4490  char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */
4491  uchar col[4];
4492 
4493  /* set text color */
4494  /* XXX: if active, highlight differently? */
4495 
4496  if (selected) {
4498  }
4499  else {
4501  }
4502 
4503  /* get name */
4504  acf->name(ale, name);
4505 
4506  offset += 3;
4507  UI_fontstyle_draw_simple(fstyle, offset, ytext, name, col);
4508 
4509  /* draw red underline if channel is disabled */
4510  if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) {
4513 
4515 
4516  /* FIXME: replace hardcoded color here, and check on extents! */
4517  immUniformColor3f(1.0f, 0.0f, 0.0f);
4518 
4519  GPU_line_width(2.0f);
4520 
4522  immVertex2f(pos, (float)offset, yminc);
4523  immVertex2f(pos, (float)v2d->cur.xmax, yminc);
4524  immEnd();
4525 
4526  immUnbindProgram();
4527  }
4528  }
4529 
4530  /* step 6) draw backdrops behind mute+protection toggles + (sliders) ....................... */
4531  /* - Reset offset - now goes from RHS of panel.
4532  * - Exception for graph editor, which needs extra space for the scroll bar.
4533  */
4534  if (ac->spacetype == SPACE_GRAPH &&
4536  offset = V2D_SCROLL_WIDTH;
4537  }
4538  else {
4539  offset = 0;
4540  }
4541 
4542  /* TODO: when drawing sliders, make those draw instead of these toggles if not enough space */
4543 
4544  if (v2d) {
4545  short draw_sliders = 0;
4546  float ymin_ofs = 0.0f;
4547  float color[3];
4549 
4551 
4552  /* get and set backdrop color */
4553  acf->get_backdrop_color(ac, ale, color);
4554  immUniformColor3fv(color);
4555 
4556  /* check if we need to show the sliders */
4557  if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) {
4558  switch (ac->spacetype) {
4559  case SPACE_ACTION: {
4560  SpaceAction *saction = (SpaceAction *)ac->sl;
4561  draw_sliders = (saction->flag & SACTION_SLIDERS);
4562  break;
4563  }
4564  case SPACE_GRAPH: {
4565  SpaceGraph *sipo = (SpaceGraph *)ac->sl;
4566  draw_sliders = (sipo->flag & SIPO_SLIDERS);
4567  break;
4568  }
4569  }
4570  }
4571 
4572  /* check if there's enough space for the toggles if the sliders are drawn too */
4573  if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2)) {
4574  /* protect... */
4575  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
4576  offset += ICON_WIDTH;
4577  }
4578 
4579  /* mute... */
4580  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) {
4581  offset += ICON_WIDTH;
4582  }
4583 
4584  /* grease pencil visibility... */
4585  if (ale->type == ANIMTYPE_GPLAYER) {
4586  offset += ICON_WIDTH;
4587  }
4588 
4589  /* modifiers toggle... */
4590  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MOD_OFF)) {
4591  offset += ICON_WIDTH;
4592  }
4593 
4594  /* pinned... */
4595  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PINNED)) {
4596  offset += ICON_WIDTH;
4597  }
4598 
4599  /* NOTE: technically, NLA Action "pushdown" should be here too,
4600  * but there are no sliders there. */
4601 
4602  /* NLA action channels have slightly different spacing requirements... */
4603  if (ale->type == ANIMTYPE_NLAACTION) {
4604  ymin_ofs = NLACHANNEL_SKIP;
4605  }
4606  }
4607 
4608  /* Draw slider:
4609  * - Even if we can draw sliders for this view,
4610  * we must also check that the channel-type supports them
4611  * (only only F-Curves really can support them for now).
4612  * - Slider should start before the toggles (if they're visible)
4613  * to keep a clean line down the side.
4614  */
4615  if ((draw_sliders) &&
4617  /* adjust offset */
4618  offset += SLIDER_WIDTH;
4619  }
4620 
4621  /* Finally draw a backdrop rect behind these:
4622  * - Starts from the point where the first toggle/slider starts.
4623  * - Ends past the space that might be reserved for a scroller.
4624  */
4625  immRectf(pos,
4626  v2d->cur.xmax - (float)offset,
4627  yminc + ymin_ofs,
4628  v2d->cur.xmax + EXTRA_SCROLL_PAD,
4629  ymaxc);
4630 
4631  immUnbindProgram();
4632  }
4633 }
4634 
4635 /* ------------------ */
4636 
4637 /* callback for (normal) widget settings - send notifiers */
4638 static void achannel_setting_widget_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
4639 {
4641 }
4642 
4643 /* callback for widget settings that need flushing */
4644 static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void *setting_wrap)
4645 {
4646  bAnimListElem *ale_setting = (bAnimListElem *)ale_npoin;
4647  bAnimContext ac;
4648  ListBase anim_data = {NULL, NULL};
4649  int filter;
4650  int setting = POINTER_AS_INT(setting_wrap);
4651  short on = 0;
4652 
4653  /* send notifiers before doing anything else... */
4655 
4656  /* verify that we have a channel to operate on. */
4657  if (!ale_setting) {
4658  return;
4659  }
4660 
4661  if (ale_setting->type == ANIMTYPE_GPLAYER) {
4662  /* draw cache updates for settings that affect the visible strokes */
4663  if (setting == ACHANNEL_SETTING_VISIBLE) {
4664  bGPdata *gpd = (bGPdata *)ale_setting->id;
4666  }
4667 
4668  /* UI updates */
4670  }
4671 
4672  /* Tag for full animation update, so that the settings will have an effect. */
4673  if (ale_setting->id) {
4674  DEG_id_tag_update(ale_setting->id, ID_RECALC_ANIMATION);
4675  }
4676  if (ale_setting->adt && ale_setting->adt->action) {
4677  /* Action is it's own datablock, so has to be tagged specifically. */
4679  }
4680 
4681  /* verify animation context */
4682  if (ANIM_animdata_get_context(C, &ac) == 0) {
4683  return;
4684  }
4685 
4686  /* check if the setting is on... */
4687  on = ANIM_channel_setting_get(&ac, ale_setting, setting);
4688 
4689  /* on == -1 means setting not found... */
4690  if (on == -1) {
4691  return;
4692  }
4693 
4694  /* get all channels that can possibly be chosen - but ignore hierarchy */
4696  ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
4697 
4698  /* call API method to flush the setting */
4699  ANIM_flush_setting_anim_channels(&ac, &anim_data, ale_setting, setting, on);
4700 
4701  /* free temp data */
4702  ANIM_animdata_freelist(&anim_data);
4703 }
4704 
4705 /* callback for wrapping NLA Track "solo" toggle logic */
4706 static void achannel_nlatrack_solo_widget_cb(bContext *C, void *ale_poin, void *UNUSED(arg2))
4707 {
4708  bAnimListElem *ale = ale_poin;
4709  AnimData *adt = ale->adt;
4710  NlaTrack *nlt = ale->data;
4711 
4712  /* Toggle 'solo' mode. There are several complications here which need explaining:
4713  * - The method call is needed to perform a few additional validation operations
4714  * to ensure that the mode is applied properly
4715  * - BUT, since the button already toggles the value, we need to un-toggle it
4716  * before the API call gets to it, otherwise it will end up clearing the result
4717  * again!
4718  */
4719  nlt->flag ^= NLATRACK_SOLO;
4720  BKE_nlatrack_solo_toggle(adt, nlt);
4721 
4722  /* send notifiers */
4725 }
4726 
4727 /* callback for widget sliders - insert keyframes */
4728 static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
4729 {
4730  ID *id = (ID *)id_poin;
4731  AnimData *adt = BKE_animdata_from_id(id);
4732  FCurve *fcu = (FCurve *)fcu_poin;
4733 
4734  ReportList *reports = CTX_wm_reports(C);
4738  ListBase nla_cache = {NULL, NULL};
4739  PointerRNA id_ptr, ptr;
4740  PropertyRNA *prop;
4741  eInsertKeyFlags flag = 0;
4742  bool done = false;
4743  float cfra;
4744 
4745  /* Get RNA pointer */
4746  RNA_id_pointer_create(id, &id_ptr);
4747 
4748  /* Get NLA context for value remapping */
4750  (float)CFRA);
4752  &nla_cache, &id_ptr, adt, &anim_eval_context);
4753 
4754  /* get current frame and apply NLA-mapping to it (if applicable) */
4755  cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
4756 
4757  /* Get flags for keyframing. */
4758  flag = ANIM_get_keyframing_flags(scene, true);
4759 
4760  /* try to resolve the path stored in the F-Curve */
4761  if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
4762  /* set the special 'replace' flag if on a keyframe */
4763  if (fcurve_frame_has_keyframe(fcu, cfra, 0)) {
4764  flag |= INSERTKEY_REPLACE;
4765  }
4766 
4767  /* insert a keyframe for this F-Curve */
4768  done = insert_keyframe_direct(
4769  reports, ptr, prop, fcu, &anim_eval_context, ts->keyframe_type, nla_context, flag);
4770 
4771  if (done) {
4772  if (adt->action != NULL) {
4774  }
4777  }
4778  }
4779 
4781 }
4782 
4783 /* callback for shapekey widget sliders - insert keyframes */
4784 static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, void *kb_poin)
4785 {
4786  Main *bmain = CTX_data_main(C);
4787  Key *key = (Key *)key_poin;
4788  KeyBlock *kb = (KeyBlock *)kb_poin;
4789  char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb);
4790 
4791  ReportList *reports = CTX_wm_reports(C);
4795  ListBase nla_cache = {NULL, NULL};
4796  PointerRNA id_ptr, ptr;
4797  PropertyRNA *prop;
4798  eInsertKeyFlags flag = 0;
4799  bool done = false;
4800 
4801  /* Get RNA pointer */
4802  RNA_id_pointer_create((ID *)key, &id_ptr);
4803 
4804  /* Get NLA context for value remapping */
4806  (float)CFRA);
4808  &nla_cache, &id_ptr, key->adt, &anim_eval_context);
4809 
4810  /* get current frame and apply NLA-mapping to it (if applicable) */
4811  const float remapped_frame = BKE_nla_tweakedit_remap(
4812  key->adt, anim_eval_context.eval_time, NLATIME_CONVERT_UNMAP);
4813 
4814  /* get flags for keyframing */
4815  flag = ANIM_get_keyframing_flags(scene, true);
4816 
4817  /* try to resolve the path stored in the F-Curve */
4818  if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop)) {
4819  /* find or create new F-Curve */
4820  /* XXX is the group name for this ok? */
4821  bAction *act = ED_id_action_ensure(bmain, (ID *)key);
4822  FCurve *fcu = ED_action_fcurve_ensure(bmain, act, NULL, &ptr, rna_path, 0);
4823 
4824  /* set the special 'replace' flag if on a keyframe */
4825  if (fcurve_frame_has_keyframe(fcu, remapped_frame, 0)) {
4826  flag |= INSERTKEY_REPLACE;
4827  }
4828 
4829  /* insert a keyframe for this F-Curve */
4830  const AnimationEvalContext remapped_anim_eval_context = BKE_animsys_eval_context_construct_at(
4831  &anim_eval_context, remapped_frame);
4832  done = insert_keyframe_direct(reports,
4833  ptr,
4834  prop,
4835  fcu,
4836  &remapped_anim_eval_context,
4837  ts->keyframe_type,
4838  nla_context,
4839  flag);
4840 
4841  if (done) {
4843  }
4844  }
4845 
4846  /* free the path */
4847  if (rna_path) {
4848  MEM_freeN(rna_path);
4849  }
4850 
4852 }
4853 
4854 /* callback for NLA Control Curve widget sliders - insert keyframes */
4856  void *UNUSED(id_poin),
4857  void *fcu_poin)
4858 {
4859  /* ID *id = (ID *)id_poin; */
4860  FCurve *fcu = (FCurve *)fcu_poin;
4861 
4862  PointerRNA ptr;
4863  PropertyRNA *prop;
4864  int index;
4865 
4866  ReportList *reports = CTX_wm_reports(C);
4869  eInsertKeyFlags flag = 0;
4870  bool done = false;
4871  float cfra;
4872 
4873  /* get current frame - *no* NLA mapping should be done */
4874  cfra = (float)CFRA;
4875 
4876  /* get flags for keyframing */
4877  flag = ANIM_get_keyframing_flags(scene, true);
4878 
4879  /* Get pointer and property from the slider -
4880  * this should all match up with the NlaStrip required. */
4881  UI_context_active_but_prop_get(C, &ptr, &prop, &index);
4882 
4883  if (fcu && prop) {
4884  /* set the special 'replace' flag if on a keyframe */
4885  if (fcurve_frame_has_keyframe(fcu, cfra, 0)) {
4886  flag |= INSERTKEY_REPLACE;
4887  }
4888 
4889  /* insert a keyframe for this F-Curve */
4892  cfra);
4893  done = insert_keyframe_direct(
4894  reports, ptr, prop, fcu, &anim_eval_context, ts->keyframe_type, NULL, flag);
4895 
4896  if (done) {
4898  }
4899  }
4900 }
4901 
4902 /* Draw a widget for some setting */
4904  bAnimListElem *ale,
4905  const bAnimChannelType *acf,
4906  uiBlock *block,
4907  int xpos,
4908  int ypos,
4909  int setting)
4910 {
4911  short ptrsize, butType;
4912  bool negflag;
4913  bool usetoggle = true;
4914  int flag, icon;
4915  void *ptr;
4916  const char *tooltip;
4917  uiBut *but = NULL;
4918  bool enabled;
4919 
4920  /* get the flag and the pointer to that flag */
4921  flag = acf->setting_flag(ac, setting, &negflag);
4922  ptr = acf->setting_ptr(ale, setting, &ptrsize);
4923  enabled = ANIM_channel_setting_get(ac, ale, setting);
4924 
4925  /* get the base icon for the setting */
4926  switch (setting) {
4927  case ACHANNEL_SETTING_VISIBLE: /* visibility eyes */
4928  // icon = ((enabled) ? ICON_HIDE_OFF : ICON_HIDE_ON);
4929  icon = ICON_HIDE_ON;
4930 
4932  tooltip = TIP_("F-Curve visibility in Graph Editor");
4933  }
4934  else if (ale->type == ANIMTYPE_GPLAYER) {
4935  tooltip = TIP_("Grease Pencil layer is visible in the viewport");
4936  }
4937  else {
4938  tooltip = TIP_("Channels are visible in Graph Editor for editing");
4939  }
4940  break;
4941 
4943  icon = ICON_UNPINNED;
4944  tooltip = TIP_("Channels are visible in Graph Editor for editing");
4945  break;
4946 
4947  case ACHANNEL_SETTING_MOD_OFF: /* modifiers disabled */
4948  icon = ICON_MODIFIER_OFF;
4949  tooltip = TIP_("Enable F-Curve modifiers");
4950  break;
4951 
4952  case ACHANNEL_SETTING_EXPAND: /* expanded triangle */
4953  // icon = ((enabled) ? ICON_TRIA_DOWN : ICON_TRIA_RIGHT);
4954  icon = ICON_TRIA_RIGHT;
4955  tooltip = TIP_("Make channels grouped under this channel visible");
4956  break;
4957 
4958  case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */
4959  // icon = ((enabled) ? ICON_SOLO_OFF : ICON_SOLO_ON);
4960  icon = ICON_SOLO_OFF;
4961  tooltip = TIP_(
4962  "NLA Track is the only one evaluated in this animation data-block, with all others "
4963  "muted");
4964  break;
4965 
4966  /* --- */
4967 
4968  case ACHANNEL_SETTING_PROTECT: /* protected lock */
4969  /* TODO: what about when there's no protect needed? */
4970  // icon = ((enabled) ? ICON_LOCKED : ICON_UNLOCKED);
4971  icon = ICON_UNLOCKED;
4972 
4973  if (ale->datatype != ALE_NLASTRIP) {
4974  tooltip = TIP_("Editability of keyframes for this channel");
4975  }
4976  else {
4977  tooltip = TIP_("Editability of NLA Strips in this track");
4978  }
4979  break;
4980 
4981  case ACHANNEL_SETTING_MUTE: /* muted speaker */
4982  icon = ((enabled) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT);
4983  usetoggle = false;
4984 
4986  tooltip = TIP_("Does F-Curve contribute to result");
4987  }
4988  else if ((ac) && (ac->spacetype == SPACE_NLA) && (ale->type != ANIMTYPE_NLATRACK)) {
4989  tooltip = TIP_(
4990  "Temporarily disable NLA stack evaluation (i.e. only the active action is evaluated)");
4991  }
4992  else if (ale->type == ANIMTYPE_GPLAYER) {
4993  tooltip = TIP_(
4994  "Shows all keyframes during animation playback and enabled all frames for editing "
4995  "(uncheck to use only the current keyframe during animation playback and editing)");
4996  }
4997  else {
4998  tooltip = TIP_("Do channels contribute to result (toggle channel muting)");
4999  }
5000  break;
5001 
5002  case ACHANNEL_SETTING_PINNED: /* pin icon */
5003  // icon = ((enabled) ? ICON_PINNED : ICON_UNPINNED);
5004  icon = ICON_UNPINNED;
5005 
5006  if (ale->type == ANIMTYPE_NLAACTION) {
5007  tooltip = TIP_("Display action without any time remapping (when unpinned)");
5008  }
5009  else {
5010  /* TODO: there are no other tools which require the 'pinning' concept yet */
5011  tooltip = NULL;
5012  }
5013  break;
5014 
5015  default:
5016  tooltip = NULL;
5017  icon = 0;
5018  break;
5019  }
5020 
5021  /* type of button */
5022  if (usetoggle) {
5023  if (negflag) {
5024  butType = UI_BTYPE_ICON_TOGGLE_N;
5025  }
5026  else {
5027  butType = UI_BTYPE_ICON_TOGGLE;
5028  }
5029  }
5030  else {
5031  if (negflag) {
5032  butType = UI_BTYPE_TOGGLE_N;
5033  }
5034  else {
5035  butType = UI_BTYPE_TOGGLE;
5036  }
5037  }
5038  /* draw button for setting */
5039  if (ptr && flag) {
5040  switch (ptrsize) {
5041  case sizeof(int): /* integer pointer for setting */
5042  but = uiDefIconButBitI(block,
5043  butType,
5044  flag,
5045  0,
5046  icon,
5047  xpos,
5048  ypos,
5049  ICON_WIDTH,
5050  ICON_WIDTH,
5051  ptr,
5052  0,
5053  0,
5054  0,
5055  0,
5056  tooltip);
5057  break;
5058 
5059  case sizeof(short): /* short pointer for setting */
5060  but = uiDefIconButBitS(block,
5061  butType,
5062  flag,
5063  0,
5064  icon,
5065  xpos,
5066  ypos,
5067  ICON_WIDTH,
5068  ICON_WIDTH,
5069  ptr,
5070  0,
5071  0,
5072  0,
5073  0,
5074  tooltip);
5075  break;
5076 
5077  case sizeof(char): /* char pointer for setting */
5078  but = uiDefIconButBitC(block,
5079  butType,
5080  flag,
5081  0,
5082  icon,
5083  xpos,
5084  ypos,
5085  ICON_WIDTH,
5086  ICON_WIDTH,
5087  ptr,
5088  0,
5089  0,
5090  0,
5091  0,
5092  tooltip);
5093  break;
5094  }
5095 
5096  /* set call to send relevant notifiers and/or perform type-specific updates */
5097  if (but) {
5098  switch (setting) {
5099  /* settings needing flushing up/down hierarchy */
5100  case ACHANNEL_SETTING_VISIBLE: /* Graph Editor - 'visibility' toggles */
5101  case ACHANNEL_SETTING_PROTECT: /* General - protection flags */
5102  case ACHANNEL_SETTING_MUTE: /* General - muting flags */
5103  case ACHANNEL_SETTING_PINNED: /* NLA Actions - 'map/nomap' */
5106  UI_but_funcN_set(but,
5108  MEM_dupallocN(ale),
5109  POINTER_FROM_INT(setting));
5110  break;
5111 
5112  /* settings needing special attention */
5113  case ACHANNEL_SETTING_SOLO: /* NLA Tracks - Solo toggle */
5115  break;
5116 
5117  /* no flushing */
5118  case ACHANNEL_SETTING_EXPAND: /* expanding - cannot flush,
5119  * otherwise all would open/close at once */
5120  default:
5122  break;
5123  }
5124 
5125  if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) ||
5126  (ale->id != NULL && ID_IS_LINKED(ale->id))) {
5127  if (setting != ACHANNEL_SETTING_EXPAND) {
5129  }
5130  }
5131  }
5132  }
5133 }
5134 
5135 /* Draw UI widgets the given channel */
5137  bAnimContext *ac,
5138  bAnimListElem *ale,
5139  uiBlock *block,
5140  rctf *rect,
5141  size_t channel_index)
5142 {
5143  const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
5144  View2D *v2d = &ac->region->v2d;
5145  float ymid;
5146  const short channel_height = round_fl_to_int(BLI_rctf_size_y(rect));
5147  const bool is_being_renamed = achannel_is_being_renamed(ac, acf, channel_index);
5148 
5149  /* sanity checks - don't draw anything */
5150  if (ELEM(NULL, acf, ale, block)) {
5151  return;
5152  }
5153 
5154  /* get initial offset */
5155  short offset = rect->xmin;
5156  if (acf->get_offset) {
5157  offset += acf->get_offset(ac, ale);
5158  }
5159 
5160  /* calculate appropriate y-coordinates for icon buttons */
5161  ymid = BLI_rctf_cent_y(rect) - 0.5f * ICON_WIDTH;
5162 
5163  /* no button backdrop behind icons */
5165 
5166  /* step 1) draw expand widget ....................................... */
5167  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
5168  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_EXPAND);
5169  offset += ICON_WIDTH;
5170  }
5171 
5172  /* step 2) draw icon ............................................... */
5173  if (acf->icon) {
5174  /* icon is not drawn here (not a widget) */
5175  offset += ICON_WIDTH;
5176  }
5177 
5178  /* step 3) draw special toggles .................................
5179  * - in Graph Editor, checkboxes for visibility in curves area
5180  * - in NLA Editor, glowing dots for solo/not solo...
5181  * - in Grease Pencil mode, color swatches for layer color
5182  */
5183  if (ac->sl) {
5184  if ((ac->spacetype == SPACE_GRAPH) &&
5185  (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) ||
5186  acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE))) {
5187  /* pin toggle */
5188  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE)) {
5189  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_ALWAYS_VISIBLE);
5190  offset += ICON_WIDTH;
5191  }
5192  /* visibility toggle */
5193  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
5194  /* For F-curves, add the extra space for the color bands. */
5196  offset += GRAPH_ICON_VISIBILITY_OFFSET;
5197  }
5198  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_VISIBLE);
5199  offset += ICON_WIDTH;
5200  }
5201  }
5202  else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
5203  /* 'solo' setting for NLA Tracks */
5204  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_SOLO);
5205  offset += ICON_WIDTH;
5206  }
5207  }
5208 
5209  /* step 4) draw text - check if renaming widget is in use... */
5210  if (is_being_renamed) {
5211  PointerRNA ptr = {NULL};
5212  PropertyRNA *prop = NULL;
5213 
5214  /* draw renaming widget if we can get RNA pointer for it
5215  * NOTE: property may only be available in some cases, even if we have
5216  * a callback available (e.g. broken F-Curve rename)
5217  */
5218  if (acf->name_prop(ale, &ptr, &prop)) {
5219  const short margin_x = 3 * round_fl_to_int(UI_DPI_FAC);
5220  const short width = ac->region->winx - offset - (margin_x * 2);
5221  uiBut *but;
5222 
5224 
5225  but = uiDefButR(block,
5226  UI_BTYPE_TEXT,
5227  1,
5228  "",
5229  offset + margin_x,
5230  rect->ymin,
5232  channel_height,
5233  &ptr,
5235  -1,
5236  0,
5237  0,
5238  -1,
5239  -1,
5240  NULL);
5241 
5242  /* copy what outliner does here, see outliner_buttons */
5243  if (UI_but_active_only(C, ac->region, block, but) == false) {
5244  ac->ads->renameIndex = 0;
5245 
5246  /* send notifiers */
5248  }
5249 
5251  }
5252  else {
5253  /* Cannot get property/cannot or rename for some reason, so clear rename index
5254  * so that this doesn't hang around, and the name can be drawn normally - T47492
5255  */
5256  ac->ads->renameIndex = 0;
5258  }
5259  }
5260 
5261  /* step 5) draw mute+protection toggles + (sliders) ....................... */
5262  /* reset offset - now goes from RHS of panel */
5263  offset = (int)rect->xmax;
5264 
5265  /* TODO: when drawing sliders, make those draw instead of these toggles if not enough space. */
5266  if (v2d && !is_being_renamed) {
5267  short draw_sliders = 0;
5268 
5269  /* check if we need to show the sliders */
5270  if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) {
5271  switch (ac->spacetype) {
5272  case SPACE_ACTION: {
5273  SpaceAction *saction = (SpaceAction *)ac->sl;
5274  draw_sliders = (saction->flag & SACTION_SLIDERS);
5275  break;
5276  }
5277  case SPACE_GRAPH: {
5278  SpaceGraph *sipo = (SpaceGraph *)ac->sl;
5279  draw_sliders = (sipo->flag & SIPO_SLIDERS);
5280  break;
5281  }
5282  }
5283  }
5284 
5285  /* check if there's enough space for the toggles if the sliders are drawn too */
5286  if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2)) {
5287  /* protect... */
5288  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
5289  offset -= ICON_WIDTH;
5290  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_PROTECT);
5291  }
5292  /* mute... */
5293  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) {
5294  offset -= ICON_WIDTH;
5295  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_MUTE);
5296  }
5297  if (ale->type == ANIMTYPE_GPLAYER) {
5298  /* Not technically "mute"
5299  * (in terms of anim channels, but this sets layer visibility instead). */
5300  offset -= ICON_WIDTH;
5301  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_VISIBLE);
5302  }
5303 
5304  /* modifiers disable */
5305  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MOD_OFF)) {
5306  offset -= ICON_WIDTH;
5307  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_MOD_OFF);
5308  }
5309 
5310  /* ----------- */
5311 
5312  /* pinned... */
5313  if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PINNED)) {
5314  offset -= ICON_WIDTH;
5315  draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_PINNED);
5316  }
5317 
5318  /* NLA Action "pushdown" */
5319  if ((ale->type == ANIMTYPE_NLAACTION) && (ale->adt && ale->adt->action) &&
5320  !(ale->adt->flag & ADT_NLA_EDIT_ON)) {
5321  uiBut *but;
5322  PointerRNA *opptr_b;
5323 
5325 
5326  offset -= UI_UNIT_X;
5327  but = uiDefIconButO(block,
5328  UI_BTYPE_BUT,
5329  "NLA_OT_action_pushdown",
5331  ICON_NLA_PUSHDOWN,
5332  offset,
5333  ymid,
5334  UI_UNIT_X,
5335  UI_UNIT_X,
5336  NULL);
5337 
5338  opptr_b = UI_but_operator_ptr_get(but);
5339  RNA_int_set(opptr_b, "channel_index", channel_index);
5340 
5342  }
5343  }
5344 
5345  /* Draw slider:
5346  * - Even if we can draw sliders for this view, we must also check that the channel-type
5347  * supports them (only only F-Curves really can support them for now).
5348  * - To make things easier, we use RNA-autobuts for this so that changes are
5349  * reflected immediately, wherever they occurred.
5350  * BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
5351  * and wouldn't be able to auto-keyframe.
5352  * - Slider should start before the toggles (if they're visible)
5353  * to keep a clean line down the side.
5354  * - Sliders are always drawn in Shapekey mode now. Prior to this
5355  * the SACTION_SLIDERS flag would be set when changing into Shapekey mode.
5356  */
5357  if (((draw_sliders) && ELEM(ale->type,
5361  ANIMTYPE_GPLAYER)) ||
5362  ale->type == ANIMTYPE_SHAPEKEY) {
5363  /* adjust offset */
5364  /* TODO: make slider width dynamic,
5365  * so that they can be easier to use when the view is wide enough. */
5366  offset -= SLIDER_WIDTH;
5367 
5368  /* need backdrop behind sliders... */
5370 
5371  if (ale->owner) { /* Slider using custom RNA Access ---------- */
5372  if (ale->type == ANIMTYPE_NLACURVE) {
5373  NlaStrip *strip = (NlaStrip *)ale->owner;
5374  FCurve *fcu = (FCurve *)ale->data;
5375  PointerRNA ptr;
5376  PropertyRNA *prop;
5377 
5378  /* create RNA pointers */
5379  RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, &ptr);
5380  prop = RNA_struct_find_property(&ptr, fcu->rna_path);
5381 
5382  /* create property slider */
5383  if (prop) {
5384  uiBut *but;
5385 
5386  /* Create the slider button,
5387  * and assign relevant callback to ensure keyframes are inserted. */
5388  but = uiDefAutoButR(block,
5389  &ptr,
5390  prop,
5391  fcu->array_index,
5392  "",
5393  ICON_NONE,
5394  offset,
5395  rect->ymin,
5396  SLIDER_WIDTH,
5397  channel_height);
5399  }
5400  }
5401  }
5402  else if (ale->id) { /* Slider using RNA Access --------------- */
5403  PointerRNA id_ptr, ptr;
5404  PropertyRNA *prop;
5405  char *rna_path = NULL;
5406  int array_index = 0;
5407  short free_path = 0;
5408 
5409  /* get destination info */
5410  if (ale->type == ANIMTYPE_FCURVE) {
5411  FCurve *fcu = (FCurve *)ale->data;
5412 
5413  rna_path = fcu->rna_path;
5414  array_index = fcu->array_index;
5415  }
5416  else if (ale->type == ANIMTYPE_SHAPEKEY) {
5417  KeyBlock *kb = (KeyBlock *)ale->data;
5418  Key *key = (Key *)ale->id;
5419 
5420  rna_path = BKE_keyblock_curval_rnapath_get(key, kb);
5421  free_path = 1;
5422  }
5423  /* Special for Grease Pencil Layer. */
5424  else if (ale->type == ANIMTYPE_GPLAYER) {
5425  bGPdata *gpd = (bGPdata *)ale->id;
5426  if ((gpd != NULL) && ((gpd->flag & GP_DATA_ANNOTATIONS) == 0)) {
5427  /* Reset slider offset, in order to add special gp icons. */
5428  offset += SLIDER_WIDTH;
5429 
5430  char *gp_rna_path = NULL;
5431  bGPDlayer *gpl = (bGPDlayer *)ale->data;
5432 
5433  /* Create the RNA pointers. */
5434  RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
5435  RNA_id_pointer_create(ale->id, &id_ptr);
5436  int icon;
5437 
5438  /* Layer onion skinning switch. */
5439  offset -= ICON_WIDTH;
5441  prop = RNA_struct_find_property(&ptr, "use_onion_skinning");
5442  gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
5443  if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
5444  icon = (gpl->onion_flag & GP_LAYER_ONIONSKIN) ? ICON_ONIONSKIN_ON :
5445  ICON_ONIONSKIN_OFF;
5446  uiDefAutoButR(block,
5447  &ptr,
5448  prop,
5449  array_index,
5450  "",
5451  icon,
5452  offset,
5453  rect->ymin,
5454  ICON_WIDTH,
5455  channel_height);
5456  }
5457  MEM_freeN(gp_rna_path);
5458 
5459  /* Mask Layer. */
5460  offset -= ICON_WIDTH;
5462  prop = RNA_struct_find_property(&ptr, "use_mask_layer");
5463  gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
5464  if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
5465  icon = ICON_LAYER_ACTIVE;
5466  if (gpl->flag & GP_LAYER_USE_MASK) {
5467  icon = ICON_MOD_MASK;
5468  }
5469  else {
5470  icon = ICON_LAYER_ACTIVE;
5471  }
5472  uiDefAutoButR(block,
5473  &ptr,
5474  prop,
5475  array_index,
5476  "",
5477  icon,
5478  offset,
5479  rect->ymin,
5480  ICON_WIDTH,
5481  channel_height);
5482  }
5483  MEM_freeN(gp_rna_path);
5484 
5485  /* Layer opacity. */
5486  const short width = SLIDER_WIDTH * 0.6;
5487  offset -= width;
5489  prop = RNA_struct_find_property(&ptr, "opacity");
5490  gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
5491  if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
5492  uiDefAutoButR(block,
5493  &ptr,
5494  prop,
5495  array_index,
5496  "",
5497  ICON_NONE,
5498  offset,
5499  rect->ymin,
5500  width,
5501  channel_height);
5502  }
5503  MEM_freeN(gp_rna_path);
5504  }
5505  }
5506 
5507  /* Only if RNA-Path found. */
5508  if (rna_path) {
5509  /* get RNA pointer, and resolve the path */
5510  RNA_id_pointer_create(ale->id, &id_ptr);
5511 
5512  /* try to resolve the path */
5513  if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop)) {
5514  uiBut *but;
5515 
5516  /* Create the slider button,
5517  * and assign relevant callback to ensure keyframes are inserted. */
5518  but = uiDefAutoButR(block,
5519  &ptr,
5520  prop,
5521  array_index,
5522  "",
5523  ICON_NONE,
5524  offset,
5525  rect->ymin,
5526  SLIDER_WIDTH,
5527  channel_height);
5528 
5529  /* assign keyframing function according to slider type */
5530  if (ale->type == ANIMTYPE_SHAPEKEY) {
5532  }
5533  else {
5535  }
5536  }
5537 
5538  /* free the path if necessary */
5539  if (free_path) {
5540  MEM_freeN(rna_path);
5541  }
5542  }
5543  }
5544  else { /* Special Slider for stuff without RNA Access ---------- */
5545  /* TODO: only implement this case when we really need it... */
5546  }
5547  }
5548  }
5549 }
5550 
5551 /* *********************************************** */
typedef float(TangentPoint)[2]
struct AnimData * BKE_animdata_from_id(struct ID *id)
Definition: anim_data.c:96
void BKE_animsys_free_nla_keyframing_context_cache(struct ListBase *cache)
Definition: anim_sys.c:2756
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
Definition: anim_sys.c:637
struct NlaKeyframingContext * BKE_animsys_get_nla_keyframing_context(struct ListBase *cache, struct PointerRNA *ptr, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context)
AnimationEvalContext BKE_animsys_eval_context_construct_at(const AnimationEvalContext *anim_eval_context, float eval_time)
Definition: anim_sys.c:647
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:751
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Definition: context.c:1401
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
short BKE_curve_type_get(const struct Curve *cu)
char * BKE_keyblock_curval_rnapath_get(struct Key *key, struct KeyBlock *kb)
Definition: key.c:1966
@ NLATIME_CONVERT_UNMAP
Definition: BKE_nla.h:153
void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt)
Definition: nla.c:1054
float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode)
Definition: nla.c:582
MINLINE int round_fl_to_int(float a)
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
Definition: math_color.c:407
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
Definition: BLI_rect.h:148
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:165
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNUSED_VARS(...)
#define POINTER_FROM_INT(i)
#define UNUSED(x)
#define POINTER_AS_INT(i)
#define MAX2(a, b)
#define ELEM(...)
#define TIP_(msgid)
#define IFACE_(msgid)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_TRANSFORM
Definition: DNA_ID.h:599
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:614
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:611
@ ID_RECALC_ANIMATION_NO_FLUSH
Definition: DNA_ID.h:690
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:426
@ ID_TE
Definition: DNA_ID_enums.h:64
@ ID_NT
Definition: DNA_ID_enums.h:80
@ ID_MA
Definition: DNA_ID_enums.h:63
@ ID_PA
Definition: DNA_ID_enums.h:82
@ AGRP_ACTIVE
@ AGRP_SELECTED
@ AGRP_EXPANDED_G
@ AGRP_EXPANDED
@ AGRP_PROTECTED
@ AGRP_MODIFIERS_OFF
@ AGRP_MUTED
@ AGRP_NOTVISIBLE
@ ACT_COLLAPSED
@ ADS_FLAG_SUMMARY_COLLAPSED
@ SACTION_SLIDERS
@ ADT_NLA_SOLO_TRACK
@ ADT_CURVES_ALWAYS_VISIBLE
@ ADT_CURVES_NOT_VISIBLE
@ ADT_DRIVERS_COLLAPSED
@ ADT_NLA_SKEYS_COLLAPSED
@ ADT_NLA_EVAL_OFF
@ ADT_NLA_EDIT_NOMAP
@ ADT_UI_SELECTED
@ ADT_NLA_EDIT_ON
eInsertKeyFlags
@ INSERTKEY_REPLACE
@ FCURVE_DISABLED
@ FCURVE_MUTED
@ FCURVE_MOD_OFF
@ FCURVE_SELECTED
@ FCURVE_PROTECTED
@ FCURVE_VISIBLE
@ NLATRACK_SOLO
@ NLATRACK_ACTIVE
@ NLATRACK_MUTED
@ NLATRACK_DISABLED
@ NLATRACK_SELECTED
@ NLATRACK_PROTECTED
@ ARM_DS_EXPAND
@ CACHEFILE_DS_EXPAND
@ CAM_DS_EXPAND
@ CU_DS_EXPAND
@ GP_LAYER_LOCKED
@ GP_LAYER_FRAMELOCK
@ GP_LAYER_SELECT
@ GP_LAYER_USE_MASK
@ GP_LAYER_HIDE
@ GP_LAYER_ONIONSKIN
@ GP_DATA_EXPAND
@ GP_DATA_ANNOTATIONS
@ KEY_DS_EXPAND
@ KEYBLOCK_SEL
@ KEYBLOCK_MUTE
@ KEYBLOCK_LOCKED
#define LT_DS_EXPAND
@ BASE_SELECTED
#define LA_DS_EXPAND
#define LS_DS_EXPAND
@ MASK_LAYERFLAG_LOCKED
@ MASK_LAYERFLAG_SELECT
@ MASK_ANIMF_EXPAND
#define MA_DS_EXPAND
@ ME_DS_EXPAND
#define MB_DS_EXPAND
@ MCLIP_DATA_EXPAND
#define NTREE_TEXTURE
#define NTREE_DS_EXPAND
#define NTREE_COMPOSIT
#define NTREE_SHADER
Object is a sort of wrapper for general info.
@ OB_ADS_COLLAPSED
@ OB_SPEAKER
@ OB_LATTICE
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_CAMERA
@ OB_FONT
@ OB_ARMATURE
@ OB_LAMP
@ OB_MESH
@ OB_POINTCLOUD
@ OB_HAIR
@ OB_VOLUME
@ OB_CURVE
@ OB_GPENCIL
@ OB_LIGHTPROBE
#define PART_DS_EXPAND
#define CFRA
#define SCE_DS_COLLAPSED
#define SCE_DS_SELECTED
@ SIM_DS_EXPAND
@ SPACE_ACTION
@ SPACE_NLA
@ SPACE_GRAPH
@ SIPO_SLIDERS
#define SPK_DS_EXPAND
#define TEX_DS_EXPAND
@ USER_ANIM_SHOW_CHANNEL_GROUP_COLORS
@ VO_DS_EXPAND
#define WO_DS_EXPAND
#define ACHANNEL_BUTTON_WIDTH
Definition: ED_anim_api.h:440
eAnimChannels_SetFlag
Definition: ED_anim_api.h:506
@ ANIMTYPE_NLACURVE
Definition: ED_anim_api.h:210
@ ANIMTYPE_SHAPEKEY
Definition: ED_anim_api.h:238
@ ANIMTYPE_GROUP
Definition: ED_anim_api.h:206
@ ANIMTYPE_GPLAYER
Definition: ED_anim_api.h:241
@ ANIMTYPE_NLAACTION
Definition: ED_anim_api.h:247
@ ANIMTYPE_NUM_TYPES
Definition: ED_anim_api.h:252
@ ANIMTYPE_FCURVE
Definition: ED_anim_api.h:207
@ ANIMTYPE_NLATRACK
Definition: ED_anim_api.h:246
void nla_action_get_color(struct AnimData *adt, struct bAction *act, float color[4])
Definition: nla_draw.c:69
@ ACHANNEL_ROLE_CHANNEL
Definition: ED_anim_api.h:502
@ ACHANNEL_ROLE_EXPANDER
Definition: ED_anim_api.h:498
@ ALE_NLASTRIP
Definition: ED_anim_api.h:261
@ ANIMCONT_ACTION
Definition: ED_anim_api.h:117
#define NLACHANNEL_SKIP
Definition: ED_anim_api.h:450
eAnimChannel_Settings
Definition: ED_anim_api.h:518
@ ACHANNEL_SETTING_ALWAYS_VISIBLE
Definition: ED_anim_api.h:532
@ ACHANNEL_SETTING_PINNED
Definition: ED_anim_api.h:529
@ ACHANNEL_SETTING_MUTE
Definition: ED_anim_api.h:522
@ ACHANNEL_SETTING_PROTECT
Definition: ED_anim_api.h:521
@ ACHANNEL_SETTING_VISIBLE
Definition: ED_anim_api.h:525
@ ACHANNEL_SETTING_EXPAND
Definition: ED_anim_api.h:523
@ ACHANNEL_SETTING_SOLO
Definition: ED_anim_api.h:527
@ ACHANNEL_SETTING_MOD_OFF
Definition: ED_anim_api.h:530
@ ACHANNEL_SETTING_SELECT
Definition: ED_anim_api.h:519
@ ANIMFILTER_DATA_VISIBLE
Definition: ED_anim_api.h:295
@ ANIMFILTER_LIST_CHANNELS
Definition: ED_anim_api.h:303
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
GPUVertFormat * immVertexFormat(void)
void immUniformColor3f(float r, float g, float b)
void immBegin(GPUPrimType, uint vertex_len)
void immUniformColor3fvAlpha(const float rgb[3], float a)
void immEnd(void)
void immUniformColor3fv(const float rgb[3])
void immRectf(uint pos, float x1, float y1, float x2, float y2)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:36
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:171
@ GPU_BLEND_NONE
Definition: GPU_state.h:55
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:57
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:55
void GPU_line_width(float width)
Definition: gpu_state.cc:173
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
Read Guarded memory(de)allocation.
StructRNA RNA_ShapeKey
StructRNA RNA_ActionGroup
StructRNA RNA_FCurve
StructRNA RNA_NlaTrack
StructRNA RNA_MaskLayer
StructRNA RNA_GPencilLayer
StructRNA RNA_Action
StructRNA RNA_NlaStrip
#define C
Definition: RandGen.cpp:39
@ UI_EMBOSS_NONE
Definition: UI_interface.h:108
@ UI_EMBOSS
Definition: UI_interface.h:107
@ UI_BUT_DISABLED
Definition: UI_interface.h:199
uiBut * uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:5495
@ UI_CNR_BOTTOM_LEFT
@ UI_CNR_TOP_LEFT
void UI_draw_roundbox_4fv(const struct rctf *rect, bool filled, float rad, const float col[4])
struct PointerRNA * UI_but_operator_ptr_get(uiBut *but)
Definition: interface.c:6218
uiBut * uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x, int y, int width, int height)
void UI_fontstyle_draw_simple(const struct uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
void UI_draw_roundbox_3fv_alpha(const struct rctf *rect, bool filled, float rad, const float col[3], float alpha)
void UI_draw_roundbox_corner_set(int type)
uiBut * uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:5433
uiBut * uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:5144
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
Definition: interface.c:3542
bool UI_but_active_only(const struct bContext *C, struct ARegion *region, uiBlock *block, uiBut *but)
#define UI_DPI_FAC
Definition: UI_interface.h:309
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
Definition: interface.c:6294
uiBut * UI_context_active_but_prop_get(const struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index)
#define UI_FSTYLE_WIDGET
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
Definition: interface.c:6301
#define UI_UNIT_X
uiBut * uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:5371
@ UI_BTYPE_BUT
Definition: UI_interface.h:334
@ UI_BTYPE_TOGGLE
Definition: UI_interface.h:344
@ UI_BTYPE_TOGGLE_N
Definition: UI_interface.h:345
@ UI_BTYPE_TEXT
Definition: UI_interface.h:336
@ UI_BTYPE_ICON_TOGGLE_N
Definition: UI_interface.h:347
@ UI_BTYPE_ICON_TOGGLE
Definition: UI_interface.h:346
uiBut * uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, int x, int y, short width, short height, const char *tip)
Definition: interface.c:5587
void UI_but_flag_enable(uiBut *but, int flag)
Definition: interface.c:6077
void UI_icon_draw(float x, float y, int icon_id)
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1191
@ TH_NLA_TRACK
Definition: UI_resources.h:300
@ TH_GROUP
Definition: UI_resources.h:90
@ TH_DOPESHEET_CHANNELSUBOB
Definition: UI_resources.h:229
@ TH_ANIM_ACTIVE
Definition: UI_resources.h:282
@ TH_SHADE2
Definition: UI_resources.h:81
@ TH_GROUP_ACTIVE
Definition: UI_resources.h:91
@ TH_TEXT
Definition: UI_resources.h:58
@ TH_DOPESHEET_CHANNELOB
Definition: UI_resources.h:228
@ TH_TEXT_HI
Definition: UI_resources.h:59
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
Definition: resources.c:1218
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
Definition: resources.c:1381
#define V2D_SCROLL_WIDTH
Definition: UI_view2d.h:68
#define ND_DATA
Definition: WM_types.h:408
#define NC_ANIMATION
Definition: WM_types.h:289
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:197
#define NA_EDITED
Definition: WM_types.h:462
#define NC_GPENCIL
Definition: WM_types.h:300
#define ND_NLA
Definition: WM_types.h:397
#define NA_RENAME
Definition: WM_types.h:466
#define ND_ANIMCHAN
Definition: WM_types.h:396
static void acf_gpl_name(bAnimListElem *ale, char *name)
static bAnimChannelType ACF_DSWOR
static void acf_nla_controls_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
void ANIM_channel_draw_widgets(const bContext *C, bAnimContext *ac, bAnimListElem *ale, uiBlock *block, rctf *rect, size_t channel_index)
static bAnimChannelType ACF_DSPART
static int acf_nlaaction_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bAnimChannelType ACF_DSNTREE
static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
static short acf_generic_indention_flexible(bAnimContext *UNUSED(ac), bAnimListElem *ale)
static void acf_nlaaction_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
static bool acf_shapekey_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static int acf_object_icon(bAnimListElem *ale)
static void * acf_gpl_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static int acf_mask_icon(bAnimListElem *UNUSED(ale))
static void acf_object_name(bAnimListElem *ale, char *name)
static bAnimChannelType ACF_SCENE
static void acf_nlaaction_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static short acf_generic_basic_offset(bAnimContext *ac, bAnimListElem *ale)
static void * acf_dsmclip_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name)
static bAnimChannelType ACF_MASKLAYER
static void * acf_dsmball_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
#define GRAPH_ICON_VISIBILITY_OFFSET
#define GET_ACF_FLAG_PTR(ptr, type)
static bAnimChannelType ACF_NLACURVE
static bool acf_gpd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static void * acf_dswor_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dsmesh_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_nlaaction_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *ale, eAnimChannel_Settings setting)
static int acf_dscur_icon(bAnimListElem *ale)
static void * acf_dscur_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bAnimChannelType ACF_DSSIMULATION
static bAnimChannelType ACF_GPD
static bAnimChannelType ACF_DSLAT
void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode)
static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting)
static void * acf_shapekey_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void * acf_dspart_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
#define INDENT_STEP_SIZE
static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dstex_icon(bAnimListElem *UNUSED(ale))
static void acf_nla_curve_name(bAnimListElem *ale, char *name)
static bAnimChannelType ACF_DSVOLUME
static bool acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static int acf_dsntree_icon(bAnimListElem *UNUSED(ale))
static int acf_nlaaction_icon(bAnimListElem *ale)
static bAnimChannelType ACF_DSMCLIP
static void * acf_nla_controls_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_dsskey_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static bAnimChannelType ACF_NLATRACK
static int acf_dslight_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dsvolume_icon(bAnimListElem *UNUSED(ale))
static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static bool acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static int acf_object_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
#define SLIDER_WIDTH
static bAnimChannelType ACF_DSPOINTCLOUD
static bAnimChannelType ACF_SUMMARY
static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static void acf_generic_root_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
static void * acf_group_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static bool acf_object_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static int acf_dscachefile_icon(bAnimListElem *ale)
static int acf_nlatrack_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bAnimChannelType ACF_DSMBALL
void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc, size_t channel_index)
static bAnimChannelType ACF_DSLINESTYLE
static bAnimChannelType ACF_DSHAIR
static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
static void * acf_fcurve_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static void * acf_dslat_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dspointcloud_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void * acf_dsarm_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dsskey_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void * acf_dsskey_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bool achannel_is_being_renamed(const bAnimContext *ac, const bAnimChannelType *acf, size_t channel_index)
static void acf_group_name(bAnimListElem *ale, char *name)
#define RENAME_TEXT_MIN_WIDTH
static void acf_gpd_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
static bAnimChannelType ACF_FCURVE
static void * acf_dsntree_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bAnimChannelType ACF_DSSPK
static int acf_dsmclip_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static void acf_nlatrack_name(bAnimListElem *ale, char *name)
static void * acf_summary_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dspart_icon(bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_DSTEX
static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
static void * acf_dslinestyle_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dssimulation_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static short acf_dsntree_offset(bAnimContext *ac, bAnimListElem *ale)
static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
#define ICON_WIDTH
static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static bool acf_gpl_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static int acf_gpd_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_show_channel_colors(void)
static int acf_dsmat_icon(bAnimListElem *UNUSED(ale))
static short acf_generic_indention_0(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_FILLACTD
static void * acf_dsgpencil_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void achannel_nlatrack_solo_widget_cb(bContext *C, void *ale_poin, void *UNUSED(arg2))
static void acf_group_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
static bool acf_nlatrack_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static void * acf_dsmat_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
#define ANIM_CHAN_NAME_SIZE
static bool acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
static int acf_dstex_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bool acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *ale, eAnimChannel_Settings setting)
static int acf_dsarm_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static short acf_nodetree_rootType_offset(bNodeTree *ntree)
static int acf_dscam_icon(bAnimListElem *UNUSED(ale))
void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level)
static bool acf_shapekey_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static void * acf_dssimulation_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bool acf_masklay_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
#define ACF_SETTING_SET(sval, sflag, smode)
static void * acf_dspointcloud_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void achannel_setting_widget_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
static void * acf_nlatrack_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static int acf_dslinestyle_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void acf_nlaaction_name(bAnimListElem *ale, char *name)
static void * acf_dsvolume_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bAnimChannelType ACF_DSGPENCIL
static bAnimChannelType ACF_MASKDATA
static int acf_dsspk_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_scene_icon(bAnimListElem *UNUSED(ale))
#define GRAPH_COLOR_BAND_WIDTH
static void * acf_fillactd_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dslat_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dsntree_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_mask_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dsvolume_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name)
static bAnimChannelType ACF_GROUP
static bool acf_group_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static bAnimChannelType ACF_OBJECT
static int acf_nla_controls_icon(bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_FILLDRIVERS
static void * acf_dstex_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_nla_controls_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dscachefile_setting_flag(bAnimContext *ac, eAnimChannel_Settings setting, bool *neg)
static int acf_dshair_icon(bAnimListElem *UNUSED(ale))
static int acf_dsmesh_icon(bAnimListElem *UNUSED(ale))
static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static int acf_gpd_icon(bAnimListElem *UNUSED(ale))
static int acf_dslat_icon(bAnimListElem *UNUSED(ale))
static void achannel_setting_slider_nla_curve_cb(bContext *C, void *UNUSED(id_poin), void *fcu_poin)
static int acf_dslight_icon(bAnimListElem *UNUSED(ale))
static void * acf_dslight_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bAnimChannelType ACF_NLAACTION
static int acf_group_setting_flag(bAnimContext *ac, eAnimChannel_Settings setting, bool *neg)
static bool acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static bAnimChannelType ACF_DSMAT
static int acf_dssimulation_icon(bAnimListElem *UNUSED(ale))
static void acf_nla_controls_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
static bAnimChannelType ACF_DSCUR
static int acf_dsspk_icon(bAnimListElem *UNUSED(ale))
static void acf_summary_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
static void * acf_dscachefile_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_dsgpencil_icon(bAnimListElem *UNUSED(ale))
static void * acf_mask_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
static int acf_dsmclip_icon(bAnimListElem *UNUSED(ale))
static short acf_dstex_offset(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale))
static bool acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static int acf_dsmball_icon(bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_DSLIGHT
static bAnimChannelType ACF_DSCACHEFILE
static bAnimChannelType ACF_DSARM
static int acf_dsmball_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bAnimChannelType ACF_GPL
static int acf_dsarm_icon(bAnimListElem *UNUSED(ale))
static void * acf_dshair_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static int acf_masklay_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void acf_nlatrack_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
static void acf_nla_controls_name(bAnimListElem *UNUSED(ale), char *name)
static void * acf_object_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dsskey_icon(bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_DSCAM
static void * acf_gpd_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static bAnimChannelType ACF_DSMESH
const bAnimChannelType * ANIM_channel_get_typeinfo(bAnimListElem *ale)
static short acf_generic_indention_1(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale))
static bool acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
static int acf_dsgpencil_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dswor_icon(bAnimListElem *UNUSED(ale))
static void * acf_dsspk_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, void *kb_poin)
static bool acf_mask_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static void * acf_filldrivers_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void acf_fcurve_name(bAnimListElem *ale, char *name)
static int acf_dspointcloud_icon(bAnimListElem *UNUSED(ale))
static int acf_dslinestyle_icon(bAnimListElem *UNUSED(ale))
static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
static bool acf_nlaaction_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static void acf_generic_dataexpand_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
static void * acf_scene_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static bool acf_nla_controls_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
static int acf_fillactd_icon(bAnimListElem *UNUSED(ale))
static int acf_filldrivers_icon(bAnimListElem *UNUSED(ale))
static bAnimChannelType ACF_SHAPEKEY
static void * acf_nlaaction_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static bAnimChannelType * animchannelTypeInfo[ANIMTYPE_NUM_TYPES]
static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dshair_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void *setting_wrap)
static int acf_shapekey_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static bAnimChannelType ACF_NLACONTROLS
static void acf_gpencil_channel_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
static void ANIM_init_channel_typeinfo_data(void)
static short ACF_INIT
static bool acf_gpl_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static bool acf_generic_idblock_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
static void acf_shapekey_name(bAnimListElem *ale, char *name)
static bAnimChannelType ACF_DSSKEY
static void acf_masklay_name(bAnimListElem *ale, char *name)
static void * acf_dsmesh_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void acf_mask_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
#define EXTRA_SCROLL_PAD
static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static int acf_dswor_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
static void * acf_dscam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
static void * acf_masklay_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode)
void ANIM_animdata_freelist(ListBase *anim_data)
Definition: anim_deps.c:425
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
Definition: anim_filter.c:405
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
Definition: anim_filter.c:3442
int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
unsigned int U
Definition: btGjkEpa3.h:78
Scene scene
FreestyleLineStyle linestyle
Simulation simulation
const Depsgraph * depsgraph
bNodeTree * ntree
uint pos
uint col
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
bool enabled
#define GS(x)
Definition: iris.c:241
bAction * ED_id_action_ensure(Main *bmain, ID *id)
Definition: keyframing.c:136
bool fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter)
Definition: keyframing.c:2813
bool insert_keyframe_direct(ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, struct NlaKeyframingContext *nla_context, eInsertKeyFlags flag)
Definition: keyframing.c:1249
FCurve * ED_action_fcurve_ensure(struct Main *bmain, struct bAction *act, const char group[], struct PointerRNA *ptr, const char rna_path[], const int array_index)
Definition: keyframing.c:194
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_mode)
Definition: keyframing.c:92
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:42
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:122
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1145
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6319
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
char * RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:6027
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
Definition: rna_access.c:953
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
Definition: rna_access.c:761
bool RNA_path_resolve_property(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
Definition: rna_access.c:5434
const char * RNA_property_ui_name(const PropertyRNA *prop)
Definition: rna_access.c:2043
bAction * action
short flag
struct Object * object
struct AnimData * adt
struct AnimData * adt
struct AnimData * adt
bActionGroup * grp
char * rna_path
BezTriple * bezt
float color[3]
int array_index
short flag
struct AnimData * adt
int flag
struct AnimData * adt
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
short flag
Definition: DNA_key_types.h:58
char name[64]
Definition: DNA_key_types.h:68
short flag
struct AnimData * adt
Definition: DNA_key_types.h:81
struct AnimData * adt
struct AnimData * adt
short flag
Definition: BKE_main.h:116
char name[64]
struct AnimData * adt
struct AnimData * adt
short flag
struct AnimData * adt
struct AnimData * adt
char name[64]
char name[64]
struct AnimData * adt
struct AnimData * adt
struct StructRNA * type
Definition: RNA_types.h:51
short flag
struct ToolSettings * toolsettings
struct AnimData * adt
struct AnimData * adt
bDopeSheet ads
struct AnimData * adt
struct AnimData * adt
short flag
unsigned char select[4]
unsigned char solid[4]
unsigned char active[4]
struct AnimData * adt
struct AnimData * adt
short flag
ThemeWireColor cs
void *(* setting_ptr)(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
Definition: ED_anim_api.h:569
void(* name)(bAnimListElem *ale, char *name)
Definition: ED_anim_api.h:554
void(* get_backdrop_color)(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
Definition: ED_anim_api.h:545
short(* get_offset)(bAnimContext *ac, bAnimListElem *ale)
Definition: ED_anim_api.h:551
bool(* name_prop)(bAnimListElem *ale, struct PointerRNA *ptr, struct PropertyRNA **prop)
Definition: ED_anim_api.h:556
void(* draw_backdrop)(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
Definition: ED_anim_api.h:547
const char * channel_type_name
Definition: ED_anim_api.h:539
bool(* has_setting)(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
Definition: ED_anim_api.h:562
short(* get_indent_level)(bAnimContext *ac, bAnimListElem *ale)
Definition: ED_anim_api.h:549
int(* setting_flag)(bAnimContext *ac, eAnimChannel_Settings setting, bool *neg)
Definition: ED_anim_api.h:564
int(* icon)(bAnimListElem *ale)
Definition: ED_anim_api.h:558
struct ARegion * region
Definition: ED_anim_api.h:89
short spacetype
Definition: ED_anim_api.h:80
struct bDopeSheet * ads
Definition: ED_anim_api.h:92
short datatype
Definition: ED_anim_api.h:75
void * data
Definition: ED_anim_api.h:73
struct SpaceLink * sl
Definition: ED_anim_api.h:87
struct ID * fcurve_owner_id
Definition: ED_anim_api.h:183
struct AnimData * adt
Definition: ED_anim_api.h:170
struct ID * id
Definition: ED_anim_api.h:168
struct AnimData * adt
float color[4]
char info[128]
struct AnimData * adt
struct AnimData * adt
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymin
Definition: DNA_vec_types.h:86
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157