Skip to content

Conversation

@greeble-dev
Copy link
Contributor

@greeble-dev greeble-dev commented Jan 2, 2026

Objective

Add more information to the documentation for glTF coordinate conversion. This tries to address the issues raised in #22209.

Solution

The new docs cover exactly which entities will have a correct Transform::forward, assuming the glTF file consistently uses the standard glTF coordinate system for both scenes and nodes.

I've also restored the warning that was in the 0.17 documentation:

CAUTION: This is an experimental feature. Behavior may change in future versions.

This is because:

  1. I want to add node conversion in 0.19, and that might involve changing how scene conversion works.
  2. Cart has mentioned that BSN might restructure scenes, which could also change how scene conversion works.

Screenshot:

image

If this PR lands then I might do another PR to update the migration guide - I can't update it in this PR as the guides are only in the 0.18 branch.

… glTF file follows the standard coordinate system. Added experimental warning.
@greeble-dev greeble-dev added C-Docs An addition or correction to our documentation S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-glTF Related to the glTF 3D scene/model format labels Jan 2, 2026
@greeble-dev greeble-dev added this to the 0.18 milestone Jan 2, 2026
@greeble-dev
Copy link
Contributor Author

I'm adding this to the 0.18 milestone - it's a docs only change to a feature that was changed substantially in 0.18.

/// then created for each node within the glTF scene. Nodes without a
/// parent in the glTF scene become children of the scene entity.
/// The scene entity is created by the glTF loader. Its parent is the entity
/// with the `SceneInstance` component, and its children are the root nodes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Every entity is created by the glTF loader, not just the "scene entity"
  • SceneInstance and SceneRoot are not part of a scene. If you spawn a scene using the SceneSpawner you will not have a SceneInstance or a SceneRoot.

Here's an alternative:

Bevy's glTF loader creates an Entity for each glTF Scene to contain the glTF Scene's nodes. This Scene Entity's children are the entities created from the top-level nodes in the glTF Scene definition. Each node can also continue to have its own child nodes. The Scene Entity that was created to contain the glTF Scene's nodes is the one that becomes rotated.

If you use SceneRoot to spawn the entire scene as a child, that means the Entity with the SceneRoot is parent of the full set of Scene nodes described in the previous paragraph, including the Scene Entity. The child Entity of the SceneRoot is the one that is rotated according to the previous paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every entity is created by the glTF loader, not just the "scene entity"

The parent of the scene entity is not created by the loader. I was worried that the user might interpret "scene entity" as the parent entity that they created, so it's worth emphasising that the loader creates the scene entity even if it's arguably redundant.

SceneInstance and SceneRoot are not part of a scene. If you spawn a scene using the SceneSpawner you will not have a SceneInstance or a SceneRoot.

The reference to SceneInstance was originally added by Cart. So you're correct and I'm open to changing it, but I'm reluctant to do so without a second opinion. Maybe it was an oversight and should be changed, or maybe there's an assumption that most people use SceneRoot/SceneInstance and that keeps the explanation simpler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like you agree with the suggested rewrite but want to add SceneInstance into the second paragraph in addition to SceneRoot.

Copy link
Contributor Author

@greeble-dev greeble-dev Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with the suggested rewrite. I think the current description is good enough, assuming most people are spawning scenes via components.

If I feel there's a consensus that the current description isn't good enough, I'd still need to take a different approach - the suggested rewrite doesn't cover another place that references the scene entity:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. I think the PR is not sufficient, so I'll leave the change suggestion.

Different documentation sections that are incorrect should also be updated, which is separate from this suggestion and does not affect its relevance.

Copy link
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because the experimental note needs to make it into 0.18, but I maintain the suggested change should be made.

@ChristopherBiscardi ChristopherBiscardi added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 4, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 5, 2026
Merged via the queue into bevyengine:main with commit bd9ccb6 Jan 5, 2026
47 checks passed
cart pushed a commit that referenced this pull request Jan 8, 2026
# Objective

Add more information to the documentation for glTF coordinate
conversion. This tries to address the issues raised in #22209.

## Solution

The new docs cover exactly which entities will have a correct
`Transform::forward`, assuming the glTF file consistently uses the
standard glTF coordinate system for both scenes and nodes.

I've also restored the warning that was in the 0.17 documentation:

> _CAUTION: This is an experimental feature. Behavior may change in
future versions._

This is because:

1. I want to [add node
conversion](#22354) in 0.19,
and that might involve changing how scene conversion works.
2. Cart has mentioned that [BSN might restructure
scenes](#20394 (comment)),
which could also change how scene conversion works.

Screenshot:

<img width="1252" height="1519" alt="image"
src="https://github.com/user-attachments/assets/ca37dd14-81f1-4adb-86fe-d8c593956c27"
/>

If this PR lands then I might do another PR to update the migration
guide - I can't update it in this PR as the guides are only in the 0.18
branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-glTF Related to the glTF 3D scene/model format C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants