branches/blender-2.47

Merge from trunk:
	Revision: 15096
	Revision: 15110
This commit is contained in:
Diego Borghetti 2008-06-04 00:35:10 +00:00
parent 81172e3d35
commit 2c19984f79
2 changed files with 21 additions and 5 deletions

View File

@ -1485,7 +1485,7 @@ void insertkey_action(void)
data= get_action_context(&datatype);
if (data == NULL) return;
cfra = frame_to_float(CFRA);
if (datatype == ACTCONT_ACTION) {
ListBase act_data = {NULL, NULL};
bActListElem *ale;
@ -1941,6 +1941,7 @@ void paste_actdata ()
int filter;
void *data;
short datatype;
Object *ob= OBACT;
short no_name= 0;
float offset = CFRA - actcopy_firstframe;
@ -2017,7 +2018,7 @@ void paste_actdata ()
/* loop over curves, pasting keyframes */
for (ico= ipo_src->curve.first; ico; ico= ico->next) {
icu= verify_ipocurve((ID*)OBACT, ico->blocktype, actname, conname, "", ico->adrcode);
icu= verify_ipocurve((ID*)ob, ico->blocktype, actname, conname, "", ico->adrcode);
if (icu) {
/* just start pasting, with the the first keyframe on the current frame, and so on */
@ -2045,6 +2046,14 @@ void paste_actdata ()
/* free temp memory */
BLI_freelistN(&act_data);
/* do depsgraph updates (for 3d-view)? */
if ((ob) && (G.saction->pin==0)) {
if (ob->type == OB_ARMATURE)
DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
else
DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
}
/* undo and redraw stuff */
allqueue(REDRAWVIEW3D, 0);
allspace(REMAKEIPO, 0);

View File

@ -153,9 +153,12 @@ void BL_ArmatureObject::GetPose(bPose **pose)
int copy_constraint_channels_hack = 1;
copy_pose(pose, m_pose, copy_constraint_channels_hack);
}
else
else {
if (*pose == m_pose)
// no need to copy if the pointers are the same
return;
extract_pose_from_pose(*pose, m_pose);
}
}
void BL_ArmatureObject::GetMRDPose(bPose **pose)
@ -169,7 +172,11 @@ void BL_ArmatureObject::GetMRDPose(bPose **pose)
//}
if (!*pose)
copy_pose(pose, m_objArma->pose, 0);
// must duplicate the constraints too otherwise we have corruption in free_pose_channels()
// because it will free the blender constraints.
// Ideally, blender should rememeber that the constraints were not copied so that
// free_pose_channels() would not free them.
copy_pose(pose, m_objArma->pose, 1);
else
extract_pose_from_pose(*pose, m_objArma->pose);