Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/action.c
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | static void action_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int flag) | ||||
| bActionGroup *group_dst, *group_src; | bActionGroup *group_dst, *group_src; | ||||
| FCurve *fcurve_dst, *fcurve_src; | FCurve *fcurve_dst, *fcurve_src; | ||||
| /* Duplicate the lists of groups and markers. */ | /* Duplicate the lists of groups and markers. */ | ||||
| BLI_duplicatelist(&action_dst->groups, &action_src->groups); | BLI_duplicatelist(&action_dst->groups, &action_src->groups); | ||||
| BLI_duplicatelist(&action_dst->markers, &action_src->markers); | BLI_duplicatelist(&action_dst->markers, &action_src->markers); | ||||
| /* Relink action group parents */ | |||||
| bActionGroup *subgrp; | |||||
| for (group_dst = action_dst->groups.first, group_src = action_src->groups.first; | |||||
| group_dst && group_src; | |||||
| group_dst = group_dst->next, group_src = group_src->next) { | |||||
| for (subgrp = action_dst->groups.first; subgrp; subgrp = subgrp->next) { | |||||
| if (subgrp->parent == group_src) { | |||||
| subgrp->parent = group_dst; | |||||
| } | |||||
| } | |||||
| } | |||||
| /* Copy F-Curves, fixing up the links as we go. */ | /* Copy F-Curves, fixing up the links as we go. */ | ||||
| BLI_listbase_clear(&action_dst->curves); | BLI_listbase_clear(&action_dst->curves); | ||||
| for (fcurve_src = action_src->curves.first; fcurve_src; fcurve_src = fcurve_src->next) { | for (fcurve_src = action_src->curves.first; fcurve_src; fcurve_src = fcurve_src->next) { | ||||
| /* Duplicate F-Curve. */ | /* Duplicate F-Curve. */ | ||||
| /* XXX TODO: pass subdata flag? | /* XXX TODO: pass subdata flag? | ||||
| * But surprisingly does not seem to be doing any ID refcounting... */ | * But surprisingly does not seem to be doing any ID refcounting... */ | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | static void action_blend_read_data(BlendDataReader *reader, ID *id) | ||||
| } | } | ||||
| /* >>> XXX deprecated - old animation system */ | /* >>> XXX deprecated - old animation system */ | ||||
| BKE_fcurve_blend_read_data(reader, &act->curves); | BKE_fcurve_blend_read_data(reader, &act->curves); | ||||
| LISTBASE_FOREACH (bActionGroup *, agrp, &act->groups) { | LISTBASE_FOREACH (bActionGroup *, agrp, &act->groups) { | ||||
| BLO_read_data_address(reader, &agrp->channels.first); | BLO_read_data_address(reader, &agrp->channels.first); | ||||
| BLO_read_data_address(reader, &agrp->channels.last); | BLO_read_data_address(reader, &agrp->channels.last); | ||||
| BLO_read_data_address(reader, &agrp->parent); | |||||
| } | } | ||||
| BLO_read_data_address(reader, &act->preview); | BLO_read_data_address(reader, &act->preview); | ||||
| BKE_previewimg_blend_read(reader, act->preview); | BKE_previewimg_blend_read(reader, act->preview); | ||||
| } | } | ||||
| static void blend_read_lib_constraint_channels(BlendLibReader *reader, ID *id, ListBase *chanbase) | static void blend_read_lib_constraint_channels(BlendLibReader *reader, ID *id, ListBase *chanbase) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||