Skip to content

Commit

Permalink
Release v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
webermm committed May 31, 2023
1 parent 7711416 commit 0b91d0a
Show file tree
Hide file tree
Showing 471 changed files with 92,390 additions and 1,240 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*.ramres filter=lfs diff=lfs merge=lfs -text
*.ramses filter=lfs diff=lfs merge=lfs -text
*.rlogic filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
* text=auto
*.blend filter=lfs diff=lfs merge=lfs -text
* text=auto
# The logo is an exception, not checked in over LFS because it doesn't work on RTD
doc/_static/logo.png -filter -diff -merge -text
24 changes: 24 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -------------------------------------------------------------------------
# Copyright (C) 2022 BMW AG
# -------------------------------------------------------------------------
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# -------------------------------------------------------------------------

# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

---
version: 2

sphinx:
configuration: doc/conf.py
fail_on_warning: true

python:
version: 3.7
install:
- requirements: doc/requirements.txt
...
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ If a copy of the MPL was not distributed with this file, You can obtain one at h
-->

## [1.9.0] Stencil & Scissor support, Linkable instance count, Texture optimization, Misc Bugfixes
* **File version number has changed. Files saved with RaCo 1.9.0 cannot be opened by previous versions.**

### Known Issues
* Setting a MeshNode `instanceCount` property to a negative value via a link will lead to a runtime crash in Ramses.

### Added
* Added support for stencil testing via new stencil-related properties in the `Material` and `MeshNode` options.
* Added support for scissor testing via new properties in the options container of the `Material` and `MeshNode` types.
* Added color write mask suport in the `Material` and `MeshNode` options.

### Changes
* Added support for direct list/tuple assignment to properties of vector type in Python API.
* Available at feature level 5: made the `instanceCount` property of `MeshNodes` linkable.
* Optimize the texture format in Ramses for normal `Texture` objects. No duplicate color channels or channels with constant values are created anymore. This removes warnings about creating empty channels.
* Do not display warnings for unlinked interfaces in Export dialog

### Fixes
* Don't allow to create links between Vec2f/etc properties and struct properties with the same child properties since they can't be created in the LogicEngine.
* Fixed the potential loss of struct uniform values in `MeshNodes` when loading a file created with RamsesComposer V1.7.0 or earlier with V1.8.0.
* Fix preview scaling to make the scale equal to the device pixel over scene size ratio where the scene size is given by the `Display Size` property in the `ProjectSettings` object.


## [1.8.0] Free Tagging System, Lua Logging, Linkable Struct Uniforms, Misc Bugfixes
* **File version number has changed. Files saved with RaCo 1.8.0 cannot be opened by previous versions.**

Expand Down
5 changes: 3 additions & 2 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 1.8.0)
project(RaCoOS VERSION 1.9.0)

SET(RACO_RELEASE_DIRECTORY ${CMAKE_BINARY_DIR}/release)

Expand Down Expand Up @@ -396,4 +396,5 @@ add_subdirectory(EditorApp)
add_subdirectory(resources)

add_subdirectory(PyAPITests)
add_subdirectory(screenshot_tests)
add_subdirectory(screenshot_tests)
add_subdirectory(doc)
61 changes: 61 additions & 0 deletions PyAPITests/pyt_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,67 @@ def test_prop_set_top_fail(self):
with self.assertRaises(RuntimeError):
node.visibility = True

def test_vec_prop_set(self):
lua = raco.create("LuaScript", "lua")
lua.uri = self.cwd() + R"/../resources/scripts/types-scalar.lua"

# Vector assignment from list
lua.inputs.vector2i = [1, 2]
self.assertEqual(lua.inputs.vector2i.i1.value(), 1)

lua.inputs.vector2f = [1.5, 2]
lua.inputs.vector3i = [1, 2, 3]
lua.inputs.vector3f = [1.5, 2, 3]
lua.inputs.vector4i = [1, 2, 3, 4]
lua.inputs.vector4f = [1.5, 2, 3, 4]
self.assertEqual(lua.inputs.vector4f.w.value(), 4)

# Vector assignment from tuple
lua.inputs.vector2f = (3.5, 4)
self.assertEqual(lua.inputs.vector2f.x.value(), 3.5)

# Vector dimension must match list length
with self.assertRaises(RuntimeError):
lua.inputs.vector2f = (1, 2, 3)

def test_array_prop_set_from_list_fail(self):
lua = raco.create("LuaScript", "lua")
lua.uri = self.cwd() + R"/../resources/scripts/array.lua"

# Array of size 5 exists
self.assertEqual(len(lua.inputs.float_array.keys()), 5)

# Array assignment is not supported
with self.assertRaises(RuntimeError):
lua.inputs.float_array = [1, 2, 3, 4, 5]

def test_struct_prop_set_from_list_fail(self):
lua = raco.create("LuaScript", "lua")
lua.uri = self.cwd() + R"/../resources/scripts/struct.lua"

