Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_relations.c
| Show First 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | if ((base->object->type == OB_ARMATURE) && (base->object != ob)) { | ||||
| /* Only copy over animdata now, after all the remapping has been done, | /* Only copy over animdata now, after all the remapping has been done, | ||||
| * so that we don't have to worry about ambiguities re which armature | * so that we don't have to worry about ambiguities re which armature | ||||
| * a bone came from! | * a bone came from! | ||||
| */ | */ | ||||
| if (base->object->adt) { | if (base->object->adt) { | ||||
| if (ob->adt == NULL) { | if (ob->adt == NULL) { | ||||
| /* no animdata, so just use a copy of the whole thing */ | /* no animdata, so just use a copy of the whole thing */ | ||||
| ob->adt = BKE_animdata_copy(base->object->adt, false); | ob->adt = BKE_animdata_copy(bmain, base->object->adt, false); | ||||
| } | } | ||||
| else { | else { | ||||
| /* merge in data - we'll fix the drivers manually */ | /* merge in data - we'll fix the drivers manually */ | ||||
| BKE_animdata_merge_copy(&ob->id, &base->object->id, ADT_MERGECOPY_KEEP_DST, false); | BKE_animdata_merge_copy(&ob->id, &base->object->id, ADT_MERGECOPY_KEEP_DST, false); | ||||
| } | } | ||||
| } | } | ||||
| if (curarm->adt) { | if (curarm->adt) { | ||||
| if (arm->adt == NULL) { | if (arm->adt == NULL) { | ||||
| /* no animdata, so just use a copy of the whole thing */ | /* no animdata, so just use a copy of the whole thing */ | ||||
| arm->adt = BKE_animdata_copy(curarm->adt, false); | arm->adt = BKE_animdata_copy(bmain, curarm->adt, false); | ||||
| } | } | ||||
| else { | else { | ||||
| /* merge in data - we'll fix the drivers manually */ | /* merge in data - we'll fix the drivers manually */ | ||||
| BKE_animdata_merge_copy(&arm->id, &curarm->id, ADT_MERGECOPY_KEEP_DST, false); | BKE_animdata_merge_copy(&arm->id, &curarm->id, ADT_MERGECOPY_KEEP_DST, false); | ||||
| } | } | ||||
| } | } | ||||
| /* Free the old object data */ | /* Free the old object data */ | ||||
| ▲ Show 20 Lines • Show All 511 Lines • Show Last 20 Lines | |||||