Skip to content

[Merged by Bors] - Add extras field to GltfNode - #6973

Closed
alradish wants to merge 4 commits into
bevyengine:mainfrom
alradish:alradish/gltf_extras
Closed

alradish wants to merge 4 commits into
bevyengine:mainfrom
alradish:alradish/gltf_extras

Conversation

@alradish

@alradish alradish commented Dec 17, 2022 •

Copy link
Copy Markdown
Contributor

Objective

In our project we parse GltfNode from *.gltf file, and we need extra properties information from Blender. Right now there is no way to get this properties from GltfNode (only through query when you spawn scene), so objective of this PR is to add extra properties to GltfNode

Solution

Store extra properties inside Gltf structs


Changelog

  • Add pub field extras to GltfNode/GltfMesh/GltfPrimitive which store extras
  • Add pub field material_extras to GltfPrimitive which store material extras

Comment thread crates/bevy_gltf/src/loader.rs Outdated
Comment on lines +371 to +376
extras: node
.mesh()
.and_then(|mesh| mesh.extras().as_ref())
.map(|extras| super::GltfExtras {
value: extras.get().to_string(),
}),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those are not the node extras, those are the node' mesh extras

Maybe add a extras field with the node extras, and a mesh_extras field with those from the mesh?

@alradish alradish Jan 26, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Because nodes, meshes, primitives and materials can have extra properties, I added the appropriate fields to the Gltf structs

@james7132 james7132 added C-Feature A new feature, making something new possible A-Assets Load files from disk to use for things like images, models, and sounds labels Jan 2, 2023
@alradish
alradish force-pushed the alradish/gltf_extras branch from 6bfd317 to 0598aad Compare January 22, 2023 20:24
@alradish
alradish marked this pull request as draft January 22, 2023 20:39
@alradish
alradish force-pushed the alradish/gltf_extras branch from 2dc87aa to 1502ab3 Compare January 26, 2023 17:40
@alradish
alradish marked this pull request as ready for review January 26, 2023 17:52
@alradish
alradish requested a review from mockersf January 26, 2023 17:52
@JoshuaBatty

Copy link
Copy Markdown

Just wanted to add my support for having extras added to GltfNode.

@mockersf did you still have any concerns? Is there anything I can do to help shepherd this through?

@mockersf

mockersf commented Feb 8, 2023

Copy link
Copy Markdown
Member

@mockersf did you still have any concerns? Is there anything I can do to help shepherd this through?

Looks good to me, I'm just bad at managing my notifications... thanks for the ping!

@mockersf

mockersf commented Feb 8, 2023

Copy link
Copy Markdown
Member

bors try

bors Bot added a commit that referenced this pull request Feb 8, 2023
@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 8, 2023

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM. Let's see if this can merge; those CI failures don't seem to be your fault.

bors r+

bors Bot pushed a commit that referenced this pull request Feb 13, 2023
# Objective

In our project we parse `GltfNode` from `*.gltf` file, and we need extra properties information from Blender. Right now there is no way to get this properties from GltfNode (only through query when you spawn scene), so objective of this PR is to add extra properties to `GltfNode`

## Solution

Store extra properties inside `Gltf` structs

---

## Changelog

- Add pub field `extras` to `GltfNode`/`GltfMesh`/`GltfPrimitive` which store extras
- Add pub field `material_extras` to `GltfPrimitive` which store material extras
@bors bors Bot changed the title Add extras field to GltfNode [Merged by Bors] - Add extras field to GltfNode Feb 13, 2023
@bors bors Bot closed this Feb 13, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 14, 2023
# Objective

In our project we parse `GltfNode` from `*.gltf` file, and we need extra properties information from Blender. Right now there is no way to get this properties from GltfNode (only through query when you spawn scene), so objective of this PR is to add extra properties to `GltfNode`

## Solution

Store extra properties inside `Gltf` structs

---

## Changelog

- Add pub field `extras` to `GltfNode`/`GltfMesh`/`GltfPrimitive` which store extras
- Add pub field `material_extras` to `GltfPrimitive` which store material extras
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 15, 2023
# Objective

In our project we parse `GltfNode` from `*.gltf` file, and we need extra properties information from Blender. Right now there is no way to get this properties from GltfNode (only through query when you spawn scene), so objective of this PR is to add extra properties to `GltfNode`

## Solution

Store extra properties inside `Gltf` structs

---

## Changelog

- Add pub field `extras` to `GltfNode`/`GltfMesh`/`GltfPrimitive` which store extras
- Add pub field `material_extras` to `GltfPrimitive` which store material extras
@mockersf mockersf mentioned this pull request Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible 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.

5 participants