Skip to content

Commit

Permalink
Release v0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AchimStremplat committed Mar 25, 2022
1 parent ff48031 commit 6081cf8
Show file tree
Hide file tree
Showing 38 changed files with 945 additions and 258 deletions.
28 changes: 25 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,33 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
### Known Issues
-->

## [0.13.1]
* **File version number has changed. Files saved with RaCo 0.13.1 cannot be opened by RaCo versions 0.12.x or earlier. **

### Known Issues
* RaCoHeadless will crash when trying to load a scene using external references from scenes which cannot be found.
* The crash will be preceded by an error message like this "External reference update failed: Can't load external project '...' with path '....rca'"
* If the same scene is opened in the Ramses Composer, the same error message will be displayed in a message box.
* When this occurs, the best way forward is to restore the file in the stated location.

### Fixes
* Don't reset preview background color to black if the preview is resized or moved.
* Collapsed vector view for floats does round the displayed number again.
* Capturing the ramses-logic output revealed a ramses-logic error message during load caused by attempting to initialize scripts using modules which have not been loaded yet.
* The "Export" button could be disabled without explanation if external references caused entries in the error view.
* Material uniform textures which are unset now show an error message, since exporting them with ramses does not work.
* Fix losing input properties of interface LuaScripts in nested PrefabInstances with externally referenced Prefabs during load. This fix breaks the propagation of the values of new LuaScript interface properties in the Prefab update performed as part of external reference update during load.
* Fixed Ramses Composer not being able to launch under certain multiple display arrangements on Linux.
* Fixed internal side-effect handling of LuaScript module property updates.
* Under some circumstances RaCo attempted to delete Lua Modules in ramses-logic before the referencing Lua Scripts when the scene was closed, causing an error to be logged.

### Changes
* The "Export" button in the export dialog is no longer disabled if there are errors in the scene. Instead its label is changed to "Export (with errors)".
* The error view in the export dialog now shows all errors, including the ones caused by external references.

## [0.13.0] Compressed project files, cubemap extensions, log view
* **File version number has changed. Files saved with RaCo 0.13.0 cannot be opened by previous versions.**
* Version was superseded by 0.13.1 while still being a preliminary release.

### Known Issues
* RaCoHeadless will crash when trying to load a scene using external references from scenes which cannot be found.
Expand Down Expand Up @@ -56,9 +81,6 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
* Improved support for High DPI screens.
* Fixed losing the property values of PrefabInstance interface scripts when pasting PrefabInstances.

### Regressions discovered and fixed after pre-release
* Don't reset preview background color to black if the preview is resized or moved.

## [0.12.0] Bug Fixes and Usability Improvements
* **File version number has changed. Files saved with RaCo 0.12.0 cannot be opened by previous versions.**

Expand Down
16 changes: 13 additions & 3 deletions 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.13.0)
project(RaCoOS VERSION 0.13.1)

SET(RACO_RELEASE_DIRECTORY ${CMAKE_BINARY_DIR}/release)

Expand Down Expand Up @@ -232,9 +232,19 @@ if(PACKAGE_TESTS)
deploy_ramses_client_only_shared_dlls(${TESTNAME})
endmacro()
function(raco_package_add_test_resouces TESTNAME SOURCE_DIRECTORY)
list(JOIN ARGN "!" RESOURCES_FILE_LIST)
target_compile_definitions(${TESTNAME} PRIVATE RACO_LOCAL_TEST_RESOURCES_SOURCE_DIRECTORY="${SOURCE_DIRECTORY}")
foreach(fname ${ARGN})
set_property(GLOBAL APPEND PROPERTY "${TESTNAME}_RESOURCE_FILES" "${fname}")
set_property(GLOBAL APPEND PROPERTY "${TESTNAME}_RESOURCE_DIRECTORIES" "${SOURCE_DIRECTORY}")
endforeach(fname)
get_property("${TESTNAME}_RESOURCE_FILES" GLOBAL PROPERTY "${TESTNAME}_RESOURCE_FILES")
get_property("${TESTNAME}_RESOURCE_DIRECTORIES" GLOBAL PROPERTY "${TESTNAME}_RESOURCE_DIRECTORIES")

list(JOIN "${TESTNAME}_RESOURCE_FILES" "!" RESOURCES_FILE_LIST)
list(JOIN "${TESTNAME}_RESOURCE_DIRECTORIES" "!" RESOURCES_DIRECTORY_LIST)
#message("${TESTNAME} --> ${RESOURCES_FILE_LIST}")
#message("${TESTNAME} ==> ${RESOURCES_DIRECTORY_LIST}")
target_compile_definitions(${TESTNAME} PRIVATE RACO_LOCAL_TEST_RESOURCES_FILE_LIST="${RESOURCES_FILE_LIST}")
target_compile_definitions(${TESTNAME} PRIVATE RACO_LOCAL_TEST_RESOURCES_DIRECTORY_LIST="${RESOURCES_DIRECTORY_LIST}")
endfunction()
endif()

