Skip to content

Commit

Permalink
Merge pull request pmndrs#41 from epoll31/path-prefix
Browse files Browse the repository at this point in the history
Added pathPrefix option to leva form and generated code
  • Loading branch information
SaraVieira authored May 24, 2024
2 parents 56c8322 + b1fb9e0 commit 477b785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions components/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const Result = () => {
keepgroups: { value: false, label: 'keep groups', hint: 'Keep (empty) groups' },
meta: { value: false, hint: 'Include metadata (as userData)' },
precision: { value: 3, min: 1, max: 8, step: 1, hint: 'Number of fractional digits (default: 2)' },
pathPrefix: {
label: 'path prefix',
value: '',
hint: 'Prefix for all paths',
},
}))

const preview = useControls(
Expand Down
3 changes: 2 additions & 1 deletion utils/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const useStore = create((set, get) => ({
saveAs(blob, `${fileName.split('.')[0]}.zip`)
},
generateScene: async (config) => {
const { fileName, buffers } = get()
const { fileName: rawFileName, buffers } = get()
const fileName = config.pathPrefix && config.pathPrefix !== '' ? `${config.pathPrefix}/${rawFileName}` : rawFileName
let result
if (buffers.size !== 1) {
const loadingManager = new THREE.LoadingManager()
Expand Down

0 comments on commit 477b785

Please sign in to comment.