Blender V4.3
graph_buttons.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math_rotation.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_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 1391 of file graph_buttons.cc.

Referenced by do_graph_region_modifier_buttons().

◆ B_IPO_DEPCHANGE

#define B_IPO_DEPCHANGE   10

◆ B_REDR

#define B_REDR   1

Definition at line 56 of file graph_buttons.cc.

Referenced by graph_panel_key_properties().

◆ GRAPH_FMODIFIER_PANEL_PREFIX

#define GRAPH_FMODIFIER_PANEL_PREFIX   "GRAPH"

The start of FModifier panels registered for the graph editor.

Definition at line 1393 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 95 of file graph_buttons.cc.

References graph_panel_context().

Referenced by fmodifier_get_pointers(), and fmodifier_list_space_specific().

◆ do_graph_region_driver_buttons()

◆ do_graph_region_modifier_buttons()

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

Definition at line 1403 of file graph_buttons.cc.

References B_FMODIFIER_REDRAW, NC_ANIMATION, and WM_event_add_notifier().

Referenced by graph_panel_modifiers().

◆ driver_add_var_cb()

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

Definition at line 650 of file graph_buttons.cc.

References driver_add_new_variable(), and ED_undo_push().

Referenced by graph_draw_driver_settings_panel().

◆ driver_delete_var_cb()

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

Definition at line 660 of file graph_buttons.cc.

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

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

Definition at line 710 of file graph_buttons.cc.

References FCurve::driver, ChannelDriver::flag, and FCurve::flag.

Referenced by graph_draw_driver_settings_panel().

◆ get_active_fcurve_keyframe_edit()

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

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

◆ graph_draw_driven_property_panel()

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

◆ graph_draw_driver_settings_panel()

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

Definition at line 997 of file graph_buttons.cc.

References B_IPO_DEPCHANGE, BKE_driver_has_simple_expression(), BLI_listbase_is_empty(), BLI_STR_UTF8_DEGREE_SIGN, col, 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, 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_, LISTBASE_FOREACH, FCurve::modifiers, RAD2DEGF, RNA_pointer_create(), RPT_, SNPRINTF, TIP_, ChannelDriver::type, UI_block_emboss_set(), UI_block_func_handle_set(), UI_BTYPE_BUT, UI_but_func_set(), UI_EMBOSS, UI_EMBOSS_NONE, UI_ITEM_NONE, UI_ITEM_R_ICON_ONLY, UI_LAYOUT_ALIGN_EXPAND, UI_LAYOUT_ALIGN_LEFT, UI_UNIT_X, UI_UNIT_Y, uiDefIconBut(), uiDefIconTextBut(), uiItemL(), uiItemO(), uiItemR(), uiItemS(), uiLayoutBox(), uiLayoutColumn(), uiLayoutGetBlock(), uiLayoutRow(), uiLayoutSetAlignment(), UNUSED_VARS, and ChannelDriver::variables.

Referenced by graph_panel_drivers(), and graph_panel_drivers_popover().

◆ graph_fmodifier_panel_id()

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

◆ graph_panel_context()

◆ graph_panel_cursor()

◆ graph_panel_cursor_header()

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

◆ graph_panel_driven_property()

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

◆ graph_panel_drivers()

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

◆ graph_panel_drivers_header()

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

◆ graph_panel_drivers_poll()

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

◆ graph_panel_drivers_popover()

◆ graph_panel_drivers_popover_poll()

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

Definition at line 1328 of file graph_buttons.cc.

References ED_operator_graphedit_active().

Referenced by graph_buttons_register().

◆ graph_panel_driverVar__contextProp()

◆ graph_panel_driverVar__locDiff()

◆ graph_panel_driverVar__rotDiff()

◆ graph_panel_driverVar__singleProp()

◆ graph_panel_driverVar__transChan()

◆ graph_panel_driverVar_fallback()

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

◆ graph_panel_key_properties()

◆ graph_panel_modifiers()

◆ graph_panel_poll()

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

Definition at line 105 of file graph_buttons.cc.

References graph_panel_context().

Referenced by graph_buttons_register().

◆ graph_panel_properties()

◆ graphedit_activekey_handles_cb()

◆ graphedit_activekey_left_handle_coord_cb()

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

◆ graphedit_activekey_right_handle_coord_cb()

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

◆ graphedit_activekey_update_cb()

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