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 ab6139b6a4 - Show all commits

View File

@ -90,12 +90,12 @@ NOSTREAM = 0xFFFFFFFF # (-1) unallocated directory entry
UNKNOWN_SIZE = 0x7FFFFFFF UNKNOWN_SIZE = 0x7FFFFFFF
MIN_FILE_SIZE = 1536 MIN_FILE_SIZE = 1536
STGTY_EMPTY = 0 #: empty directory entry STGTY_EMPTY = 0 # empty directory entry
STGTY_STORAGE = 1 #: element is a storage object STGTY_STORAGE = 1 # element is a storage object
STGTY_STREAM = 2 #: element is a stream object STGTY_STREAM = 2 # element is a stream object
STGTY_LOCKBYTES = 3 #: element is an ILockBytes object STGTY_LOCKBYTES = 3 # element is an ILockBytes object
STGTY_PROPERTY = 4 #: element is an IPropertyStorage object STGTY_PROPERTY = 4 # element is an IPropertyStorage object
STGTY_ROOT = 5 #: element is a root storage STGTY_ROOT = 5 # element is a root storage
VT_EMPTY=0; VT_NULL=1; VT_I2=2; VT_I4=3; VT_R4=4; VT_R8=5; VT_CY=6; VT_EMPTY=0; VT_NULL=1; VT_I2=2; VT_I4=3; VT_R4=4; VT_R8=5; VT_CY=6;
VT_DATE=7; VT_BSTR=8; VT_DISPATCH=9; VT_ERROR=10; VT_BOOL=11; VT_DATE=7; VT_BSTR=8; VT_DISPATCH=9; VT_ERROR=10; VT_BOOL=11;
@ -568,22 +568,6 @@ class ImportMaxFile:
sectorsize=self.sectorsize, fat=self.fat, sectorsize=self.sectorsize, fat=self.fat,
filesize=self._filesize) filesize=self._filesize)
def _list(self, files, prefix, node, streams=True, storages=False):
prefix = prefix + [node.name]
for entry in node.kids:
if entry.entry_type == STGTY_STORAGE:
if storages:
files.append(prefix[1:] + [entry.name])
self._list(files, prefix, entry, streams, storages)
elif entry.entry_type == STGTY_STREAM:
if streams:
files.append(prefix[1:] + [entry.name])
def listdir(self, streams=True, storages=False):
files = []
self._list(files, [], self.root, streams, storages)
return files
def _find(self, filename): def _find(self, filename):
if isinstance(filename, str): if isinstance(filename, str):
filename = filename.split('/') filename = filename.split('/')