Blender V5.0
graph_buttons.cc File Reference
#include <cfloat>
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_anim_data.hh"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_fcurve.hh"
#include "BKE_fcurve_driver.h"
#include "BKE_global.hh"
#include "BKE_screen.hh"
#include "BKE_unit.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "ED_anim_api.hh"
#include "ED_screen.hh"
#include "ED_undo.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "graph_intern.hh"

Go to the source code of this file.

Macros

#define B_REDR   1

Functions

Internal Utilities
static bool graph_panel_context (const bContext *C, bAnimListElem **ale, FCurve **fcu)
FCurveANIM_graph_context_fcurve (const bContext *C)
static bool graph_panel_poll (const bContext *C, PanelType *)
Cursor Header
static void graph_panel_cursor_header (const bContext *C, Panel *panel)
static void graph_panel_cursor (const bContext *C, Panel *panel)
Active F-Curve
static void graph_panel_properties (const bContext *C, Panel *panel)
Active Keyframe
static bool get_active_fcurve_keyframe_edit (const FCurve *fcu, BezTriple **r_bezt, BezTriple **r_prevbezt)
static void graphedit_activekey_update_cb (bContext *, void *fcu_ptr, void *)
static void graphedit_activekey_handles_cb (bContext *C, void *fcu_ptr, void *bezt_ptr)
static void graphedit_activekey_left_handle_coord_cb (bContext *C, void *fcu_ptr, void *bezt_ptr)
static void graphedit_activekey_right_handle_coord_cb (bContext *C, void *fcu_ptr, void *bezt_ptr)
static void graph_panel_key_properties (const bContext *C, Panel *panel)
Registration
void graph_buttons_register (ARegionType *art)

Drivers

#define B_IPO_DEPCHANGE   10
static void do_graph_region_driver_buttons (bContext *C, void *id_v, int event)
static void driver_add_var_cb (bContext *C, void *driver_v, void *)
static void driver_delete_var_cb (bContext *C, void *driver_v, void *dvar_v)
static void driver_dvar_invalid_name_query_cb (bContext *C, void *dvar_v, void *)
static void driver_update_flags_cb (bContext *, void *fcu_v, void *)
static bool graph_panel_drivers_poll (const bContext *C, PanelType *)
static void graph_panel_driverVar_fallback (uiLayout *layout, const DriverTarget *dtar, PointerRNA *dtar_ptr)
static void graph_panel_driverVar__singleProp (uiLayout *layout, ID *id, DriverVar *dvar)
static void graph_panel_driverVar__rotDiff (uiLayout *layout, ID *id, DriverVar *dvar)
static void graph_panel_driverVar__locDiff (uiLayout *layout, ID *id, DriverVar *dvar)
static void graph_panel_driverVar__transChan (uiLayout *layout, ID *id, DriverVar *dvar)
static void graph_panel_driverVar__contextProp (uiLayout *layout, ID *id, DriverVar *dvar)
static void graph_draw_driven_property_enabled_btn (uiLayout *layout, ID *id, FCurve *fcu, const char *label)
static void graph_panel_drivers_header (const bContext *C, Panel *panel)
static void graph_draw_driven_property_panel (uiLayout *layout, ID *id, FCurve *fcu)
static void graph_draw_driver_settings_panel (uiLayout *layout, ID *id, FCurve *fcu, const bool is_popover)
static void graph_panel_driven_property (const bContext *C, Panel *panel)
static void graph_panel_drivers (const bContext *C, Panel *panel)
static bool graph_panel_drivers_popover_poll (const bContext *C, PanelType *)
static void graph_panel_drivers_popover (const bContext *C, Panel *panel)

F-Curve Modifiers

Note
All the drawing code is in editors/animation/fmodifier_ui.cc.
#define B_FMODIFIER_REDRAW   20
#define GRAPH_FMODIFIER_PANEL_PREFIX   "GRAPH"
static void graph_fmodifier_panel_id (void *fcm_link, char *r_name)
static void do_graph_region_modifier_buttons (bContext *C, void *, int event)
static void graph_panel_modifiers (const bContext *C, Panel *panel)

