Skip to content

Commit

Permalink
Release v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
webermm committed Aug 29, 2022
1 parent 2fb2ce7 commit 9d62f51
Show file tree
Hide file tree
Showing 148 changed files with 4,000 additions and 906 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build*/
out/
.vscode/
.idea/
vc140.pdb
.vs/
Testing/
Expand Down
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,49 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
-->

## [1.3.0] Ramses Logic feature level 2 support, relinking, search function, UI improvements

* **File version number has changed. Files saved with RaCo 1.3.0 cannot be opened by previous versions.**
* **Export now supports ramses-logic feature levels 1 and 2. Scenes exported with feature level 2 can't be opened with ramses-logic before v1.1.0 or with ramses-logic using feature level 1.**

### Added
* Added support for LogicEngine feature levels
* The current feature level of a project can be seen in the ProjectSettings object.
* An application feature level can be set using the '-f' command line option in both the GUI and the headless application.
* Creating a new project will use the application feature level. If the application feature level is set to -1 the maximum supported feature level is used.
* Loading a project will set the current feature level to the project feature level if the application feature level is set to -1. If the application feature level is >=1 the project will be upgraded to the application feature level on load. Downgrading to a lower feature level is not possible.
* Loading a project will always upgrade all externally referenced project to the feature level of the loaded project.
* Added support for the following features available at LogicEngine feature level 2
* Added new linkable `enabled` property to Nodes.
* Allow using planes for the frustum of perspective cameras. Switching is performed using a new `frustumType` property in the PerspectiveCamera. The properties in the frustum container of the camera will be changed accordingly.
* RenderPass property changes
* Added a new linkable `renderOnce` property.
* Renamed `order` to `renderOrder` to match the LogicEngine property name.
* Made the `enabled`, `renderOrder`, and `clearColor` properties linkable.
* Added the AnchorPoint user type.
* Anchor points are LogicEngine objects calculating the viewport coordinates and the depth of a node origin as seen by a camera.
* Anchor point objects can't be used as external references.
* See LogicEngine documentation for details.
* Added improved reference editor. The new reference editor follows the same functionality as the link start point editor.
* Copied objects that are able to be used as references can be set as such a reference by right-clicking on the reference text box in the Property Editor.
* Added tree view object filter ability.
* Search words can be separated by space to combine multiple searches.
* Added in-place renaming option for tree views.
* Automatically fill the shader paths when the first path is set following a simple naming convention based on file extensions. Two naming conventions are supported
* Extensions *.vert, *.geom, *.frag, *.def
* Extensions *.vert.glsl, *.geom.glsl, *.frag.glsl, *.def

### Changes
* Allow relinking of external projects during load when a project file is missing.
* A warning message is shown and the user can choose to supply a new project file to load instead of the missing project.
* Only the loading process if affected, neither the main nor any external project are saved automatically.
* Due to the removal of redundant information during file save the new project path will only be saved if the external project is directly used by the current project.

### Fixes
* Fixed the ~11 seconds freezing in RaCo Editor, under Linux with Nvidia in performance mode, when the Preview dock is resized.
* Fix trace player to update the outputs of LuaScript objects correctly when locking objects.


## [1.2.0] Trace player, weak links, and running Python script in GUI application
* **File version number has changed. Files saved with RaCo 1.1.2 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 1.2.0)
project(RaCoOS VERSION 1.3.0)

SET(RACO_RELEASE_DIRECTORY ${CMAKE_BINARY_DIR}/release)

