1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::material::Material;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[serde(rename_all = "camelCase")]
/**
* An external Material index.
*/
pub struct MaterialIndex {
/**
* The optional attribute provides a partial URI to be added to all
* relative asset uris. A valid base path should normally start with
* https:// or file://, and end with either a slash or the path sepa-
* rator character of the operating system.
*/
pub base_path: Option<String>,
/**
* The mandatory attribute provides unique content hashes for assets
* that are directly referenced in the OC data set. The specific hash
* algorithm is unspecified. It may be an MD5 hash of the binary
* content for instance. But low-res assets may use the same hash as
* the originals, they are derived from. So, the only operation that is
* legal for hash, is to compare them with an optionally existing one.
*/
#[serde(
deserialize_with = "crate::utils::deserialize_optional_map_without_null_values",
default
)]
pub hashes: Option<HashMap<String, String>>,
/**
* The mandatory attribute provides an embedded Material index.
*/
#[serde(
deserialize_with = "crate::utils::deserialize_map_without_null_values",
default
)]
pub materials: HashMap<String, Material>,
}