Turned on snapping by default + fixed opening scene from filebrowser

This commit is contained in:
Antoine Pilote
2024-08-27 22:54:28 -04:00
parent 946cf31340
commit c01d6e960c
2 changed files with 3 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ namespace Nuake
ImGuizmo::OPERATION CurrentOperation = ImGuizmo::TRANSLATE;
ImGuizmo::MODE CurrentMode = ImGuizmo::WORLD;
bool UseSnapping = false;
bool UseSnapping = true;
Vector3 CurrentSnapping = { 0.0f, 0.0f, 0.0f };
Ref<Material> m_SelectedMaterial;
Ref<Directory> m_CurrentDirectory;

View File

@@ -536,13 +536,13 @@ namespace Nuake
{
Ref<Scene> scene = Scene::New();
const std::string projectPath = file->GetAbsolutePath();
if (!scene->Deserialize(FileSystem::ReadFile(projectPath, true)))
if (!scene->Deserialize(json::parse(FileSystem::ReadFile(projectPath, true))))
{
Logger::Log("Failed loading scene: " + projectPath,"editor", CRITICAL);
ImGui::PopFont();
return;
}
FileSystem::SetRootDirectory(projectPath + "/");
scene->Path = FileSystem::AbsoluteToRelative(projectPath);
Engine::LoadScene(scene);
}