Skip to content

Commit

Permalink
Release v0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ParadoxDaKo committed Dec 20, 2021
1 parent 1a1f2dc commit bf8ffc5
Show file tree
Hide file tree
Showing 53 changed files with 773 additions and 369 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
### Known Issues
-->

## [0.11.1] Interim Release - The Tangent Fix

### Added
* Added real-time update of file read-only status in the application title bar.

### Fixes
* Fixed tangents and bitangents being thrown away after glTF import.
* Assets in glTF files that do not specify meshes but are otherwise valid can be imported now.
* A Mesh that loads a meshless glTF file will still show an error.
* A baked Mesh that loads a glTF file with no nodes referencing meshes will show an error.
* Fixed Mesh not being properly displayed after getting baked, unbaked, then baked again.
* Fixed missing update of broken link errors by undo/redo in some cases.


## [0.11.0] Lua Modules
* **File version number has changed. Files saved with RaCo 0.11.0 cannot be opened by previous versions.**
* **Export file format has changed. Scenes exported with RaCo 0.11.0 / ramses-logic 0.13.0 cannot be opened by previous ramses-logic versions.**
Expand Down Expand Up @@ -52,6 +66,7 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
* The property "timeRange" in Animations introduced in ramses-logic 0.13.0 is not supported yet.
* The new "TimerNode" introduced in ramses-logic 0.13.0 cannot be created in RaCo yet.


## [0.10.0] Animations
* **File version number has changed. Files saved with RaCo 0.10.0 cannot be opened by previous versions.**

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.19)

SET(CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo")

project(RaCoOS VERSION 0.11.0)
project(RaCoOS VERSION 0.11.1)

SET(RACO_RELEASE_DIRECTORY ${CMAKE_BINARY_DIR}/release)

Expand Down
30 changes: 15 additions & 15 deletions EditorApp/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ ads::CDockAreaWidget* createAndAddObjectTree(const char* title, const char* dock
}

ads::CDockAreaWidget* createAndAddProjectBrowser(MainWindow* mainWindow, const char* dockObjName, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, raco::application::RaCoApplication* racoApplication, ads::CDockAreaWidget* dockArea) {
auto* model = new raco::object_tree::model::ObjectTreeViewExternalProjectModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->activeRaCoProject().fileChangeMonitor(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects());
auto* model = new raco::object_tree::model::ObjectTreeViewExternalProjectModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects());
return createAndAddObjectTree(MainWindow::DockWidgetTypes::PROJECT_BROWSER, dockObjName, model, new QSortFilterProxyModel, Queries::filterForVisibleObjects, ads::BottomDockWidgetArea, mainWindow, dockManager, treeDockManager, dockArea);
}