# Struct with 2 elements exists
self.assertEqual(len(lua.inputs.struct.keys()), 2)

# Struct assignment is not supported
with self.assertRaises(RuntimeError):
lua.inputs.struct = [1, 2]

def test_vec_prop_set_from_non_iterable_fail(self):
lua = raco.create("LuaScript", "lua")
lua.uri = self.cwd() + R"/../resources/scripts/types-scalar.lua"

# Assigning non-iterable results in error
with self.assertRaises(TypeError):
lua.inputs.vector2i = 1

def test_vec_prop_set_from_wrong_type_fail(self):
lua = raco.create("LuaScript", "lua")
lua.uri = self.cwd() + R"/../resources/scripts/types-scalar.lua"

# Assigning non-iterable results in error
with self.assertRaises(RuntimeError):
lua.inputs.vector2i = [1, "abc"]

def test_set_int_enum_fail(self):
material = raco.create("Material", "my_mat")

Expand Down
6 changes: 5 additions & 1 deletion components/libApplication/src/RaCoProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ RaCoProject::RaCoProject(const QString& file, Project& p, EngineInterface* engin
// Since link duplicates may differ in link validity we need to initialize the link validity from scratch.
if (project_.checkLinkDuplicates()) {
project_.deduplicateLinks();
context_->initLinkValidity();
}
// Needed because
// - link duplicates may have different link validity
// - we used to allow links between logicengine primitive Vec2f/... and structs with the same content properties
// although they can't be linked in the logicengine.
context_->initLinkValidity();

// Create creation records for all PrefabInstances to force update of their children:
// This is necessary since we don't save all the children of the PrefabInstances anymore.
Expand Down
14 changes: 5 additions & 9 deletions components/libApplication/tests/RaCoApplication_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "testing/TestEnvironmentCore.h"
#include "testing/RaCoApplicationTest.h"

#include "core/PathManager.h"
#include "core/Queries.h"
Expand All @@ -26,11 +26,7 @@
using raco::application::RaCoApplication;
using raco::components::Naming;

class RaCoApplicationFixture : public RacoBaseTest<> {
public:
raco::ramses_base::HeadlessEngineBackend backend{raco::ramses_base::BaseEngineBackend::maxFeatureLevel};
RaCoApplication application{backend};
};
class RaCoApplicationFixture : public RaCoApplicationTest {};

TEST_F(RaCoApplicationFixture, feature_level_load_keep_file_featue_level) {
application.switchActiveRaCoProject({}, {}, true, 1);
Expand Down Expand Up @@ -134,7 +130,7 @@ TEST_F(RaCoApplicationFixture, export_interface_link_opt_4) {
application.switchActiveRaCoProject(QString::fromStdString((test_path() / "export-interface-link-opt-4.rca").string()), {});

std::string error;
EXPECT_FALSE(application.exportProject((test_path() / "export-interface-link-opt-4.ramses").string(), (test_path() / "export-interface-link-opt-4.rlogic").string(), false, error, false));
EXPECT_TRUE(application.exportProject((test_path() / "export-interface-link-opt-4.ramses").string(), (test_path() / "export-interface-link-opt-4.rlogic").string(), false, error, false));
}

TEST_F(RaCoApplicationFixture, export_with_lua_save_mode_for_feature_level_1) {
Expand Down Expand Up @@ -636,7 +632,7 @@ TEST_F(RaCoApplicationFixture, importglTFScenegraphWrongFileReturnsEmptyScenegra

auto absPath = test_path().append("nonexistentFile.gltf").string();

auto dummyCacheEntry = commandInterface->meshCache()->registerFileChangedHandler(absPath, {nullptr, nullptr, []() {}});
auto dummyCacheEntry = commandInterface->meshCache()->registerFileChangedHandler(absPath, {nullptr, nullptr});
auto scenegraph = commandInterface->meshCache()->getMeshScenegraph(absPath);

ASSERT_EQ(scenegraph, nullptr);
Expand All @@ -647,7 +643,7 @@ TEST_F(RaCoApplicationFixture, importglTFScenegraphWrongFileReturnsEmptyAnimSamp
commandInterface->deleteObjects(application.activeRaCoProject().project()->instances());

auto absPath = test_path().append("nonexistentFile.gltf").string();
auto dummyCacheEntry = commandInterface->meshCache()->registerFileChangedHandler(absPath, {nullptr, nullptr, []() {}});
auto dummyCacheEntry = commandInterface->meshCache()->registerFileChangedHandler(absPath, {nullptr, nullptr});
auto animSampler = commandInterface->meshCache()->getAnimationSamplerData(absPath, 0, 0);

ASSERT_EQ(animSampler, nullptr);
Expand Down
Loading

0 comments on commit 0b91d0a

Please sign in to comment.