Skip to content

Commit

Permalink
Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
webermm committed Jul 19, 2022
1 parent a6af107 commit 1d96283
Show file tree
Hide file tree
Showing 219 changed files with 32,960 additions and 1,785 deletions.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,70 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
-->

## [1.1.0] Lua Interfaces, various UI improvements
* **File version number has changed. Files saved with RaCo 1.1.0 cannot be opened by previous versions.**
* **Check the suggested migration procedure below for the LuaInterfaces introduced in RamsesComposer 1.1.0 to avoid unnecessary issues.**

### Added
* Added LuaInterface objects
* LuaInterfaces are created from an interface script similar to the Lua scripts but only containing an interface function and only defining input but not output properties. Interfaces can't use modules either. See the LogicEngine documentation for further details.
* The input properties of LuaInterfaces can be both starting end ending points of links.
* Interfaces do not have a run function and no Lua code is evaluated each frame.
* LuaInterfaces replace the LuaScripts as interfaces for Prefabs. LuaScripts inside PrefabInstances are now completely readonly, i.e. their input property can't be changed or have links ending on them anymore.
* Migration of Prefab/PrefabInstance interface LuaScripts to LuaInterfaces is performed automatically when loading an old project: new LuaInterface objects are generated for each interface LuaScript and the interface scripts files are generated in an `interfaces/` subdirectory of the project directory. Furthermore the links ending on the interface LuaScripts are rerouted through the newly created LuaInterfaces leading to the same behaviour as before.
* LuaInterfaces are also allowed outside Prefabs/PrefabInstances.
* **WARNING** The migration code will generate and write the interface scripts each time it is run. If a file is loaded repeatedly without saving it the interface files will be overwritten each time. To avoid running the migration code repeatedly make sure to save the scenes after loading. A python migration script included in the release automates this process, see below.
* **Suggested migration procedure**
* Open main scene, make sure there are no errors, in particular no errors relating to scripts (including missing modules). Make sure all scenes have been migrated to RaCo 1.0.x.
* If you do not ensure that the scripts have no errors, the LuaInterface objects generated for the scripts will not work as expected!
* Use the Python migration script on the main scene, e. g. `\bin\RelWithDebInfo\RaCoHeadless.exe -r \python\migrate_recursive.py -l 3 -p .rca
* Make sure to include the "-l 3" otherwise the console will be full with irrelevant info/debug/trace messages.
* The script will perform the migration by loading and saving the main scene and all external scenes used by it.
* The automatic migration might fail if multiple main scenes in the same directory are migrated like this since there might be conflicting versions of the new interface files being generated and written to the same file. This should not happen if there is only a single project file per directory.
* Open the scene in RaCo again and verify the scene.
* The generated interface files are now safe to be edited and will not be overwritten on subsequent loads of the project.
* Make sure the C++ coders loading and using the scene change their code to search for LuaInterface objects instead of LuaScript objects, if the object they try to find is part of a prefab instance.
* (optional optimization) Strip all simple OUT=IN assignments from the scripts serving as prefab interfaces and link those properties directly to the LuaInterface objects. This can decrease the CPU load of your scene on the target significantly due to the link optimization (see below).
* Added link optimization when exporting: links chains that have only LuaInterfaces in the middle of the chain will be replaced by single link from the chain start to the chain end property.
* Added Ramses log output to RaCo log output.
* Ramses trace-level log output has to be explicitly activated in the RaCo Editor with the command argument "-t".
* Added custom Texture mipmap support, similar to CubeMap's mipmap support.
* Added tooltips for RaCo properties showing the RaCo-internal property name.
* Added more information to Texture and CubeMap information boxes.
* Allow configuration of standard modules used for lua scripts and modules via a new stdModules property in LuaScript and LuaScriptModule types.
* Added context menu item in the Treeview and Project Browser to open the external project(s) of the selected objects in a separate RamsesComposer instance.
* Added keybord shortcuts for the toolbar menus of the main window.
* Added "u_Resolution" as builtin shader uniform in addition to "u_resolution".

### Changes
* Update from ramses-logic 1.0.2 to 1.1.0
* Update from ramses 27.0.119 to 27.0.121
* Disallowed referencing objects inside Prefabs from objects outside of the same Prefab.
* Disallowed moving top-level objects onto top-level places inside the same objects tree view.
* Extended Texture & Cubemap information to show color channel flow from origin file to shader channels.
* Texture format down-conversion message has been downgraded from warning to information level.
* Texture format up-conversion warning message has been declared as deprecated as it will be upgraded to an error soon.
* Texture format conversion message from palette to any 8-bit format has been downgraded from warning to information level.
* Add python script path as first element of `sys.argv` during script execution with RaCoHeadless.
* Renamed some Node/MeshNode/PerspectiveCamera/OrthographicCamera/PrefabInstance, Timer and LuaScript/LuaInterface properties so they are closer to their ramses-logic counterparts.
* Attention: This affects Python scripts that directly accesses properties by name.
* Added `projectPath` function to Python API to query the path of the current project.

### Fixes
* Fixed crash when switching scenes after an Export Dialog that shows scene errors has been closed.
* Fixed repeated Ramses DisplayDispatcher "no renderer events" message appearing in log.
* Fixed texture not being loaded when using RG8 mode on grayscale pictures.
* Raise python exception if Python API `load` is called with an empty string as filename argument.
* Fixed crash when saving files with relative paths using Python API.
* Add missing TextureFormat enum to Python API.
* Fixed greyscale PNGs not looking correct when texture format RG8 is selected.
* Fixed goto button not working when the referenced object is not selectable in the scene graphs of the current layout.
* Fixed logging of error messages for projects loaded in the RaCoHeadless application to include errors generated by the Ramses/RamsesLogic engine interface code.
* Fixed link removal in Python API to fail when attempting to remove links ending on read-only objects, e.g. external reference objects or PrefabInstance contents.
* Removed spurious "discard invalid link" warning with empty start and/or endpoints when pasting as external reference.
* Fixed crash when moving Nodes to root level in scenegraph.


## [1.0.1] Fix export differences between RaCoHeadless and Ramses Composer GUI

### Fixes
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 1.0.1)
project(RaCoOS VERSION 1.1.0)

SET(RACO_RELEASE_DIRECTORY ${CMAKE_BINARY_DIR}/release)

Expand Down
11 changes: 7 additions & 4 deletions EditorApp/OpenRecentMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "utils/u8path.h"
#include <QSettings>

OpenRecentMenu::OpenRecentMenu(QWidget* parent) : QMenu{"Open Recent", parent} {
OpenRecentMenu::OpenRecentMenu(QWidget* parent) : QMenu{"Open &Recent", parent} {
QObject::connect(this, &QMenu::aboutToShow, this, [this]() {
refreshRecentFileMenu();
});
Expand Down Expand Up @@ -50,16 +50,19 @@ void OpenRecentMenu::refreshRecentFileMenu() {
while (actions().size() > 0) {
removeAction(actions().at(0));
}
int index = 0;
for (const auto& file : recentFiles) {
auto* action = addAction(file);
index = (index + 1) % 10;
auto actionText = QString::fromStdString("&" + std::to_string(index) + ". ") + file;
auto* action = addAction(actionText);

auto fileString = file.toStdString();
if (!raco::utils::u8path(fileString).exists()) {
action->setEnabled(false);
action->setText(file + " (unavailable)");
action->setText(actionText + " (unavailable)");
} else if (!raco::utils::u8path(fileString).userHasReadAccess()) {
action->setEnabled(false);
action->setText(file + " (no read access)");
action->setText(actionText + " (no read access)");
}
QObject::connect(action, &QAction::triggered, this, [this, file]() {
Q_EMIT openProject(file);
Expand Down
7 changes: 6 additions & 1 deletion EditorApp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ int main(int argc, char* argv[]) {
<< "project",
"Load a scene from specified path.",
"project-path");
QCommandLineOption ramsesTraceLogMessageAction(
QStringList() << "t"
<< "trace-messages-ramses",
"Enable trace-level Ramses log messages.");
parser.addOption(consoleOption);
parser.addOption(forwardCommandLineArgs);
parser.addOption(noDumpFileCheckOption);
parser.addOption(loadProjectAction);
parser.addOption(ramsesTraceLogMessageAction);

// apply global style, must be done before application instance
QApplication::setStyle(new raco::style::RaCoStyle());
Expand Down Expand Up @@ -124,7 +129,7 @@ int main(int argc, char* argv[]) {
std::unique_ptr<raco::application::RaCoApplication> app;

try {
app = std::make_unique<raco::application::RaCoApplication>(rendererBackend, projectFile, true);
app = std::make_unique<raco::application::RaCoApplication>(rendererBackend, raco::application::RaCoApplicationLaunchSettings{projectFile, true, parser.isSet(ramsesTraceLogMessageAction)});
} catch (const raco::application::FutureFileVersion& error) {
LOG_ERROR(raco::log_system::COMMON, "File load error: project file was created with newer file version {} but current file version is {}.", error.fileVersion_, raco::serialization::RAMSES_PROJECT_FILE_VERSION);
app.reset();
Expand Down
27 changes: 21 additions & 6 deletions EditorApp/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "user_types/Animation.h"
#include "user_types/AnimationChannel.h"
#include "user_types/CubeMap.h"
#include "user_types/LuaInterface.h"
#include "user_types/LuaScript.h"
#include "user_types/LuaScriptModule.h"
#include "user_types/MeshNode.h"
Expand Down Expand Up @@ -150,11 +151,12 @@ ads::CDockAreaWidget* createAndAddPreview(MainWindow* mainWindow, const char* do
void connectPropertyBrowserAndTreeDockManager(raco::property_browser::PropertyBrowserWidget* propertyBrowser, raco::object_tree::view::ObjectTreeDockManager& treeDockManager) {
QObject::connect(&treeDockManager, &raco::object_tree::view::ObjectTreeDockManager::newObjectTreeItemsSelected, propertyBrowser, &raco::property_browser::PropertyBrowserWidget::setValueHandles);
QObject::connect(&treeDockManager, &raco::object_tree::view::ObjectTreeDockManager::selectionCleared, propertyBrowser, &raco::property_browser::PropertyBrowserWidget::clear);
QObject::connect(propertyBrowser->model(), &raco::property_browser::PropertyBrowserModel::objectSelectionRequested, &treeDockManager, &raco::object_tree::view::ObjectTreeDockManager::selectObjectAcrossAllTreeDocks);
}

ads::CDockAreaWidget* createAndAddPropertyBrowser(MainWindow* mainWindow, const char* dockObjName, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, raco::application::RaCoApplication* application) {
auto propertyBrowser = new raco::property_browser::PropertyBrowserWidget(application->dataChangeDispatcher(), application->activeRaCoProject().commandInterface(), mainWindow);
QObject::connect(propertyBrowser->model(), &raco::property_browser::PropertyBrowserModel::objectSelectionRequested, mainWindow, &MainWindow::focusToObject);
QObject::connect(mainWindow, &MainWindow::objectFocusRequestedForPropertyBrowser, propertyBrowser, &raco::property_browser::PropertyBrowserWidget::setValueHandleFromObjectId);
connectPropertyBrowserAndTreeDockManager(propertyBrowser, treeDockManager);
auto* dockWidget = createDockWidget(MainWindow::DockWidgetTypes::PROPERTY_BROWSER, mainWindow);
dockWidget->setWidget(propertyBrowser, ads::CDockWidget::ForceNoScrollArea);
Expand Down Expand Up @@ -228,7 +230,8 @@ ads::CDockAreaWidget* createAndAddPrefabTree(MainWindow* mainWindow, const char*
OrthographicCamera::typeDescription.typeName,
PerspectiveCamera::typeDescription.typeName,
Animation::typeDescription.typeName,
LuaScript::typeDescription.typeName};
LuaScript::typeDescription.typeName,
LuaInterface::typeDescription.typeName};

auto* model = new raco::object_tree::model::ObjectTreeViewPrefabModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects(), allowedCreateableUserTypes);

Expand All @@ -247,7 +250,8 @@ ads::CDockAreaWidget* createAndAddSceneGraphTree(MainWindow* mainWindow, const c
OrthographicCamera::typeDescription.typeName,
PerspectiveCamera::typeDescription.typeName,
Animation::typeDescription.typeName,
LuaScript::typeDescription.typeName};
LuaScript::typeDescription.typeName,
LuaInterface::typeDescription.typeName};

auto* model = new raco::object_tree::model::ObjectTreeViewDefaultModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects(), allowedCreateableUserTypes);
return createAndAddObjectTree(MainWindow::DockWidgetTypes::SCENE_GRAPH, dockObjName, model, nullptr,
Expand Down Expand Up @@ -412,6 +416,8 @@ MainWindow::MainWindow(raco::application::RaCoApplication* racoApplication, raco
about.exec();
});

QObject::connect(this, &MainWindow::objectFocusRequestedForTreeDock, &treeDockManager_, &raco::object_tree::view::ObjectTreeDockManager::selectObjectAcrossAllTreeDocks);

restoreSettings();
restoreCachedLayout();

Expand Down Expand Up @@ -446,14 +452,15 @@ void MainWindow::timerEvent(QTimerEvent* event) {
Q_EMIT viewportChanged({*viewport->i1_, *viewport->i2_});

for (auto preview : findChildren<raco::ramses_widgets::PreviewMainWindow*>()) {
preview->commit();
preview->commit(racoApplication_->rendererDirty_);
preview->displayScene(racoApplication_->sceneBackendImpl()->currentSceneId(), backgroundColor);
}
racoApplication_->rendererDirty_ = false;
auto logicEngineExecutionEnd = std::chrono::high_resolution_clock::now();
timingsModel_.addLogicEngineTotalExecutionDuration(std::chrono::duration_cast<std::chrono::microseconds>(logicEngineExecutionEnd - startLoop).count());
rendererBackend_->doOneLoop();

racoApplication_->sceneBackendImpl()->flush();

rendererBackend_->doOneLoop();
}

void MainWindow::closeEvent(QCloseEvent* event) {
Expand Down Expand Up @@ -730,6 +737,14 @@ void MainWindow::updateActiveProjectConnection() {
}
}

void MainWindow::focusToObject(const QString& objectID) {
if (treeDockManager_.getTreeDockAmount() != 0 && treeDockManager_.docksContainObject(objectID)) {
Q_EMIT objectFocusRequestedForTreeDock(objectID);
} else {
Q_EMIT objectFocusRequestedForPropertyBrowser(objectID);
}
}

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
3 changes: 3 additions & 0 deletions EditorApp/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class MainWindow : public QMainWindow {

public Q_SLOTS:
void showMeshImportErrorMessage(const std::string& filePath, const std::string& meshError);
void focusToObject(const QString& objectID);

protected:
void timerEvent(QTimerEvent* event) override;
Expand All @@ -86,6 +87,8 @@ protected Q_SLOTS:

Q_SIGNALS:
void viewportChanged(const QSize& sceneSize);
void objectFocusRequestedForPropertyBrowser(const QString& objectID);
void objectFocusRequestedForTreeDock(const QString& objectID);

private:
Ui::MainWindow* ui;
Expand Down
Loading

0 comments on commit 1d96283

Please sign in to comment.