@@ -1742,6 +1742,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
17421742 _allocate_onion_layers ();
17431743 }
17441744
1745+ #ifndef _3D_DISABLED
17451746 // Hide superfluous elements that would make the overlay unnecessary cluttered.
17461747 if (Node3DEditor::get_singleton ()->is_visible ()) {
17471748 // 3D
@@ -1766,6 +1767,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
17661767 Node3DEditor::get_singleton ()->set_state (new_state);
17671768 } else {
17681769 // CanvasItemEditor.
1770+ #endif // _3D_DISABLED
17691771 onion.temp .canvas_edit_state = CanvasItemEditor::get_singleton ()->get_state ();
17701772 Dictionary new_state = onion.temp .canvas_edit_state .duplicate ();
17711773 new_state[" show_origin" ] = false ;
@@ -1779,7 +1781,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_prolog() {
17791781 new_state[" show_transformation_gizmos" ] = onion.include_gizmos ? new_state[" gizmos" ] : Variant (false );
17801782 // TODO: Save/restore only affected entries.
17811783 CanvasItemEditor::get_singleton ()->set_state (new_state);
1784+ #ifndef _3D_DISABLED
17821785 }
1786+ #endif // _3D_DISABLED
17831787
17841788 // Tweak the root viewport to ensure it's rendered before our target.
17851789 RID root_vp = get_tree ()->get_root ()->get_viewport_rid ();
@@ -1889,14 +1893,18 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_epilog() {
18891893 player->seek_internal (onion.temp .anim_player_position , true , true , false );
18901894 player->restore (onion.temp .anim_values_backup );
18911895
1896+ #ifndef _3D_DISABLED
18921897 // Restore state of main editors.
18931898 if (Node3DEditor::get_singleton ()->is_visible ()) {
18941899 // 3D
18951900 Node3DEditor::get_singleton ()->set_state (onion.temp .spatial_edit_state );
18961901 } else { // CanvasItemEditor
18971902 // 2D
1903+ #endif // _3D_DISABLED
18981904 CanvasItemEditor::get_singleton ()->set_state (onion.temp .canvas_edit_state );
1905+ #ifndef _3D_DISABLED
18991906 }
1907+ #endif // _3D_DISABLED
19001908
19011909 // Update viewports with skin layers overlaid for the actual engine loop render.
19021910 onion.can_overlay = true ;
@@ -2291,7 +2299,9 @@ AnimationPlayerEditor::~AnimationPlayerEditor() {
22912299void AnimationPlayerEditorPlugin::_notification (int p_what) {
22922300 switch (p_what) {
22932301 case NOTIFICATION_ENTER_TREE: {
2302+ #ifndef _3D_DISABLED
22942303 Node3DEditor::get_singleton ()->connect (SNAME (" transform_key_request" ), callable_mp (this , &AnimationPlayerEditorPlugin::_transform_key_request));
2304+ #endif // _3D_DISABLED
22952305 InspectorDock::get_inspector_singleton ()->connect (SNAME (" property_keyed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_property_keyed));
22962306 anim_editor->get_track_editor ()->connect (SNAME (" keying_changed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_update_keying));
22972307 InspectorDock::get_inspector_singleton ()->connect (SNAME (" edited_object_changed" ), callable_mp (anim_editor->get_track_editor (), &AnimationTrackEditor::update_keying));
@@ -2309,6 +2319,7 @@ void AnimationPlayerEditorPlugin::_property_keyed(const String &p_keyed, const V
23092319 te->insert_value_key (p_keyed, p_advance);
23102320}
23112321
2322+ #ifndef _3D_DISABLED
23122323void AnimationPlayerEditorPlugin::_transform_key_request (Object *sp, const String &p_sub, const Transform3D &p_key) {
23132324 if (!anim_editor->get_track_editor ()->has_keying ()) {
23142325 return ;
@@ -2321,6 +2332,7 @@ void AnimationPlayerEditorPlugin::_transform_key_request(Object *sp, const Strin
23212332 anim_editor->get_track_editor ()->insert_transform_key (s, p_sub, Animation::TYPE_ROTATION_3D, p_key.basis .get_rotation_quaternion ());
23222333 anim_editor->get_track_editor ()->insert_transform_key (s, p_sub, Animation::TYPE_SCALE_3D, p_key.basis .get_scale ());
23232334}
2335+ #endif // _3D_DISABLED
23242336
23252337void AnimationPlayerEditorPlugin::_update_keying () {
23262338 InspectorDock::get_inspector_singleton ()->set_keying (anim_editor->get_track_editor ()->has_keying ());
0 commit comments