New Addon: Import Autodesk .max #105013

Closed
Sebastian Sille wants to merge 136 commits from (deleted):nrgsille-import_max into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit f50fc1533e - Show all commits

View File

@ -620,7 +620,7 @@ class ImportMaxFile:
try: try:
self.fp.seek(self.sectorsize * (sect + 1)) self.fp.seek(self.sectorsize * (sect + 1))
except: except:
print('IndexError: MAX sector index out of range') print('IndexError: Sector index out of range')
sector = self.fp.read(self.sectorsize) sector = self.fp.read(self.sectorsize)
return sector return sector
@ -693,9 +693,6 @@ class ImportMaxFile:
return self.root.name return self.root.name
def getproperties(self, filename): def getproperties(self, filename):
streampath = filename
if not isinstance(streampath, str):
streampath = '/'.join(streampath)
fp = self.openstream(filename) fp = self.openstream(filename)
data = {} data = {}
try: try:
@ -1296,7 +1293,8 @@ def get_arch_material(ad):
material = Material() material = Material()
try: try:
material.set('diffuse', get_color(ad, 0x1A)) material.set('diffuse', get_color(ad, 0x1A))
material.set('specular', get_color(ad, 0x02)) material.set('specular', get_color(ad, 0x05))
material.set('shinines', get_value(ad, 0x0B))
except: except:
pass pass
return material return material