Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying out the docker image or the convert.sh script #10

Open
maxime1992 opened this issue Nov 22, 2021 · 5 comments
Open

Error when trying out the docker image or the convert.sh script #10

maxime1992 opened this issue Nov 22, 2021 · 5 comments

Comments

@maxime1992
Copy link

I just tried running the following:

./convert.sh stp ./assets/test.stp outputpath.gltf

and I get the following error:

ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['python', '/opt/3d-model-convert-to-gltf/server/convert.py', 'stp', '/home/maxime/Downloads/step/3d-model-convert-to-gltf/assets/test.stp', '/home/maxime/Downloads/step/3d-model-convert-to-gltf/outputpath.gltf']' command failed.  (See above for error)
Traceback (most recent call last):
  File "/opt/3d-model-convert-to-gltf/server/convert.py", line 33, in <module>
    main()
  File "/opt/3d-model-convert-to-gltf/server/convert.py", line 20, in main
    out_convert_gltf_path = Convert.convert_by_type(sys.argv[1], os.path.abspath(sys.argv[2]), is_bin)
  File "/opt/3d-model-convert-to-gltf/server/service/Convert.py", line 219, in convert_by_type
    result = model.handler(file_path, is_bin)
TypeError: handler() missing 1 required positional argument: 'need_draco'

Am I missing something?

@paul-sudo
Copy link

I noticed while testing that docker pull wj2015/3d-model-convert-to-gltf:latest is not using the latest version, but an older one.
I was able to fix the problem by copying the latest version from the repository (master branch) to the Docker container.

@stellar-creator
Copy link

I have the same problem - I get "TypeError: handler() missing 1 required positional argument: 'need_draco'" in the terminal

@HorizonsQT
Copy link

HorizonsQT commented Aug 31, 2022

The bug was fixed https://github.com/wangerzi/3d-model-convert-to-gltf/issues/12, but the bug free verison docker image yet been uploaded.

In my case, I use command mode.

I fix this problem by changing the content of the convert.sh file, and it works well for me:

  1. Download the updated Convert.py file in the local path (keep it in the same dir with convert.sh)
  2. Update the convert.sh file with the content below:

inputPath=$(
cd "$(dirname "$2")"
pwd
)
inputFile=$inputPath/`basename $2`
outPath=$(
cd "$(dirname "$3")"
pwd
)
outFile=$outPath/`basename $3`
docker run -v $inputPath:$inputPath -v $outPath:$outPath --name stp-to-gltf wj2015/3d-model-convert-to-gltf:v1.6
docker cp Convert.py stp-to-gltf:/opt/3d-model-convert-to-gltf/server/service/Convert.py
docker exec -it stp-to-gltf /bin/bash -c "cd $inputPath && conda run -n pythonocc python /opt/3d-model-convert-to-gltf/server/convert.py $1 $inputFile $outFile $4"

  1. Make sure to set the convert.sh permission , then launch the file by using (in my case MacOS)
    sh convert.sh stp test.stp test.gltf
  2. Enjoy !

@xianshun163
Copy link

I follow this method, transfer the test.stp to test.gltf . But when I use the tree.js to open the test.gltf,It can not get the model.

@goggle555
Copy link

I had the same problem, but I was able to fix it by changing the container' tag in convert.sh.

Before:

docker run -v $inputPath:$inputPath -v $outPath:$outPath wj2015/3d-model-convert-to-gltf:v1.6 /bin/bash -c "cd $inputPath && conda run -n pythonocc python /opt/3d-model-convert-to-gltf/server/convert.py $1 $inputFile $outFile $4"

After:

docker run -v $inputPath:$inputPath -v $outPath:$outPath wj2015/3d-model-convert-to-gltf:v1.7 /bin/bash -c "cd $inputPath && conda run -n pythonocc python /opt/3d-model-convert-to-gltf/server/convert.py $1 $inputFile $outFile $4"

Changing container's tag from v1.6 to v1.7.
v1.7 is available on docker hub :)
https://hub.docker.com/r/wj2015/3d-model-convert-to-gltf/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants