jmplonka / Importer3D

FreeCAD Addon to import several 3D files 3D Studio Max (*.3ds, *.max), LightWave Object (*.lwo), Autodesk binary Maya (*.md) or GSkin-Mesh (*.gsm)
44 stars 11 forks source link

Unable to Import .max file #6

Open chrisjq opened 3 years ago

chrisjq commented 3 years ago

While trying to import the 3Dmax file from https://www.thingiverse.com/thing:71264 I get the error, using FreeCad 0.19 dev:

11:47:30 Traceback (most recent call last): File "", line 1, in File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 50, in insert return open(filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 60, in open read(doc, filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 29, in read importMAX.read(doc, filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 999, in read readClassData(ole, fileName) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 337, in readClassData CLS_DATA = readChunks(ole, 'ClassData', fileName+'.ClsDat.bin') File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 333, in readChunks return reader.getChunks(scene, 0, containerReader, primitiveReader) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 206, in getChunks for i in xrange(offset - old): <class 'NameError'>: name 'xrange' is not defined

jmplonka commented 3 years ago

Let mee have a loik into it... Thank you for sharing Jens

jmplonka commented 3 years ago

Should be fixed now.

chrisjq commented 3 years ago

OK, I now get this (Also I gave you the wrong thingiverse link: https://www.thingiverse.com/thing:832684): 19:47:39 Traceback (most recent call last): File "", line 1, in File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 50, in insert return open(filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 60, in open read(doc, filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importer3D.py", line 29, in read importMAX.read(doc, filename) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 1009, in read readScene(doc, ole, fileName) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 991, in readScene SCENE_LIST = readChunks(ole, 'Scene', fileName+'.Scn.bin', containerReader=SceneChunk) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 333, in readChunks return reader.getChunks(scene, 0, containerReader, primitiveReader) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 204, in getChunks offset, chunk = self.getNextChunk(data, offset, level, len(chunks), containerReader, primitiveReader) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 227, in getNextChunk chunk.setData(chunkData) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 182, in setData self.children = reader.getChunks(data, self.level + 1, SceneChunk, ByteArrayChunk) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 204, in getChunks offset, chunk = self.getNextChunk(data, offset, level, len(chunks), containerReader, primitiveReader) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 227, in getNextChunk chunk.setData(chunkData) File "/Users/chris/Library/Preferences/FreeCAD/Mod/Importer3D/importMAX.py", line 182, in setData self.children = reader.getChunks(data, self.level + 1, SceneChunk, ByteArrayChunk) File "/Users<class 'TypeError'>: can't multiply sequence by non-int of type 'float'

jmplonka commented 3 years ago

Should be fixed now. Unfortunately not all 3ds MAX features are supported (e.g. ProBoolean) so the result looks different.

jc4d commented 3 years ago

Hi, not sure if this is the right place but I'm getting errors when trying to import a 2013 3dmax.

File "", line 1, in File "C:\Program Files\FreeCAD 0.19\Mod\Importer3D-master\importer3D.py", line 50, in insert return open(filename) File "C:\Program Files\FreeCAD 0.19\Mod\Importer3D-master\importer3D.py", line 60, in open read(doc, filename) File "C:\Program Files\FreeCAD 0.19\Mod\Importer3D-master\importer3D.py", line 29, in read importMAX.read(doc, filename) File "C:\Program Files\FreeCAD 0.19\Mod\Importer3D-master\importMAX.py", line 1137, in read if (olefile.isOleFile(fileName)): <class 'NameError'>: name 'olefile' is not defined

jmplonka commented 3 years ago

Hello, it looks like that the package "olefile" is not installed! please try the following: open the command line window (type WIN+R and enter cmd in the dialog box) enter FreeCAD bin folder (type cd "C:\Program Files\FreeCAD 0.19\bin" in the command line window) install missing package (type python.exe -m pip install olefile in the command line window)

phillipse01 commented 3 years ago

Got the same "<class 'NameError'>: name 'olefile' is not defined"

Trying the above got me: Requirement already satisfied: olefile in g:\program files\freecad 0.19\bin\lib\site-packages (0.46)

Using Python 3.8.6+

phillipse01 commented 3 years ago

solved by taking the import out of the try statement