@@ -1763,6 +1763,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
17631763 _allocate_onion_layers ();
17641764 }
17651765
1766+ #ifndef _3D_DISABLED
17661767 // Hide superfluous elements that would make the overlay unnecessary cluttered.
17671768 if (Node3DEditor::get_singleton ()->is_visible ()) {
17681769 // 3D
@@ -1787,6 +1788,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
17871788 Node3DEditor::get_singleton ()->set_state (new_state);
17881789 } else {
17891790 // CanvasItemEditor.
1791+ #endif // _3D_DISABLED
17901792 onion.temp .canvas_edit_state = CanvasItemEditor::get_singleton ()->get_state ();
17911793 Dictionary new_state = onion.temp .canvas_edit_state .duplicate ();
17921794 new_state[" show_origin" ] = false ;
@@ -1800,7 +1802,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
18001802 new_state[" show_transformation_gizmos" ] = onion.include_gizmos ? new_state[" gizmos" ] : Variant (false );
18011803 // TODO: Save/restore only affected entries.
18021804 CanvasItemEditor::get_singleton ()->set_state (new_state);
1805+ #ifndef _3D_DISABLED
18031806 }
1807+ #endif // _3D_DISABLED
18041808
18051809 // Tweak the root viewport to ensure it's rendered before our target.
18061810 RID root_vp = get_tree ()->get_root ()->get_viewport_rid ();
@@ -1910,14 +1914,18 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_epilog() {
19101914 player->seek_internal (onion.temp .anim_player_position , true , true , false );
19111915 player->restore (onion.temp .anim_values_backup );
19121916
1917+ #ifndef _3D_DISABLED
19131918 // Restore state of main editors.
19141919 if (Node3DEditor::get_singleton ()->is_visible ()) {
19151920 // 3D
19161921 Node3DEditor::get_singleton ()->set_state (onion.temp .spatial_edit_state );
19171922 } else { // CanvasItemEditor
19181923 // 2D
1924+ #endif // _3D_DISABLED
19191925 CanvasItemEditor::get_singleton ()->set_state (onion.temp .canvas_edit_state );
1926+ #ifndef _3D_DISABLED
19201927 }
1928+ #endif // _3D_DISABLED
19211929
19221930 // Update viewports with skin layers overlaid for the actual engine loop render.
19231931 onion.can_overlay = true ;
@@ -2312,7 +2320,9 @@ AnimationPlayerEditor::~AnimationPlayerEditor() {
23122320void AnimationPlayerEditorPlugin::_notification (int p_what) {
23132321 switch (p_what) {
23142322 case NOTIFICATION_ENTER_TREE: {
2323+ #ifndef _3D_DISABLED
23152324 Node3DEditor::get_singleton ()->connect (SNAME (" transform_key_request" ), callable_mp (this , &AnimationPlayerEditorPlugin::_transform_key_request));
2325+ #endif // _3D_DISABLED
23162326 InspectorDock::get_inspector_singleton ()->connect (SNAME (" property_keyed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_property_keyed));
23172327 anim_editor->get_track_editor ()->connect (SNAME (" keying_changed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_update_keying));
23182328 InspectorDock::get_inspector_singleton ()->connect (SNAME (" edited_object_changed" ), callable_mp (anim_editor->get_track_editor (), &AnimationTrackEditor::update_keying));
@@ -2330,6 +2340,7 @@ void AnimationPlayerEditorPlugin::_property_keyed(const String &p_keyed, const V
23302340 te->insert_value_key (p_keyed, p_advance);
23312341}
23322342
2343+ #ifndef _3D_DISABLED
23332344void AnimationPlayerEditorPlugin::_transform_key_request (Object *sp, const String &p_sub, const Transform3D &p_key) {
23342345 if (!anim_editor->get_track_editor ()->has_keying ()) {
23352346 return ;
@@ -2342,6 +2353,7 @@ void AnimationPlayerEditorPlugin::_transform_key_request(Object *sp, const Strin
23422353 anim_editor->get_track_editor ()->insert_transform_key (s, p_sub, Animation::TYPE_ROTATION_3D, p_key.basis .get_rotation_quaternion ());
23432354 anim_editor->get_track_editor ()->insert_transform_key (s, p_sub, Animation::TYPE_SCALE_3D, p_key.basis .get_scale ());
23442355}
2356+ #endif // _3D_DISABLED
23452357
23462358void AnimationPlayerEditorPlugin::_update_keying () {
23472359 InspectorDock::get_inspector_singleton ()->set_keying (anim_editor->get_track_editor ()->has_keying ());
0 commit comments