Expand Down Expand Up @@ -304,8 +304,7 @@ void createInitialWidgets(MainWindow* mainWindow, raco::ramses_widgets::Renderer
MainWindow::MainWindow(raco::application::RaCoApplication* racoApplication, raco::ramses_widgets::RendererBackend* rendererBackend, QWidget* parent)
: QMainWindow(parent),
rendererBackend_{rendererBackend},
racoApplication_{racoApplication},
applicationName_("Ramses Composer") {
racoApplication_{racoApplication} {
// Setup the UI from the QtCreator file mainwindow.ui
ui = new Ui::MainWindow();
ui->setupUi(this);
Expand Down Expand Up @@ -541,6 +540,7 @@ void MainWindow::openProject(const QString& file) {
configureDebugActions(ui, this, racoApplication_->activeRaCoProject().commandInterface());

updateApplicationTitle();
updateActiveProjectConnection();

if (racoApplication_->activeRaCoProject().project()->settings()->enableTimerFlag_.asBool() == true) {
ui->menuDebug->addAction(ui->actionEnableRuntimeScriptPreview);
Expand All @@ -560,17 +560,7 @@ MainWindow::~MainWindow() {
}

void MainWindow::updateApplicationTitle() {
raco::application::RaCoProject& project = racoApplication_->activeRaCoProject();
if (racoApplication_->activeProjectPath().empty()) {
setWindowTitle(applicationName_ + " - <New project>");
} else {
auto path = QString::fromStdString(racoApplication_->activeProjectPath());
auto windowTitle = applicationName_ + " - " + project.name() + " (" + path + ")";
if (!QFileInfo(path).isWritable()) {
windowTitle += " <read-only>";
}
setWindowTitle(windowTitle);
}
setWindowTitle(racoApplication_->generateApplicationTitle());
}

bool MainWindow::saveActiveProject() {
Expand Down Expand Up @@ -604,11 +594,12 @@ bool MainWindow::saveAsActiveProject() {
if (racoApplication_->activeRaCoProject().saveAs(newPath, setProjectName)) {
recentFileMenu_->addRecentFile(racoApplication_->activeProjectPath().c_str());

updateActiveProjectConnection();
updateApplicationTitle();
return true;
} else {
updateApplicationTitle();
QMessageBox::critical(this, "Save Error", fmt::format("Can not save project: Writing the project file '{}' failed (detailed error in the log). If you are using source control and the file is read-only: check if the file is in a state where you are allowed to edit it?", applicationName_.toStdString()).c_str(), QMessageBox::Ok);
QMessageBox::critical(this, "Save Error", fmt::format("Can not save project: Writing the project file '{}' failed (detailed error in the log). If you are using source control and the file is read-only: check if the file is in a state where you are allowed to edit it?", newPath.toStdString()).c_str(), QMessageBox::Ok);
}
} else {
QMessageBox::warning(this, "Save Error", fmt::format("Can not save project: externally referenced projects not clean.").c_str(), QMessageBox::Ok);
Expand Down Expand Up @@ -722,6 +713,15 @@ void MainWindow::resetDockManager() {
dockManager_ = createDockManager(this);
}

void MainWindow::updateActiveProjectConnection() {
QObject::disconnect(activeProjectFileConnection_);
if (!racoApplication_->activeProjectPath().empty()) {
activeProjectFileConnection_ = QObject::connect(&racoApplication_->activeRaCoProject(), &raco::application::RaCoProject::activeProjectFileChanged, [this]() {
updateApplicationTitle();
});
}
}

void MainWindow::showMeshImportErrorMessage(const std::string& filePath, const std::string& meshError) {
auto filePathQString = QString::fromStdString(filePath);
auto dialogText = meshError.empty() ? QString{"Ramses Composer encountered an unknown error while importing assets from %1.\nConsult with the logs or file contents to find the error."}.arg(filePathQString)
Expand Down
4 changes: 3 additions & 1 deletion EditorApp/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ protected Q_SLOTS:
bool saveAsActiveProject();
void importScene();
void resetDockManager();
void updateActiveProjectConnection();

Q_SIGNALS:
void viewportChanged(const QSize& sceneSize);

private:
QString applicationName_;
Ui::MainWindow* ui;
OpenRecentMenu* recentFileMenu_;
RaCoDockManager* dockManager_;
Expand All @@ -92,6 +93,7 @@ protected Q_SLOTS:
raco::application::RaCoApplication* racoApplication_;
raco::object_tree::view::ObjectTreeDockManager treeDockManager_;
raco::common_widgets::TimingsModel timingsModel_{this};
QMetaObject::Connection activeProjectFileConnection_;

int renderTimerId_ = 0;
};
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class ExternalProjectsStore : public raco::core::ExternalProjectsStoreInterface

std::map<std::string, std::unique_ptr<RaCoProject>> externalProjects_;

components::ExternalProjectFileChangeMonitor externalProjectFileChangeMonitor_;
components::ProjectFileChangeMonitor externalProjectFileChangeMonitor_;

std::unordered_map<std::string, raco::components::ExternalProjectFileChangeMonitor::UniqueListener> externalProjectFileChangeListeners_;
std::unordered_map<std::string, raco::components::ProjectFileChangeMonitor::UniqueListener> externalProjectFileChangeListeners_;
};

} // namespace raco::application
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace raco::application {

class RaCoApplication {
public:
static const inline QString APPLICATION_NAME{"Ramses Composer"};

explicit RaCoApplication(ramses_base::BaseEngineBackend& engine, const QString& initialProject = {});

RaCoProject& activeRaCoProject();
Expand All @@ -62,7 +64,6 @@ class RaCoApplication {

raco::core::ExternalProjectsStoreInterface* externalProjects();
raco::core::MeshCache* meshCache();
raco::core::FileChangeMonitor* fileChangeMonitor();

const core::SceneBackendInterface* sceneBackend() const;

Expand All @@ -72,6 +73,8 @@ class RaCoApplication {

raco::core::EngineInterface* engine();

QString generateApplicationTitle() const;

private:
// Needs to access externalProjectsStore_ directly:
friend class ::ObjectTreeViewExternalProjectModelTest;
Expand All @@ -84,7 +87,6 @@ class RaCoApplication {
std::unique_ptr<raco::ramses_adaptor::SceneBackend> scenesBackend_;

components::MeshCacheImpl meshCache_;
components::FileChangeMonitorImpl fileChangeMonitor_;

std::unique_ptr<RaCoProject> activeProject_;

Expand Down
14 changes: 9 additions & 5 deletions components/libApplication/include/application/RaCoProject.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
#pragma once

#include "components/FileChangeMonitorImpl.h"
#include "components/MeshCacheImpl.h"
#include "components/Naming.h"
#include "core/CommandInterface.h"
Expand All @@ -35,8 +34,8 @@ struct FutureFileVersion : public std::exception {
}
};

class RaCoProject {

class RaCoProject : public QObject {
Q_OBJECT
public:
Q_DISABLE_COPY(RaCoProject);
~RaCoProject();
Expand All @@ -62,19 +61,22 @@ class RaCoProject {
raco::core::Errors* errors();
raco::core::DataChangeRecorder* recorder();
raco::core::CommandInterface* commandInterface();
raco::core::FileChangeMonitor* fileChangeMonitor();
raco::core::UndoStack* undoStack();
raco::core::MeshCache* meshCache();

QJsonDocument serializeProject(const std::unordered_map<std::string, std::vector<int>>& currentVersions);

Q_SIGNALS:
void activeProjectFileChanged();

private:
// @exception ExtrefError
RaCoProject(const QString& file, raco::core::Project& p, raco::core::EngineInterface* engineInterface, const raco::core::UndoStack::Callback& callback, raco::core::ExternalProjectsStoreInterface* externalProjectsStore, RaCoApplication* app, std::vector<std::string>& pathStack);

void onAfterProjectPathChange(const std::string& oldPath, const std::string& newPath);
void generateProjectSubfolder(const std::string& subFolderPath);
void generateAllProjectSubfolders();
void updateActiveFileListener();

raco::core::DataChangeRecorder recorder_;
raco::core::Errors errors_;
Expand All @@ -83,7 +85,9 @@ class RaCoProject {
std::shared_ptr<raco::core::BaseContext> context_;
bool dirty_{false};

raco::core::FileChangeMonitor* fileChangeMonitor_;
components::ProjectFileChangeMonitor activeProjectFileChangeMonitor_;
raco::components::ProjectFileChangeMonitor::UniqueListener activeProjectFileChangeListener_;

raco::core::MeshCache* meshCache_;
raco::core::UndoStack undoStack_;
raco::core::CommandInterface commandInterface_;
Expand Down
35 changes: 31 additions & 4 deletions components/libApplication/src/RaCoApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

#include <ramses_base/LogicEngineFormatter.h>

#ifdef OS_WINDOWS
// see: https://doc.qt.io/qt-5/qfileinfo.html#ntfs-permissions
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
#endif

namespace raco::application {

RaCoApplication::RaCoApplication(ramses_base::BaseEngineBackend& engine, const QString& initialProject)
Expand Down Expand Up @@ -188,6 +193,32 @@ raco::core::EngineInterface* RaCoApplication::engine() {
return engine_->coreInterface();
}

QString RaCoApplication::generateApplicationTitle() const {
const auto& project = activeRaCoProject();
if (activeProjectPath().empty()) {
return APPLICATION_NAME + " - <New project>";
}

auto path = QString::fromStdString(activeProjectPath());
auto windowTitle = APPLICATION_NAME + " - " + project.name() + " (" + path + ")";
auto fileInfo = QFileInfo(path);
if (fileInfo.exists() && !fileInfo.isWritable()) {
windowTitle += " <read-only>";
} else {
#ifdef OS_WINDOWS
// check NTFS permissions under Win, only after simple read-only check returns false
// (the permissions may still forbid writing)
qt_ntfs_permission_lookup++;
fileInfo = QFileInfo(path);
if (fileInfo.exists() && !fileInfo.isWritable()) {
windowTitle += " <read-only>";
}
qt_ntfs_permission_lookup--;
#endif
}
return windowTitle;
}

core::ExternalProjectsStoreInterface* RaCoApplication::externalProjects() {
return &externalProjectsStore_;
}
Expand All @@ -196,8 +227,4 @@ raco::core::MeshCache* RaCoApplication::meshCache() {
return &meshCache_;
}

raco::core::FileChangeMonitor* RaCoApplication::fileChangeMonitor() {
return &fileChangeMonitor_;
}

} // namespace raco::application
19 changes: 12 additions & 7 deletions components/libApplication/src/RaCoProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "core/Queries.h"
#include "core/Undo.h"
#include "ramses_base/BaseEngineBackend.h"
#include "components/FileChangeMonitorImpl.h"
#include "components/Naming.h"
#include "application/RaCoApplication.h"
#include "components/RaCoPreferences.h"
Expand Down Expand Up @@ -62,11 +61,9 @@ RaCoProject::RaCoProject(const QString& file, Project& p, EngineInterface* engin
callback();
}),
commandInterface_(context_.get(), &undoStack_),
fileChangeMonitor_{app->fileChangeMonitor()},
meshCache_{app->meshCache()} {
context_->setMeshCache(meshCache_);
context_->setExternalProjectsStore(externalProjectsStore);
context_->setFileChangeMonitor(fileChangeMonitor_);

// Abort file loading if we encounter external reference RenderPasses or extref cameras outside a Prefab.
// A bug in V0.9.0 allowed to create such projects.
Expand Down Expand Up @@ -134,6 +131,10 @@ RaCoProject::RaCoProject(const QString& file, Project& p, EngineInterface* engin

undoStack_.reset();
context_->changeMultiplexer().reset();

if (!project_.currentFileName().empty()) {
updateActiveFileListener();
}
dirty_ = false;
}

Expand All @@ -151,6 +152,7 @@ void RaCoProject::onAfterProjectPathChange(const std::string& oldPath, const std
}
}
project_.rerootExternalProjectPaths(oldPath, newPath);
updateActiveFileListener();
}

void RaCoProject::generateProjectSubfolder(const std::string& subFolderPath) {
Expand All @@ -168,6 +170,13 @@ void RaCoProject::generateAllProjectSubfolders() {
generateProjectSubfolder(prefs.shaderSubdirectory.toStdString());
}

void RaCoProject::updateActiveFileListener() {
activeProjectFileChangeListener_ = activeProjectFileChangeMonitor_.registerFileChangedHandler(project_.currentPath(),
[this]() {
Q_EMIT activeProjectFileChanged();
});
}

RaCoProject::~RaCoProject() {
for (const auto& instance : project_.instances()) {
instance->onBeforeDeleteObject(errors_);
Expand Down Expand Up @@ -410,10 +419,6 @@ CommandInterface* RaCoProject::commandInterface() {
return &commandInterface_;
}

FileChangeMonitor* RaCoProject::fileChangeMonitor() {
return fileChangeMonitor_;
}

UndoStack* RaCoProject::undoStack() {
return &undoStack_;
}
Expand Down
1 change: 1 addition & 0 deletions components/libApplication/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ raco_package_add_test_resouces(
meshes/InterpolationTest/interpolation.bin
meshes/InterpolationTest/l.jpg
meshes/Duck.glb
meshes/meshless.gltf
meshes/negativeScaleQuad.gltf
meshes/ToyCar/ToyCar.gltf
meshes/ToyCar/ToyCar.bin
Expand Down
Loading

0 comments on commit bf8ffc5

Please sign in to comment.