Blender  V3.3
Macros
graph_buttons.c File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#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.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_anim_data.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "RNA_prototypes.h"
#include "ED_anim_api.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_undo.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "graph_intern.h"

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 *UNUSED(pt))
 
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 *UNUSED(C), void *fcu_ptr, void *UNUSED(bezt_ptr))
 
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 *UNUSED(arg))
 
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 *UNUSED(arg))
 
static void driver_update_flags_cb (bContext *UNUSED(C), void *fcu_v, void *UNUSED(arg))
 
static bool graph_panel_drivers_poll (const bContext *C, PanelType *UNUSED(pt))
 
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_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 *UNUSED(pt))
 
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.c
#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 *UNUSED(arg), int event)
 
static void graph_panel_modifiers (const bContext *C, Panel *panel)
 

Detailed Description

Graph editor space & buttons.

Definition in file graph_buttons.c.

Macro Definition Documentation

◆ B_FMODIFIER_REDRAW

#define B_FMODIFIER_REDRAW   20

Definition at line 1335 of file graph_buttons.c.

◆ B_IPO_DEPCHANGE

#define B_IPO_DEPCHANGE   10

Definition at line 619 of file graph_buttons.c.

◆ B_REDR

#define B_REDR   1

Definition at line 57 of file graph_buttons.c.

◆ GRAPH_FMODIFIER_PANEL_PREFIX

#define GRAPH_FMODIFIER_PANEL_PREFIX   "GRAPH"

The start of FModifier panels registered for the graph editor.

Definition at line 1337 of file graph_buttons.c.

Function Documentation

◆ ANIM_graph_context_fcurve()

FCurve* ANIM_graph_context_fcurve ( const bContext C)

Definition at line 96 of file graph_buttons.c.

References C, graph_panel_context(), and NULL.

◆ do_graph_region_driver_buttons()

static void do_graph_region_driver_buttons ( bContext C,
void id_v,
int  event 
)
static

◆ do_graph_region_modifier_buttons()

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

Definition at line 1347 of file graph_buttons.c.

References B_FMODIFIER_REDRAW, C, NC_ANIMATION, NULL, 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 UNUSEDarg 
)
static

Definition at line 665 of file graph_buttons.c.

References C, 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 675 of file graph_buttons.c.

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

Referenced by graph_draw_driver_settings_panel().

◆ driver_dvar_invalid_name_query_cb()

static void driver_dvar_invalid_name_query_cb ( bContext C,
void dvar_v,
void UNUSEDarg 
)
static

◆ driver_update_flags_cb()

static void driver_update_flags_cb ( bContext UNUSEDC,
void fcu_v,
void UNUSEDarg 
)
static

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

void graph_buttons_register ( ARegionType art)

◆ 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 936 of file graph_buttons.c.

References B_IPO_DEPCHANGE, BKE_driver_has_simple_expression(), BLI_listbase_is_empty(), BLI_snprintf(), col, DriverVar::curval, 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_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_LOC_DIFF, DVAR_TYPE_ROT_DIFF, DVAR_TYPE_SINGLE_PROP, DVAR_TYPE_TRANSFORM_CHAN, ELEM, ChannelDriver::expression, ListBase::first, DriverVar::flag, ChannelDriver::flag, G, G_FLAG_SCRIPT_AUTOEXEC, graph_panel_driverVar__locDiff(), graph_panel_driverVar__rotDiff(), graph_panel_driverVar__singleProp(), graph_panel_driverVar__transChan(), IFACE_, FCurve::modifiers, DriverVar::next, NULL, RAD2DEGF, RNA_pointer_create(), DriverTarget::rotation_mode, DriverVar::targets, TIP_, DriverTarget::transChan, DriverVar::type, 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_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(), 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()

static bool graph_panel_context ( const bContext C,
bAnimListElem **  ale,
FCurve **  fcu 
)
static

◆ graph_panel_cursor()

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

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

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

◆ graph_panel_drivers_popover()

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

◆ graph_panel_drivers_popover_poll()

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

Definition at line 1271 of file graph_buttons.c.

References C, and ED_operator_graphedit_active().

Referenced by graph_buttons_register().

◆ graph_panel_driverVar__locDiff()

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

◆ graph_panel_driverVar__rotDiff()

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

◆ graph_panel_driverVar__singleProp()

static void graph_panel_driverVar__singleProp ( uiLayout layout,
ID id,
DriverVar dvar 
)
static

◆ graph_panel_driverVar__transChan()

static void graph_panel_driverVar__transChan ( uiLayout layout,
ID id,
DriverVar dvar 
)
static

◆ graph_panel_key_properties()

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

◆ graph_panel_modifiers()

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

◆ graph_panel_poll()

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

Definition at line 106 of file graph_buttons.c.

References C, graph_panel_context(), and NULL.

Referenced by graph_buttons_register().

◆ graph_panel_properties()

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

◆ graphedit_activekey_handles_cb()

static void graphedit_activekey_handles_cb ( bContext C,
void fcu_ptr,
void bezt_ptr 
)
static

◆ 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 UNUSEDC,
void fcu_ptr,
void UNUSEDbezt_ptr 
)
static