Blender  V2.93
fmodifier_ui.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
31 #include <string.h>
32 
33 #include "DNA_anim_types.h"
34 #include "DNA_scene_types.h"
35 #include "DNA_space_types.h"
36 
37 #include "MEM_guardedalloc.h"
38 
39 #include "BLT_translation.h"
40 
41 #include "BLI_blenlib.h"
42 #include "BLI_utildefines.h"
43 
44 #include "BKE_context.h"
45 #include "BKE_fcurve.h"
46 #include "BKE_screen.h"
47 
48 #include "WM_api.h"
49 #include "WM_types.h"
50 
51 #include "RNA_access.h"
52 
53 #include "UI_interface.h"
54 #include "UI_resources.h"
55 
56 #include "ED_anim_api.h"
57 #include "ED_undo.h"
58 
59 #include "DEG_depsgraph.h"
60 
61 typedef void (*PanelDrawFn)(const bContext *, struct Panel *);
62 static void fmodifier_panel_header(const bContext *C, Panel *panel);
63 
64 /* -------------------------------------------------------------------- */
72 {
74 
75  if (area->spacetype == SPACE_GRAPH) {
77  return &fcu->modifiers;
78  }
79 
80  if (area->spacetype == SPACE_NLA) {
82  return &strip->modifiers;
83  }
84 
85  /* This should not be called in any other space. */
86  BLI_assert(false);
87  return NULL;
88 }
89 
94 static PointerRNA *fmodifier_get_pointers(const bContext *C, const Panel *panel, ID **r_owner_id)
95 {
97 
98  if (r_owner_id != NULL) {
99  *r_owner_id = ptr->owner_id;
100  }
101 
102  if (C != NULL && CTX_wm_space_graph(C)) {
104  uiLayoutSetActive(panel->layout, !(fcu->flag & FCURVE_MOD_OFF));
105  }
106 
107  return ptr;
108 }
109 
113 static void fmodifier_reorder(bContext *C, Panel *panel, int new_index)
114 {
115  ID *owner_id;
116  PointerRNA *ptr = fmodifier_get_pointers(NULL, panel, &owner_id);
117  FModifier *fcm = ptr->data;
118  const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(fcm->type);
119 
120  /* Cycles modifier has to be the first, so make sure it's kept that way. */
122  WM_report(RPT_ERROR, "Modifier requires original data");
123  return;
124  }
125 
127 
128  /* Again, make sure we don't move a modifier before a cycles modifier. */
129  FModifier *fcm_first = modifiers->first;
130  const FModifierTypeInfo *fmi_first = get_fmodifier_typeinfo(fcm_first->type);
131  if (fmi_first->requires & FMI_REQUIRES_ORIGINAL_DATA && new_index == 0) {
132  WM_report(RPT_ERROR, "Modifier requires original data");
133  return;
134  }
135 
136  int current_index = BLI_findindex(modifiers, fcm);
137  BLI_assert(current_index >= 0);
138  BLI_assert(new_index >= 0);
139 
140  /* Don't do anything if the drag didn't change the index. */
141  if (current_index == new_index) {
142  return;
143  }
144 
145  /* Move the FModifier in the list. */
146  BLI_listbase_link_move(modifiers, fcm, new_index - current_index);
147 
148  ED_undo_push(C, "Reorder F-Curve Modifier");
149 
152 }
153 
154 static short get_fmodifier_expand_flag(const bContext *UNUSED(C), Panel *panel)
155 {
157  FModifier *fcm = (FModifier *)ptr->data;
158 
159  return fcm->ui_expand_flag;
160 }
161 
162 static void set_fmodifier_expand_flag(const bContext *UNUSED(C), Panel *panel, short expand_flag)
163 {
165  FModifier *fcm = (FModifier *)ptr->data;
166 
167  fcm->ui_expand_flag = expand_flag;
168 }
169 
172  PanelDrawFn draw,
173  PanelTypePollFn poll,
174  const char *id_prefix)
175 {
176  PanelType *panel_type = MEM_callocN(sizeof(PanelType), __func__);
177 
178  /* Intentionally leave the label field blank. The header is filled with buttons. */
180  BLI_snprintf(panel_type->idname, BKE_ST_MAXNAME, "%s_PT_%s", id_prefix, fmi->name);
181  BLI_strncpy(panel_type->category, "Modifiers", BKE_ST_MAXNAME);
183 
184  panel_type->draw_header = fmodifier_panel_header;
185  panel_type->draw = draw;
186  panel_type->poll = poll;
187 
188  /* Give the panel the special flag that says it was built here and corresponds to a
189  * modifier rather than a #PanelType. */
191  panel_type->reorder = fmodifier_reorder;
194 
195  BLI_addtail(&region_type->paneltypes, panel_type);
196 
197  return panel_type;
198 }
199 
207  const char *name,
208  const char *label,
209  PanelDrawFn draw_header,
210  PanelDrawFn draw,
211  PanelTypePollFn poll,
212  PanelType *parent)
213 {
214  PanelType *panel_type = MEM_callocN(sizeof(PanelType), __func__);
215 
216  BLI_snprintf(panel_type->idname, BKE_ST_MAXNAME, "%s_%s", parent->idname, name);
217  BLI_strncpy(panel_type->label, label, BKE_ST_MAXNAME);
218  BLI_strncpy(panel_type->category, "Modifiers", BKE_ST_MAXNAME);
220 
221  panel_type->draw_header = draw_header;
222  panel_type->draw = draw;
223  panel_type->poll = poll;
225 
226  BLI_assert(parent != NULL);
227  BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME);
228  panel_type->parent = parent;
229  BLI_addtail(&parent->children, BLI_genericNodeN(panel_type));
230  BLI_addtail(&region_type->paneltypes, panel_type);
231 
232  return panel_type;
233 }
234 
237 /* -------------------------------------------------------------------- */
241 /* XXX! -------------------------------- */
242 /* Temporary definition for limits of float number buttons
243  * (FLT_MAX tends to infinity with old system). */
244 #define UI_FLT_MAX 10000.0f
245 
246 #define B_REDR 1
247 #define B_FMODIFIER_REDRAW 20
248 
249 /* callback to remove the given modifier */
250 typedef struct FModifierDeleteContext {
254 
255 static void delete_fmodifier_cb(bContext *C, void *ctx_v, void *fcm_v)
256 {
258  ListBase *modifiers = ctx->modifiers;
259  FModifier *fcm = (FModifier *)fcm_v;
260 
261  /* remove the given F-Modifier from the active modifier-stack */
262  remove_fmodifier(modifiers, fcm);
263 
264  ED_undo_push(C, "Delete F-Curve Modifier");
265 
268 }
269 
271 {
272  FModifier *fcm = (FModifier *)ptr->data;
273  uiItemS(layout);
274 
275  uiLayout *row = uiLayoutRowWithHeading(layout, true, IFACE_("Influence"));
276  uiItemR(row, ptr, "use_influence", 0, "", ICON_NONE);
277  uiLayout *sub = uiLayoutRow(row, true);
278 
280  uiItemR(sub, ptr, "influence", 0, "", ICON_NONE);
281 }
282 
284 {
285  uiLayout *layout = panel->layout;
286 
288 
289  uiItemR(layout, ptr, "use_restricted_range", 0, NULL, ICON_NONE);
290 }
291 
292 static void fmodifier_frame_range_draw(const bContext *C, Panel *panel)
293 {
294  uiLayout *col;
295  uiLayout *layout = panel->layout;
296 
298 
299  uiLayoutSetPropSep(layout, true);
300  uiLayoutSetPropDecorate(layout, false);
301 
302  FModifier *fcm = (FModifier *)ptr->data;
304 
305  col = uiLayoutColumn(layout, true);
306  uiItemR(col, ptr, "frame_start", 0, IFACE_("Start"), ICON_NONE);
307  uiItemR(col, ptr, "frame_end", 0, IFACE_("End"), ICON_NONE);
308 
309  col = uiLayoutColumn(layout, true);
310  uiItemR(col, ptr, "blend_in", 0, IFACE_("Blend In"), ICON_NONE);
311  uiItemR(col, ptr, "blend_out", 0, IFACE_("Out"), ICON_NONE);
312 }
313 
314 static void fmodifier_panel_header(const bContext *C, Panel *panel)
315 {
316  uiLayout *layout = panel->layout;
317 
318  ID *owner_id;
319  PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
320  FModifier *fcm = (FModifier *)ptr->data;
321  const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
322 
323  uiBlock *block = uiLayoutGetBlock(layout);
324 
325  uiLayout *sub = uiLayoutRow(layout, true);
328 
329  /* Checkbox for 'active' status (for now). */
330  uiItemR(sub, ptr, "active", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
331 
332  /* Name. */
333  if (fmi) {
334  uiItemL(sub, IFACE_(fmi->name), ICON_NONE);
335  }
336  else {
337  uiItemL(sub, IFACE_("<Unknown Modifier>"), ICON_NONE);
338  }
339 
340  /* Right align. */
341  sub = uiLayoutRow(layout, true);
344 
345  /* 'Mute' button. */
346  uiItemR(sub, ptr, "mute", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
347 
348  /* Delete button. */
349  uiBut *but = uiDefIconBut(block,
350  UI_BTYPE_BUT,
351  B_REDR,
352  ICON_X,
353  0,
354  0,
355  UI_UNIT_X,
356  UI_UNIT_Y,
357  NULL,
358  0.0,
359  0.0,
360  0.0,
361  0.0,
362  TIP_("Delete Modifier"));
364  ctx->owner_id = owner_id;
366  BLI_assert(ctx->modifiers != NULL);
367 
368  UI_but_funcN_set(but, delete_fmodifier_cb, ctx, fcm);
369 
370  uiItemS(layout);
371 }
372 
375 /* -------------------------------------------------------------------- */
379 static void generator_panel_draw(const bContext *C, Panel *panel)
380 {
381  uiLayout *layout = panel->layout;
382 
383  ID *owner_id;
384  PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
385  FModifier *fcm = (FModifier *)ptr->data;
387 
388  uiItemR(layout, ptr, "mode", 0, "", ICON_NONE);
389 
390  uiLayoutSetPropSep(layout, true);
391  uiLayoutSetPropDecorate(layout, false);
392 
393  uiItemR(layout, ptr, "use_additive", 0, NULL, ICON_NONE);
394 
395  uiItemR(layout, ptr, "poly_order", 0, IFACE_("Order"), ICON_NONE);
396 
397  PropertyRNA *prop = RNA_struct_find_property(ptr, "coefficients");
398  uiLayout *col = uiLayoutColumn(layout, true);
399  switch (data->mode) {
400  case FCM_GENERATOR_POLYNOMIAL: /* Polynomial expression. */
401  {
402 
403  char xval[32];
404 
405  /* The first value gets a "Coefficient" label. */
406  BLI_strncpy(xval, "Coefficient", sizeof(xval));
407 
408  for (int i = 0; i < data->arraysize; i++) {
409  uiItemFullR(col, ptr, prop, i, 0, 0, N_(xval), ICON_NONE);
410  BLI_snprintf(xval, sizeof(xval), "x^%d", i + 1);
411  }
412  break;
413  }
414  case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */
415  {
416  {
417  /* Add column labels above the buttons to prevent confusion.
418  * Fake the property split layout, otherwise the labels use the full row. */
419  uiLayout *split = uiLayoutSplit(col, 0.4f, false);
420  uiLayoutColumn(split, false);
421  uiLayout *title_col = uiLayoutColumn(split, false);
422  uiLayout *title_row = uiLayoutRow(title_col, true);
423  uiItemL(title_row, N_("A"), ICON_NONE);
424  uiItemL(title_row, N_("B"), ICON_NONE);
425  }
426 
427  uiLayout *first_row = uiLayoutRow(col, true);
428  uiItemFullR(first_row, ptr, prop, 0, 0, 0, N_("y = (Ax + B)"), ICON_NONE);
429  uiItemFullR(first_row, ptr, prop, 1, 0, 0, "", ICON_NONE);
430  for (int i = 2; i < data->arraysize - 1; i += 2) {
431  /* \u2715 is the multiplication symbol. */
432  uiLayout *row = uiLayoutRow(col, true);
433  uiItemFullR(row, ptr, prop, i, 0, 0, N_("\u2715 (Ax + B)"), ICON_NONE);
434  uiItemFullR(row, ptr, prop, i + 1, 0, 0, "", ICON_NONE);
435  }
436  break;
437  }
438  }
439 
440  fmodifier_influence_draw(layout, ptr);
441 }
442 
443 static void panel_register_generator(ARegionType *region_type,
444  const char *id_prefix,
445  PanelTypePollFn poll_fn)
446 {
447  PanelType *panel_type = fmodifier_panel_register(
448  region_type, FMODIFIER_TYPE_GENERATOR, generator_panel_draw, poll_fn, id_prefix);
449  fmodifier_subpanel_register(region_type,
450  "frame_range",
451  "",
454  poll_fn,
455  panel_type);
456 }
457 
460 /* -------------------------------------------------------------------- */
464 static void fn_generator_panel_draw(const bContext *C, Panel *panel)
465 {
466  uiLayout *col;
467  uiLayout *layout = panel->layout;
468 
470 
471  uiItemR(layout, ptr, "function_type", 0, "", ICON_NONE);
472 
473  uiLayoutSetPropSep(layout, true);
474  uiLayoutSetPropDecorate(layout, false);
475 
476  col = uiLayoutColumn(layout, false);
477  uiItemR(col, ptr, "use_additive", 0, NULL, ICON_NONE);
478 
479  col = uiLayoutColumn(layout, false);
480  uiItemR(col, ptr, "amplitude", 0, NULL, ICON_NONE);
481  uiItemR(col, ptr, "phase_multiplier", 0, NULL, ICON_NONE);
482  uiItemR(col, ptr, "phase_offset", 0, NULL, ICON_NONE);
483  uiItemR(col, ptr, "value_offset", 0, NULL, ICON_NONE);
484 
485  fmodifier_influence_draw(layout, ptr);
486 }
487 
488 static void panel_register_fn_generator(ARegionType *region_type,
489  const char *id_prefix,
490  PanelTypePollFn poll_fn)
491 {
492  PanelType *panel_type = fmodifier_panel_register(
493  region_type, FMODIFIER_TYPE_FN_GENERATOR, fn_generator_panel_draw, poll_fn, id_prefix);
494  fmodifier_subpanel_register(region_type,
495  "frame_range",
496  "",
499  poll_fn,
500  panel_type);
501 }
502 
505 /* -------------------------------------------------------------------- */
509 static void cycles_panel_draw(const bContext *C, Panel *panel)
510 {
511  uiLayout *col;
512  uiLayout *layout = panel->layout;
513 
515 
516  uiLayoutSetPropSep(layout, true);
517  uiLayoutSetPropDecorate(layout, false);
518 
519  /* Before. */
520  col = uiLayoutColumn(layout, false);
521  uiItemR(col, ptr, "mode_before", 0, NULL, ICON_NONE);
522  uiItemR(col, ptr, "cycles_before", 0, IFACE_("Count"), ICON_NONE);
523 
524  /* After. */
525  col = uiLayoutColumn(layout, false);
526  uiItemR(col, ptr, "mode_after", 0, NULL, ICON_NONE);
527  uiItemR(col, ptr, "cycles_after", 0, IFACE_("Count"), ICON_NONE);
528 
529  fmodifier_influence_draw(layout, ptr);
530 }
531 
532 static void panel_register_cycles(ARegionType *region_type,
533  const char *id_prefix,
534  PanelTypePollFn poll_fn)
535 {
536  PanelType *panel_type = fmodifier_panel_register(
537  region_type, FMODIFIER_TYPE_CYCLES, cycles_panel_draw, poll_fn, id_prefix);
538  fmodifier_subpanel_register(region_type,
539  "frame_range",
540  "",
543  poll_fn,
544  panel_type);
545 }
546 
549 /* -------------------------------------------------------------------- */
553 static void noise_panel_draw(const bContext *C, Panel *panel)
554 {
555  uiLayout *col;
556  uiLayout *layout = panel->layout;
557 
559 
560  uiLayoutSetPropSep(layout, true);
561  uiLayoutSetPropDecorate(layout, false);
562 
563  uiItemR(layout, ptr, "blend_type", 0, NULL, ICON_NONE);
564 
565  col = uiLayoutColumn(layout, false);
566  uiItemR(col, ptr, "scale", 0, NULL, ICON_NONE);
567  uiItemR(col, ptr, "strength", 0, NULL, ICON_NONE);
568  uiItemR(col, ptr, "offset", 0, NULL, ICON_NONE);
569  uiItemR(col, ptr, "phase", 0, NULL, ICON_NONE);
570  uiItemR(col, ptr, "depth", 0, NULL, ICON_NONE);
571 
572  fmodifier_influence_draw(layout, ptr);
573 }
574 
575 static void panel_register_noise(ARegionType *region_type,
576  const char *id_prefix,
577  PanelTypePollFn poll_fn)
578 {
579  PanelType *panel_type = fmodifier_panel_register(
580  region_type, FMODIFIER_TYPE_NOISE, noise_panel_draw, poll_fn, id_prefix);
581  fmodifier_subpanel_register(region_type,
582  "frame_range",
583  "",
586  poll_fn,
587  panel_type);
588 }
589 
592 /* -------------------------------------------------------------------- */
596 static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(arg))
597 {
599  FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
600  FCM_EnvelopeData *fedn;
601  FCM_EnvelopeData fed;
602 
603  /* init template data */
604  fed.min = -1.0f;
605  fed.max = 1.0f;
606  fed.time = (float)scene->r.cfra; /* XXX make this int for ease of use? */
607  fed.f1 = fed.f2 = 0;
608 
609  /* check that no data exists for the current frame... */
610  if (env->data) {
611  bool exists;
612  int i = BKE_fcm_envelope_find_index(env->data, (float)(scene->r.cfra), env->totvert, &exists);
613 
614  /* binarysearch_...() will set exists by default to 0,
615  * so if it is non-zero, that means that the point exists already */
616  if (exists) {
617  return;
618  }
619 
620  /* add new */
621  fedn = MEM_callocN((env->totvert + 1) * sizeof(FCM_EnvelopeData), "FCM_EnvelopeData");
622 
623  /* add the points that should occur before the point to be pasted */
624  if (i > 0) {
625  memcpy(fedn, env->data, i * sizeof(FCM_EnvelopeData));
626  }
627 
628  /* add point to paste at index i */
629  *(fedn + i) = fed;
630 
631  /* add the points that occur after the point to be pasted */
632  if (i < env->totvert) {
633  memcpy(fedn + i + 1, env->data + i, (env->totvert - i) * sizeof(FCM_EnvelopeData));
634  }
635 
636  /* replace (+ free) old with new */
637  MEM_freeN(env->data);
638  env->data = fedn;
639 
640  env->totvert++;
641  }
642  else {
643  env->data = MEM_callocN(sizeof(FCM_EnvelopeData), "FCM_EnvelopeData");
644  *(env->data) = fed;
645 
646  env->totvert = 1;
647  }
648 }
649 
650 /* callback to remove envelope data point */
651 /* TODO: should we have a separate file for things like this? */
652 static void fmod_envelope_deletepoint_cb(bContext *UNUSED(C), void *fcm_dv, void *ind_v)
653 {
654  FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
655  FCM_EnvelopeData *fedn;
656  int index = POINTER_AS_INT(ind_v);
657 
658  /* check that no data exists for the current frame... */
659  if (env->totvert > 1) {
660  /* allocate a new smaller array */
661  fedn = MEM_callocN(sizeof(FCM_EnvelopeData) * (env->totvert - 1), "FCM_EnvelopeData");
662 
663  memcpy(fedn, env->data, sizeof(FCM_EnvelopeData) * (index));
664  memcpy(fedn + index,
665  env->data + (index + 1),
666  sizeof(FCM_EnvelopeData) * ((env->totvert - index) - 1));
667 
668  /* free old array, and set the new */
669  MEM_freeN(env->data);
670  env->data = fedn;
671  env->totvert--;
672  }
673  else {
674  /* just free array, since the only vert was deleted */
675  if (env->data) {
676  MEM_freeN(env->data);
677  env->data = NULL;
678  }
679  env->totvert = 0;
680  }
681 }
682 
683 /* draw settings for envelope modifier */
684 static void envelope_panel_draw(const bContext *C, Panel *panel)
685 {
686  uiLayout *row, *col;
687  uiLayout *layout = panel->layout;
688 
689  ID *owner_id;
690  PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
691  FModifier *fcm = (FModifier *)ptr->data;
692  FMod_Envelope *env = (FMod_Envelope *)fcm->data;
693 
694  uiLayoutSetPropSep(layout, true);
695  uiLayoutSetPropDecorate(layout, false);
696 
697  /* General settings. */
698  col = uiLayoutColumn(layout, true);
699  uiItemR(col, ptr, "reference_value", 0, IFACE_("Reference"), ICON_NONE);
700  uiItemR(col, ptr, "default_min", 0, IFACE_("Min"), ICON_NONE);
701  uiItemR(col, ptr, "default_max", 0, IFACE_("Max"), ICON_NONE);
702 
703  /* Control points list. */
704 
705  row = uiLayoutRow(layout, false);
706  uiBlock *block = uiLayoutGetBlock(row);
707 
708  uiBut *but = uiDefBut(block,
709  UI_BTYPE_BUT,
711  IFACE_("Add Control Point"),
712  0,
713  0,
714  7.5 * UI_UNIT_X,
715  UI_UNIT_Y,
716  NULL,
717  0,
718  0,
719  0,
720  0,
721  TIP_("Add a new control-point to the envelope on the current frame"));
723 
724  col = uiLayoutColumn(layout, false);
725  uiLayoutSetPropSep(col, false);
726 
727  FCM_EnvelopeData *fed = env->data;
728  for (int i = 0; i < env->totvert; i++, fed++) {
729  PointerRNA ctrl_ptr;
730  RNA_pointer_create(owner_id, &RNA_FModifierEnvelopeControlPoint, fed, &ctrl_ptr);
731 
732  /* get a new row to operate on */
733  row = uiLayoutRow(col, true);
734  block = uiLayoutGetBlock(row);
735 
736  uiItemR(row, &ctrl_ptr, "frame", 0, NULL, ICON_NONE);
737  uiItemR(row, &ctrl_ptr, "min", 0, IFACE_("Min"), ICON_NONE);
738  uiItemR(row, &ctrl_ptr, "max", 0, IFACE_("Max"), ICON_NONE);
739 
740  but = uiDefIconBut(block,
741  UI_BTYPE_BUT,
743  ICON_X,
744  0,
745  0,
746  0.9 * UI_UNIT_X,
747  UI_UNIT_Y,
748  NULL,
749  0.0,
750  0.0,
751  0.0,
752  0.0,
753  TIP_("Delete envelope control point"));
755  UI_block_align_begin(block);
756  }
757 
758  fmodifier_influence_draw(layout, ptr);
759 }
760 
761 static void panel_register_envelope(ARegionType *region_type,
762  const char *id_prefix,
763  PanelTypePollFn poll_fn)
764 {
765  PanelType *panel_type = fmodifier_panel_register(
766  region_type, FMODIFIER_TYPE_ENVELOPE, envelope_panel_draw, poll_fn, id_prefix);
767  fmodifier_subpanel_register(region_type,
768  "frame_range",
769  "",
772  poll_fn,
773  panel_type);
774 }
775 
778 /* -------------------------------------------------------------------- */
782 static void limits_panel_draw(const bContext *C, Panel *panel)
783 {
784  uiLayout *col, *row, *sub;
785  uiLayout *layout = panel->layout;
786 
788 
789  uiLayoutSetPropSep(layout, true);
790  uiLayoutSetPropDecorate(layout, false);
791 
792  /* Minimums. */
793  col = uiLayoutColumn(layout, false);
794  row = uiLayoutRowWithHeading(col, true, IFACE_("Minimum X"));
795  uiItemR(row, ptr, "use_min_x", 0, "", ICON_NONE);
796  sub = uiLayoutColumn(row, true);
797  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min_x"));
798  uiItemR(sub, ptr, "min_x", 0, "", ICON_NONE);
799 
800  row = uiLayoutRowWithHeading(col, true, IFACE_("Y"));
801  uiItemR(row, ptr, "use_min_y", 0, "", ICON_NONE);
802  sub = uiLayoutColumn(row, true);
803  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min_y"));
804  uiItemR(sub, ptr, "min_y", 0, "", ICON_NONE);
805 
806  /* Maximums. */
807  col = uiLayoutColumn(layout, false);
808  row = uiLayoutRowWithHeading(col, true, IFACE_("Maximum X"));
809  uiItemR(row, ptr, "use_max_x", 0, "", ICON_NONE);
810  sub = uiLayoutColumn(row, true);
811  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max_x"));
812  uiItemR(sub, ptr, "max_x", 0, "", ICON_NONE);
813 
814  row = uiLayoutRowWithHeading(col, true, IFACE_("Y"));
815  uiItemR(row, ptr, "use_max_y", 0, "", ICON_NONE);
816  sub = uiLayoutColumn(row, true);
817  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max_y"));
818  uiItemR(sub, ptr, "max_y", 0, "", ICON_NONE);
819 
820  fmodifier_influence_draw(layout, ptr);
821 }
822 
823 static void panel_register_limits(ARegionType *region_type,
824  const char *id_prefix,
825  PanelTypePollFn poll_fn)
826 {
827  PanelType *panel_type = fmodifier_panel_register(
828  region_type, FMODIFIER_TYPE_LIMITS, limits_panel_draw, poll_fn, id_prefix);
829  fmodifier_subpanel_register(region_type,
830  "frame_range",
831  "",
834  poll_fn,
835  panel_type);
836 }
837 
840 /* -------------------------------------------------------------------- */
844 static void stepped_panel_draw(const bContext *C, Panel *panel)
845 {
846  uiLayout *col, *sub, *row;
847  uiLayout *layout = panel->layout;
848 
850 
851  uiLayoutSetPropSep(layout, true);
852  uiLayoutSetPropDecorate(layout, false);
853 
854  /* Stepping Settings. */
855  col = uiLayoutColumn(layout, false);
856  uiItemR(col, ptr, "frame_step", 0, NULL, ICON_NONE);
857  uiItemR(col, ptr, "frame_offset", 0, NULL, ICON_NONE);
858 
859  /* Start range settings. */
860  row = uiLayoutRowWithHeading(layout, true, IFACE_("Start Frame"));
861  uiItemR(row, ptr, "use_frame_start", 0, "", ICON_NONE);
862  sub = uiLayoutColumn(row, true);
863  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_frame_start"));
864  uiItemR(sub, ptr, "frame_start", 0, "", ICON_NONE);
865 
866  /* End range settings. */
867  row = uiLayoutRowWithHeading(layout, true, IFACE_("End Frame"));
868  uiItemR(row, ptr, "use_frame_end", 0, "", ICON_NONE);
869  sub = uiLayoutColumn(row, true);
870  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_frame_end"));
871  uiItemR(sub, ptr, "frame_end", 0, "", ICON_NONE);
872 
873  fmodifier_influence_draw(layout, ptr);
874 }
875 
876 static void panel_register_stepped(ARegionType *region_type,
877  const char *id_prefix,
878  PanelTypePollFn poll_fn)
879 {
880  PanelType *panel_type = fmodifier_panel_register(
881  region_type, FMODIFIER_TYPE_STEPPED, stepped_panel_draw, poll_fn, id_prefix);
882  fmodifier_subpanel_register(region_type,
883  "frame_range",
884  "",
887  poll_fn,
888  panel_type);
889 }
890 
893 /* -------------------------------------------------------------------- */
901  ID *owner_id,
902  ListBase *fmodifiers,
903  uiListPanelIDFromDataFunc panel_id_fn)
904 {
905  ARegion *region = CTX_wm_region(C);
906 
907  bool panels_match = UI_panel_list_matches_data(region, fmodifiers, panel_id_fn);
908 
909  if (!panels_match) {
910  UI_panels_free_instanced(C, region);
911  FModifier *fcm = fmodifiers->first;
912  for (int i = 0; fcm; i++, fcm = fcm->next) {
913  char panel_idname[MAX_NAME];
914  panel_id_fn(fcm, panel_idname);
915 
916  PointerRNA *fcm_ptr = MEM_mallocN(sizeof(PointerRNA), "panel customdata");
917  RNA_pointer_create(owner_id, &RNA_FModifier, fcm, fcm_ptr);
918 
919  UI_panel_add_instanced(C, region, &region->panels, panel_idname, fcm_ptr);
920  }
921  }
922  else {
923  /* Assuming there's only one group of instanced panels, update the custom data pointers. */
924  Panel *panel = region->panels.first;
925  LISTBASE_FOREACH (FModifier *, fcm, fmodifiers) {
926 
927  /* Move to the next instanced panel corresponding to the next modifier. */
928  while ((panel->type == NULL) || !(panel->type->flag & PANEL_TYPE_INSTANCED)) {
929  panel = panel->next;
930  BLI_assert(panel != NULL); /* There shouldn't be fewer panels than modifiers with UIs. */
931  }
932 
933  PointerRNA *fcm_ptr = MEM_mallocN(sizeof(PointerRNA), "panel customdata");
934  RNA_pointer_create(owner_id, &RNA_FModifier, fcm, fcm_ptr);
935  UI_panel_custom_data_set(panel, fcm_ptr);
936 
937  panel = panel->next;
938  }
939  }
940 }
941 
943  const char *modifier_panel_prefix,
944  PanelTypePollFn poll_function)
945 {
946  panel_register_generator(region_type, modifier_panel_prefix, poll_function);
947  panel_register_fn_generator(region_type, modifier_panel_prefix, poll_function);
948  panel_register_noise(region_type, modifier_panel_prefix, poll_function);
949  panel_register_envelope(region_type, modifier_panel_prefix, poll_function);
950  panel_register_limits(region_type, modifier_panel_prefix, poll_function);
951  panel_register_stepped(region_type, modifier_panel_prefix, poll_function);
952 }
953 
955  const char *modifier_panel_prefix,
956  PanelTypePollFn poll_function)
957 {
958  panel_register_cycles(region_type, modifier_panel_prefix, poll_function);
959 }
960 
963 /* -------------------------------------------------------------------- */
970 /* Copy/Paste Buffer itself (list of FModifier 's) */
972 
973 /* ---------- */
974 
975 /* free the copy/paste buffer */
977 {
978  /* just free the whole buffer */
980 }
981 
982 /* copy the given F-Modifiers to the buffer, returning whether anything was copied or not
983  * assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free()
984  * - active: only copy the active modifier
985  */
987 {
988  bool ok = true;
989 
990  /* sanity checks */
991  if (ELEM(NULL, modifiers, modifiers->first)) {
992  return 0;
993  }
994 
995  /* copy the whole list, or just the active one? */
996  if (active) {
997  FModifier *fcm = find_active_fmodifier(modifiers);
998 
999  if (fcm) {
1000  FModifier *fcmN = copy_fmodifier(fcm);
1002  }
1003  else {
1004  ok = 0;
1005  }
1006  }
1007  else {
1009  }
1010 
1011  /* did we succeed? */
1012  return ok;
1013 }
1014 
1015 /* 'Paste' the F-Modifier(s) from the buffer to the specified list
1016  * - replace: free all the existing modifiers to leave only the pasted ones
1017  */
1018 bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, FCurve *curve)
1019 {
1020  FModifier *fcm;
1021  bool ok = false;
1022 
1023  /* sanity checks */
1024  if (modifiers == NULL) {
1025  return 0;
1026  }
1027 
1028  bool was_cyclic = curve && BKE_fcurve_is_cyclic(curve);
1029 
1030  /* if replacing the list, free the existing modifiers */
1031  if (replace) {
1032  free_fmodifiers(modifiers);
1033  }
1034 
1035  /* now copy over all the modifiers in the buffer to the end of the list */
1036  for (fcm = fmodifier_copypaste_buf.first; fcm; fcm = fcm->next) {
1037  /* make a copy of it */
1038  FModifier *fcmN = copy_fmodifier(fcm);
1039 
1040  fcmN->curve = curve;
1041 
1042  /* make sure the new one isn't active, otherwise the list may get several actives */
1043  fcmN->flag &= ~FMODIFIER_FLAG_ACTIVE;
1044 
1045  /* now add it to the end of the list */
1046  BLI_addtail(modifiers, fcmN);
1047  ok = 1;
1048  }
1049 
1050  /* adding or removing the Cycles modifier requires an update to handles */
1051  if (curve && BKE_fcurve_is_cyclic(curve) != was_cyclic) {
1053  }
1054 
1055  /* did we succeed? */
1056  return ok;
1057 }
1058 
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct SpaceGraph * CTX_wm_space_graph(const bContext *C)
Definition: context.c:863
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct FModifier * copy_fmodifier(const struct FModifier *src)
int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists)
void copy_fmodifiers(ListBase *dst, const ListBase *src)
Definition: fmodifier.c:1197
const FModifierTypeInfo * fmodifier_get_typeinfo(const struct FModifier *fcm)
struct FModifier * find_active_fmodifier(ListBase *modifiers)
Definition: fmodifier.c:1288
@ FMI_REQUIRES_ORIGINAL_DATA
Definition: BKE_fcurve.h:126
bool remove_fmodifier(ListBase *modifiers, struct FModifier *fcm)
Definition: fmodifier.c:1226
const FModifierTypeInfo * get_fmodifier_typeinfo(const int type)
Definition: fmodifier.c:1072
void calchandles_fcurve(struct FCurve *fcu)
Definition: fcurve.c:1391
void free_fmodifiers(ListBase *modifiers)
Definition: fmodifier.c:1269
bool BKE_fcurve_is_cyclic(struct FCurve *fcu)
Definition: fcurve.c:1267
#define BKE_ST_MAXNAME
Definition: BKE_screen.h:68
@ PANEL_TYPE_DRAW_BOX
Definition: BKE_screen.h:305
@ PANEL_TYPE_INSTANCED
Definition: BKE_screen.h:303
@ PANEL_TYPE_DEFAULT_CLOSED
Definition: BKE_screen.h:297
@ PANEL_TYPE_HEADER_EXPAND
Definition: BKE_screen.h:300
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:923
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
Definition: listbase.c:475
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define POINTER_FROM_INT(i)
#define UNUSED(x)
#define POINTER_AS_INT(i)
#define ELEM(...)
#define TIP_(msgid)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
#define N_(msgid)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:614
eFModifier_Types
@ FMODIFIER_TYPE_CYCLES
@ FMODIFIER_TYPE_STEPPED
@ FMODIFIER_TYPE_FN_GENERATOR
@ FMODIFIER_TYPE_NOISE
@ FMODIFIER_TYPE_GENERATOR
@ FMODIFIER_TYPE_ENVELOPE
@ FMODIFIER_TYPE_LIMITS
@ FCM_GENERATOR_POLYNOMIAL_FACTORISED
@ FCM_GENERATOR_POLYNOMIAL
@ FMODIFIER_FLAG_USEINFLUENCE
@ FMODIFIER_FLAG_ACTIVE
@ FMODIFIER_FLAG_RANGERESTRICT
@ FCURVE_MOD_OFF
#define MAX_NAME
Definition: DNA_defs.h:62
@ SPACE_NLA
@ SPACE_GRAPH
bool(* PanelTypePollFn)(const struct bContext *C, struct PanelType *pt)
Definition: ED_anim_api.h:685
struct NlaStrip * ANIM_nla_context_strip(const struct bContext *C)
void(* uiListPanelIDFromDataFunc)(void *data_link, char *r_idname)
Definition: ED_anim_api.h:687
struct FCurve * ANIM_graph_context_fcurve(const struct bContext *C)
void ED_undo_push(struct bContext *C, const char *str)
Definition: ed_undo.c:117
_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
Read Guarded memory(de)allocation.
StructRNA RNA_FModifier
StructRNA RNA_FModifierEnvelopeControlPoint
#define C
Definition: RandGen.cpp:39
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
#define UI_UNIT_Y
void uiLayoutSetActive(uiLayout *layout, bool active)
@ UI_ITEM_R_ICON_ONLY
uiBlock * uiLayoutGetBlock(uiLayout *layout)
@ UI_EMBOSS_NONE
Definition: UI_interface.h:108
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:5223
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
Definition: interface.c:4687
void uiItemL(uiLayout *layout, const char *name, int icon)
struct PointerRNA * UI_panel_custom_data_get(const struct Panel *panel)
void UI_panel_custom_data_set(struct Panel *panel, struct PointerRNA *custom_data)
struct Panel * UI_panel_add_instanced(const struct bContext *C, struct ARegion *region, struct ListBase *panels, const char *panel_idname, struct PointerRNA *custom_data)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS(uiLayout *layout)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_panels_free_instanced(const struct bContext *C, struct ARegion *region)
@ UI_LAYOUT_ALIGN_LEFT
@ UI_LAYOUT_ALIGN_RIGHT
bool UI_panel_list_matches_data(struct ARegion *region, struct ListBase *data, uiListPanelIDFromDataFunc panel_idname_func)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
Definition: interface.c:6294
void UI_block_align_begin(uiBlock *block)
Definition: interface.c:3821
void uiLayoutSetEmboss(uiLayout *layout, eUIEmbossType emboss)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
Definition: interface.c:6301
#define UI_UNIT_X
@ UI_BTYPE_BUT
Definition: UI_interface.h:334
#define NC_ANIMATION
Definition: WM_types.h:289
#define NA_EDITED
Definition: WM_types.h:462
#define ND_KEYFRAME
Definition: WM_types.h:394
const char * label
Scene scene
Curve curve
#define B_FMODIFIER_REDRAW
Definition: fmodifier_ui.c:247
static void delete_fmodifier_cb(bContext *C, void *ctx_v, void *fcm_v)
Definition: fmodifier_ui.c:255
static void panel_register_noise(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:575
bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, FCurve *curve)
static void fmodifier_frame_range_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:292
static void fmodifier_panel_header(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:314
static void cycles_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:509
static void set_fmodifier_expand_flag(const bContext *UNUSED(C), Panel *panel, short expand_flag)
Definition: fmodifier_ui.c:162
void ANIM_fmodifiers_copybuf_free(void)
Definition: fmodifier_ui.c:976
static void panel_register_stepped(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:876
static void fmodifier_frame_range_header_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:283
static PanelType * fmodifier_panel_register(ARegionType *region_type, eFModifier_Types type, PanelDrawFn draw, PanelTypePollFn poll, const char *id_prefix)
Definition: fmodifier_ui.c:170
static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(arg))
Definition: fmodifier_ui.c:596
static void fmodifier_reorder(bContext *C, Panel *panel, int new_index)
Definition: fmodifier_ui.c:113
static PointerRNA * fmodifier_get_pointers(const bContext *C, const Panel *panel, ID **r_owner_id)
Definition: fmodifier_ui.c:94
static void generator_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:379
struct FModifierDeleteContext FModifierDeleteContext
static void fn_generator_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:464
#define B_REDR
Definition: fmodifier_ui.c:246
static void fmod_envelope_deletepoint_cb(bContext *UNUSED(C), void *fcm_dv, void *ind_v)
Definition: fmodifier_ui.c:652
static void panel_register_cycles(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:532
static void noise_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:553
static ListBase fmodifier_copypaste_buf
Definition: fmodifier_ui.c:971
void ANIM_modifier_panels_register_graph_only(ARegionType *region_type, const char *modifier_panel_prefix, PanelTypePollFn poll_function)
Definition: fmodifier_ui.c:954
static void fmodifier_influence_draw(uiLayout *layout, PointerRNA *ptr)
Definition: fmodifier_ui.c:270
void ANIM_modifier_panels_register_graph_and_NLA(ARegionType *region_type, const char *modifier_panel_prefix, PanelTypePollFn poll_function)
Definition: fmodifier_ui.c:942
void(* PanelDrawFn)(const bContext *, struct Panel *)
Definition: fmodifier_ui.c:61
static void panel_register_limits(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:823
static ListBase * fmodifier_list_space_specific(const bContext *C)
Definition: fmodifier_ui.c:71
static void panel_register_envelope(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:761
static short get_fmodifier_expand_flag(const bContext *UNUSED(C), Panel *panel)
Definition: fmodifier_ui.c:154
static void panel_register_generator(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:443
static void limits_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:782
static void envelope_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:684
static PanelType * fmodifier_subpanel_register(ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelTypePollFn poll, PanelType *parent)
Definition: fmodifier_ui.c:206
bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active)
Definition: fmodifier_ui.c:986
static void stepped_panel_draw(const bContext *C, Panel *panel)
Definition: fmodifier_ui.c:844
void ANIM_fmodifier_panels(const bContext *C, ID *owner_id, ListBase *fmodifiers, uiListPanelIDFromDataFunc panel_id_fn)
Definition: fmodifier_ui.c:900
static void panel_register_fn_generator(ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
Definition: fmodifier_ui.c:488
uint col
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool active
all scheduled work for the GPU.
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
Definition: abc_util.cc:115
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
ListBase paneltypes
Definition: BKE_screen.h:216
ListBase panels
short flag
ListBase modifiers
FCM_EnvelopeData * data
struct FCurve * curve
struct FModifier * next
short ui_expand_flag
void * data
Definition: DNA_ID.h:273
void * first
Definition: DNA_listBase.h:47
ListBase modifiers
short(* get_list_data_expand_flag)(const struct bContext *C, struct Panel *pa)
Definition: BKE_screen.h:278
void(* draw)(const struct bContext *C, struct Panel *panel)
Definition: BKE_screen.h:266
bool(* poll)(const struct bContext *C, struct PanelType *pt)
Definition: BKE_screen.h:260
void(* draw_header)(const struct bContext *C, struct Panel *panel)
Definition: BKE_screen.h:262
char idname[BKE_ST_MAXNAME]
Definition: BKE_screen.h:241
void(* set_list_data_expand_flag)(const struct bContext *C, struct Panel *pa, short expand_flag)
Definition: BKE_screen.h:285
void(* reorder)(struct bContext *C, struct Panel *pa, int new_index)
Definition: BKE_screen.h:271
char translation_context[BKE_ST_MAXNAME]
Definition: BKE_screen.h:244
ListBase children
Definition: BKE_screen.h:289
char category[BKE_ST_MAXNAME]
Definition: BKE_screen.h:246
struct PanelType * parent
Definition: BKE_screen.h:288
char label[BKE_ST_MAXNAME]
Definition: BKE_screen.h:242
char parent_id[BKE_ST_MAXNAME]
Definition: BKE_screen.h:248
struct PanelType * type
struct uiLayout * layout
struct Panel * next
void * data
Definition: RNA_types.h:52
struct ID * owner_id
Definition: RNA_types.h:50
struct RenderData r
void WM_report(ReportType type, const char *message)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157