Expand Down
9 changes: 7 additions & 2 deletions EditorApp/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ ads::CDockAreaWidget* createAndAddUndoView(raco::application::RaCoApplication* a
}

ads::CDockAreaWidget* createAndAddErrorView(MainWindow* mainWindow, raco::application::RaCoApplication* application, const char* dockObjName, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, raco::common_widgets::LogViewModel* logViewModel, ads::CDockAreaWidget* dockArea = nullptr) {
auto* errorView = new raco::common_widgets::ErrorView(application->activeRaCoProject().commandInterface(), application->dataChangeDispatcher(), true, logViewModel);
auto* errorView = new raco::common_widgets::ErrorView(application->activeRaCoProject().commandInterface(), application->dataChangeDispatcher(), false, logViewModel);
QObject::connect(errorView, &raco::common_widgets::ErrorView::objectSelectionRequested, &treeDockManager, &raco::object_tree::view::ObjectTreeDockManager::selectObjectAcrossAllTreeDocks);
auto* dock = createDockWidget(MainWindow::DockWidgetTypes::ERROR_VIEW, mainWindow);
dock->setWidget(errorView);
Expand Down Expand Up @@ -302,7 +302,6 @@ MainWindow::MainWindow(raco::application::RaCoApplication* racoApplication, raco
ui->menuFile->insertMenu(ui->actionSave, recentFileMenu_);
dockManager_ = createDockManager(this);
setWindowIcon(QIcon(":applicationLogo"));
resize(QGuiApplication::screenAt(this->pos())->size() * 0.85);

logViewModel_ = new raco::common_widgets::LogViewModel(this);

Expand Down Expand Up @@ -654,6 +653,12 @@ void MainWindow::restoreCachedLayout() {
auto cachedLayoutInfo = dockManager_->getCachedLayoutInfo();
if (cachedLayoutInfo.empty()) {
createInitialWidgets(this, *rendererBackend_, racoApplication_, dockManager_, treeDockManager_);

#ifdef Q_OS_WIN
// explicit maximization of docks needed or else RaCo will not look properly maximized on Windows
dockManager_->showMaximized();
#endif
showMaximized();
} else {
regenerateLayoutDocks(cachedLayoutInfo);

Expand Down
30 changes: 25 additions & 5 deletions components/libApplication/src/RaCoProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "core/ProjectMigration.h"
#include "core/Serialization.h"
#include "core/SerializationKeys.h"
#include "user_types/LuaScript.h"
#include "user_types/LuaScriptModule.h"
#include "user_types/MeshNode.h"
#include "user_types/Node.h"
#include "user_types/OrthographicCamera.h"
Expand Down Expand Up @@ -94,13 +96,13 @@ RaCoProject::RaCoProject(const QString& file, Project& p, EngineInterface* engin
context_->initLinkValidity();
}

context_->performExternalFileReload(project_.instances());

// Push currently loading project on the project load stack to enable project loop detection to work.
pathStack.emplace_back(file.toStdString());
context_->updateExternalReferences(pathStack);
pathStack.pop_back();

context_->performExternalFileReload(project_.instances());

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

Expand All @@ -111,7 +113,25 @@ RaCoProject::RaCoProject(const QString& file, Project& p, EngineInterface* engin
}

void RaCoProject::onAfterProjectPathChange(const std::string& oldPath, const std::string& newPath) {
for (auto& object : context_->project()->instances()) {
// Somewhat outdated description of a problem here:
// We need the LuaScripts to be processed before the LuaScriptModules:
// otherwise we will loose the references to the modules in the LuaScript module properties.
// Mechanism for losing the module references:
// - reroot / set LuaModule uri property
// - call LuaScript::onAfterReferencedObjectChanged as side effect of operation above
// - LuaScript module sync will now remove the module properties because the lua file can't be loaded because
// the LuaScript uri property has not been rerooted yet but is resolved using the new project path.
// - reroot / set LuaScript uri property
// restores the module properties again but the reference values are now lost (not anymore, caching works again)
// Solutions
// - get module caching in LuaScript working again (this now works again)
// - set all uri properties before calling the side effect handlers; problematic because we would be opening the
// BaseContext::set function and reordering the steps it takes. might be necessary though.
// update: we now have module caching in the LuaScript working again;
// but: we still potentially call some callback handlers multiple times;
// it would be nice the optimize this but that needs an extension of the second solution above.
auto instances{context_->project()->instances()};
for (auto& object : instances) {
if (PathQueries::isPathRelativeToCurrentProject(object)) {
for (const auto& property : ValueTreeIteratorAdaptor(ValueHandle{object})) {
if (auto anno = property.query<URIAnnotation>(); anno && !anno->isProjectSubdirectoryURI()) {
Expand Down Expand Up @@ -224,7 +244,7 @@ std::unique_ptr<RaCoProject> RaCoProject::createNew(RaCoApplication* app) {
result->context_->set({settings, &ProjectSettings::defaultResourceDirectories_, &ProjectSettings::DefaultResourceDirectories::meshSubdirectory_}, prefs.meshSubdirectory.toStdString());
result->context_->set({settings, &ProjectSettings::defaultResourceDirectories_, &ProjectSettings::DefaultResourceDirectories::scriptSubdirectory_}, prefs.scriptSubdirectory.toStdString());
result->context_->set({settings, &ProjectSettings::defaultResourceDirectories_, &ProjectSettings::DefaultResourceDirectories::shaderSubdirectory_}, prefs.shaderSubdirectory.toStdString());

result->context_->set({sRenderPass, &user_types::RenderPass::camera_}, sCamera);
result->context_->set({sRenderPass, &user_types::RenderPass::layer0_}, sRenderLayer);
result->context_->addProperty({sRenderLayer, &user_types::RenderLayer::renderableTags_}, "render_main", std::make_unique<data_storage::Value<int>>(0));
Expand Down Expand Up @@ -285,7 +305,7 @@ std::unique_ptr<RaCoProject> RaCoProject::loadFromFile(const QString& filename,

auto result{raco::serialization::deserializeProject(document, filename.toStdString())};

Project p{ result.objects };
Project p{result.objects};
p.setCurrentPath(filename.toStdString());
for (const auto& instance : result.objects) {
instance->onAfterDeserialization();
Expand Down
11 changes: 11 additions & 0 deletions components/libApplication/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ set(TEST_LIBRARIES
raco::Testing
raco::Utils
)

raco_package_add_headless_test(
libApplication_test
"${TEST_SOURCES}"
"${TEST_LIBRARIES}"
${CMAKE_CURRENT_BINARY_DIR}
)

raco_package_add_test_resouces(
libApplication_test "${CMAKE_SOURCE_DIR}/resources"
shaders/basic.frag
Expand All @@ -50,3 +52,12 @@ raco_package_add_test_resouces(
scripts/types-scalar.lua
scripts/runtime-error.lua
)

raco_package_add_test_resouces(
libApplication_test "${CMAKE_CURRENT_SOURCE_DIR}/testData"
loadDoubleModuleReferenceWithoutError.rca
scripts/m1.lua
scripts/m2.lua
scripts/s.lua
)

33 changes: 33 additions & 0 deletions components/libApplication/tests/RaCoProject_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "application/RaCoApplication.h"
#include "components/RaCoPreferences.h"
#include "core/PathManager.h"
#include "spdlog/sinks/base_sink.h"
#include "testing/TestEnvironmentCore.h"
#include "testing/TestUtil.h"
#include "user_types/LuaScript.h"
Expand Down Expand Up @@ -884,4 +885,36 @@ TEST_F(RaCoProjectFixture, readOnlyProject_appTitleSuffix) {
EXPECT_EQ(app.generateApplicationTitle().toStdString(), expectedAppTitle);
}
}

TEST_F(RaCoProjectFixture, loadDoubleModuleReferenceWithoutError) {
// RAOS-819: If a script references two modules make sure we/ramses-logic does not log an error even though the scripts are all correct.
class CaptureLog : public spdlog::sinks::base_sink<std::mutex> {
public:
virtual void sink_it_(const spdlog::details::log_msg& msg) {
msgs_.emplace_back(msg);
}
virtual void flush_() {}

bool containsError() {
return std::find_if(std::begin(msgs_), std::end(msgs_), [](const spdlog::details::log_msg& msg) {
return msg.level >= spdlog::level::err;
}) != std::end(msgs_);
}

private:
std::vector<spdlog::details::log_msg> msgs_;
};
spdlog::drop_all();
raco::log_system::init();
const auto logsink = std::make_shared<CaptureLog>();
raco::log_system::registerSink(logsink);
std::vector<std::string> pathStack;
RaCoApplication app{backend};
auto project = app.activeRaCoProject().loadFromFile(QString::fromUtf8((test_path() / "loadDoubleModuleReferenceWithoutError.rca").string().data()), &app, pathStack);
ASSERT_TRUE(project != nullptr);
ASSERT_FALSE(logsink->containsError());
raco::log_system::unregisterSink(logsink);
}


#endif
Loading

0 comments on commit 6081cf8

Please sign in to comment.