diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index 637b3917c76..441d5878ae3 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -953,19 +953,12 @@ Variant AnimationMixer::post_process_key_value(const Ref &p_anim, int } Variant AnimationMixer::_post_process_key_value(const Ref &p_anim, int p_track, Variant p_value, const Object *p_object, int p_object_idx) { - switch (p_anim->track_get_type(p_track)) { #ifndef _3D_DISABLED - case Animation::TYPE_POSITION_3D: { - if (p_object_idx >= 0) { - const Skeleton3D *skel = Object::cast_to(p_object); - return Vector3(p_value) * skel->get_motion_scale(); - } - return p_value; - } break; -#endif // _3D_DISABLED - default: { - } break; + if (p_object_idx >= 0 && p_anim->track_get_type(p_track) == Animation::TYPE_POSITION_3D) { + const Skeleton3D *skel = Object::cast_to(p_object); + return Vector3(p_value) * skel->get_motion_scale(); } +#endif // _3D_DISABLED return p_value; } diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp index 645850015b2..fd520dadd66 100644 --- a/scene/animation/root_motion_view.cpp +++ b/scene/animation/root_motion_view.cpp @@ -28,6 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#ifndef _3D_DISABLED + #include "root_motion_view.h" #include "scene/animation/animation_tree.h" @@ -203,3 +205,5 @@ RootMotionView::RootMotionView() { RootMotionView::~RootMotionView() { set_base(RID()); } + +#endif // _3D_DISABLED diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index baaa78f9f2e..111d6447a02 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -78,7 +78,6 @@ #include "scene/animation/animation_node_state_machine.h" #include "scene/animation/animation_player.h" #include "scene/animation/animation_tree.h" -#include "scene/animation/root_motion_view.h" #include "scene/animation/tween.h" #include "scene/audio/audio_stream_player.h" #include "scene/debugger/scene_debugger.h" @@ -273,6 +272,7 @@ #include "scene/3d/voxel_gi.h" #include "scene/3d/world_environment.h" #include "scene/3d/xr_nodes.h" +#include "scene/animation/root_motion_view.h" #include "scene/resources/environment.h" #include "scene/resources/fog_material.h" #include "scene/resources/importer_mesh.h" diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 9e020b5d933..7f498052749 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -96,7 +96,6 @@ #include "tests/scene/test_arraymesh.h" #include "tests/scene/test_audio_stream_wav.h" #include "tests/scene/test_bit_map.h" -#include "tests/scene/test_camera_3d.h" #include "tests/scene/test_code_edit.h" #include "tests/scene/test_color_picker.h" #include "tests/scene/test_control.h" @@ -105,16 +104,12 @@ #include "tests/scene/test_curve_3d.h" #include "tests/scene/test_gradient.h" #include "tests/scene/test_navigation_agent_2d.h" -#include "tests/scene/test_navigation_agent_3d.h" #include "tests/scene/test_navigation_obstacle_2d.h" -#include "tests/scene/test_navigation_obstacle_3d.h" #include "tests/scene/test_navigation_region_2d.h" -#include "tests/scene/test_navigation_region_3d.h" #include "tests/scene/test_node.h" #include "tests/scene/test_node_2d.h" #include "tests/scene/test_packed_scene.h" #include "tests/scene/test_path_2d.h" -#include "tests/scene/test_path_3d.h" #include "tests/scene/test_primitives.h" #include "tests/scene/test_sprite_frames.h" #include "tests/scene/test_text_edit.h" @@ -124,10 +119,18 @@ #include "tests/scene/test_window.h" #include "tests/servers/rendering/test_shader_preprocessor.h" #include "tests/servers/test_navigation_server_2d.h" -#include "tests/servers/test_navigation_server_3d.h" #include "tests/servers/test_text_server.h" #include "tests/test_validate_testing.h" +#ifndef _3D_DISABLED +#include "tests/scene/test_camera_3d.h" +#include "tests/scene/test_navigation_agent_3d.h" +#include "tests/scene/test_navigation_obstacle_3d.h" +#include "tests/scene/test_navigation_region_3d.h" +#include "tests/scene/test_path_3d.h" +#include "tests/servers/test_navigation_server_3d.h" +#endif // _3D_DISABLED + #include "modules/modules_tests.gen.h" #include "tests/display_server_mock.h"