diff --git a/engine/src/base/Path.js b/engine/src/base/Path.js index 5bcdde4d3..9cb49abd3 100644 --- a/engine/src/base/Path.js +++ b/engine/src/base/Path.js @@ -130,7 +130,7 @@ Wick.Path = class extends Wick.Base { /** * The type of path that this path is. Can be 'path', 'text', or 'image' - * @returns {string} + * @returns {'text' | 'image' | 'path'} */ get pathType() { if (this.view.item instanceof paper.TextItem) { diff --git a/src/Editor/EditorCore.jsx b/src/Editor/EditorCore.jsx index 73c0a5e46..a99b93d50 100644 --- a/src/Editor/EditorCore.jsx +++ b/src/Editor/EditorCore.jsx @@ -2053,12 +2053,20 @@ class EditorCore extends Component { } exportSelectedClip = () => { - var clip = this.project.selection.getSelectedObject(); - if (!clip) return; - if (!(clip instanceof window.Wick.Clip)) return; + var object = this.project.selection.getSelectedObject(); + if (!object) return; + if (!object instanceof Wick.Base || !(object instanceof Wick.Asset))) return; + if (object._temporary) return; + + var cname = object.classname; + if(cname === 'Path') { + var pt = object.path; + if(pt === 'path') return; // no need to export paths + cname = `Path::${}`; // could be: (some real Rust/C++ codebase has this), Path::image, or Path::text + } window.Wick.WickObjectFile.toWickObjectFile(clip, 'blob', file => { - window.saveFileFromWick(file, (clip.identifier || 'object'), '.wickobj'); + window.saveFileFromWick(file, (clip.identifier || object.identifier !== null ? object.identifier : cname), '.wickobj'); }); }