Blender
V3.3
|
#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 |
struct | Seq_callback_data |
Macros | |
#define | DNA_DEPRECATED_ALLOW |
#define | RET_ABP(items) |
Typedefs | |
typedef struct AdrBit2Path | AdrBit2Path |
typedef struct Seq_callback_data | Seq_callback_data |
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 AdrBit2Path * | adrcode_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 ChannelDriver * | idriver_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) |
static bool | seq_convert_callback (Sequence *seq, void *userdata) |
void | do_versions_ipos_to_animato (Main *bmain) |
Variables | |
static CLG_LogRef | LOG = {"bke.ipo"} |
IDTypeInfo | IDType_ID_IP |
static AdrBit2Path | ob_layer_bits [] |
#define RET_ABP | ( | items | ) |
typedef struct AdrBit2Path AdrBit2Path |
typedef struct Seq_callback_data Seq_callback_data |
|
static |
Definition at line 1781 of file ipo.c.
References BLI_freelinkN(), BLI_freelistN(), BLI_listbase_is_empty(), bActionChannel::constraintChannels, curves, ListBase::first, bAction::groups, Ipo::id, id_us_min(), bActionChannel::ipo, bConstraintChannel::ipo, ipo_to_animato(), bConstraintChannel::name, bActionChannel::name, bActionChannel::next, bConstraintChannel::next, and NULL.
Referenced by action_to_animdata(), do_versions_ipos_to_animato(), and nlastrips_to_animdata().
Definition at line 1904 of file ipo.c.
References AnimData::action, action_to_animato(), BKE_animdata_from_id(), bAction::curves, AnimData::drivers, ELEM, G, G_DEBUG, bAction::groups, and NULL.
Referenced by do_versions_ipos_to_animato().
|
static |
Definition at line 231 of file ipo.c.
References ID_OB, NULL, OB_LAY, ob_layer_bits, and RET_ABP.
Referenced by icu_to_fcurves().
|
static |
Definition at line 1221 of file ipo.c.
References DTAR_TRANSCHAN_LOCX, DTAR_TRANSCHAN_LOCY, DTAR_TRANSCHAN_LOCZ, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ, DTAR_TRANSCHAN_SCALEX, OB_LOC_X, OB_LOC_Y, OB_LOC_Z, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, OB_SIZE_X, OB_SIZE_Y, and OB_SIZE_Z.
Referenced by idriver_to_cdriver().
|
static |
Definition at line 771 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().
|
static |
Definition at line 420 of file ipo.c.
References CO_ENFORCE, CO_HEADTAIL, and NULL.
Referenced by get_rna_access().
Called from do_versions() in readfile.c
to convert the old 'IPO/adrcode' system to the new 'Animato/RNA' system.
The basic method used here, is to loop over data-blocks which have IPO-data, and add those IPO's to new AnimData blocks as Actions. Action/NLA data only works well for Objects, so these only need to be checked for there.
Data that has been converted should be freed immediately, which means that it is immediately clear which data-blocks have yet to be converted, and also prevent freeing errors when we exit.
Definition at line 2082 of file ipo.c.
References AnimData::action, action_to_animato(), action_to_animdata(), Main::actions, BKE_action_add(), BKE_animdata_ensure_id(), BKE_animdata_from_id(), BKE_fcurves_free(), BLI_freelinkN(), Ipo::blocktype, Main::cameras, bPose::chanbase, CLOG_ERROR, CLOG_WARN, bPoseChannel::constraints, Object::constraints, Ipo::curve, Main::curves, bAction::curves, Scene::ed, ListBase::first, ID::flag, G, G_DEBUG, bAction::groups, id, Camera::id, Curve::id, Ipo::id, Key::id, Light::id, Material::id, Object::id, Tex::id, World::id, ID_OB, id_us_min(), bAction::idroot, Main::ipo, bConstraintChannel::ipo, ipo_to_animato(), ipo_to_animdata(), LIB_FAKEUSER, Main::lights, LOG, Main::materials, bConstraintChannel::name, bPoseChannel::name, bConstraint::name, ID::name, bPoseChannel::next, bConstraintChannel::next, bConstraint::next, ID::next, nlastrips_to_animdata(), NULL, Main::objects, Object::pose, scene, Main::scenes, seq_convert_callback(), SEQ_for_each_callback(), Editing::seqbase, Editing::seqbasep, Main::shapekeys, Main::textures, ID::us, Main::versionfile, and Main::worlds.
Referenced by setup_app_data().
|
static |
Definition at line 1334 of file ipo.c.
References action_groups_add_channel(), AGRP_MUTED, AGRP_SELECTED, BKE_action_group_find_name(), BLI_addtail(), BLI_strncpy(), BLI_uniquename(), bAction::curves, DATA_, FCURVE_MUTED, ListBase::first, bActionGroup::flag, FCurve::flag, bAction::groups, ListBase::last, MEM_callocN, bActionGroup::name, and NULL.
Referenced by icu_to_fcurves().
|
static |
Definition at line 1028 of file ipo.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_new(), BLI_snprintf(), BLI_str_escape(), camera_adrcodes_to_paths(), CLOG_WARN, constraint_adrcodes_to_paths(), ID_CA, ID_CO, ID_CU_LEGACY, ID_KE, ID_LA, ID_MA, ID_OB, ID_PA, ID_PO, ID_SEQ, ID_SO, ID_TE, ID_WO, light_adrcodes_to_paths(), LOG, material_adrcodes_to_paths(), Sequence::name, NULL, ob_adrcodes_to_paths(), particle_adrcodes_to_paths(), pchan_adrcodes_to_paths(), SEQ_FAC1, SEQ_FAC_OPACITY, SEQ_FAC_SPEED, shapekey_adrcodes_to_paths(), sound_adrcodes_to_paths(), STREQ, texture_adrcodes_to_paths(), and world_adrcodes_to_paths().
Referenced by icu_to_fcurves().
|
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...
actname | name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to. |
constname | name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to seq. |
seq | sequencer-strip (if applicable) that IPO-Curve's IPO-block belonged to. |
Definition at line 1406 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, usdtokens::b(), 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, offset, AdrBit2Path::path, Curve::pathlen, FCurve::rna_path, SEQ_IPO_FRAME_LOCKED, src, Sequence::startdisp, STREQ, DriverVar::targets, FCurve::totvert, IpoCurve::totvert, DriverTarget::transChan, ChannelDriver::variables, and BezTriple::vec.
Referenced by ipo_to_animato().
|
static |
Definition at line 1251 of file ipo.c.
References IpoDriver::adrcode, adrcode_to_dtar_transchan(), BLI_strncpy(), IpoDriver::blocktype, driver_add_new_variable(), driver_change_variable_type(), DRIVER_NAME_OFFS, DRIVER_TYPE_AVERAGE, DRIVER_TYPE_PYTHON, DTAR_FLAG_LOCALSPACE, DVAR_TYPE_ROT_DIFF, DVAR_TYPE_TRANSFORM_CHAN, ChannelDriver::expression, DriverTarget::flag, DriverTarget::id, ID_AR, ID_OB, DriverTarget::idtype, if(), IPO_DRIVER_TYPE_PYTHON, MEM_callocN, IpoDriver::name, NULL, IpoDriver::ob, OB_ROT_DIFF, DriverTarget::pchan_name, DriverVar::targets, DriverTarget::transChan, ChannelDriver::type, and IpoDriver::type.
Referenced by icu_to_fcurves().
|
static |
Definition at line 100 of file ipo.c.
References BLI_endian_switch_int16(), BLO_read_data_address, BLO_read_list(), BLO_read_requires_endian_switch(), Ipo::blocktype, Ipo::curve, LISTBASE_FOREACH, and NULL.
|
static |
Definition at line 152 of file ipo.c.
References BLO_expand, Ipo::curve, and LISTBASE_FOREACH.
|
static |
Definition at line 141 of file ipo.c.
References BLO_read_id_address, Ipo::curve, Ipo::id, ID::lib, and LISTBASE_FOREACH.
Definition at line 71 of file ipo.c.
References IpoCurve::bezt, BLI_freelinkN(), IpoCurve::bp, Ipo::curve, IpoCurve::driver, ListBase::first, G, G_DEBUG, Ipo::id, MEM_freeN, ID::name, and IpoCurve::next.
|
static |
Definition at line 1693 of file ipo.c.
References IpoCurve::bezt, BLI_freelinkN(), Ipo::blocktype, IpoCurve::bp, Ipo::curve, IpoCurve::driver, ELEM, ListBase::first, G, G_DEBUG, icu_to_fcurves(), Ipo::id, ID_OB, ID_REAL_USERS, id_us_min(), IPO_DRIVER_TYPE_PYTHON, MEM_freeN, Ipo::muteipo, IpoCurve::next, NULL, IpoDriver::ob, STREQ, and IpoDriver::type.
Referenced by action_to_animato(), do_versions_ipos_to_animato(), and ipo_to_animdata().
|
static |
Definition at line 1838 of file ipo.c.
References AnimData::action, BKE_action_add(), BKE_animdata_from_id(), BLI_listbase_count(), BLI_movelisttolist(), BLI_snprintf(), CLOG_ERROR, Ipo::curve, bAction::curves, AnimData::drivers, ELEM, anim::first, ListBase::first, G, G_DEBUG, id, Ipo::id, ipo_to_animato(), LOG, MAX_ID_NAME, Sequence::name, ID::name, and NULL.
Referenced by do_versions_ipos_to_animato(), and seq_convert_callback().
|
static |
Definition at line 816 of file ipo.c.
References LA_COL_B, LA_COL_G, LA_COL_R, LA_DIST, LA_ENERGY, LA_HALOINT, LA_QUAD1, LA_QUAD2, LA_SPOTBL, LA_SPOTSI, mtex_adrcodes_to_paths(), and NULL.
Referenced by get_rna_access().
|
static |
Definition at line 678 of file ipo.c.
References MA_ADD, MA_ALPHA, MA_AMB, MA_COL_B, MA_COL_G, MA_COL_R, MA_EMIT, MA_FRESMIR, MA_FRESMIRI, MA_FRESTRA, MA_FRESTRAI, MA_HARD, MA_HASIZE, MA_IOR, MA_MIR_B, MA_MIR_G, MA_MIR_R, MA_RAYM, MA_REF, MA_SPEC, MA_SPEC_B, MA_SPEC_G, MA_SPEC_R, MA_SPTR, MA_TRANSLU, mtex_adrcodes_to_paths(), and NULL.
Referenced by get_rna_access().
|
static |
Definition at line 471 of file ipo.c.
References BLI_snprintf(), MA_MAP1, MA_MAP10, MA_MAP11, MA_MAP12, MA_MAP13, MA_MAP14, MA_MAP15, MA_MAP16, MA_MAP17, MA_MAP18, MA_MAP2, MA_MAP3, MA_MAP4, MA_MAP5, MA_MAP6, MA_MAP7, MA_MAP8, MA_MAP9, MAP_B, MAP_COLF, MAP_DISP, MAP_DVAR, MAP_G, MAP_NORF, MAP_OFS_X, MAP_OFS_Y, MAP_OFS_Z, MAP_R, MAP_SIZE_X, MAP_SIZE_Y, MAP_SIZE_Z, MAP_VARF, and NULL.
Referenced by light_adrcodes_to_paths(), material_adrcodes_to_paths(), and world_adrcodes_to_paths().
Definition at line 1933 of file ipo.c.
References NlaStrip::act, bActionStrip::act, NlaStrip::actend, bActionStrip::actend, action_to_animato(), NlaStrip::actstart, bActionStrip::actstart, ACTSTRIP_ACTIVE, ACTSTRIP_AUTO_BLENDS, ACTSTRIP_HOLDLASTFRAME, ACTSTRIP_LOCK_ACTION, ACTSTRIP_MUTE, ACTSTRIP_REVERSE, ACTSTRIP_SELECT, ACTSTRIPMODE_ADD, BKE_animdata_from_id(), BKE_nlastrip_validate_name(), BKE_nlatrack_add(), BKE_nlatrack_add_strip(), NlaStrip::blendin, bActionStrip::blendin, NlaStrip::blendmode, NlaStrip::blendout, bActionStrip::blendout, BLI_freelinkN(), BLI_freelistN(), bAction::curves, AnimData::drivers, NlaStrip::end, bActionStrip::end, NlaStrip::extendmode, ListBase::first, NlaStrip::flag, bActionStrip::flag, bAction::groups, MEM_callocN, bActionStrip::mode, bActionStrip::modifiers, bActionStrip::next, NLASTRIP_EXTEND_NOTHING, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_AUTO_BLENDS, NLASTRIP_FLAG_MUTED, NLASTRIP_FLAG_REVERSE, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_MODE_ADD, NLASTRIP_MODE_REPLACE, NULL, NlaStrip::repeat, bActionStrip::repeat, NlaStrip::scale, bActionStrip::scale, NlaStrip::start, and bActionStrip::start.
Referenced by do_versions_ipos_to_animato().
|
static |
Definition at line 248 of file ipo.c.
References NULL, OB_COL_A, OB_COL_B, OB_COL_G, OB_COL_R, OB_DLOC_X, OB_DLOC_Y, OB_DLOC_Z, OB_DROT_X, OB_DROT_Y, OB_DROT_Z, OB_DSIZE_X, OB_DSIZE_Y, OB_DSIZE_Z, OB_LOC_X, OB_LOC_Y, OB_LOC_Z, OB_PD_FFALL, OB_PD_FMAXD, OB_PD_FSTR, OB_PD_PERM, OB_PD_RDAMP, OB_PD_SDAMP, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, OB_SIZE_X, OB_SIZE_Y, and OB_SIZE_Z.
Referenced by get_rna_access().
|
static |
Definition at line 933 of file ipo.c.
References NULL, PART_AVE, PART_BB_TILT, PART_BROWN, PART_CLUMP, PART_DAMP, PART_DRAG, PART_GRAV_X, PART_GRAV_Y, PART_GRAV_Z, PART_KINK_AMP, PART_KINK_FREQ, PART_KINK_SHAPE, PART_LENGTH, PART_PD2_FFALL, PART_PD2_FMAXD, PART_PD2_FSTR, PART_PD_FFALL, PART_PD_FMAXD, PART_PD_FSTR, and PART_SIZE.
Referenced by get_rna_access().
|
static |
Definition at line 2033 of file ipo.c.
References AnimData::action, IpoCurve::adrcode, Seq_callback_data::adt, Seq_callback_data::bmain, ELEM, Sequence::flag, G, G_DEBUG, ID_SCE, id_us_min(), bAction::idroot, if(), ipo_to_animdata(), Sequence::name, NULL, Seq_callback_data::scene, SEQ_FAC1, SEQ_FAC_OPACITY, SEQ_FAC_SPEED, SEQ_TYPE_COLOR, SEQ_TYPE_IMAGE, SEQ_TYPE_META, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE, SEQ_TYPE_SPEED, SEQ_USE_EFFECT_DEFAULT_FADE, and Sequence::type.
Referenced by do_versions_ipos_to_animato().
|
static |
Definition at line 441 of file ipo.c.
References BKE_keyblock_from_key(), BLI_snprintf(), BLI_str_escape(), BLI_strncpy(), and KeyBlock::name.
Referenced by get_rna_access().
|
static |
Definition at line 861 of file ipo.c.
References NULL, SND_ATTEN, SND_PANNING, SND_PITCH, and SND_VOLUME.
Referenced by get_rna_access().
|
static |
Definition at line 591 of file ipo.c.
References NULL, TE_BRIGHT, TE_COL_B, TE_COL_G, TE_COL_R, TE_CONTRA, TE_DISTA, TE_ISCA, TE_MG_GAIN, TE_MG_LAC, TE_MG_OCT, TE_MG_OFF, TE_MG_TYP, TE_MGH, TE_N_BAS1, TE_N_BAS2, TE_NDEPTH, TE_NSIZE, TE_NTYPE, TE_TURB, TE_VN_COLT, TE_VN_DISTM, TE_VNMEXP, TE_VNW1, TE_VNW2, TE_VNW3, and TE_VNW4.
Referenced by get_rna_access().
|
static |
IDTypeInfo IDType_ID_IP |
|
static |
Definition at line 69 of file ipo.c.
Referenced by do_versions_ipos_to_animato(), get_rna_access(), ipo_to_animdata(), and pchan_adrcodes_to_paths().
|
static |
Definition at line 210 of file ipo.c.
Referenced by adrcode_bitmaps_to_paths().