diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 17:42:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 17:53:59 +0300 |
commit | 4dc639ac9965f3d0e8b2304363c62d888cdd1dc9 (patch) | |
tree | f0272c9c70e5095dbabf5bce59d07cd8492f1b74 /source/blender/makesdna/DNA_object_types.h | |
parent | 163be42a9661741757325039909ba81f0701b248 (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/makesdna/DNA_object_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index ffc798317ce..22b878ebac6 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -127,6 +127,11 @@ typedef struct ObjectDisplay { int flag; } ObjectDisplay; +/* Forward declaration for cache bbone deformation information. + * + * TODO(sergey): Consider moving it to more appropriate place. */ +struct ObjectBBoneDeform; + /* Not saved in file! */ typedef struct Object_Runtime { /* Original mesh pointer, before object->data was changed to point @@ -149,6 +154,8 @@ typedef struct Object_Runtime { /* Runtime grease pencil drawing data */ struct GpencilBatchCache *gpencil_cache; + + struct ObjectBBoneDeform *cached_bbone_deformation; } Object_Runtime; typedef struct Object { |