gltfjsx icon indicating copy to clipboard operation
gltfjsx copied to clipboard

How to set output path?

Open MaxmaxmaximusAWS opened this issue 4 years ago • 5 comments

image

this script create Scene.js in root of my project

MaxmaxmaximusAWS avatar Oct 07 '20 04:10 MaxmaxmaximusAWS

no idea how that would work, a second arg maybe?

drcmda avatar Dec 05 '20 16:12 drcmda

@MaxmaxmaximusAWS By default command to write to a new file, if you have admin rights, then it is

echo @react-three/gltfjsx > assets/gltf/scenge.gltf

//to see the contents just cat it or nano

cat target_file.txt

You can create a bash script to do so and chmod it.

You will also need to play around with the paths a bit.

ghost avatar Dec 10 '20 12:12 ghost

Going off of what @algorithmhash said. For what it's worth, here is a pipeline script I made that might help you out.... You'll need to modify it a bit to fit your needs, but it's pretty straightforward. It handles draco-compressing, gltf-jsx, and component output directory.

Usage: ./scripts/pipeline.rb model-name.gltf

https://github.com/Code47X/tanman.dev/blob/master/scripts/pipeline.rb

Code47X avatar Jan 11 '21 16:01 Code47X

@Code47X looks like that repo is private?

It would be nice to have an --outputDirectory option that could be passed to choose where files are output to.

For example, I have public/scenes that has all of my gltf scenes (i.e. public/scenes/scene1.gltf, public/scenes/scene2.gltf) and want to export them all to src/components/scenes (i.e. src/components/scenes/scene1.tsx, src/components/scenes/scene2.tsx)

TranquilMarmot avatar Sep 29 '21 05:09 TranquilMarmot

@TranquilMarmot Whoops - here is a gist of the pipeline script I mentioned: https://gist.github.com/Code47X/ad0bbbf8ff0aefd5536e9431e66d5f0d

I do agree though, an output directory option would be a nice addition.

Code47X avatar Sep 29 '21 05:09 Code47X