Detailed Description

Graph editor space & buttons.

Definition in file graph_buttons.cc.

Macro Definition Documentation

◆ B_FMODIFIER_REDRAW

#define B_FMODIFIER_REDRAW   20

Definition at line 1380 of file graph_buttons.cc.

◆ B_IPO_DEPCHANGE

#define B_IPO_DEPCHANGE   10

◆ B_REDR

#define B_REDR   1

Definition at line 57 of file graph_buttons.cc.

◆ GRAPH_FMODIFIER_PANEL_PREFIX

#define GRAPH_FMODIFIER_PANEL_PREFIX   "GRAPH"

The start of FModifier panels registered for the graph editor.

Definition at line 1382 of file graph_buttons.cc.

Referenced by graph_buttons_register(), and graph_fmodifier_panel_id().

Function Documentation

◆ ANIM_graph_context_fcurve()

FCurve * ANIM_graph_context_fcurve ( const bContext * C)

Definition at line 96 of file graph_buttons.cc.

References C, and graph_panel_context().

Referenced by fmodifier_get_pointers(), and fmodifier_list_space_specific().

◆ do_graph_region_driver_buttons()

◆ do_graph_region_modifier_buttons()

void do_graph_region_modifier_buttons ( bContext * C,
void * ,
int event )
static

Definition at line 1400 of file graph_buttons.cc.

References B_FMODIFIER_REDRAW, C, NC_ANIMATION, and WM_event_add_notifier().

Referenced by graph_panel_modifiers().

◆ driver_add_var_cb()

void driver_add_var_cb ( bContext * C,
void * driver_v,
void *  )
static

Definition at line 650 of file graph_buttons.cc.

References C, driver_add_new_variable(), and ED_undo_push().

Referenced by graph_draw_driver_settings_panel().

◆ driver_delete_var_cb()

void driver_delete_var_cb ( bContext * C,
void * driver_v,
void * dvar_v )
static

Definition at line 660 of file graph_buttons.cc.

References C, driver_free_variable_ex(), and ED_undo_push().

Referenced by graph_draw_driver_settings_panel().

◆ driver_dvar_invalid_name_query_cb()

◆ driver_update_flags_cb()

void driver_update_flags_cb ( bContext * ,
void * fcu_v,
void *  )
static

◆ get_active_fcurve_keyframe_edit()

bool get_active_fcurve_keyframe_edit ( const FCurve * fcu,
BezTriple ** r_bezt,
BezTriple ** r_prevbezt )
static

◆ graph_buttons_register()

◆ graph_draw_driven_property_enabled_btn()

void graph_draw_driven_property_enabled_btn ( uiLayout * layout,
ID * id,
FCurve * fcu,
const char * label )
static

◆ graph_draw_driven_property_panel()

void graph_draw_driven_property_panel ( uiLayout * layout,
ID * id,
FCurve * fcu )
static

◆ graph_draw_driver_settings_panel()

void graph_draw_driver_settings_panel ( uiLayout * layout,
ID * id,
FCurve * fcu,
const bool is_popover )
static

Definition at line 990 of file graph_buttons.cc.

