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 28c6317302 - Show all commits

View File

@ -389,7 +389,7 @@ class MaxFileDirEntry:
self.is_minifat = False self.is_minifat = False
if self.entry_type in (STGTY_ROOT, STGTY_STREAM) and self.size > 0: if self.entry_type in (STGTY_ROOT, STGTY_STREAM) and self.size > 0:
if self.size < maxfile.minisectorcutoff \ if self.size < maxfile.minisectorcutoff \
and self.entry_type == STGTY_STREAM: # only streams can be in MiniFAT and self.entry_type == STGTY_STREAM: # only streams can be in MiniFAT
self.is_minifat = True self.is_minifat = True
else: else:
self.is_minifat = False self.is_minifat = False
@ -563,7 +563,7 @@ class ImportMaxFile:
if minifat: if minifat:
used_streams = self._used_streams_minifat used_streams = self._used_streams_minifat
else: else:
if first_sect in (DIFSECT,FATSECT,ENDOFCHAIN,FREESECT): if first_sect in (DIFSECT, FATSECT, ENDOFCHAIN, FREESECT):
return return
used_streams = self._used_streams_fat used_streams = self._used_streams_fat
if first_sect in used_streams: if first_sect in used_streams:
@ -597,7 +597,7 @@ class ImportMaxFile:
self.fat = array.array('I') self.fat = array.array('I')
self.loadfat_sect(sect) self.loadfat_sect(sect)
if self.num_difat_sectors != 0: if self.num_difat_sectors != 0:
nb_difat_sectors = (self.sectorsize//4) - 1 nb_difat_sectors = (self.sectorsize // 4) - 1
nb_difat = (self.num_fat_sectors - 109 + nb_difat_sectors - 1) // nb_difat_sectors nb_difat = (self.num_fat_sectors - 109 + nb_difat_sectors - 1) // nb_difat_sectors
isect_difat = self.first_difat_sector isect_difat = self.first_difat_sector
for i in range(nb_difat): for i in range(nb_difat):
@ -1177,7 +1177,7 @@ def get_scale(pos):
if (scale is None): if (scale is None):
scale = pos.get_first(0x2505) scale = pos.get_first(0x2505)
pos = scale.data pos = scale.data
elif (uid == 0x442315): # TCB Zoom elif (uid == 0x442315): # TCB Zoom
scale = pos.get_first(0x2501) scale = pos.get_first(0x2501)
if (scale is None): if (scale is None):
scale = pos.get_first(0x2505) scale = pos.get_first(0x2505)