summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp18
-rw-r--r--editor/plugins/script_text_editor.cpp7
2 files changed, 19 insertions, 6 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 4d5c292847..3d3dc978bc 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -793,7 +793,7 @@ Vector<Quat> EditorSceneImporterGLTF::_decode_accessor_as_quat(GLTFState &state,
ret.resize(ret_size);
{
for (int i = 0; i < ret_size; i++) {
- ret.write[i] = Quat(attribs_ptr[i * 4 + 0], attribs_ptr[i * 4 + 1], attribs_ptr[i * 4 + 2], attribs_ptr[i * 4 + 3]);
+ ret.write[i] = Quat(attribs_ptr[i * 4 + 0], attribs_ptr[i * 4 + 1], attribs_ptr[i * 4 + 2], attribs_ptr[i * 4 + 3]).normalized();
}
}
return ret;
@@ -1793,17 +1793,24 @@ template <>
struct EditorSceneImporterGLTFInterpolate<Quat> {
Quat lerp(const Quat &a, const Quat &b, float c) const {
+ ERR_FAIL_COND_V(a.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(b.is_normalized() == false, Quat());
- return a.slerp(b, c);
+ return a.slerp(b, c).normalized();
}
Quat catmull_rom(const Quat &p0, const Quat &p1, const Quat &p2, const Quat &p3, float c) {
+ ERR_FAIL_COND_V(p1.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(p2.is_normalized() == false, Quat());
- return p1.slerp(p2, c);
+ return p1.slerp(p2, c).normalized();
}
Quat bezier(Quat start, Quat control_1, Quat control_2, Quat end, float t) {
- return start.slerp(end, t);
+ ERR_FAIL_COND_V(start.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(end.is_normalized() == false, Quat());
+
+ return start.slerp(end, t).normalized();
}
};
@@ -1945,7 +1952,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
Vector3 base_scale = Vector3(1, 1, 1);
if (!track.rotation_track.values.size()) {
- base_rot = state.nodes[E->key()]->rotation;
+ base_rot = state.nodes[E->key()]->rotation.normalized();
}
if (!track.translation_track.values.size()) {
@@ -1991,6 +1998,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
xform = skeleton->get_bone_rest(bone).affine_inverse() * xform;
rot = xform.basis.get_rotation_quat();
+ rot.normalize();
scale = xform.basis.get_scale();
pos = xform.origin;
}
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 01cc1f7feb..66705f85bf 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1576,15 +1576,20 @@ void ScriptTextEditor::register_editor() {
#ifdef OSX_ENABLED
ED_SHORTCUT("script_text_editor/find_next", TTR("Find Next"), KEY_MASK_CMD | KEY_G);
ED_SHORTCUT("script_text_editor/find_previous", TTR("Find Previous"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_G);
+ ED_SHORTCUT("script_text_editor/replace", TTR("Replace..."), KEY_MASK_ALT | KEY_MASK_CMD | KEY_F);
#else
ED_SHORTCUT("script_text_editor/find_next", TTR("Find Next"), KEY_F3);
ED_SHORTCUT("script_text_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT | KEY_F3);
-#endif
ED_SHORTCUT("script_text_editor/replace", TTR("Replace..."), KEY_MASK_CMD | KEY_R);
+#endif
ED_SHORTCUT("script_text_editor/find_in_files", TTR("Find in files..."), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F);
+#ifdef OSX_ENABLED
+ ED_SHORTCUT("script_text_editor/goto_function", TTR("Goto Function..."), KEY_MASK_CTRL | KEY_MASK_CMD | KEY_J);
+#else
ED_SHORTCUT("script_text_editor/goto_function", TTR("Goto Function..."), KEY_MASK_ALT | KEY_MASK_CMD | KEY_F);
+#endif
ED_SHORTCUT("script_text_editor/goto_line", TTR("Goto Line..."), KEY_MASK_CMD | KEY_L);
#ifdef OSX_ENABLED