Blender  V2.93
Classes | Macros | Typedefs | Functions | Variables
ipo.c File Reference
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "DNA_anim_types.h"
#include "DNA_camera_types.h"
#include "DNA_constraint_types.h"
#include "DNA_ipo_types.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_nla_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_endian_switch.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_nla.h"
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "SEQ_iterator.h"
#include "BLO_read_write.h"

Go to the source code of this file.

Classes

struct  AdrBit2Path
 

Macros

#define DNA_DEPRECATED_ALLOW
 
#define RET_ABP(items)
 

Typedefs

typedef struct AdrBit2Path AdrBit2Path
 

Functions

static void ipo_free_data (ID *id)
 
static void ipo_blend_read_data (BlendDataReader *reader, ID *id)
 
static void ipo_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void ipo_blend_read_expand (BlendExpander *expander, ID *id)
 
static AdrBit2Pathadrcode_bitmaps_to_paths (int blocktype, int adrcode, int *tot)
 
static const char * ob_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * pchan_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * constraint_adrcodes_to_paths (int adrcode, int *array_index)
 
static char * shapekey_adrcodes_to_paths (ID *id, int adrcode, int *UNUSED(array_index))
 
static const char * mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index))
 
static const char * texture_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * material_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * camera_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * light_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * sound_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * world_adrcodes_to_paths (int adrcode, int *array_index)
 
static const char * particle_adrcodes_to_paths (int adrcode, int *array_index)
 
static char * get_rna_access (ID *id, int blocktype, int adrcode, char actname[], char constname[], Sequence *seq, int *array_index)
 
static short adrcode_to_dtar_transchan (short adrcode)
 
static ChannelDriveridriver_to_cdriver (IpoDriver *idriver)
 
static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, char *grpname, int muteipo)
 
static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, Sequence *seq, int muteipo)
 
static void ipo_to_animato (ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq, ListBase *animgroups, ListBase *anim, ListBase *drivers)
 
static void action_to_animato (ID *id, bAction *act, ListBase *groups, ListBase *curves, ListBase *drivers)
 
static void ipo_to_animdata (Main *bmain, ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq)
 
static void action_to_animdata (ID *id, bAction *act)
 
static void nlastrips_to_animdata (ID *id, ListBase *strips)
 
void do_versions_ipos_to_animato (Main *bmain)
 

Variables

static CLG_LogRef LOG = {"bke.ipo"}
 
IDTypeInfo IDType_ID_IP
 
static AdrBit2Path ob_layer_bits []
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 38 of file ipo.c.

◆ RET_ABP

#define RET_ABP (   items)
Value:
{ \
*tot = ARRAY_SIZE(items); \
return items; \
} \
(void)0
#define ARRAY_SIZE(arr)

Definition at line 238 of file ipo.c.

Typedef Documentation

◆ AdrBit2Path

typedef struct AdrBit2Path AdrBit2Path

Function Documentation

◆ action_to_animato()

static void action_to_animato ( ID id,
bAction act,
ListBase groups,
ListBase curves,
ListBase drivers 
)
static

◆ action_to_animdata()

static void action_to_animdata ( ID id,
bAction act 
)
static

◆ adrcode_bitmaps_to_paths()

static AdrBit2Path* adrcode_bitmaps_to_paths ( int  blocktype,
int  adrcode,
int *  tot 
)
static

Definition at line 246 of file ipo.c.

References ID_OB, NULL, OB_LAY, ob_layer_bits, and RET_ABP.

Referenced by icu_to_fcurves().

◆ adrcode_to_dtar_transchan()

static short adrcode_to_dtar_transchan ( short  adrcode)
static

◆ camera_adrcodes_to_paths()

static const char* camera_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

Definition at line 786 of file ipo.c.

References CAM_END, CAM_LENS, CAM_ORTHO, CAM_SHIFT_X, CAM_SHIFT_Y, CAM_STA, CAM_YF_APERT, CAM_YF_FDIST, and NULL.

Referenced by get_rna_access().

◆ constraint_adrcodes_to_paths()

static const char* constraint_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

Definition at line 435 of file ipo.c.

References CO_ENFORCE, CO_HEADTAIL, and NULL.

