Blender V4.3
anim_ipo_utils.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_anim_types.h"
#include "RNA_access.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "ED_anim_api.hh"
#include "ANIM_action.hh"
#include "fmt/format.h"
#include <cstring>

Go to the source code of this file.

Macros

#define HSV_BANDWIDTH   0.3f
 

Functions

std::optional< intgetname_anim_fcurve (char *name, ID *id, FCurve *fcu)
 
std::string getname_anim_fcurve_for_slot (Main &bmain, const blender::animrig::Slot &slot, FCurve &fcurve)
 
void getcolor_fcurve_rainbow (int cur, int tot, float out[3])
 

Macro Definition Documentation

◆ HSV_BANDWIDTH

#define HSV_BANDWIDTH   0.3f

Definition at line 283 of file anim_ipo_utils.cc.

Referenced by getcolor_fcurve_rainbow().

Function Documentation

◆ getcolor_fcurve_rainbow()

void getcolor_fcurve_rainbow ( int cur,
int tot,
float out[3] )

Automatically determine a color for the nth F-Curve.

Definition at line 287 of file anim_ipo_utils.cc.

References float, fmod(), HSV_BANDWIDTH, and hsv_to_rgb_v().

Referenced by graph_refresh_fcurve_colors().

◆ getname_anim_fcurve()

std::optional< int > getname_anim_fcurve ( char * name,
ID * id,
FCurve * fcu )

Get icon + name for channel-list displays for F-Curve.

Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings), and return the icon used for the struct that this property refers to

Warning
name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.cc for details).
Returns
the icon of whatever struct the F-Curve's RNA path resolves to. Returns #std::nullopt if the path could not be resolved.

Definition at line 41 of file anim_ipo_utils.cc.

References FCurve::array_index, BLI_assert_unreachable, BLI_snprintf(), BLI_sprintfN(), BLI_str_quoted_substr(), BLI_strncpy(), PointerRNA::data, FCURVE_DISABLED, FCurve::flag, GS, ID_SCE, MEM_freeN(), ID::name, PointerRNA::owner_id, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_array_check(), RNA_property_array_item_char(), RNA_property_string_get_alloc(), RNA_property_ui_name(), RNA_struct_is_a(), RNA_struct_name_property(), RNA_struct_ui_icon(), RNA_struct_ui_name(), RPT_, SNPRINTF, and PointerRNA::type.

Referenced by acf_fcurve_name(), getname_anim_fcurve_for_slot(), graph_draw_driven_property_panel(), and graph_panel_properties().

◆ getname_anim_fcurve_for_slot()

std::string getname_anim_fcurve_for_slot ( Main & bmain,
const blender::animrig::Slot & slot,
FCurve & fcurve )