23#define DNA_DEPRECATED_ALLOW
102 printf(
"Freed %d (Unconverted) Ipo-Curves from IPO '%s'\n", n, ipo->
id.
name + 2);
108 Ipo *ipo =
reinterpret_cast<Ipo *
>(id);
134 if (icu->driver !=
nullptr) {
139 if (icu->driver !=
nullptr) {
148 if (icu->driver !=
nullptr) {
209 {(1 << 0),
"layers", 0}, {(1 << 1),
"layers", 1}, {(1 << 2),
"layers", 2},
210 {(1 << 3),
"layers", 3}, {(1 << 4),
"layers", 4}, {(1 << 5),
"layers", 5},
211 {(1 << 6),
"layers", 6}, {(1 << 7),
"layers", 7}, {(1 << 8),
"layers", 8},
212 {(1 << 9),
"layers", 9}, {(1 << 10),
"layers", 10}, {(1 << 11),
"layers", 11},
213 {(1 << 12),
"layers", 12}, {(1 << 13),
"layers", 13}, {(1 << 14),
"layers", 14},
214 {(1 << 15),
"layers", 15}, {(1 << 16),
"layers", 16}, {(1 << 17),
"layers", 17},
215 {(1 << 18),
"layers", 18}, {(1 << 19),
"layers", 19},
221#define RET_ABP(items) \
223 *tot = ARRAY_SIZE(items); \
264 return "delta_location";
267 return "delta_location";
270 return "delta_location";
274 return "rotation_euler";
277 return "rotation_euler";
280 return "rotation_euler";
283 return "delta_rotation_euler";
286 return "delta_rotation_euler";
289 return "delta_rotation_euler";
302 return "delta_scale";
305 return "delta_scale";
308 return "delta_scale";
324 poin = &(ob->pd->f_strength);
329 poin = &(ob->pd->f_power);
334 poin = &(ob->pd->pdef_damp);
339 poin = &(ob->pd->pdef_rdamp);
344 poin = &(ob->pd->pdef_perm);
349 poin = &(ob->pd->maxdist);
370 return "rotation_quaternion";
373 return "rotation_quaternion";
376 return "rotation_quaternion";
379 return "rotation_quaternion";
383 return "rotation_euler";
386 return "rotation_euler";
389 return "rotation_euler";
413 CLOG_ERROR(&
LOG,
"unmatched PoseChannel setting (code %d)", adrcode);
429 return "data.head_tail";
441 static char buf[128];
456 char kb_name_esc[
sizeof(kb->
name) * 2];
458 SNPRINTF(buf,
"key_blocks[\"%s\"].value", kb_name_esc);
462 SNPRINTF(buf,
"key_blocks[%d].value", adrcode);
471 const char *base =
nullptr, *prop =
nullptr;
472 static char buf[128];
476 base =
"textures[0]";
479 base =
"textures[1]";
482 base =
"textures[2]";
485 base =
"textures[3]";
488 base =
"textures[4]";
491 base =
"textures[5]";
494 base =
"textures[6]";
497 base =
"textures[7]";
500 base =
"textures[8]";
503 base =
"textures[9]";
506 base =
"textures[10]";
509 base =
"textures[11]";
512 base =
"textures[12]";
515 base =
"textures[13]";
518 base =
"textures[14]";
521 base =
"textures[15]";
524 base =
"textures[16]";
527 base =
"textures[17]";
531 adrcode = (adrcode & (
MA_MAP1 - 1));
535 poin = &(mtex->ofs[0]);
538 poin = &(mtex->ofs[1]);
541 poin = &(mtex->ofs[2]);
544 poin = &(mtex->size[0]);
547 poin = &(mtex->size[1]);
550 poin = &(mtex->size[2]);
562 poin = &(mtex->def_var);
565 poin = &(mtex->colfac);
568 poin = &(mtex->norfac);
571 poin = &(mtex->varfac);
575 prop =
"warp_factor";
609 return "noise_basis";
611 return "noise_basis";
616 return "feature_weights";
619 return "feature_weights";
622 return "feature_weights";
625 return "feature_weights";
627 return "minkovsky_exponent";
629 return "distance_metric";
635 return "noise_intensity";
639 return "distortion_amount";
646 return "highest_dimension";
685 return "diffuse_color";
688 return "diffuse_color";
691 return "diffuse_color";
695 return "specular_color";
698 return "specular_color";
701 return "specular_color";
705 return "mirror_color";
708 return "mirror_color";
711 return "mirror_color";
717 return "diffuse_intensity";
726 return "specular_intensity";
729 return "specular_hardness";
732 return "specular_opacity";
741 return "translucency";
744 return "raytrace_mirror.reflect";
747 return "raytrace_mirror.fresnel";
750 return "raytrace_mirror.fresnel_factor";
753 return "raytrace_transparency.fresnel";
756 return "raytrace_transparency.fresnel_factor";
780 return "ortho_scale";
796 poin = &(ca->YF_aperture);
799 poin = &(ca->dof_distance);
843 return "linear_attenuation";
845 return "quadratic_attenuation";
848 return "halo_intensity";
877 return "attenuation";
894 return "horizon_color";
897 return "horizon_color";
900 return "horizon_color";
903 return "zenith_color";
906 return "zenith_color";
909 return "zenith_color";
915 return "mist.intensity";
921 return "mist.height";
939 return "settings.clump_factor";
941 return "settings.angular_velocity_factor";
943 return "settings.particle_size";
945 return "settings.drag_factor";
947 return "settings.brownian_factor";
949 return "settings.damp_factor";
951 return "settings.length";
954 return "settings.acceleration";
957 return "settings.acceleration";
960 return "settings.acceleration";
962 return "settings.kink_amplitude";
964 return "settings.kink_frequency";
966 return "settings.kink_shape";
968 return "settings.billboard_tilt";
978 poin = &(part->pd->f_strength);
983 poin = &(part->pd->f_power);
988 poin = &(part->pd->maxdist);
993 poin = &(part->pd2->f_strength);
998 poin = &(part->pd2->f_power);
1003 poin = &(part->pd2->maxdist);
1029 const char actname[],
1030 const char constname[],
1035 const char *propname =
nullptr;
1036 char *rpath =
nullptr;
1038 int dummy_index = 0;
1046 switch (blocktype) {
1095 propname =
"eval_time";
1103 propname =
"effect_fader";
1106 propname =
"speed_fader";
1109 propname =
"blend_alpha";
1123 CLOG_WARN(&
LOG,
"No path for blocktype %d, adrcode %d yet", blocktype, adrcode);
1131 if ((propname ==
nullptr) && (blocktype > 0)) {
1133 if (r_array_index) {
1142 if (r_array_index) {
1143 *r_array_index = dummy_index;
1149 if ((actname && actname[0]) && (constname && constname[0])) {
1155 SNPRINTF(buf,
"pose.bones[\"%s\"].constraints[\"%s\"]", actname_esc, constname_esc);
1157 else if (actname && actname[0]) {
1158 if ((blocktype ==
ID_OB) &&
STREQ(actname,
"Object")) {
1162 else if ((blocktype ==
ID_KE) &&
STREQ(actname,
"Shape")) {
1165 STRNCPY(buf,
"data.shape_keys");
1171 SNPRINTF(buf,
"pose.bones[\"%s\"]", actname_esc);
1174 else if (constname && constname[0]) {
1178 SNPRINTF(buf,
"constraints[\"%s\"]", constname_esc);
1182 char seq_name_esc[(
sizeof(seq->
name) - 2) * 2];
1184 SNPRINTF(buf,
"sequence_editor.sequences_all[\"%s\"]", seq_name_esc);
1201 if (r_array_index ==
nullptr) {
1202 SNPRINTF(buf,
"[\"%d\"]", dummy_index);
1260 if (idriver->
name[0]) {
1280 dtar->
id = (
ID *)idriver->
ob;
1282 if (idriver->
name[0]) {
1288 dtar->
id = (
ID *)idriver->
ob;
1290 if (idriver->
name[0]) {
1301 dtar->
id = (
ID *)idriver->
ob;
1303 if (idriver->
name[0]) {
1317 dtar->
id = (
ID *)idriver->
ob;
1334 if (groups && grpname) {
1342 memset(&tmp_act, 0,
sizeof(
bAction));
1352 if (agrp ==
nullptr) {
1369 sizeof(agrp->
name));
1473 if (abp && totbits) {
1478 printf(
"\tconvert bitflag ipocurve, totbits = %d\n", totbits);
1490 for (
b = 0;
b < totbits;
b++, abp++) {
1494 if (
b < (totbits - 1)) {
1521 for (dst = fcurve->
bezt, src = icu->
bezt, i = 0; i < fcurve->
totvert; i++, dst++, src++) {
1542 if (
int(dst->
vec[1][1]) & (abp->
bit)) {
1543 dst->
vec[0][1] = dst->
vec[1][1] = dst->
vec[2][1] = 1.0f;
1546 dst->
vec[0][1] = dst->
vec[1][1] = dst->
vec[2][1] = 0.0f;
1588 for (dst = fcu->
bezt, src = icu->
bezt, i = 0; i < fcu->
totvert; i++, dst++, src++) {
1619 dst->
vec[0][1] *= fac;
1620 dst->
vec[1][1] *= fac;
1621 dst->
vec[2][1] *= fac;
1651 dst->
vec[0][0] *= fac;
1652 dst->
vec[1][0] *= fac;
1653 dst->
vec[2][0] *= fac;
1663 dst->
vec[0][0] += offset;
1666 dst->
vec[1][0] += offset;
1669 dst->
vec[2][0] += offset;
1703 if (
ELEM(
nullptr, ipo, anim, drivers)) {
1708 printf(
"ipo_to_animato\n");
1786 act->wrap().is_action_legacy(),
1787 "Conversion from pre-2.5 animation data should happen before conversion to layered Actions");
1801 for (achan =
static_cast<bActionChannel *
>(act->chanbase.first); achan; achan = achann) {
1803 achann = achan->
next;
1809 achan->
ipo =
nullptr;
1817 conchann = conchan->
next;
1822 id, conchan->
ipo, achan->
name, conchan->
name,
nullptr, groups, curves, drivers);
1824 conchan->
ipo =
nullptr;
1846 ListBase anim = {
nullptr,
nullptr};
1847 ListBase drivers = {
nullptr,
nullptr};
1850 if (
ELEM(
nullptr,
id, ipo)) {
1853 if (adt ==
nullptr) {
1859 printf(
"ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s curves:%d\n",
1862 (actname) ? actname :
"<None>",
1863 (constname) ? constname :
"<None>",
1864 (seq) ? (seq->
name + 2) :
"<None>",
1872 ipo_to_animato(
id, ipo, actname, constname, seq,
nullptr, &anim, &drivers);
1880 if (adt->
action ==
nullptr) {
1888 BLI_assert_msg(assign_ok,
"Expecting the assignment of a new Action to always work");
1892 printf(
"\t\tadded new action - '%s'\n", nameBuf);
1901 if (drivers.
first) {
1903 printf(
"\thas drivers\n");
1918 if (
ELEM(
nullptr, adt, act->chanbase.first)) {
1923 if (adt->
action ==
nullptr) {
1926 printf(
"act_to_adt - set adt action to act\n");
1929 BLI_assert_msg(assign_ok,
"Expecting the assignment of a just-converted Action to work");
1968 strip->
act = as->act;
1971 strip->
start = as->start;
1972 strip->
end = as->end;
1974 strip->
actend = as->actend;
1977 strip->
repeat = as->repeat;
1978 strip->
scale = as->scale;
2030 if (as->modifiers.first) {
2047 IpoCurve *icu =
static_cast<IpoCurve *
>((seq->ipo) ? seq->ipo->curve.first :
nullptr);
2051 printf(
"\tconverting sequence strip %s\n", seq->
name + 2);
2054 if (
ELEM(
nullptr, seq->ipo, icu)) {
2060 switch (seq->
type) {
2093 ListBase drivers = {
nullptr,
nullptr};
2096 if (bmain ==
nullptr) {
2107 printf(
"INFO: Converting to Animato...\n");
2113 for (
id =
static_cast<ID *
>(bmain->
objects.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2118 printf(
"\tconverting ob %s\n", id->name + 2);
2122 if (ob->nlastrips.first) {
2138 ob->action =
nullptr;
2144 else if ((ob->ipo) || (ob->action)) {
2152 ob->action =
nullptr;
2207 if (ob->constraintChannels.first) {
2208 for (conchan =
static_cast<bConstraintChannel *
>(ob->constraintChannels.first); conchan;
2212 conchann = conchan->
next;
2221 conchan->
ipo =
nullptr;
2232 if (adt && adt->
action) {
2239 for (
id =
static_cast<ID *
>(bmain->
shapekeys.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2243 printf(
"\tconverting key %s\n", id->name + 2);
2267 for (
id =
static_cast<ID *
>(bmain->
materials.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2271 printf(
"\tconverting material %s\n", id->name + 2);
2292 for (
id =
static_cast<ID *
>(bmain->
worlds.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2296 printf(
"\tconverting world %s\n", id->name + 2);
2317 for (
id =
static_cast<ID *
>(bmain->
scenes.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2327 for (
id =
static_cast<ID *
>(bmain->
textures.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2331 printf(
"\tconverting texture %s\n", id->name + 2);
2352 for (
id =
static_cast<ID *
>(bmain->
cameras.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2356 printf(
"\tconverting camera %s\n", id->name + 2);
2377 for (
id =
static_cast<ID *
>(bmain->
lights.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2381 printf(
"\tconverting light %s\n", id->name + 2);
2402 for (
id =
static_cast<ID *
>(bmain->
curves.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2406 printf(
"\tconverting curve %s\n", id->name + 2);
2438 for (
id =
static_cast<ID *
>(bmain->
actions.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2442 printf(
"\tconverting action %s\n", id->name + 2);
2446 if (act->chanbase.first) {
2455 for (
id =
static_cast<ID *
>(bmain->
ipo.
first); id;
id =
static_cast<ID *
>(
id->next)) {
2459 printf(
"\tconverting ipo %s\n", id->name + 2);
2474 ipo->
id.
flag &= ~ID_FLAG_FAKEUSER;
2481 printf(
"INFO: Animato convert done\n");
Functions and classes to work with Actions.
Blender kernel action and pose functionality.
void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
bAction * BKE_action_add(Main *bmain, const char name[])
bActionGroup * BKE_action_group_find_name(bAction *act, const char name[])
AnimData * BKE_animdata_ensure_id(ID *id)
AnimData * BKE_animdata_from_id(const ID *id)
FCurve * BKE_fcurve_copy(const FCurve *fcu)
FModifier * add_fmodifier(ListBase *modifiers, int type, FCurve *owner_fcu)
FCurve * BKE_fcurve_create(void)
void BKE_fcurves_free(ListBase *list)
struct DriverVar * driver_add_new_variable(struct ChannelDriver *driver)
void driver_change_variable_type(struct DriverVar *dvar, int type)
@ IDTYPE_FLAGS_NO_ANIMDATA
@ IDTYPE_FLAGS_NO_LIBLINKING
KeyBlock * BKE_keyblock_find_by_index(Key *key, int index)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
@ IDWALK_DO_DEPRECATED_POINTERS
bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip, bool is_liboverride)
void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt)
NlaTrack * BKE_nlatrack_new_tail(ListBase *nla_tracks, const bool is_liboverride)
void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
#define BLI_assert_msg(a, msg)
A dynamically sized string ADT.
char * BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL()
BLI_INLINE void BLI_endian_switch_int16(short *val) ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define UNUSED_VARS_NDEBUG(...)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define ID_REAL_USERS(id)
@ NLASTRIP_FLAG_AUTO_BLENDS
@ NLASTRIP_FLAG_SYNC_LENGTH
@ FCM_EXTRAPOLATE_CYCLIC_OFFSET
@ DVAR_TYPE_TRANSFORM_CHAN
@ NLASTRIP_EXTEND_NOTHING
#define IPO_DRIVER_TYPE_PYTHON
Object is a sort of wrapper for general info.
@ SEQ_USE_EFFECT_DEFAULT_FADE
Read Guarded memory(de)allocation.
static void mul(btAlignedObjectArray< T > &items, const Q &value)
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
static const char * texture_adrcodes_to_paths(int adrcode, int *r_array_index)
static char * shapekey_adrcodes_to_paths(ID *id, int adrcode, int *)
static const char * material_adrcodes_to_paths(int adrcode, int *r_array_index)
static AdrBit2Path ob_layer_bits[]
static void ipo_blend_read_data(BlendDataReader *reader, ID *id)
static bool seq_convert_callback(Sequence *seq, void *userdata)
static void action_to_animato(ID *id, bAction *act, ListBase *groups, ListBase *curves, ListBase *drivers)
static void ipo_foreach_id(ID *id, LibraryForeachIDData *data)
static void nlastrips_to_animdata(ID *id, ListBase *strips)
static const char * world_adrcodes_to_paths(int adrcode, int *r_array_index)
static const char * camera_adrcodes_to_paths(int adrcode, int *r_array_index)
static void action_to_animdata(ID *id, bAction *act)
static const char * ob_adrcodes_to_paths(int adrcode, int *r_array_index)
static const char * pchan_adrcodes_to_paths(int adrcode, int *r_array_index)
static void ipo_to_animato(ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq, ListBase *animgroups, ListBase *anim, ListBase *drivers)
void do_versions_ipos_to_animato(Main *bmain)
static const char * sound_adrcodes_to_paths(int adrcode, int *r_array_index)
static void ipo_to_animdata(Main *bmain, ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq)
static const char * light_adrcodes_to_paths(int adrcode, int *r_array_index)
static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, Sequence *seq, int muteipo)
static AdrBit2Path * adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *tot)
static const char * constraint_adrcodes_to_paths(int adrcode, int *r_array_index)
static short adrcode_to_dtar_transchan(short adrcode)
static char * get_rna_access(ID *id, int blocktype, int adrcode, const char actname[], const char constname[], Sequence *seq, int *r_array_index)
static const char * particle_adrcodes_to_paths(int adrcode, int *r_array_index)
static void fcurve_add_to_list(ListBase *groups, ListBase *list, FCurve *fcu, char *grpname, int muteipo)
static const char * mtex_adrcodes_to_paths(int adrcode, int *)
static void ipo_free_data(ID *id)
static ChannelDriver * idriver_to_cdriver(IpoDriver *idriver)
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
bool assign_action(bAction *action, ID &animated_id)
struct bActionChannel * next
ListBase constraintChannels
struct bActionStrip * next
struct bConstraintChannel * next