Referenced by get_rna_access().

◆ do_versions_ipos_to_animato()

void do_versions_ipos_to_animato ( Main bmain)

◆ fcurve_add_to_list()

static void fcurve_add_to_list ( ListBase groups,
ListBase list,
FCurve fcu,
char *  grpname,
int  muteipo 
)
static

◆ get_rna_access()

static char* get_rna_access ( ID id,
int  blocktype,
int  adrcode,
char  actname[],
char  constname[],
Sequence seq,
int *  array_index 
)
static

◆ icu_to_fcurves()

static void icu_to_fcurves ( ID id,
ListBase groups,
ListBase list,
IpoCurve icu,
char *  actname,
char *  constname,
Sequence seq,
int  muteipo 
)
static

Convert IPO-Curve to F-Curve (including Driver data), and free any of the old data that is not relevant, BUT do not free the IPO-Curve itself...

Parameters
actnamename of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to.
constnamename of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to seq.
seqsequencer-strip (if applicable) that IPO-Curve's IPO-block belonged to.

Definition at line 1421 of file ipo.c.

References AC_EUL_X, AC_EUL_Y, AC_EUL_Z, add_fmodifier(), IpoCurve::adrcode, adrcode_bitmaps_to_paths(), AdrBit2Path::array_index, FCurve::array_index, FCurve::bezt, IpoCurve::bezt, BEZT_IPO_CONST, BEZT_KEYTYPE_KEYFRAME, AdrBit2Path::bit, BKE_fcurve_copy(), BKE_fcurve_create(), BLI_strdup(), IpoCurve::blocktype, IpoCurve::bp, data, FModifier::data, FCurve::driver, IpoCurve::driver, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ, ELEM, Sequence::enddisp, FCurve::extend, IpoCurve::extrap, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCURVE_ACTIVE, fcurve_add_to_list(), FCURVE_DISABLED, FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCURVE_MUTED, FCURVE_PROTECTED, FCURVE_SELECTED, FCURVE_VISIBLE, ListBase::first, FCurve::flag, IpoCurve::flag, Sequence::flag, float(), FMODIFIER_TYPE_CYCLES, G, G_DEBUG, get_rna_access(), GS, BezTriple::h1, BezTriple::h2, HD_AUTO, HD_AUTO_ANIM, BezTriple::hide, id, ID_OB, ID_PO, idriver_to_cdriver(), if(), BezTriple::ipo, IpoCurve::ipo, IPO_ACTIVE, IPO_AUTO_HORIZ, IPO_CYCL, IPO_CYCLX, IPO_DIR, IPO_HORIZ, IPO_MIXED, IPO_MUTE, IPO_PROTECT, IPO_SELECT, IPO_VISIBLE, M_PI, MEM_callocN, FCurve::modifiers, mul(), ID::name, NULL, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, AdrBit2Path::path, Curve::pathlen, FCurve::rna_path, SEQ_IPO_FRAME_LOCKED, Sequence::startdisp, STREQ, DriverVar::targets, FCurve::totvert, IpoCurve::totvert, DriverTarget::transChan, ChannelDriver::variables, and BezTriple::vec.

Referenced by ipo_to_animato().

◆ idriver_to_cdriver()

static ChannelDriver* idriver_to_cdriver ( IpoDriver idriver)
static

◆ ipo_blend_read_data()

static void ipo_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ ipo_blend_read_expand()

static void ipo_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 168 of file ipo.c.

References BLO_expand, Ipo::curve, and LISTBASE_FOREACH.

◆ ipo_blend_read_lib()

static void ipo_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 157 of file ipo.c.

References BLO_read_id_address, Ipo::curve, Ipo::id, ID::lib, and LISTBASE_FOREACH.

◆ ipo_free_data()

static void ipo_free_data ( ID id)
static

◆ ipo_to_animato()

static void ipo_to_animato ( ID id,
Ipo ipo,
char  actname[],
char  constname[],
Sequence seq,
ListBase animgroups,
ListBase anim,
ListBase drivers 
)
static

◆ ipo_to_animdata()

