summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp9
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp2
-rw-r--r--editor/scene_tree_dock.cpp3
4 files changed, 9 insertions, 9 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 8748d021b6..30edbd1e87 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1606,7 +1606,9 @@ static void _reset_animation_players(Node *p_node, List<Ref<AnimatedValuesBackup
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(p_node->get_child(i));
if (player && player->is_reset_on_save_enabled() && player->can_apply_reset()) {
Ref<AnimatedValuesBackup> old_values = player->apply_reset();
- r_anim_backups->push_back(old_values);
+ if (old_values.is_valid()) {
+ r_anim_backups->push_back(old_values);
+ }
}
_reset_animation_players(p_node->get_child(i), r_anim_backups);
}
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index 8b098ad23b..dcea7b26f3 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -4168,14 +4168,11 @@ void CollisionShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, i
if (Object::cast_to<CapsuleShape3D>(*s)) {
Vector3 axis;
- axis[p_id == 0 ? 0 : 2] = 1.0;
+ axis[p_id == 0 ? 0 : 1] = 1.0;
Ref<CapsuleShape3D> cs2 = s;
Vector3 ra, rb;
Geometry3D::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
float d = axis.dot(ra);
- if (p_id == 1) {
- d -= cs2->get_radius();
- }
if (Node3DEditor::get_singleton()->is_snap_enabled()) {
d = Math::snapped(d, Node3DEditor::get_singleton()->get_translate_snap());
@@ -4397,7 +4394,7 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector<Vector3> points;
- Vector3 d(0, height * 0.5, 0);
+ Vector3 d(0, height * 0.5 - radius, 0);
for (int i = 0; i < 360; i++) {
float ra = Math::deg2rad((float)i);
float rb = Math::deg2rad((float)i + 1);
@@ -4456,7 +4453,7 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector<Vector3> handles;
handles.push_back(Vector3(cs2->get_radius(), 0, 0));
- handles.push_back(Vector3(0, cs2->get_height() * 0.5 + cs2->get_radius(), 0));
+ handles.push_back(Vector3(0, cs2->get_height() * 0.5, 0));
p_gizmo->add_handles(handles, handles_material);
}
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 3de2ffc137..0bb0bfde6f 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -386,7 +386,7 @@ PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_chi
const real_t radius(half_height * 0.2);
CapsuleShape3D *bone_shape_capsule = memnew(CapsuleShape3D);
- bone_shape_capsule->set_height((half_height - radius) * 2);
+ bone_shape_capsule->set_height(half_height * 2);
bone_shape_capsule->set_radius(radius);
CollisionShape3D *bone_shape = memnew(CollisionShape3D);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 8994adf112..0b228c2695 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1143,6 +1143,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
editor_selection->clear();
editor_selection->add_node(new_node);
+ scene_tree->get_scene_tree()->grab_focus();
} break;
default: {
@@ -2279,7 +2280,7 @@ void SceneTreeDock::_create() {
_do_reparent(last_created, -1, nodes, true);
}
- scene_tree->get_scene_tree()->call_deferred(SNAME("grab_focus"));
+ scene_tree->get_scene_tree()->grab_focus();
}
void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_properties, bool p_remove_old) {