Expand Down
6 changes: 3 additions & 3 deletions EditorApp/EditMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ EditMenu::EditMenu(raco::application::RaCoApplication* racoApplication, raco::ob
copyAction->setEnabled(false);
pasteAction->setEnabled(raco::RaCoClipboard::hasEditorObject());
} else {
auto focusedTreeView = activeObjectTreeDockWithSelection->getCurrentlyActiveTreeView();
auto focusedTreeView = activeObjectTreeDockWithSelection->getActiveTreeView();
auto selectedIndices = focusedTreeView->getSelectedIndices();
auto pasteIndex = focusedTreeView->getSelectedInsertionTargetIndex();
copyAction->setEnabled(focusedTreeView->canCopyAtIndices(selectedIndices));
Expand Down Expand Up @@ -88,14 +88,14 @@ void EditMenu::globalRedoCallback(raco::application::RaCoApplication* racoApplic

void EditMenu::globalCopyCallback(raco::application::RaCoApplication* racoApplication, raco::object_tree::view::ObjectTreeDockManager* objectTreeDockManager) {
if (auto activeObjectTreeDockWithSelection = objectTreeDockManager->getActiveDockWithSelection()) {
auto focusedTreeView = activeObjectTreeDockWithSelection->getCurrentlyActiveTreeView();
auto focusedTreeView = activeObjectTreeDockWithSelection->getActiveTreeView();
focusedTreeView->globalCopyCallback();
}
}

void EditMenu::globalPasteCallback(raco::application::RaCoApplication* racoApplication, raco::object_tree::view::ObjectTreeDockManager* objectTreeDockManager) {
if (auto activeObjectTreeDockWithSelection = objectTreeDockManager->getActiveDockWithSelection()) {
auto focusedTreeView = activeObjectTreeDockWithSelection->getCurrentlyActiveTreeView();
auto focusedTreeView = activeObjectTreeDockWithSelection->getActiveTreeView();

focusedTreeView->globalPasteCallback(focusedTreeView->getSelectedInsertionTargetIndex());
} else {
Expand Down
23 changes: 21 additions & 2 deletions EditorApp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ int main(int argc, char* argv[]) {
QStringList() << "t"
<< "trace-messages-ramses",
"Enable trace-level Ramses log messages.");
QCommandLineOption ramsesLogicFeatureLevel(
QStringList() << "f"
<< "featurelevel",
fmt::format("RamsesLogic feature level (-1, {} ... {})", static_cast<int>(raco::ramses_base::BaseEngineBackend::minFeatureLevel), static_cast<int>(raco::ramses_base::BaseEngineBackend::maxFeatureLevel)).c_str(),
"feature-level",
QString::fromStdString(std::to_string(static_cast<int>(raco::ramses_base::BaseEngineBackend::maxFeatureLevel))));
QCommandLineOption pyrunOption(
QStringList() << "r"
<< "run",
Expand All @@ -99,6 +105,7 @@ int main(int argc, char* argv[]) {
parser.addOption(noDumpFileCheckOption);
parser.addOption(loadProjectAction);
parser.addOption(ramsesTraceLogMessageAction);
parser.addOption(ramsesLogicFeatureLevel);
parser.addOption(pyrunOption);

// apply global style, must be done before application instance
Expand Down Expand Up @@ -153,6 +160,17 @@ int main(int argc, char* argv[]) {
projectFile = QFileInfo(positionalArgs.at(0)).absoluteFilePath();
}

int featureLevel = -1;
if (parser.isSet(ramsesLogicFeatureLevel)) {
featureLevel = parser.value(ramsesLogicFeatureLevel).toInt();
if (!(featureLevel == -1 ||
featureLevel >= static_cast<int>(raco::ramses_base::BaseEngineBackend::minFeatureLevel) &&
featureLevel <= static_cast<int>(raco::ramses_base::BaseEngineBackend::maxFeatureLevel))) {
LOG_ERROR(raco::log_system::COMMON, fmt::format("RamsesLogic feature level {} outside valid range (-1, {} ... {})", featureLevel, static_cast<int>(raco::ramses_base::BaseEngineBackend::minFeatureLevel), static_cast<int>(raco::ramses_base::BaseEngineBackend::maxFeatureLevel)));
exit(1);
}
}

QString pythonScriptPath{};
if (parser.isSet(pyrunOption)) {
QFileInfo path(parser.value(pyrunOption));
Expand All @@ -171,12 +189,13 @@ int main(int argc, char* argv[]) {
raco::style::RaCoStyle::installFont();

auto ramsesCommandLineArgs = parser.value(forwardCommandLineArgs).toStdString();
raco::ramses_widgets::RendererBackend rendererBackend{parser.isSet(forwardCommandLineArgs) ? ramsesCommandLineArgs : ""};
int initialFeatureLevel = featureLevel == -1 ? static_cast<int>(raco::ramses_base::BaseEngineBackend::maxFeatureLevel) : featureLevel;
raco::ramses_widgets::RendererBackend rendererBackend{static_cast<rlogic::EFeatureLevel>(initialFeatureLevel), parser.isSet(forwardCommandLineArgs) ? ramsesCommandLineArgs : ""};

std::unique_ptr<raco::application::RaCoApplication> app;

try {
app = std::make_unique<raco::application::RaCoApplication>(rendererBackend, raco::application::RaCoApplicationLaunchSettings{projectFile, true, parser.isSet(ramsesTraceLogMessageAction), true});
app = std::make_unique<raco::application::RaCoApplication>(rendererBackend, raco::application::RaCoApplicationLaunchSettings(projectFile, true, parser.isSet(ramsesTraceLogMessageAction), featureLevel, true));
} 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
47 changes: 34 additions & 13 deletions EditorApp/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "object_tree_view_model/ObjectTreeViewExternalProjectModel.h"
#include "object_tree_view_model/ObjectTreeViewPrefabModel.h"
#include "object_tree_view_model/ObjectTreeViewResourceModel.h"
#include "object_tree_view_model/ObjectTreeViewTopLevelSortProxyModel.h"
#include "object_tree_view_model/ObjectTreeViewSortProxyModels.h"
#include "ramses_widgets/PreviewMainWindow.h"
#include "property_browser/PropertyBrowserItem.h"
#include "property_browser/PropertyBrowserModel.h"
Expand All @@ -52,6 +52,7 @@
#include "core/Serialization.h"
#include "ui_mainwindow.h"

#include "user_types/AnchorPoint.h"
#include "user_types/Animation.h"
#include "user_types/AnimationChannel.h"
#include "user_types/CubeMap.h"
Expand Down Expand Up @@ -181,16 +182,15 @@ void createAndAddProjectSettings(MainWindow* mainWindow, const char* dockObjName
dockManager->addDockWidget(ads::RightDockWidgetArea, dock);
}

ads::CDockAreaWidget* createAndAddObjectTree(const char* title, const char* dockObjName, raco::object_tree::model::ObjectTreeViewDefaultModel *dockModel, QSortFilterProxyModel* sortFilterModel, ads::DockWidgetArea area, MainWindow* mainWindow, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, ads::CDockAreaWidget* dockArea) {
ads::CDockAreaWidget* createAndAddObjectTree(const char* title, const char* dockObjName, raco::object_tree::model::ObjectTreeViewDefaultModel* dockModel, raco::object_tree::model::ObjectTreeViewDefaultSortFilterProxyModel* sortFilterModel, ads::DockWidgetArea area, MainWindow* mainWindow, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, ads::CDockAreaWidget* dockArea) {
auto* dockObjectView = new raco::object_tree::view::ObjectTreeDock(title, mainWindow);
QObject::connect(dockModel, &raco::object_tree::model::ObjectTreeViewDefaultModel::meshImportFailed, mainWindow, &MainWindow::showMeshImportErrorMessage);
dockModel->buildObjectTree();
auto newTreeView = new raco::object_tree::view::ObjectTreeView(title, dockModel, sortFilterModel);
if (sortFilterModel) {
newTreeView->setSortingEnabled(true);
if (sortFilterModel && sortFilterModel->sortingEnabled()) {
newTreeView->sortByColumn(raco::object_tree::model::ObjectTreeViewDefaultModel::COLUMNINDEX_TYPE, Qt::SortOrder::AscendingOrder);
}
dockObjectView->addTreeView(newTreeView);
dockObjectView->setTreeView(newTreeView);
treeDockManager.addTreeDock(dockObjectView);
dockModel->setParent(dockObjectView);

Expand All @@ -200,13 +200,14 @@ 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->dataChangeDispatcher(), racoApplication->externalProjects());
return createAndAddObjectTree(MainWindow::DockWidgetTypes::PROJECT_BROWSER, dockObjName, model, new QSortFilterProxyModel, ads::BottomDockWidgetArea, mainWindow, dockManager, treeDockManager, dockArea);
return createAndAddObjectTree(MainWindow::DockWidgetTypes::PROJECT_BROWSER, dockObjName, model, new raco::object_tree::model::ObjectTreeViewDefaultSortFilterProxyModel(mainWindow), ads::BottomDockWidgetArea, mainWindow, dockManager, treeDockManager, dockArea);
}

ads::CDockAreaWidget* createAndAddResourceTree(MainWindow* mainWindow, const char* dockObjName, RaCoDockManager* dockManager, raco::object_tree::view::ObjectTreeDockManager& treeDockManager, raco::application::RaCoApplication* racoApplication, ads::CDockAreaWidget* dockArea) {
using namespace raco::user_types;

static const std::vector<std::string> allowedCreateableUserTypes{
AnchorPoint::typeDescription.typeName,
AnimationChannel::typeDescription.typeName,
CubeMap::typeDescription.typeName,
LuaScriptModule::typeDescription.typeName,
Expand All @@ -221,7 +222,7 @@ ads::CDockAreaWidget* createAndAddResourceTree(MainWindow* mainWindow, const cha

auto* model = new raco::object_tree::model::ObjectTreeViewResourceModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects(), allowedCreateableUserTypes);
return createAndAddObjectTree(
MainWindow::DockWidgetTypes::RESOURCES, dockObjName, model, new QSortFilterProxyModel,
MainWindow::DockWidgetTypes::RESOURCES, dockObjName, model, new raco::object_tree::model::ObjectTreeViewTopLevelSortFilterProxyModel(mainWindow),
ads::BottomDockWidgetArea, mainWindow, dockManager, treeDockManager, dockArea);
}

Expand All @@ -242,7 +243,7 @@ ads::CDockAreaWidget* createAndAddPrefabTree(MainWindow* mainWindow, const char*
auto* model = new raco::object_tree::model::ObjectTreeViewPrefabModel(racoApplication->activeRaCoProject().commandInterface(), racoApplication->dataChangeDispatcher(), racoApplication->externalProjects(), allowedCreateableUserTypes);

return createAndAddObjectTree(
MainWindow::DockWidgetTypes::PREFABS, dockObjName, model, new raco::object_tree::model::ObjectTreeViewTopLevelSortFilterProxyModel,
MainWindow::DockWidgetTypes::PREFABS, dockObjName, model, new raco::object_tree::model::ObjectTreeViewTopLevelSortFilterProxyModel(mainWindow),
ads::BottomDockWidgetArea, mainWindow, dockManager, treeDockManager, dockArea);
}

Expand All @@ -260,7 +261,7 @@ ads::CDockAreaWidget* createAndAddSceneGraphTree(MainWindow* mainWindow, const c
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,
return createAndAddObjectTree(MainWindow::DockWidgetTypes::SCENE_GRAPH, dockObjName, model, new raco::object_tree::model::ObjectTreeViewDefaultSortFilterProxyModel(mainWindow, false),
ads::LeftDockWidgetArea, mainWindow, dockManager, treeDockManager, nullptr);
}

Expand Down Expand Up @@ -587,19 +588,39 @@ void MainWindow::openProject(const QString& file) {
delete dockManager_;
logViewModel_->clear();


killTimer(renderTimerId_);

try {
racoApplication_->switchActiveRaCoProject(file);
auto relinkCallback = [this](const std::string& projectPath) -> std::string {
auto answer = QMessageBox::warning(this, "External Project Not Found: Relink?",
fmt::format("External project '{}' was not found!\n\nSpecify replacement project and relink?", projectPath).c_str(),
QMessageBox::Yes | QMessageBox::No);
if (answer == QMessageBox::Yes) {
auto projectDirectory = raco::utils::u8path(projectPath).normalized().parent_path().string();
auto file = QFileDialog::getOpenFileName(this,
"Replace: " + QString::fromStdString(projectPath),
QString::fromStdString(projectDirectory),
"Ramses Composer Assembly (*.rca)");
return file.toStdString();
}
return std::string();
};
racoApplication_->switchActiveRaCoProject(file, relinkCallback, true, racoApplication_->applicationFeatureLevel());
} catch (const raco::application::FutureFileVersion& error) {
racoApplication_->switchActiveRaCoProject({});
racoApplication_->switchActiveRaCoProject({}, {});
QMessageBox::warning(this, "File Load Error", fmt::format("Project file was created with newer version of {app_name}. Please upgrade.\n\nExpected File Version: {expected_file_version}\nFound File Version: {file_version}", fmt::arg("app_name", "Ramses Composer"), fmt::arg("expected_file_version", raco::serialization::RAMSES_PROJECT_FILE_VERSION), fmt::arg("file_version", error.fileVersion_)).c_str(), QMessageBox::Close);
} catch (const ExtrefError& error) {
racoApplication_->switchActiveRaCoProject({});
racoApplication_->switchActiveRaCoProject({}, {});
QMessageBox::warning(this, "File Load Error", fmt::format("External reference update failed.\n\n{}", error.what()).c_str(), QMessageBox::Close);
} catch (const std::exception& e) {
racoApplication_->switchActiveRaCoProject({});
racoApplication_->switchActiveRaCoProject({}, {});
QMessageBox::warning(this, "File Load Error", fmt::format("Project file {} could not be loaded.\n\nReported error: {}\n\nCheck whether the file has been broken or corrupted.", fileString, e.what()).c_str(), QMessageBox::Close);
}

renderTimerId_ = startTimer(timerInterval60Fps);


// Recreate our layout with new context
dockManager_ = createDockManager(this);
restoreCachedLayout();
Expand Down
Loading

0 comments on commit 9d62f51

Please sign in to comment.