static void ipo_to_animdata ( Main bmain,
ID id,
Ipo ipo,
char  actname[],
char  constname[],
Sequence seq 
)
static

◆ light_adrcodes_to_paths()

static const char* light_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ material_adrcodes_to_paths()

static const char* material_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ mtex_adrcodes_to_paths()

static const char* mtex_adrcodes_to_paths ( int  adrcode,
int *  UNUSEDarray_index 
)
static

◆ nlastrips_to_animdata()

static void nlastrips_to_animdata ( ID id,
ListBase strips 
)
static

◆ ob_adrcodes_to_paths()

static const char* ob_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ particle_adrcodes_to_paths()

static const char* particle_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ pchan_adrcodes_to_paths()

static const char* pchan_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ shapekey_adrcodes_to_paths()

static char* shapekey_adrcodes_to_paths ( ID id,
int  adrcode,
int *  UNUSEDarray_index 
)
static

Definition at line 456 of file ipo.c.

References BKE_keyblock_from_key(), BLI_snprintf(), BLI_str_escape(), BLI_strncpy(), and KeyBlock::name.

Referenced by get_rna_access().

◆ sound_adrcodes_to_paths()

static const char* sound_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

Definition at line 876 of file ipo.c.

References NULL, SND_ATTEN, SND_PANNING, SND_PITCH, and SND_VOLUME.

Referenced by get_rna_access().

◆ texture_adrcodes_to_paths()

static const char* texture_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

◆ world_adrcodes_to_paths()

static const char* world_adrcodes_to_paths ( int  adrcode,
int *  array_index 
)
static

Variable Documentation

◆ IDType_ID_IP

IDTypeInfo IDType_ID_IP
Initial value:
= {
.id_code = ID_IP,
.id_filter = 0,
.main_listbase_index = INDEX_ID_IP,
.struct_size = sizeof(Ipo),
.name = "Ipo",
.name_plural = "ipos",
.translation_context = "",
.copy_data = NULL,
.free_data = ipo_free_data,
.make_local = NULL,
.foreach_id = NULL,
.foreach_cache = NULL,
.owner_get = NULL,
.blend_write = NULL,
.blend_read_data = ipo_blend_read_data,
.blend_read_lib = ipo_blend_read_lib,
.blend_read_expand = ipo_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_NO_MAKELOCAL
Definition: BKE_idtype.h:49
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition: BKE_idtype.h:51
@ IDTYPE_FLAGS_NO_COPY
Definition: BKE_idtype.h:45
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition: BKE_idtype.h:47
@ INDEX_ID_IP
Definition: DNA_ID.h:784
@ ID_IP
Definition: DNA_ID_enums.h:69
struct Ipo Ipo
static void init_data(ModifierData *md)
static void ipo_blend_read_data(BlendDataReader *reader, ID *id)
Definition: ipo.c:116
static void ipo_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: ipo.c:157
static void ipo_blend_read_expand(BlendExpander *expander, ID *id)
Definition: ipo.c:168
static void ipo_free_data(ID *id)
Definition: ipo.c:87

Definition at line 179 of file ipo.c.

◆ LOG

CLG_LogRef LOG = {"bke.ipo"}
static

◆ ob_layer_bits

AdrBit2Path ob_layer_bits[]
static
Initial value:
= {
{(1 << 0), "layers", 0}, {(1 << 1), "layers", 1}, {(1 << 2), "layers", 2},
{(1 << 3), "layers", 3}, {(1 << 4), "layers", 4}, {(1 << 5), "layers", 5},
{(1 << 6), "layers", 6}, {(1 << 7), "layers", 7}, {(1 << 8), "layers", 8},
{(1 << 9), "layers", 9}, {(1 << 10), "layers", 10}, {(1 << 11), "layers", 11},
{(1 << 12), "layers", 12}, {(1 << 13), "layers", 13}, {(1 << 14), "layers", 14},
{(1 << 15), "layers", 15}, {(1 << 16), "layers", 16}, {(1 << 17), "layers", 17},
{(1 << 18), "layers", 18}, {(1 << 19), "layers", 19},
}

Definition at line 225 of file ipo.c.

Referenced by adrcode_bitmaps_to_paths().