Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-20 17:42:37 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-20 17:53:59 +0300
commit4dc639ac9965f3d0e8b2304363c62d888cdd1dc9 (patch)
treef0272c9c70e5095dbabf5bce59d07cd8492f1b74 /source/blender/blenkernel/BKE_armature.h
parent163be42a9661741757325039909ba81f0701b248 (diff)
Speedup rigs with multiple objects deformed by bbones
Previously each of the objects which has armature modifier will request deformation matricies from bbones. Thing is, all those deformations are the same and do not depend on object which is being modified. What's even worse is that this calculation is not cheap. This change makes it so bbones deformation is calculated once and stored in the armature object. After this armature modifiers simply use it. With a rigs we've got here dependency graph evaluation time goes down from 0.02 sec to 0.012 sec. Possible further optimization is to make bbone deformation calculated at the time when bone is calculated. This will avoid an extra threaded loop over all bones.
Diffstat (limited to 'source/blender/blenkernel/BKE_armature.h')
-rw-r--r--source/blender/blenkernel/BKE_armature.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 23a9afbda31..8ae29aee65c 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -253,6 +253,10 @@ void BKE_pose_splineik_evaluate(
struct Object *ob,
int rootchan_index);
+void BKE_pose_eval_done(
+ struct Depsgraph *depsgraph,
+ struct Object *object);
+
void BKE_pose_eval_cleanup(
struct Depsgraph *depsgraph,
struct Scene *scene,
@@ -260,6 +264,8 @@ void BKE_pose_eval_cleanup(
void BKE_pose_eval_proxy_init(struct Depsgraph *depsgraph,
struct Object *object);
+void BKE_pose_eval_proxy_done(struct Depsgraph *depsgraph,
+ struct Object *object);
void BKE_pose_eval_proxy_cleanup(struct Depsgraph *depsgraph,
struct Object *object);
@@ -268,6 +274,18 @@ void BKE_pose_eval_proxy_copy_bone(
struct Object *object,
int pchan_index);
+/* BBOne deformation cache.
+ *
+ * The idea here is to pre-calculate deformation queternions, matricies and such
+ * used by armature_deform_verts().
+ */
+struct ObjectBBoneDeform;
+struct ObjectBBoneDeform * armature_cached_bbone_deformation_get(
+ struct Object *object);
+void armature_cached_bbone_deformation_free_data(struct Object *object);
+void armature_cached_bbone_deformation_free(struct Object *object);
+void armature_cached_bbone_deformation_update(struct Object *object);
+
#ifdef __cplusplus
}
#endif