Blender V4.3
fmodifier_ui.cc File Reference
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "MEM_guardedalloc.h"
#include "BLT_translation.hh"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_screen.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "ED_anim_api.hh"
#include "ED_undo.hh"
#include "DEG_depsgraph.hh"

Go to the source code of this file.

Classes

struct  FModifierDeleteContext
 

Typedefs

using PanelDrawFn = void (*)(const bContext *, 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 *, Panel *panel)
 
static void set_fmodifier_expand_flag (const bContext *, 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 *)
 
static void fmod_envelope_deletepoint_cb (bContext *, 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 B_REDR   1
 
#define B_FMODIFIER_REDRAW   20
 
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 = {nullptr, nullptr}
 
void ANIM_fmodifiers_copybuf_free ()
 
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 228 of file fmodifier_ui.cc.

Referenced by envelope_panel_draw().

◆ B_REDR

#define B_REDR   1

Definition at line 227 of file fmodifier_ui.cc.

Referenced by fmodifier_panel_header().

Typedef Documentation

◆ PanelDrawFn

using PanelDrawFn = void (*)(const bContext *, 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 47 of file fmodifier_ui.cc.

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 951 of file fmodifier_ui.cc.

References BLI_addtail(), copy_fmodifier(), copy_fmodifiers(), ELEM, find_active_fmodifier(), ListBase::first, and fmodifier_copypaste_buf.

Referenced by graph_fmodifier_copy_exec(), and nla_fmodifier_copy_exec().

◆ ANIM_fmodifiers_copybuf_free()

void ANIM_fmodifiers_copybuf_free ( )

Free the copy/paste buffer.

Definition at line 945 of file fmodifier_ui.cc.

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,
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 980 of file fmodifier_ui.cc.

References BKE_fcurve_handles_recalc(), BKE_fcurve_is_cyclic(), BLI_addtail(), copy_fmodifier(), curve, FModifier::curve, FModifier::flag, fmodifier_copypaste_buf, free_fmodifiers(), and LISTBASE_FOREACH.

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 924 of file fmodifier_ui.cc.

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()

◆ envelope_panel_draw()

◆ fmod_envelope_addpoint_cb()

◆ fmod_envelope_deletepoint_cb()

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

◆ fmodifier_frame_range_draw()

◆ fmodifier_frame_range_header_draw()

◆ fmodifier_get_pointers()

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

◆ fmodifier_influence_draw()

◆ 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 57 of file fmodifier_ui.cc.

References ANIM_graph_context_fcurve(), ANIM_nla_context_strip(), BLI_assert, CTX_wm_area(), FCurve::modifiers, NlaStrip::modifiers, SPACE_GRAPH, and SPACE_NLA.

Referenced by fmodifier_panel_header(), and fmodifier_reorder().

◆ fmodifier_panel_header()

◆ fmodifier_panel_register()

◆ fmodifier_reorder()

◆ fmodifier_subpanel_register()

◆ fn_generator_panel_draw()

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

◆ generator_panel_draw()

◆ get_fmodifier_expand_flag()

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

◆ limits_panel_draw()

◆ 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 * ,
Panel * panel,
short expand_flag )
static

◆ stepped_panel_draw()

Variable Documentation

◆ fmodifier_copypaste_buf

ListBase fmodifier_copypaste_buf = {nullptr, nullptr}
static