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 93da464a55 - Show all commits

View File

@ -1287,7 +1287,7 @@ def get_arch_material(ad):
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, 0x02))
material.set('reflect', get_color(ad, 0x05)) material.set('reflect', get_value(ad, 0x05))
material.set('shinines', get_value(ad, 0x0B)) material.set('shinines', get_value(ad, 0x0B))
material.set('transparency', get_value(ad, 0x02)) material.set('transparency', get_value(ad, 0x02))
except: except:
@ -1316,6 +1316,7 @@ def adjust_material(obj, mat):
obj.data.materials.append(objMaterial) obj.data.materials.append(objMaterial)
objMaterial.diffuse_color[:3] = material.get('diffuse', (0.8,0.8,0.8)) objMaterial.diffuse_color[:3] = material.get('diffuse', (0.8,0.8,0.8))
objMaterial.specular_color[:3] = material.get('specular', (1.0,1.0,1.0)) objMaterial.specular_color[:3] = material.get('specular', (1.0,1.0,1.0))
objMaterial.specular_intensity = material.get('reflect', 0.5)
objMaterial.roughness = 1.0 - material.get('shinines', 0.6) objMaterial.roughness = 1.0 - material.get('shinines', 0.6)
@ -1604,7 +1605,6 @@ def load(operator, context, filepath="", scale_objects=1.0, use_material=True,
mscale = mathutils.Matrix.Scale(scale_objects, 4) mscale = mathutils.Matrix.Scale(scale_objects, 4)
if global_matrix is not None: if global_matrix is not None:
mscale = global_matrix @ mscale mscale = global_matrix @ mscale
read(context, filepath, mscale, usemat=use_material, uvmesh=use_uv_mesh, transform=use_apply_matrix) read(context, filepath, mscale, usemat=use_material, uvmesh=use_uv_mesh, transform=use_apply_matrix)
return {'FINISHED'} return {'FINISHED'}