diff options
author | K. S. Ernest (iFire) Lee <fire@users.noreply.github.com> | 2021-08-22 17:12:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 17:12:08 -0700 |
commit | bb1c930a418c153eac7e9e85dcab023bb723dd7e (patch) | |
tree | df90b0318c8a8f6f8f92001c64cdcead993bae76 | |
parent | b4cea107712b12ca6874fca189eef89cd37b30d7 (diff) | |
parent | e4b29cb6be2b6523d7e1fc4ae8e5f7f541847af8 (diff) |
Merge pull request #51991 from requizm/fix/51990
Fix 3d animations doesn't play
-rw-r--r-- | scene/resources/animation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index e6a74e7685..80e338c8e8 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -83,9 +83,11 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { const real_t *r = values.ptr(); - tt->transforms.resize(vcount / 12); + int transform3d_size = (int)sizeof(Transform3D); - for (int i = 0; i < (vcount / 12); i++) { + tt->transforms.resize(vcount / transform3d_size); + + for (int i = 0; i < (vcount / transform3d_size); i++) { TKey<TransformKey> &tk = tt->transforms.write[i]; const real_t *ofs = &r[i * 12]; tk.time = ofs[0]; |