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