kittycad_modeling_cmds/format/
fbx.rs1use parse_display::{Display, FromStr};
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5pub mod import {
7 use super::*;
8 #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
10 #[display("")]
11 #[serde(rename = "FbxImportOptions")]
12 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
13 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
14 pub struct Options {}
15}
16
17pub mod export {
19 use super::*;
20
21 #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)]
23 #[serde(rename = "FbxExportOptions")]
24 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
25 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
26 pub struct Options {
27 pub storage: Storage,
29
30 pub created: Option<chrono::DateTime<chrono::Utc>>,
32 }
33
34 impl std::fmt::Display for Options {
35 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36 write!(f, "storage: {}", self.storage)
37 }
38 }
39
40 impl std::str::FromStr for Options {
41 type Err = <Storage as std::str::FromStr>::Err;
42 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
43 Ok(Self {
44 storage: <Storage as std::str::FromStr>::from_str(s)?,
45 created: None,
46 })
47 }
48 }
49
50 #[derive(
52 Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr,
53 )]
54 #[display(style = "snake_case")]
55 #[serde(rename = "FbxStorage", rename_all = "snake_case")]
56 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
57 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
58 pub enum Storage {
59 Ascii,
61
62 #[default]
64 Binary,
65 }
66}