Skip to content

Fixed invalid default scene when created through the asset browser#369

Merged
adriengivry merged 1 commit intomainfrom
fix/invalid_default_scene
Feb 15, 2025
Merged

Fixed invalid default scene when created through the asset browser#369
adriengivry merged 1 commit intomainfrom
fix/invalid_default_scene

Conversation

@adriengivry
Copy link
Copy Markdown
Member

@adriengivry adriengivry commented Feb 14, 2025

User Problem

Scenes created through the asset browser: Create... > Scene are "pre-generated" and "pre-serialized". However, this method forces us to update the serialized version of the default scene when our components change.
This issue led to many errors showing up in the console when creating a scene through the asset browser, and then opening it.

Proposed Changes

This PR addresses this issue by adding some tools to create a default scene, and serialize it, when a default scene is requested by the asset browser. This new workflow also make it easier to maintain what a "default scene" should look like, as it is more consistent and shared between parts of the engine.

Notes

Also updated the SceneManager::m_currentScene variable type from Scene* to std::unique_ptr<Scene*> to follow the RAII idiom.

@adriengivry adriengivry added Bug Critical Something that should be fixed quickly labels Feb 14, 2025
@adriengivry adriengivry self-assigned this Feb 14, 2025
@adriengivry adriengivry merged commit 4a8356c into main Feb 15, 2025
@adriengivry adriengivry deleted the fix/invalid_default_scene branch February 15, 2025 03:56
@litelawliet
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical Something that should be fixed quickly

Development

Successfully merging this pull request may close these issues.

2 participants