diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-07 17:04:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-07 17:06:39 +0300 |
commit | 7b271d5fc11ada5d5dbd066f0e4523c33933ef51 (patch) | |
tree | 83c73fea29ec392656b6b898d09e873d76c3a0cc /source/blender/blenkernel | |
parent | 4610ca599a778a33b958d196a7782cebd5758072 (diff) |
Depsgraph: Ensure dependency cycle does not clear runtime memory
If there was a dependency cycle involved, it was possible that pchan
array will be freed before all bones are evaluated. Now clear is
done in a dedicated node, which is never a part of dependency cycle.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_armature.h | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/armature_update.c | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 6937fdcac59..23a9afbda31 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -253,16 +253,15 @@ void BKE_pose_splineik_evaluate( struct Object *ob, int rootchan_index); -void BKE_pose_eval_flush( +void BKE_pose_eval_cleanup( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob); -void BKE_pose_eval_proxy_pose_init(struct Depsgraph *depsgraph, - struct Object *object); - -void BKE_pose_eval_proxy_pose_done(struct Depsgraph *depsgraph, - struct Object *object); +void BKE_pose_eval_proxy_init(struct Depsgraph *depsgraph, + struct Object *object); +void BKE_pose_eval_proxy_cleanup(struct Depsgraph *depsgraph, + struct Object *object); void BKE_pose_eval_proxy_copy_bone( struct Depsgraph *depsgraph, diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c index c7c69a74202..2d9e2a0d84b 100644 --- a/source/blender/blenkernel/intern/armature_update.c +++ b/source/blender/blenkernel/intern/armature_update.c @@ -577,6 +577,7 @@ BLI_INLINE bPoseChannel *pose_pchan_get_indexed(Object *ob, int pchan_index) { bPose *pose = ob->pose; BLI_assert(pose != NULL); + BLI_assert(pose->chan_array != NULL); BLI_assert(pchan_index >= 0); BLI_assert(pchan_index < MEM_allocN_len(pose->chan_array) / sizeof(bPoseChannel *)); return pose->chan_array[pchan_index]; @@ -745,9 +746,9 @@ void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph, BKE_splineik_execute_tree(depsgraph, scene, ob, rootchan, ctime); } -void BKE_pose_eval_flush(struct Depsgraph *depsgraph, - Scene *scene, - Object *ob) +void BKE_pose_eval_cleanup(struct Depsgraph *depsgraph, + Scene *scene, + Object *ob) { bPose *pose = ob->pose; BLI_assert(pose != NULL); @@ -764,7 +765,7 @@ void BKE_pose_eval_flush(struct Depsgraph *depsgraph, pose->chan_array = NULL; } -void BKE_pose_eval_proxy_pose_init(struct Depsgraph *depsgraph, Object *object) +void BKE_pose_eval_proxy_init(struct Depsgraph *depsgraph, Object *object) { BLI_assert(ID_IS_LINKED(object) && object->proxy_from != NULL); DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); @@ -772,7 +773,7 @@ void BKE_pose_eval_proxy_pose_init(struct Depsgraph *depsgraph, Object *object) pose_pchan_index_create(object->pose); } -void BKE_pose_eval_proxy_pose_done(struct Depsgraph *depsgraph, Object *object) +void BKE_pose_eval_proxy_cleanup(struct Depsgraph *depsgraph, Object *object) { BLI_assert(ID_IS_LINKED(object) && object->proxy_from != NULL); DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); |