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

TypeError: unsupported operand type(s) for <<: 'str' and 'int' #5

Open
danexpo opened this issue Apr 6, 2018 · 3 comments
Open

TypeError: unsupported operand type(s) for <<: 'str' and 'int' #5

danexpo opened this issue Apr 6, 2018 · 3 comments

Comments

@danexpo
Copy link

danexpo commented Apr 6, 2018

Getting a failure running the batch file/extract_mview.py. If I try Noesis plugin, only half the model renders correctly, the rest is jumbled vertices. Python 3.6.1 on Windows 10.

Console output:
('thumbnail.jpg', 'image/jpeg')
Traceback (most recent call last):
File "C:\mviewer\extract_mview.py", line 117, in
main(sys.argv[1])
File "C:\mviewer\extract_mview.py", line 26, in main
data = decompress(data, e)
File "C:\mviewer\extract_mview.py", line 58, in decompress
p = (m << 4 | n >> 4) if r & 1 else ((m & 15) << 8 | n)
TypeError: unsupported operand type(s) for <<: 'str' and 'int'

@cronos45
Copy link

Same issue!!

/Volumes/Pennyworth1/do3d\ fileupdate/mviewer-1.0/extract_mview.py /Volumes/Pennyworth1/do3d\ fileupdate/mviewer-1.0/test_data/test_file1.mview
('thumbnail.jpg', 'image/jpeg')
Traceback (most recent call last):
File "/Volumes/Pennyworth1/do3d fileupdate/mviewer-1.0/extract_mview.py", line 117, in
main(sys.argv[1])
File "/Volumes/Pennyworth1/do3d fileupdate/mviewer-1.0/extract_mview.py", line 26, in main
data = decompress(data, e)
File "/Volumes/Pennyworth1/do3d fileupdate/mviewer-1.0/extract_mview.py", line 58, in decompress
p = (m << 4 | n >> 4) if r & 1 else ((m & 15) << 8 | n)
TypeError: unsupported operand type(s) for <<: 'str' and 'int'

@gormlykeep
Copy link

gormlykeep commented Feb 21, 2019

same issue...uninstalled and reinstaller...tried everything I can think of

C:\mview\windows\Fury.mview
('thumbnail.jpg', 'image/jpeg')
Traceback (most recent call last):
File "C:\mview\windows\extract_mview.py", line 117, in
main(sys.argv[1])
File "C:\mview\windows\extract_mview.py", line 26, in main
data = decompress(data, e)
File "C:\mview\windows\extract_mview.py", line 58, in decompress
p = (m << 4 | n >> 4) if r & 1 else ((m & 15) << 8 | n)
TypeError: unsupported operand type(s) for <<: 'str' and 'int'

@spAnser
Copy link

spAnser commented Mar 2, 2019

You can fix this by opening extract_mview.py

edit lines 56-57

        m = ord(a[n + 1])
        n = ord(a[n])

I added the ord to turn char into integers

wanderling added a commit to wanderling/mviewer that referenced this issue Nov 20, 2019
Update to make two char into integers as proposed by spAnser in majimboo#5 (comment)
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

4 participants