summaryrefslogtreecommitdiffstats
path: root/scene/animation/animation_cache.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-03-17 19:35:42 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-04 08:33:50 -0400
commitbbd49dec2379d2c15f7ce4798e4e09bf06b4bba3 (patch)
treef8568f55684195c28e8668b188e3a922494d9760 /scene/animation/animation_cache.cpp
parent5dc923d3863b504d64b19501eaec04749cd975ce (diff)
downloadredot-engine-bbd49dec2379d2c15f7ce4798e4e09bf06b4bba3.tar.gz
Disable Skeleton3D when compiling without 3D
Make animation code not depend on Skeleton3D or even Node3D
Diffstat (limited to 'scene/animation/animation_cache.cpp')
-rw-r--r--scene/animation/animation_cache.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp
index b317faeb00..9b0414c688 100644
--- a/scene/animation/animation_cache.cpp
+++ b/scene/animation/animation_cache.cpp
@@ -81,6 +81,7 @@ void AnimationCache::_update_cache() {
Ref<Resource> res;
if (animation->track_get_type(i) == Animation::TYPE_TRANSFORM3D) {
+#ifndef _3D_DISABLED
if (np.get_subname_count() > 1) {
path_cache.push_back(Path());
ERR_CONTINUE_MSG(animation->track_get_type(i) == Animation::TYPE_TRANSFORM3D, "Transform tracks can't have a subpath '" + np + "'.");
@@ -113,8 +114,8 @@ void AnimationCache::_update_cache() {
path.skeleton = sk;
}
- path.spatial = sp;
-
+ path.node_3d = sp;
+#endif // _3D_DISABLED
} else {
if (np.get_subname_count() > 0) {
RES res2;
@@ -179,14 +180,16 @@ void AnimationCache::set_track_transform(int p_idx, const Transform3D &p_transfo
return;
}
+#ifndef _3D_DISABLED
ERR_FAIL_COND(!p.node);
- ERR_FAIL_COND(!p.spatial);
+ ERR_FAIL_COND(!p.node_3d);
if (p.skeleton) {
p.skeleton->set_bone_pose(p.bone_idx, p_transform);
} else {
- p.spatial->set_transform(p_transform);
+ p.node_3d->set_transform(p_transform);
}
+#endif // _3D_DISABLED
}
void AnimationCache::set_track_value(int p_idx, const Variant &p_value) {