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

there is bug when I use my own obj file #3

Closed
FrankMelon1 opened this issue Jul 12, 2020 · 3 comments
Closed

there is bug when I use my own obj file #3

FrankMelon1 opened this issue Jul 12, 2020 · 3 comments

Comments

@FrankMelon1
Copy link

thanks for your great work!!!
it is working well when I use the obj. file that you give, but when I use my obj file, there comes bugs as below:

python obj2png.py -i /home/wutao/SMPL-master/obj2png-master/src/rp_janna_posed_004_30k.obj -v
Namespace(animate=False, azim=None, elevation=None, objfiles=['/home/wutao/SMPL-master/obj2png-master/src/rp_janna_posed_004_30k.obj'], outfile=None, quality=None, scale=None, view=True)
Traceback (most recent call last):
File "obj2png.py", line 122, in
ob.Plot(outfile,elevation=elevation,azim=azim,dpi=dpi,scale=scale,animate=animate)
File "/home/wutao/SMPL-master/obj2png-master/src/ObjFile.py", line 178, in Plot
ax.plot_trisurf(self.nodes[:,0],self.nodes[:,1],self.nodes[:,2], triangles=tri)
IndexError: too many indices for array

Do you know how to solve this?
thank you so much!
rp_janna_posed_004_30k.zip

@durgesh17media
Copy link

@pclausen @FrankMelon1 any update on this ? as I am stuck with the exact same issue.

@pclausen
Copy link
Owner

@FrankMelon1 @durgesh17media
The problem is that my parser is too simple to accept files with the face format you have

$ tail rp_janna_posed_004_30k.obj
f 25449/26579/25449 4806/5146/4806 20683/21622/20683
f 20683/21622/20683 25445/26575/25445 25449/26579/25449
f 17288/18287/17288 1331/1333/1331 25444/26574/25444
f 25444/26574/25444 6310/6856/6310 25445/26575/25445
f 25445/26575/25445 3512/3830/3512 17288/18287/17288
f 17288/18287/17288 25444/26574/25444 25445/26575/25445
f 25444/26574/25444 1331/1333/1331 20323/21290/20323
f 20323/21290/20323 4688/5023/4688 25448/26578/25448
f 25448/26578/25448 6310/6856/6310 25444/26574/25444
f 25444/26574/25444 20323/21290/20323 25448/26578/25448

A quick hack before i fix it is to simplify the format eg with sed

$ sed -E 's!/[[:digit:]]+!!g' rp_janna_posed_004_30k.obj > rp.obj
$ tail rp.obj
f 25449 4806 20683
f 20683 25445 25449
f 17288 1331 25444
f 25444 6310 25445
f 25445 3512 17288
f 17288 25444 25445
f 25444 1331 20323
f 20323 4688 25448
f 25448 6310 25444
f 25444 20323 25448

I can't test on my tablet at the moment but i assume that simplified file will parse ok.

pclausen added a commit that referenced this issue Oct 24, 2020
pclausen added a commit that referenced this issue Oct 24, 2020
Vertices parsing incorrect, issue #3
@pclausen
Copy link
Owner

it was actually issue with vertices parsing, now corrected. File has been added to test suite. Thanks for reporting.

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

3 participants