3
11

New Addon: Import Autodesk .max #22

Closed
Sebastian Sille wants to merge 38 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 94b6787948 - Show all commits

View File

@ -775,8 +775,8 @@ class MaxChunk():
def __str__(self):
if (self.unknown == True):
return "%s[%4x] %04X: %s" %("" * self.level, self.number, self.types, ":".join("%02x"%(c) for c in self.data))
return "%s[%4x] %04X: %s=%s" %("" * self.level, self.number, self.types, self.format, self.data)
return "%s[%4x] %04X: %s" %(""*self.level, self.number, self.types, ":".join("%02x"%(c) for c in self.data))
return "%s[%4x] %04X: %s=%s" %(""*self.level, self.number, self.types, self.format, self.data)
class ByteArrayChunk(MaxChunk):
@ -864,8 +864,8 @@ class ContainerChunk(MaxChunk):
def __str__(self):
if (self.unknown == True):
return "%s[%4x] %04X" %("" * self.level, self.number, self.types)
return "%s[%4x] %04X: %s" %("" * self.level, self.number, self.types, self.format)
return "%s[%4x] %04X" %(""*self.level, self.number, self.types)
return "%s[%4x] %04X: %s" %(""*self.level, self.number, self.types, self.format)
def get_first(self, types):
for child in self.children:
@ -889,8 +889,8 @@ class SceneChunk(ContainerChunk):
def __str__(self):
if (self.unknown == True):
return "%s[%4x] %s" %("" * self.level, self.number, get_class_name(self))
return "%s[%4x] %s: %s" %("" * self.level, self.number, get_class_name(self), self.format)
return "%s[%4x] %s" %(""*self.level, self.number, get_class_name(self))
return "%s[%4x] %s: %s" %(""*self.level, self.number, get_class_name(self), self.format)
def set_data(self, data):
previous = None
@ -915,7 +915,7 @@ class ChunkReader():
short, ofst = get_long(data, ofst)
if (short == 0xB000000):
data = zlib.decompress(data, zlib.MAX_WBITS|32)
print(" reading '%s'..."%self.name, len(data))
print(" reading '%s'..." %self.name, len(data))
while offset < len(data):
old = offset
offset, chunk = self.get_next_chunk(data, offset, level, len(chunks), containerReader, primitiveReader)
@ -1466,7 +1466,6 @@ def get_poly_data(chunk):
def create_editable_poly(context, node, msh, mat, mtx, umt, uvm):
coords = point4i = point6i = pointNi = None
name = node.get_first(TYP_NAME).data
poly = msh.get_first(0x08FE)
created = False
lidx = []
@ -1606,7 +1605,6 @@ def load(operator, context, filepath="", scale_objects=1.0, use_material=True,
mscale = mathutils.Matrix.Scale(scale_objects, 4)
if global_matrix is not None:
mscale = global_matrix @ mscale
read(context, filepath, mscale, usemat=use_material, uvmesh=use_uv_mesh, transform=use_apply_matrix)
return {'FINISHED'}