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

Allow exporting children of skipped nodes in glTF exporter #16017

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

alexchuber
Copy link
Contributor

See https://forum.babylonjs.com/t/gltf-export-shouldexportnode-changed/55421/2 . Expected behavior is that all nodes are checked for export using shouldExportNode(), regardless of whether parent is being exported or not, but we missed this in #15869.

Now children add themselves to their parent instead of parents tracking and adding their children. This helps address a weird situation where a child node is skipped, so its parent needs to add the indices of several grandchildren instead of just the child’s index (which is null anyway). The new parentNodeChildren parameter also helps with accessing the glTF root node list, in the case where a root node is skipped but has children that should be reparented to the root.

Also factored out the creation of the glTF nodes into _createNodeAsync() so that we can early return a null (meaning skipped) node and still process its children afterwards in _exportNodeAsync().

…ed nodes; make _createNodeAsync() to help detect skipped nodes
@bjsplat
Copy link
Collaborator

bjsplat commented Dec 19, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

Copy link
Contributor

@SergioRZMasson SergioRZMasson left a comment

Choose a reason for hiding this comment

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

LGTM

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 19, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 19, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 19, 2024

@sebavan sebavan merged commit 03a61a6 into BabylonJS:master Dec 19, 2024
14 checks passed
MiiBond pushed a commit to MiiBond/Babylon.js that referenced this pull request Dec 20, 2024
…ed nodes; make _createNodeAsync() to help detect skipped nodes (BabylonJS#16017)
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.

5 participants