diff options
-rw-r--r-- | source/blender/src/editaction.c | 13 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_ArmatureObject.cpp | 13 |
2 files changed, 21 insertions, 5 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 12b9cb8919f..40b6b7ba6fe 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -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); diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index ff9c6a75aa9..08567dde840 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -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); |