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