|
Blender V4.5
|
#include <cstring>#include "DNA_anim_types.h"#include "DNA_scene_types.h"#include "DNA_userdef_types.h"#include "MEM_guardedalloc.h"#include "BLT_translation.hh"#include "BLI_listbase.h"#include "BLI_string.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 ListBase * | fmodifier_list_space_specific (const bContext *C) |
| static PointerRNA * | fmodifier_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 PanelType * | fmodifier_panel_register (ARegionType *region_type, eFModifier_Types type, PanelDrawFn draw, PanelTypePollFn poll, const char *id_prefix) |
| static PanelType * | fmodifier_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) |
| #define B_FMODIFIER_REDRAW 20 |
Definition at line 229 of file fmodifier_ui.cc.
Referenced by do_graph_region_modifier_buttons(), and envelope_panel_draw().
| #define B_REDR 1 |
Definition at line 228 of file fmodifier_ui.cc.
Referenced by do_view3d_region_buttons(), fmodifier_panel_header(), graph_panel_key_properties(), and v3d_editvertex_buts().
| 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 48 of file fmodifier_ui.cc.
| void ANIM_fmodifier_panels | ( | const bContext * | C, |
| ID * | owner_id, | ||
| ListBase * | fmodifiers, | ||
| uiListPanelIDFromDataFunc | panel_id_fn ) |
Checks if the panels match the active strip / curve, rebuilds them if they don't.
Definition at line 874 of file fmodifier_ui.cc.
References BLI_assert, C, CTX_wm_region(), ListBase::first, PanelType::flag, LISTBASE_FOREACH, MAX_NAME, Panel::next, PANEL_TYPE_INSTANCED, ARegion::panels, RNA_pointer_create_discrete(), Panel::type, UI_panel_add_instanced(), UI_panel_custom_data_set(), UI_panel_list_matches_data(), and UI_panels_free_instanced().
Referenced by graph_panel_modifiers(), and nla_panel_modifiers().
| 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()
| active | Only copy the active modifier. |
Definition at line 955 of file fmodifier_ui.cc.
References active, 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().
| void ANIM_fmodifiers_copybuf_free | ( | ) |
Free the copy/paste buffer.
Definition at line 949 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().
'Paste' the F-Modifier(s) from the buffer to the specified list
| replace | Free all the existing modifiers to leave only the pasted ones. |
Definition at line 984 of file fmodifier_ui.cc.
References BKE_fcurve_handles_recalc(), BKE_fcurve_is_cyclic(), BLI_addtail(), copy_fmodifier(), FModifier::curve, FModifier::flag, fmodifier_copypaste_buf, FMODIFIER_FLAG_ACTIVE, free_fmodifiers(), and LISTBASE_FOREACH.
Referenced by graph_fmodifier_paste_exec(), and nla_fmodifier_paste_exec().
| void ANIM_modifier_panels_register_graph_and_NLA | ( | ARegionType * | region_type, |
| const char * | modifier_panel_prefix, | ||
| PanelTypePollFn | poll_function ) |
Definition at line 916 of file fmodifier_ui.cc.
References panel_register_envelope(), panel_register_fn_generator(), panel_register_generator(), panel_register_limits(), panel_register_noise(), and panel_register_stepped().
Referenced by graph_buttons_register(), and nla_buttons_register().
| void ANIM_modifier_panels_register_graph_only | ( | ARegionType * | region_type, |
| const char * | modifier_panel_prefix, | ||
| PanelTypePollFn | poll_function ) |
Definition at line 928 of file fmodifier_ui.cc.
References panel_register_cycles().
Referenced by graph_buttons_register().
Definition at line 486 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), fmodifier_get_pointers(), fmodifier_influence_draw(), IFACE_, Panel::layout, ptr, UI_ITEM_NONE, uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_cycles().
|
static |
Definition at line 237 of file fmodifier_ui.cc.
References C, DEG_id_tag_update(), ED_undo_push(), ID_RECALC_ANIMATION, FModifierDeleteContext::modifiers, NA_EDITED, NC_ANIMATION, ND_KEYFRAME, FModifierDeleteContext::owner_id, remove_fmodifier(), and WM_event_add_notifier().
Referenced by fmodifier_panel_header().
Definition at line 665 of file fmodifier_ui.cc.
References B_FMODIFIER_REDRAW, C, col, uiLayout::column(), FMod_Envelope::data, FModifier::data, fmod_envelope_addpoint_cb(), fmod_envelope_deletepoint_cb(), fmodifier_get_pointers(), fmodifier_influence_draw(), i, IFACE_, Panel::layout, POINTER_FROM_INT, uiLayout::prop(), ptr, RNA_pointer_create_discrete(), uiLayout::row(), TIP_, FMod_Envelope::totvert, UI_block_align_begin(), UI_BTYPE_BUT, UI_but_func_set(), UI_ITEM_NONE, UI_UNIT_X, UI_UNIT_Y, uiDefBut(), uiDefIconBut(), uiLayoutGetBlock(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_envelope().
|
static |
Definition at line 580 of file fmodifier_ui.cc.
References BKE_fcm_envelope_find_index(), C, RenderData::cfra, CTX_data_scene(), FMod_Envelope::data, FCM_EnvelopeData::f1, FCM_EnvelopeData::f2, i, FCM_EnvelopeData::max, MEM_calloc_arrayN(), MEM_callocN(), MEM_freeN(), FCM_EnvelopeData::min, Scene::r, FCM_EnvelopeData::time, and FMod_Envelope::totvert.
Referenced by envelope_panel_draw().
|
static |
Definition at line 636 of file fmodifier_ui.cc.
References FMod_Envelope::data, MEM_calloc_arrayN(), MEM_freeN(), MEM_SAFE_FREE, POINTER_AS_INT, and FMod_Envelope::totvert.
Referenced by envelope_panel_draw().
Definition at line 274 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), FModifier::flag, FMODIFIER_FLAG_RANGERESTRICT, fmodifier_get_pointers(), IFACE_, Panel::layout, ptr, UI_ITEM_NONE, uiLayoutSetActive(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_cycles(), panel_register_envelope(), panel_register_fn_generator(), panel_register_generator(), panel_register_limits(), panel_register_noise(), and panel_register_stepped().
Definition at line 265 of file fmodifier_ui.cc.
References C, fmodifier_get_pointers(), Panel::layout, uiLayout::prop(), ptr, and UI_ITEM_NONE.
Referenced by panel_register_cycles(), panel_register_envelope(), panel_register_fn_generator(), panel_register_generator(), panel_register_limits(), panel_register_noise(), and panel_register_stepped().
|
static |
Get a pointer to the panel's FModifier, and also its owner ID if r_owner_id is not nullptr. Also in the graph editor, gray out the panel if the FModifier's FCurve has modifiers turned off.
Definition at line 81 of file fmodifier_ui.cc.
References ANIM_graph_context_fcurve(), C, CTX_wm_space_graph(), FCURVE_MOD_OFF, FCurve::flag, Panel::layout, ptr, UI_panel_custom_data_get(), and uiLayoutSetActive().
Referenced by cycles_panel_draw(), envelope_panel_draw(), fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_header(), fmodifier_reorder(), fn_generator_panel_draw(), generator_panel_draw(), get_fmodifier_expand_flag(), limits_panel_draw(), noise_panel_draw(), set_fmodifier_expand_flag(), and stepped_panel_draw().
|
static |
Definition at line 252 of file fmodifier_ui.cc.
References FModifier::flag, FMODIFIER_FLAG_USEINFLUENCE, IFACE_, uiLayout::prop(), ptr, uiLayout::row(), uiLayout::separator(), UI_ITEM_NONE, and uiLayoutSetActive().
Referenced by cycles_panel_draw(), envelope_panel_draw(), fn_generator_panel_draw(), generator_panel_draw(), limits_panel_draw(), noise_panel_draw(), and stepped_panel_draw().
Get the list of FModifiers from the context (either the NLA or graph editor).
Definition at line 58 of file fmodifier_ui.cc.
References ANIM_graph_context_fcurve(), ANIM_nla_context_strip(), BLI_assert, C, CTX_wm_area(), FCurve::modifiers, NlaStrip::modifiers, SPACE_GRAPH, SPACE_NLA, and ScrArea::spacetype.
Referenced by fmodifier_panel_header(), and fmodifier_reorder().
Definition at line 296 of file fmodifier_ui.cc.
References B_REDR, BLI_assert, C, delete_fmodifier_cb(), fmodifier_get_pointers(), fmodifier_get_typeinfo(), fmodifier_list_space_specific(), IFACE_, uiLayout::label(), Panel::layout, MEM_mallocN(), FModifierDeleteContext::modifiers, blender::ui::None, FModifierDeleteContext::owner_id, uiLayout::prop(), ptr, uiLayout::row(), uiLayout::separator(), TIP_, UI_BTYPE_BUT, UI_but_funcN_set(), UI_ITEM_NONE, UI_ITEM_R_ICON_ONLY, UI_LAYOUT_ALIGN_RIGHT, UI_UNIT_X, UI_UNIT_Y, uiDefIconBut(), uiLayoutGetBlock(), uiLayoutSetAlignment(), and uiLayoutSetEmboss().
Referenced by fmodifier_panel_register().
|
static |
Definition at line 157 of file fmodifier_ui.cc.
References BLI_addtail(), BLT_I18NCONTEXT_DEFAULT_BPYRNA, PanelType::category, PanelType::draw, PanelType::draw_header, PanelType::flag, fmodifier_panel_header(), fmodifier_reorder(), get_fmodifier_expand_flag(), get_fmodifier_typeinfo(), PanelType::get_list_data_expand_flag, PanelType::idname, MEM_callocN(), FModifierTypeInfo::name, PANEL_TYPE_HEADER_EXPAND, PANEL_TYPE_INSTANCED, ARegionType::paneltypes, PanelType::poll, PanelType::reorder, set_fmodifier_expand_flag(), PanelType::set_list_data_expand_flag, SNPRINTF, STRNCPY(), and PanelType::translation_context.
Referenced by panel_register_cycles(), panel_register_envelope(), panel_register_fn_generator(), panel_register_generator(), panel_register_limits(), panel_register_noise(), and panel_register_stepped().
Move an FModifier to the index it's moved to after a drag and drop.
Definition at line 100 of file fmodifier_ui.cc.
References BLI_assert, BLI_findindex(), BLI_listbase_link_move(), C, DEG_id_tag_update(), ED_undo_push(), ListBase::first, FMI_REQUIRES_ORIGINAL_DATA, fmodifier_get_pointers(), fmodifier_list_space_specific(), get_fmodifier_typeinfo(), ID_RECALC_ANIMATION, NA_EDITED, NC_ANIMATION, ND_KEYFRAME, ptr, FModifierTypeInfo::requires_flag, RPT_ERROR, FModifier::type, WM_event_add_notifier(), and WM_global_report().
Referenced by fmodifier_panel_register().
|
static |
Add a child panel to the parent.
Definition at line 193 of file fmodifier_ui.cc.
References BLI_addtail(), BLI_assert, BLI_genericNodeN(), BLT_I18NCONTEXT_DEFAULT_BPYRNA, PanelType::category, PanelType::children, PanelType::draw, PanelType::draw_header, PanelType::flag, PanelType::idname, PanelType::label, MEM_callocN(), PANEL_TYPE_DEFAULT_CLOSED, ARegionType::paneltypes, PanelType::parent, PanelType::parent_id, PanelType::poll, SNPRINTF, STRNCPY(), and PanelType::translation_context.
Referenced by panel_register_cycles(), panel_register_envelope(), panel_register_fn_generator(), panel_register_generator(), panel_register_limits(), panel_register_noise(), and panel_register_stepped().
Definition at line 441 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), fmodifier_get_pointers(), fmodifier_influence_draw(), Panel::layout, uiLayout::prop(), ptr, UI_ITEM_NONE, uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_fn_generator().
Definition at line 356 of file fmodifier_ui.cc.
References BLT_I18NCONTEXT_ID_ACTION, C, col, uiLayout::column(), CTX_IFACE_, data, FModifier::data, FCM_GENERATOR_POLYNOMIAL, FCM_GENERATOR_POLYNOMIAL_FACTORISED, fmodifier_get_pointers(), fmodifier_influence_draw(), i, IFACE_, uiLayout::label(), Panel::layout, N_, uiLayout::prop(), ptr, RNA_struct_find_property(), uiLayout::row(), SNPRINTF, split(), STRNCPY(), UI_ITEM_NONE, uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_generator().
Definition at line 141 of file fmodifier_ui.cc.
References fmodifier_get_pointers(), ptr, and FModifier::ui_expand_flag.
Referenced by fmodifier_panel_register().
Definition at line 759 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), fmodifier_get_pointers(), fmodifier_influence_draw(), IFACE_, Panel::layout, uiLayout::prop(), ptr, RNA_boolean_get(), UI_ITEM_NONE, uiLayoutSetActive(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_limits().
Definition at line 530 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), fmodifier_get_pointers(), fmodifier_influence_draw(), Panel::layout, uiLayout::prop(), ptr, RNA_property_boolean_get(), RNA_struct_find_property(), UI_ITEM_NONE, uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_noise().
|
static |
Definition at line 509 of file fmodifier_ui.cc.
References cycles_panel_draw(), fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), and FMODIFIER_TYPE_CYCLES.
Referenced by ANIM_modifier_panels_register_graph_only().
|
static |
Definition at line 738 of file fmodifier_ui.cc.
References envelope_panel_draw(), fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), and FMODIFIER_TYPE_ENVELOPE.
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
|
static |
Definition at line 465 of file fmodifier_ui.cc.
References fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), FMODIFIER_TYPE_FN_GENERATOR, and fn_generator_panel_draw().
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
|
static |
Definition at line 420 of file fmodifier_ui.cc.
References fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), FMODIFIER_TYPE_GENERATOR, and generator_panel_draw().
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
|
static |
Definition at line 800 of file fmodifier_ui.cc.
References fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), FMODIFIER_TYPE_LIMITS, and limits_panel_draw().
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
|
static |
Definition at line 559 of file fmodifier_ui.cc.
References fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), FMODIFIER_TYPE_NOISE, and noise_panel_draw().
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
|
static |
Definition at line 853 of file fmodifier_ui.cc.
References fmodifier_frame_range_draw(), fmodifier_frame_range_header_draw(), fmodifier_panel_register(), fmodifier_subpanel_register(), FMODIFIER_TYPE_STEPPED, and stepped_panel_draw().
Referenced by ANIM_modifier_panels_register_graph_and_NLA().
Definition at line 149 of file fmodifier_ui.cc.
References fmodifier_get_pointers(), ptr, and FModifier::ui_expand_flag.
Referenced by fmodifier_panel_register().
Definition at line 821 of file fmodifier_ui.cc.
References C, col, uiLayout::column(), fmodifier_get_pointers(), fmodifier_influence_draw(), IFACE_, Panel::layout, uiLayout::prop(), ptr, RNA_boolean_get(), uiLayout::row(), UI_ITEM_NONE, uiLayoutSetActive(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by panel_register_stepped().
Definition at line 945 of file fmodifier_ui.cc.
Referenced by ANIM_fmodifiers_copy_to_buf(), ANIM_fmodifiers_copybuf_free(), and ANIM_fmodifiers_paste_from_buf().