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 0a51bb4054 - Show all commits

View File

@ -671,7 +671,6 @@ class MaxChunk():
self.unknown = True
self.format = None
self.data = None
self.resolved = False
def __str__(self):
if (self.unknown == True):
@ -701,17 +700,6 @@ class ByteArrayChunk(MaxChunk):
except:
self.data = data
def set_le16_string(self, data):
try:
long, offset = get_long(data, 0)
self.data = data[offset:offset + l * 2].decode('utf-16-le')
if (self.data[-1] == b'\0'):
self.data = self.data[0:-1]
self.format = "LStr16"
self.unknown = False
except:
self.data = data
def set_data(self, data):
if (self.types in [0x0340, 0x4001, 0x0456, 0x0962]):
self.set_string(data)
@ -1500,7 +1488,7 @@ def create_object(context, node, mscale, usemat, uvmesh, transform):
created, uid = create_mesh(context, node, msh, mtx, mat, usemat, uvmesh)
def make_scene(context, mscale, usemat, uvmesh, transform, parent, level=0):
def make_scene(context, mscale, usemat, uvmesh, transform, parent):
for chunk in parent.children:
if (isinstance(chunk, SceneChunk)):
if ((get_guid(chunk) == 0x01) and (get_super_id(chunk) == 0x01)):
@ -1513,7 +1501,7 @@ def make_scene(context, mscale, usemat, uvmesh, transform, parent, level=0):
def read_scene(context, maxfile, filename, mscale, usemat, uvmesh, transform):
global SCENE_LIST
SCENE_LIST = read_chunks(maxfile, 'Scene', filename+'.Scn.bin', containerReader=SceneChunk)
make_scene(context, mscale, usemat, uvmesh, transform, SCENE_LIST[0], 0)
make_scene(context, mscale, usemat, uvmesh, transform, SCENE_LIST[0])
def read(context, filename, mscale, usemat, uvmesh, transform):