References uiLayout::alignment_set(), B_IPO_DEPCHANGE, BKE_driver_has_simple_expression(), BLI_listbase_is_empty(), BLI_STR_UTF8_DEGREE_SIGN, uiLayout::block(), But, col, uiLayout::column(), ChannelDriver::curval, do_graph_region_driver_buttons(), FCurve::driver, driver_add_var_cb(), driver_delete_var_cb(), driver_dvar_invalid_name_query_cb(), DRIVER_FLAG_INVALID, DRIVER_FLAG_PYTHON_BLOCKED, DRIVER_TYPE_PYTHON, driver_update_flags_cb(), DTAR_ROTMODE_QUATERNION, DTAR_TRANSCHAN_ROTW, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ, DVAR_FLAG_INVALID_NAME, DVAR_TYPE_CONTEXT_PROP, DVAR_TYPE_LOC_DIFF, DVAR_TYPE_ROT_DIFF, DVAR_TYPE_SINGLE_PROP, DVAR_TYPE_TRANSFORM_CHAN, ELEM, blender::ui::Emboss, blender::ui::Expand, ChannelDriver::expression, ChannelDriver::flag, graph_panel_driverVar__contextProp(), graph_panel_driverVar__locDiff(), graph_panel_driverVar__rotDiff(), graph_panel_driverVar__singleProp(), graph_panel_driverVar__transChan(), IFACE_, uiLayout::label(), blender::ui::Left, LISTBASE_FOREACH, FCurve::modifiers, blender::ui::None, uiLayout::op(), uiLayout::prop(), RAD2DEGF, RNA_pointer_create_discrete(), uiLayout::row(), RPT_, uiLayout::separator(), SNPRINTF_UTF8, TIP_, ChannelDriver::type, UI_block_emboss_set(), UI_block_func_handle_set(), UI_but_func_set(), UI_ITEM_NONE, UI_ITEM_R_ICON_ONLY, UI_UNIT_X, UI_UNIT_Y, uiDefIconBut(), uiDefIconTextBut(), UNUSED_VARS, and ChannelDriver::variables.

Referenced by graph_panel_drivers(), and graph_panel_drivers_popover().

◆ graph_fmodifier_panel_id()

void graph_fmodifier_panel_id ( void * fcm_link,
char * r_name )
static

◆ graph_panel_context()

◆ graph_panel_cursor()

◆ graph_panel_cursor_header()

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

◆ graph_panel_driven_property()

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

◆ graph_panel_drivers()

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

◆ graph_panel_drivers_header()

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

◆ graph_panel_drivers_poll()

bool graph_panel_drivers_poll ( const bContext * C,
PanelType *  )
static

◆ graph_panel_drivers_popover()

◆ graph_panel_drivers_popover_poll()

bool graph_panel_drivers_popover_poll ( const bContext * C,
PanelType *  )
static

Definition at line 1317 of file graph_buttons.cc.

References C, and ED_operator_graphedit_active().

Referenced by graph_buttons_register().

◆ graph_panel_driverVar__contextProp()

◆ graph_panel_driverVar__locDiff()

void graph_panel_driverVar__locDiff ( uiLayout * layout,
ID * id,
DriverVar * dvar )
static

◆ graph_panel_driverVar__rotDiff()

void graph_panel_driverVar__rotDiff ( uiLayout * layout,
ID * id,
DriverVar * dvar )
static

◆ graph_panel_driverVar__singleProp()

◆ graph_panel_driverVar__transChan()

◆ graph_panel_driverVar_fallback()

void graph_panel_driverVar_fallback ( uiLayout * layout,
const DriverTarget * dtar,
PointerRNA * dtar_ptr )
static

◆ graph_panel_key_properties()

◆ graph_panel_modifiers()

◆ graph_panel_poll()

bool graph_panel_poll ( const bContext * C,
PanelType *  )
static

Definition at line 106 of file graph_buttons.cc.

References C, and graph_panel_context().

Referenced by graph_buttons_register().

◆ graph_panel_properties()

◆ graphedit_activekey_handles_cb()

◆ graphedit_activekey_left_handle_coord_cb()

void graphedit_activekey_left_handle_coord_cb ( bContext * C,
void * fcu_ptr,
void * bezt_ptr )
static

◆ graphedit_activekey_right_handle_coord_cb()

void graphedit_activekey_right_handle_coord_cb ( bContext * C,
void * fcu_ptr,
void * bezt_ptr )
static

◆ graphedit_activekey_update_cb()

void graphedit_activekey_update_cb ( bContext * ,
void * fcu_ptr,
void *  )
static