Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save children to scene to avoid subscene reloading #173

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

TheDuckCow
Copy link
Owner

This PR primarily adds a new setting to cache or save internal auto generator nodes to the scene tree. By being added to the scene tree, things like the mesh array actually get saved. The intent is this means that for instanced scenes, we don't need regenerate roads or anything on the fly such as during transform. This also helps get around the issue of #169 since we'll just make sure the curves don't get regenerated. We'll just recommend that people don't rotate RoadContainers inside dynamic scenes.

This is still a WIP and some things are broken, such as the connection tool going from a dynamic RP to a saved scene (but the other way around works). I'm having to revisit some fundamentals on things like the names of RoadSegments, and I'm also playing with locked settings to help encourage users to not touch what was previously intentionally hidden. But for saved scenes to work as intended, everything needs to be added to the scene.

Closes #109

For reference, what this check box does is described by this image - except one further improvement of this branch is that the RoadLanes pictured below are no longer constantly created and destroyed, which helps with performance and not accidentally deleting users' stuff.

Screen Shot 2024-06-11 at 6 11 46 PM

This ensures that placement of a scene doesn't *require* that the geo is
recreated, although this doesn't yet prevent the rebuilding when
instanced.
@TheDuckCow
Copy link
Owner Author

To be clear, this pushed change doesn't yet have the code which actually prevents regeneration in other loaded scenes. While I have that mostly working locally, there are other issues I want to see about addressing first which include making the connection tools work. We have to balance the skipping of loading data with also still building up things like the segment map so that the connection tool can work. Might need some new accessors and abstraction utilities to fetch things like start/end points unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gLTF scene export doesn't include meshes Save generated meshes to resources
1 participant