Skip to content

Commit 881d253

Browse files
AThousandShipsYuriSizov
authored andcommitted
Fix some build errors with disable_3d=Yes
* Some tests were incorrectly included * SCU builds with animation * Animation `switch` (cherry picked from commit c6a1ae7)
1 parent 822b2b4 commit 881d253

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

scene/animation/animation_mixer.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -953,19 +953,12 @@ Variant AnimationMixer::post_process_key_value(const Ref<Animation> &p_anim, int
953953
}
954954

955955
Variant AnimationMixer::_post_process_key_value(const Ref<Animation> &p_anim, int p_track, Variant p_value, const Object *p_object, int p_object_idx) {
956-
switch (p_anim->track_get_type(p_track)) {
957956
#ifndef _3D_DISABLED
958-
case Animation::TYPE_POSITION_3D: {
959-
if (p_object_idx >= 0) {
960-
const Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_object);
961-
return Vector3(p_value) * skel->get_motion_scale();
962-
}
963-
return p_value;
964-
} break;
965-
#endif // _3D_DISABLED
966-
default: {
967-
} break;
957+
if (p_object_idx >= 0 && p_anim->track_get_type(p_track) == Animation::TYPE_POSITION_3D) {
958+
const Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_object);
959+
return Vector3(p_value) * skel->get_motion_scale();
968960
}
961+
#endif // _3D_DISABLED
969962
return p_value;
970963
}
971964

scene/animation/root_motion_view.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
2929
/**************************************************************************/
3030

31+
#ifndef _3D_DISABLED
32+
3133
#include "root_motion_view.h"
3234

3335
#include "scene/animation/animation_tree.h"
@@ -203,3 +205,5 @@ RootMotionView::RootMotionView() {
203205
RootMotionView::~RootMotionView() {
204206
set_base(RID());
205207
}
208+
209+
#endif // _3D_DISABLED

scene/register_scene_types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#include "scene/animation/animation_node_state_machine.h"
7979
#include "scene/animation/animation_player.h"
8080
#include "scene/animation/animation_tree.h"
81-
#include "scene/animation/root_motion_view.h"
8281
#include "scene/animation/tween.h"
8382
#include "scene/audio/audio_stream_player.h"
8483
#include "scene/debugger/scene_debugger.h"
@@ -273,6 +272,7 @@
273272
#include "scene/3d/voxel_gi.h"
274273
#include "scene/3d/world_environment.h"
275274
#include "scene/3d/xr_nodes.h"
275+
#include "scene/animation/root_motion_view.h"
276276
#include "scene/resources/environment.h"
277277
#include "scene/resources/fog_material.h"
278278
#include "scene/resources/importer_mesh.h"

tests/test_main.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,12 @@
102102
#include "tests/scene/test_curve_3d.h"
103103
#include "tests/scene/test_gradient.h"
104104
#include "tests/scene/test_navigation_agent_2d.h"
105-
#include "tests/scene/test_navigation_agent_3d.h"
106105
#include "tests/scene/test_navigation_obstacle_2d.h"
107-
#include "tests/scene/test_navigation_obstacle_3d.h"
108106
#include "tests/scene/test_navigation_region_2d.h"
109-
#include "tests/scene/test_navigation_region_3d.h"
110107
#include "tests/scene/test_node.h"
111108
#include "tests/scene/test_node_2d.h"
112109
#include "tests/scene/test_packed_scene.h"
113110
#include "tests/scene/test_path_2d.h"
114-
#include "tests/scene/test_path_3d.h"
115111
#include "tests/scene/test_primitives.h"
116112
#include "tests/scene/test_sprite_frames.h"
117113
#include "tests/scene/test_text_edit.h"
@@ -121,10 +117,17 @@
121117
#include "tests/scene/test_window.h"
122118
#include "tests/servers/rendering/test_shader_preprocessor.h"
123119
#include "tests/servers/test_navigation_server_2d.h"
124-
#include "tests/servers/test_navigation_server_3d.h"
125120
#include "tests/servers/test_text_server.h"
126121
#include "tests/test_validate_testing.h"
127122

123+
#ifndef _3D_DISABLED
124+
#include "tests/scene/test_navigation_agent_3d.h"
125+
#include "tests/scene/test_navigation_obstacle_3d.h"
126+
#include "tests/scene/test_navigation_region_3d.h"
127+
#include "tests/scene/test_path_3d.h"
128+
#include "tests/servers/test_navigation_server_3d.h"
129+
#endif // _3D_DISABLED
130+
128131
#include "modules/modules_tests.gen.h"
129132

130133
#include "tests/display_server_mock.h"

0 commit comments

Comments
 (0)