Skip to content

Commit a491a63

Browse files
committed
updates
Signed-off-by: Jessie Frazelle <[email protected]>
1 parent a6c6bff commit a491a63

File tree

10 files changed

+44
-0
lines changed

10 files changed

+44
-0
lines changed

modeling-cmds/src/format/dxf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub mod export {
3737
}
3838

3939
#[cfg(feature = "python")]
40+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
4041
#[pyo3::pymethods]
4142
impl Options {
4243
#[new]

modeling-cmds/src/format/fbx.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub mod import {
1515
pub struct Options {}
1616

1717
#[cfg(feature = "python")]
18+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
1819
#[pyo3::pymethods]
1920
impl Options {
2021
#[new]
@@ -44,6 +45,7 @@ pub mod export {
4445
}
4546

4647
#[cfg(feature = "python")]
48+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
4749
#[pyo3::pymethods]
4850
impl Options {
4951
#[new]

modeling-cmds/src/format/gltf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub mod import {
1616
pub struct Options {}
1717

1818
#[cfg(feature = "python")]
19+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
1920
#[pyo3::pymethods]
2021
impl Options {
2122
#[new]
@@ -44,6 +45,7 @@ pub mod export {
4445
}
4546

4647
#[cfg(feature = "python")]
48+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
4749
#[pyo3::pymethods]
4850
impl Options {
4951
#[new]

modeling-cmds/src/format/obj.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub mod import {
3333
}
3434

3535
#[cfg(feature = "python")]
36+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
3637
#[pyo3::pymethods]
3738
impl Options {
3839
#[new]
@@ -78,6 +79,7 @@ pub mod export {
7879
}
7980

8081
#[cfg(feature = "python")]
82+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
8183
#[pyo3::pymethods]
8284
impl Options {
8385
#[new]

modeling-cmds/src/format/ply.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub mod import {
3333
}
3434

3535
#[cfg(feature = "python")]
36+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
3637
#[pyo3::pymethods]
3738
impl Options {
3839
#[new]
@@ -85,6 +86,7 @@ pub mod export {
8586
}
8687

8788
#[cfg(feature = "python")]
89+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
8890
#[pyo3::pymethods]
8991
impl Options {
9092
#[new]

modeling-cmds/src/format/sldprt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub mod import {
2020
}
2121

2222
#[cfg(feature = "python")]
23+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
2324
#[pyo3::pymethods]
2425
impl Options {
2526
#[new]

modeling-cmds/src/format/step.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub mod import {
2323
}
2424

2525
#[cfg(feature = "python")]
26+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
2627
#[pyo3::pymethods]
2728
impl Options {
2829
#[new]
@@ -56,6 +57,7 @@ pub mod export {
5657
}
5758

5859
#[cfg(feature = "python")]
60+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
5961
#[pyo3::pymethods]
6062
impl Options {
6163
#[new]

modeling-cmds/src/format/stl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pub mod export {
7474
}
7575

7676
#[cfg(feature = "python")]
77+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
7778
#[pyo3::pymethods]
7879
impl Options {
7980
#[new]

modeling-cmds/src/shared.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,21 @@ pub struct ExportFile {
625625
pub contents: crate::base64::Base64Data,
626626
}
627627

628+
#[cfg(feature = "python")]
629+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
630+
#[pyo3::pymethods]
631+
impl ExportFile {
632+
#[getter]
633+
fn contents(&self) -> Vec<u8> {
634+
self.contents.0.clone()
635+
}
636+
637+
#[getter]
638+
fn name(&self) -> String {
639+
self.name.clone()
640+
}
641+
}
642+
628643
/// The valid types of output file formats.
629644
#[derive(
630645
Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence,

modeling-cmds/src/websocket.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ impl WebSocketResponse {
320320
/// A raw file with unencoded contents to be passed over binary websockets.
321321
/// When raw files come back for exports it is sent as binary/bson, not text/json.
322322
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
323+
#[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass)]
323324
pub struct RawFile {
324325
/// The name of the file.
325326
pub name: String,
@@ -331,6 +332,21 @@ pub struct RawFile {
331332
pub contents: Vec<u8>,
332333
}
333334

335+
#[cfg(feature = "python")]
336+
#[pyo3_stub_gen::derive::gen_stub_pymethods]
337+
#[pyo3::pymethods]
338+
impl RawFile {
339+
#[getter]
340+
fn contents(&self) -> Vec<u8> {
341+
self.contents.clone()
342+
}
343+
344+
#[getter]
345+
fn name(&self) -> String {
346+
self.name.clone()
347+
}
348+
}
349+
334350
impl From<ExportFile> for RawFile {
335351
fn from(f: ExportFile) -> Self {
336352
Self {

0 commit comments

Comments
 (0)