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 4cb429054f - Show all commits

View File

@ -1244,7 +1244,7 @@ def get_color(colors, idx):
def get_value(colors, idx): def get_value(colors, idx):
prop = get_property(colors, idx) prop = get_property(colors, idx)
if (prop is not None): if (prop is not None):
siz = 15 if (len(prop.data) > 23) else 6 siz = 15 if (len(prop.data) > 19) else 6
val, offset = get_float(prop.data, siz) val, offset = get_float(prop.data, siz)
return val return val
return None return None
@ -1273,10 +1273,9 @@ def get_vray_material(vry):
material = Material() material = Material()
try: try:
material.set('diffuse', get_color(vry, 0x01)) material.set('diffuse', get_color(vry, 0x01))
material.set('ambient', get_color(vry, 0x02)) material.set('specular', get_color(vry, 0x02))
material.set('specular', get_color(vry, 0x05)) material.set('reflect', get_value(vry, 0x04))
material.set('emissive', get_color(vry, 0x05)) material.set('shinines', get_value(vry, 0x0A))
material.set('shinines', get_value(vry, 0x0B))
material.set('transparency', get_value(vry, 0x02)) material.set('transparency', get_value(vry, 0x02))
except: except:
pass pass
@ -1287,9 +1286,8 @@ def get_arch_material(ad):
material = Material() material = Material()
try: try:
material.set('diffuse', get_color(ad, 0x1A)) material.set('diffuse', get_color(ad, 0x1A))
material.set('ambient', get_color(ad, 0x02)) material.set('specular', get_color(ad, 0x02))
material.set('specular', get_color(ad, 0x05)) material.set('reflect', get_color(ad, 0x05))
material.set('emissive', get_color(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: