Skip to content

Commit

Permalink
Merge pull request #403 from kpreid/default
Browse files Browse the repository at this point in the history
`impl Default for gltf_json::Node`.
  • Loading branch information
alteous authored Dec 20, 2023
2 parents c17732e + 804a507 commit 5647436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions examples/export/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,8 @@ fn export(output: Output) {
};

let node = json::Node {
camera: None,
children: None,
extensions: Default::default(),
extras: Default::default(),
matrix: None,
mesh: Some(json::Index::new(0)),
name: None,
rotation: None,
scale: None,
translation: None,
skin: None,
weights: None,
..Default::default()
};

let root = json::Root {
Expand Down
2 changes: 1 addition & 1 deletion gltf-json/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serde_derive::{Deserialize, Serialize};
/// identity. When a node is targeted for animation (referenced by an
/// animation.channel.target), only TRS properties may be present; `matrix` will not
/// be present.
#[derive(Clone, Debug, Deserialize, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
pub struct Node {
/// The index of the camera referenced by this node.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 5647436

Please sign in to comment.