Blender  V3.3
Classes | Typedefs
fmodifier_ui.c File Reference
#include <string.h>
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "MEM_guardedalloc.h"
#include "BLT_translation.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "ED_anim_api.h"
#include "ED_undo.h"
#include "DEG_depsgraph.h"

Go to the source code of this file.

Classes

struct  FModifierDeleteContext
 

Typedefs

typedef void(* PanelDrawFn) (const bContext *, struct Panel *)
 

Functions

Panel Registering and Panel Callbacks
static ListBasefmodifier_list_space_specific (const bContext *C)
 
static PointerRNAfmodifier_get_pointers (const bContext *C, const Panel *panel, ID **r_owner_id)
 
static void fmodifier_reorder (bContext *C, Panel *panel, int new_index)
 
static short get_fmodifier_expand_flag (const bContext *UNUSED(C), Panel *panel)
 
static void set_fmodifier_expand_flag (const bContext *UNUSED(C), Panel *panel, short expand_flag)
 
static PanelTypefmodifier_panel_register (ARegionType *region_type, eFModifier_Types type, PanelDrawFn draw, PanelTypePollFn poll, const char *id_prefix)
 
static PanelTypefmodifier_subpanel_register (ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelTypePollFn poll, PanelType *parent)
 
Generator Modifier
static void generator_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_generator (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Function Generator Modifier
static void fn_generator_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_fn_generator (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Cycles Modifier
static void cycles_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_cycles (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Noise Modifier
static void noise_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_noise (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Envelope Modifier
static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *UNUSED(arg))
 
static void fmod_envelope_deletepoint_cb (bContext *UNUSED(C), void *fcm_dv, void *ind_v)
 
static void envelope_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_envelope (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Limits Modifier
static void limits_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_limits (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Stepped Interpolation Modifier
static void stepped_panel_draw (const bContext *C, Panel *panel)
 
static void panel_register_stepped (ARegionType *region_type, const char *id_prefix, PanelTypePollFn poll_fn)
 
Panel Creation
void ANIM_fmodifier_panels (const bContext *C, ID *owner_id, ListBase *fmodifiers, uiListPanelIDFromDataFunc panel_id_fn)
 
void ANIM_modifier_panels_register_graph_and_NLA (ARegionType *region_type, const char *modifier_panel_prefix, PanelTypePollFn poll_function)
 
void ANIM_modifier_panels_register_graph_only (ARegionType *region_type, const char *modifier_panel_prefix, PanelTypePollFn poll_function)
 

General UI Callbacks and Drawing

#define UI_FLT_MAX   10000.0f
 
#define B_REDR   1
 
#define B_FMODIFIER_REDRAW   20
 
typedef struct FModifierDeleteContext FModifierDeleteContext
 
static void fmodifier_panel_header (const bContext *C, Panel *panel)
 
static void delete_fmodifier_cb (bContext *C, void *ctx_v, void *fcm_v)
 
static void fmodifier_influence_draw (uiLayout *layout, PointerRNA *ptr)
 
static void fmodifier_frame_range_header_draw (const bContext *C, Panel *panel)
 
static void fmodifier_frame_range_draw (const bContext *C, Panel *panel)
 

Copy / Paste Buffer Code

For now, this is also defined in this file so that it can be shared between the graph editor and the NLA editor.

static ListBase fmodifier_copypaste_buf = {NULL, NULL}
 
void ANIM_fmodifiers_copybuf_free (void)
 
bool ANIM_fmodifiers_copy_to_buf (ListBase *modifiers, bool active)
 
bool ANIM_fmodifiers_paste_from_buf (ListBase *modifiers, bool replace, FCurve *curve)
 

Macro Definition Documentation

◆ B_FMODIFIER_REDRAW

#define B_FMODIFIER_REDRAW   20

Definition at line 232 of file fmodifier_ui.c.

◆ B_REDR

#define B_REDR   1

Definition at line 231 of file fmodifier_ui.c.

◆ UI_FLT_MAX

#define UI_FLT_MAX   10000.0f

Definition at line 229 of file fmodifier_ui.c.

Typedef Documentation

◆ FModifierDeleteContext

◆ PanelDrawFn

typedef void(* PanelDrawFn) (const bContext *, struct Panel *)

User Interface for F-Modifiers

This file defines templates and some editing callbacks needed by the interface for F-Modifiers, as used by F-Curves in the Graph Editor and NLA-Strips in the NLA Editor.

Definition at line 46 of file fmodifier_ui.c.

Function Documentation

◆ ANIM_fmodifier_panels()

void ANIM_fmodifier_panels ( const bContext C,
ID owner_id,
ListBase fmodifiers,
uiListPanelIDFromDataFunc  panel_id_fn 
)

◆ ANIM_fmodifiers_copy_to_buf()

bool ANIM_fmodifiers_copy_to_buf ( ListBase modifiers,
bool  active 
)

Copy the given F-Modifiers to the buffer, returning whether anything was copied or not assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free()

Parameters
activeOnly copy the active modifier.

Definition at line 960 of file fmodifier_ui.c.

References blender::compositor::active, BLI_addtail(), copy_fmodifier(), copy_fmodifiers(), ELEM, find_active_fmodifier(), ListBase::first, fmodifier_copypaste_buf, and NULL.

Referenced by graph_fmodifier_copy_exec(), and nla_fmodifier_copy_exec().

◆ ANIM_fmodifiers_copybuf_free()

void ANIM_fmodifiers_copybuf_free ( void  )

Free the copy/paste buffer.

Definition at line 954 of file fmodifier_ui.c.

References fmodifier_copypaste_buf, and free_fmodifiers().

Referenced by graph_fmodifier_copy_exec(), nla_fmodifier_copy_exec(), and WM_exit_ex().

◆ ANIM_fmodifiers_paste_from_buf()

bool ANIM_fmodifiers_paste_from_buf ( ListBase modifiers,
bool  replace,
struct FCurve curve 
)

'Paste' the F-Modifier(s) from the buffer to the specified list

Parameters
replaceFree all the existing modifiers to leave only the pasted ones.

Definition at line 989 of file fmodifier_ui.c.

References BKE_fcurve_handles_recalc(), BKE_fcurve_is_cyclic(), BLI_addtail(), copy_fmodifier(), curve, FModifier::curve, ListBase::first, FModifier::flag, fmodifier_copypaste_buf, FMODIFIER_FLAG_ACTIVE, free_fmodifiers(), FModifier::next, and NULL.

Referenced by graph_fmodifier_paste_exec(), and nla_fmodifier_paste_exec().

◆ ANIM_modifier_panels_register_graph_and_NLA()

void ANIM_modifier_panels_register_graph_and_NLA ( ARegionType region_type,
const char *  modifier_panel_prefix,
PanelTypePollFn  poll_function 
)

◆ ANIM_modifier_panels_register_graph_only()

void ANIM_modifier_panels_register_graph_only ( ARegionType region_type,
const char *  modifier_panel_prefix,
PanelTypePollFn  poll_function 
)

Definition at line 933 of file fmodifier_ui.c.

References panel_register_cycles().

Referenced by graph_buttons_register().

◆ cycles_panel_draw()

static void cycles_panel_draw ( const bContext C,
Panel panel 
)
static

◆ delete_fmodifier_cb()

static void delete_fmodifier_cb ( bContext C,
void ctx_v,
void fcm_v 
)
static

◆ envelope_panel_draw()

static void envelope_panel_draw ( const bContext C,
Panel panel 
)
static

◆ fmod_envelope_addpoint_cb()

static void fmod_envelope_addpoint_cb ( bContext C,
void fcm_dv,
void UNUSEDarg 
)
static

◆ fmod_envelope_deletepoint_cb()

static void fmod_envelope_deletepoint_cb ( bContext UNUSEDC,
void fcm_dv,
void ind_v 
)
static

◆ fmodifier_frame_range_draw()

static void fmodifier_frame_range_draw ( const bContext C,
Panel panel 
)
static

◆ fmodifier_frame_range_header_draw()

static void fmodifier_frame_range_header_draw ( const bContext C,
Panel panel 
)
static

◆ fmodifier_get_pointers()

static PointerRNA* fmodifier_get_pointers ( const bContext C,
const Panel panel,
ID **  r_owner_id 
)
static

◆ fmodifier_influence_draw()

static void fmodifier_influence_draw ( uiLayout layout,
PointerRNA ptr 
)
static

◆ fmodifier_list_space_specific()

static ListBase* fmodifier_list_space_specific ( const bContext C)
static

Get the list of FModifiers from the context (either the NLA or graph editor).

Definition at line 56 of file fmodifier_ui.c.

References ANIM_graph_context_fcurve(), ANIM_nla_context_strip(), blender::compositor::area(), BLI_assert, C, CTX_wm_area(), FCurve::modifiers, NlaStrip::modifiers, NULL, SPACE_GRAPH, and SPACE_NLA.

Referenced by fmodifier_panel_header(), and fmodifier_reorder().

◆ fmodifier_panel_header()

static void fmodifier_panel_header ( const bContext C,
Panel panel 
)
static

◆ fmodifier_panel_register()

static PanelType* fmodifier_panel_register ( ARegionType region_type,
eFModifier_Types  type,
PanelDrawFn  draw,
PanelTypePollFn  poll,
const char *  id_prefix 
)
static

◆ fmodifier_reorder()

static void fmodifier_reorder ( bContext C,
Panel panel,
int  new_index 
)
static

◆ fmodifier_subpanel_register()

static PanelType* fmodifier_subpanel_register ( ARegionType region_type,
const char *  name,
const char *  label,
PanelDrawFn  draw_header,
PanelDrawFn  draw,
PanelTypePollFn  poll,
PanelType parent 
)
static

◆ fn_generator_panel_draw()

static void fn_generator_panel_draw ( const bContext C,
Panel panel 
)
static

◆ generator_panel_draw()

static void generator_panel_draw ( const bContext C,
Panel panel 
)
static

◆ get_fmodifier_expand_flag()

static short get_fmodifier_expand_flag ( const bContext UNUSEDC,
Panel panel 
)
static

◆ limits_panel_draw()

static void limits_panel_draw ( const bContext C,
Panel panel 
)
static

◆ noise_panel_draw()

static void noise_panel_draw ( const bContext C,
Panel panel 
)
static

◆ panel_register_cycles()

static void panel_register_cycles ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_envelope()

static void panel_register_envelope ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_fn_generator()

static void panel_register_fn_generator ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_generator()

static void panel_register_generator ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_limits()

static void panel_register_limits ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_noise()

static void panel_register_noise ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ panel_register_stepped()

static void panel_register_stepped ( ARegionType region_type,
const char *  id_prefix,
PanelTypePollFn  poll_fn 
)
static

◆ set_fmodifier_expand_flag()

static void set_fmodifier_expand_flag ( const bContext UNUSEDC,
Panel panel,
short  expand_flag 
)
static

◆ stepped_panel_draw()

static void stepped_panel_draw ( const bContext C,
Panel panel 
)
static

Variable Documentation

◆ fmodifier_copypaste_buf

ListBase fmodifier_copypaste_buf = {NULL, NULL}
static