diff options
-rw-r--r-- | doc/classes/Animation.xml | 2 | ||||
-rw-r--r-- | doc/classes/AnimationMixer.xml | 4 | ||||
-rw-r--r-- | editor/animation_bezier_editor.cpp | 21 | ||||
-rw-r--r-- | editor/animation_bezier_editor.h | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 11 | ||||
-rw-r--r-- | platform/web/js/libs/library_godot_input.js | 1 | ||||
-rw-r--r-- | scene/2d/camera_2d.cpp | 6 | ||||
-rw-r--r-- | scene/2d/parallax_2d.cpp | 7 | ||||
-rw-r--r-- | scene/main/node.cpp | 6 |
9 files changed, 36 insertions, 24 deletions
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 3b7a6e66fe..80fd52c684 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -560,7 +560,7 @@ <param index="0" name="track_idx" type="int" /> <param index="1" name="path" type="NodePath" /> <description> - Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code]. + Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the [member AnimationMixer.root_node] that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code]. </description> </method> diff --git a/doc/classes/AnimationMixer.xml b/doc/classes/AnimationMixer.xml index 8a493ce91f..58ef118e46 100644 --- a/doc/classes/AnimationMixer.xml +++ b/doc/classes/AnimationMixer.xml @@ -304,8 +304,8 @@ This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation. </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> - The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code]. - If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale] and [RootMotionView]. + The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. The [member root_motion_track] uses the same format as [method Animation.track_set_path], but note that a bone must be specified. + If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D], or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale], and [RootMotionView]. </member> <member name="root_node" type="NodePath" setter="set_root_node" getter="get_root_node" default="NodePath("..")"> The node which node path references will travel from. diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index aa8962b580..9e5281368a 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -1096,7 +1096,8 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) { for (int i = 0; i < animation->track_get_key_count(track); ++i) { undo_redo->add_undo_method( this, - "_bezier_track_insert_key", + "_bezier_track_insert_key_at_anim", + animation, track, animation->track_get_key_time(track, i), animation->bezier_track_get_key_value(track, i), @@ -1370,7 +1371,8 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) { key[0] = h; undo_redo->add_do_method( this, - "_bezier_track_insert_key", + "_bezier_track_insert_key_at_anim", + animation, E->get().first, newpos, key[0], @@ -1391,7 +1393,8 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) { Array key = animation->track_get_key_value(E->get().first, E->get().second); undo_redo->add_undo_method( this, - "_bezier_track_insert_key", + "_bezier_track_insert_key_at_anim", + animation, E->get().first, oldpos, key[0], @@ -1409,7 +1412,8 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) { undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, 1); undo_redo->add_undo_method( this, - "_bezier_track_insert_key", + "_bezier_track_insert_key_at_anim", + animation, amr.track, amr.time, key[0], @@ -1918,10 +1922,9 @@ void AnimationBezierTrackEdit::delete_selection() { } } -void AnimationBezierTrackEdit::_bezier_track_insert_key(int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) { - ERR_FAIL_COND(animation.is_null()); - int idx = animation->bezier_track_insert_key(p_track, p_time, p_value, p_in_handle, p_out_handle); - animation->bezier_track_set_key_handle_mode(p_track, idx, p_handle_mode); +void AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim(const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) { + int idx = p_anim->bezier_track_insert_key(p_track, p_time, p_value, p_in_handle, p_out_handle); + p_anim->bezier_track_set_key_handle_mode(p_track, idx, p_handle_mode); } void AnimationBezierTrackEdit::_bind_methods() { @@ -1930,7 +1933,7 @@ void AnimationBezierTrackEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("_select_at_anim"), &AnimationBezierTrackEdit::_select_at_anim); ClassDB::bind_method(D_METHOD("_update_hidden_tracks_after"), &AnimationBezierTrackEdit::_update_hidden_tracks_after); ClassDB::bind_method(D_METHOD("_update_locked_tracks_after"), &AnimationBezierTrackEdit::_update_locked_tracks_after); - ClassDB::bind_method(D_METHOD("_bezier_track_insert_key"), &AnimationBezierTrackEdit::_bezier_track_insert_key); + ClassDB::bind_method(D_METHOD("_bezier_track_insert_key_at_anim"), &AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim); ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single"), PropertyInfo(Variant::INT, "track"))); ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::INT, "track"))); diff --git a/editor/animation_bezier_editor.h b/editor/animation_bezier_editor.h index 3067c923b9..dd7e8758f3 100644 --- a/editor/animation_bezier_editor.h +++ b/editor/animation_bezier_editor.h @@ -221,7 +221,7 @@ public: void paste_keys(real_t p_ofs, bool p_ofs_valid); void delete_selection(); - void _bezier_track_insert_key(int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode); + void _bezier_track_insert_key_at_anim(const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode); AnimationBezierTrackEdit(); }; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 632b36c705..e883c296ac 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -317,14 +317,10 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { Ref<InputEventKey> k = p_event; if ((k.is_valid() && k->is_pressed() && !k->is_echo()) || Object::cast_to<InputEventShortcut>(*p_event)) { - EditorPlugin *old_editor = editor_plugin_screen; - + bool is_handled = true; if (ED_IS_SHORTCUT("editor/filter_files", p_event)) { FileSystemDock::get_singleton()->focus_on_filter(); - get_tree()->get_root()->set_input_as_handled(); - } - - if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { + } else if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { editor_select(EDITOR_2D); } else if (ED_IS_SHORTCUT("editor/editor_3d", p_event)) { editor_select(EDITOR_3D); @@ -343,9 +339,10 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { } else if (ED_IS_SHORTCUT("editor/toggle_last_opened_bottom_panel", p_event)) { bottom_panel->toggle_last_opened_bottom_panel(); } else { + is_handled = false; } - if (old_editor != editor_plugin_screen) { + if (is_handled) { get_tree()->get_root()->set_input_as_handled(); } } diff --git a/platform/web/js/libs/library_godot_input.js b/platform/web/js/libs/library_godot_input.js index 7ea89d553f..6e3b97023d 100644 --- a/platform/web/js/libs/library_godot_input.js +++ b/platform/web/js/libs/library_godot_input.js @@ -112,6 +112,7 @@ const GodotIME = { ime.style.top = '0px'; ime.style.width = '100%'; ime.style.height = '40px'; + ime.style.pointerEvents = 'none'; ime.style.display = 'none'; ime.contentEditable = 'true'; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 514c5e7a8f..7020d162fe 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -302,6 +302,12 @@ void Camera2D::_notification(int p_what) { _interpolation_data.xform_prev = _interpolation_data.xform_curr; } break; + case NOTIFICATION_PAUSED: { + if (is_physics_interpolated_and_enabled()) { + _update_scroll(); + } + } break; + case NOTIFICATION_TRANSFORM_CHANGED: { if ((!position_smoothing_enabled && !is_physics_interpolated_and_enabled()) || _is_editing_in_editor()) { _update_scroll(); diff --git a/scene/2d/parallax_2d.cpp b/scene/2d/parallax_2d.cpp index aacab3213d..b3586a1da0 100644 --- a/scene/2d/parallax_2d.cpp +++ b/scene/2d/parallax_2d.cpp @@ -86,11 +86,10 @@ void Parallax2D::_update_scroll() { } Point2 scroll_ofs = screen_offset; - Size2 vps = get_viewport_rect().size; - if (Engine::get_singleton()->is_editor_hint()) { - vps = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")); - } else { + if (!Engine::get_singleton()->is_editor_hint()) { + Size2 vps = get_viewport_rect().size; + if (limit_begin.x <= limit_end.x - vps.x) { scroll_ofs.x = CLAMP(scroll_ofs.x, limit_begin.x, limit_end.x - vps.x); } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 5bbf8ebff4..0396f3ab4a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -177,6 +177,12 @@ void Node::_notification(int p_notification) { } } break; + case NOTIFICATION_PAUSED: { + if (is_physics_interpolated_and_enabled() && is_inside_tree()) { + reset_physics_interpolation(); + } + } break; + case NOTIFICATION_PATH_RENAMED: { if (data.path_cache) { memdelete(data.path_cache); |