-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Scene
s do not hot reload
#3759
Comments
I wonder if this is also racey. |
@nicopap if you move the watch for changes call before the asset_server.load(), does it work properly then? |
Doesn't help. When hot-reloading the shapes stay straight and colored red/orange. While the bevy-debug-scene-2.gltf shapes should be yellow/purple and slanted. Regardless of the call ordering, tested with each of those configuration:
|
I'm theory-crafting as I go so hopefully this isn't noise. I realised that I think a possible way to solve this from the outside is to do something like spawn the scene as a child of an entity so that it can be despawned recursively. Add a system that watches the I imagine this kind of thing will be addressed when @cart looks into assets as having to do this manually for any loaded scenes/prefabs or whatever would be painful. |
I was informed by @cart that there is knowledge of the entities that were spawned from a scene in the scene spawner. I’d missed that. Maybe my suggestion still works as a workaround for the underlying bug though. |
Turns out the color difference was because the colored point lights being at different positions. I'm now convinced this is strictly a question of either the |
#3340 does not fix this. Still looking into it. |
I think there is no hot reloading for |
I cooked up an absolutely atrocious patch that implements hot reloading for |
Scene
s do not hot reload
I'll keep reloading and await the hotness. ;) |
* Merge code in `SceneSpawner` for managing `DynamicScene` and `Scene`. * Add back hot reloading for `Scene`s, fixes bevyengine#3759 * Add ability to despawn `Scene`s * Add ability to spawn `DynamicScene` as child of existing entities * Add documentation to `SceneSpawner` methods. * Add `write_to_world` method to `Scene` (does the same as `DynamicScene::write_to_world`) This fixes bevyengine#3759 see this commit's merging PR for further details about this change.
* Merge code in `SceneSpawner` for managing `DynamicScene` and `Scene`. * Add back hot reloading for `Scene`s, fixes bevyengine#3759 * Add ability to despawn `Scene`s * Add ability to spawn `DynamicScene` as child of existing entities * Add documentation to `SceneSpawner` methods. * Add `write_to_world` method to `Scene` (does the same as `DynamicScene::write_to_world`) This fixes bevyengine#3759 see this commit's merging PR for further details about this change. Merge PR: bevyengine#4552
* Merge code in `SceneSpawner` for managing `DynamicScene` and `Scene`. * Add back hot reloading for `Scene`s, fixes bevyengine#3759 * Add ability to despawn `Scene`s * Add ability to spawn `DynamicScene` as child of existing entities * Add documentation to `SceneSpawner` methods. * Add `write_to_world` method to `Scene` (does the same as `DynamicScene::write_to_world`) This fixes bevyengine#3759 see this commit's merging PR for further details about this change. Merge PR: bevyengine#4552
* Merge code in `SceneSpawner` for managing `DynamicScene` and `Scene`. * Add back hot reloading for `Scene`s, fixes bevyengine#3759 * Add documentation to `SceneSpawner` methods. * Add `write_to_world` method to `Scene` (does the same as `DynamicScene::write_to_world`) This fixes bevyengine#3759 see this commit's merging PR for further details about this change. Merge PR: bevyengine#4552 A previous version of this change merged `SceneSpawner::*{,_dynamic}`, it made it too difficult to use the `SceneSpawner` so it was reverted.
…e issue when no blueprints, put my Spawn commands behind "nesting" feature since my child parent logic was messed up, good enough for now, still dont have hotreload for scene, see bevyengine/bevy#3759
Using the hot reloading file watcher on a gltf scene with more than one mesh leads to unexpected results. The loading of the updated file seems to only partially replace the original one. Some of the original entity properties seem to persist between hot reloads.
Bevy version: 0.6
OS & graphic stack: ArchLinux kernel 5.16.2; mesa/vulkan-radeon lib: v21.3.4; GPU: AMD ATI Radeon RX 5600
Reproduction steps
assets/models/Monkey.gltf
by thebevy-debug-scene-1.gltf
scene I preparedhot_asset_reloading
exampleMonkey.gltf
withbevy-debug-scene-2.gltf
.Monkey.gltf
a copy ofbevy-debug-scene-2.gltf
files:
bevy-debug-scene-1.gltfbevy-debug-scene-2.gltfI've updated my personal website, and now the scenes are gone. What you should try is swap between two scenes that have multiple entities.
Analysis
This was originally titled
hot reloading of GLTF files with multiple meshes only works partially
, however, after further investigation, it turns out thatScene
simply never update.The reason it seems to work in
assets/hot_asset_reloading.rs
is that theAssetLoader
supports loading multiple asset types as "dependencies", typically when modifying the gltf, you'll modify the mesh and material, which will correctly update. However, scenes also describe the position of entities, which entities there are etc. Turns out this does not work at all. Bevy only implement scene hot reloading forDynamicScene
s (as demonstrated in thescene/scene.rs
example), notScene
s.The text was updated successfully, but these errors were encountered: