nrgsille76 / io_scene_max

Blender Autodesk MAX Importer
https://extensions.blender.org/add-ons/io-scene-max
GNU General Public License v2.0
27 stars 4 forks source link

Multi materials issue #7

Open claro-lima opened 4 months ago

claro-lima commented 4 months ago

In models with more than one material, only the first one is applied to the entire mesh.

nrgsille76 commented 4 months ago

@claro-lima Can you upload the file wich makes problems? Or at least send me the console output? All error will be collected in console output. Multi materials are usually supported, if they are assigned to the polygons and if they are located in the multi-/sub material directory. But if one material fails because of wrong data format then that part will be skipped.

claro-lima commented 4 months ago

Hi, I think the problem is with Maxtree models. Other models from Dimensiva or 3dSky are imported correctly. Great addon. Thank You.

3deutig commented 4 months ago

hi together, we are a small cgi productionstudio and switching from max to blender about 6 Months ago and are very interested in such a tool and maybe could help you in some cases. for the problems from claro-lima. yes we could repruduze this also and found that in max/vray the Vray2SidedMtl is the problem, if this is pluged into the submaterial slot the import stops and the rest of the submaterial and material ids are gone.

we found also another issue so if there are more than just one UV Channels only the first would be imported.

if you want we could easily prepares you scenes for it, please let me know.

please write me an mail so we can directly work on that. (jens@3deutig.com)

bye, Jens

nrgsille76 commented 4 months ago

@3deutig Yea I removed importing mutiple UV maps because Blender does not support multiple UVs properly. Only the first imported is showing up, all other have vertices on zero position. The script now always checks the array compabilty of the UV map, and chooses the first map wich is compatible. I noticed that also boxmapping is included wich blender does not support.

By now only VrayMtl and VrayNormalmap is supported, blender always uses single sided faces for double sided faces they have to be doublicated and normal flipped wich I have not implemented in my script

schroef commented 4 months ago

@3deutig Yea I removed importing mutiple UV maps because Blender does not support multiple UVs properly. Only the first imported is showing up, all other have vertices on zero position. The script now always checks the array compabilty of the UV map, and chooses the first map wich is compatible. I noticed that also boxmapping is included wich blender does not support.

By now only VrayMtl and VrayNormalmap is supported, blender always uses single sided faces for double sided faces they have to be doublicated and normal flipped wich I have not implemented in my script

What do you mean it doesnt support "multi-uv" properly. It works, perhaps different from other apps.

schroef commented 4 months ago

VrayMtl

If a material is double sided. Lots of them use translucency for that. So use a altered or dedicated map for this and add a translucency shader and mix it. Other addons also do this when other apps call it a "2 sided" material

3deutig commented 3 months ago

hi everybody, sorry for my late reply.

as schroef wrote, blender supports multiple uv maps and on the fbx side it works. so there must be a way for importing this directly...hope so:,-)

for the vray specified thing, it is only a shader thing so can you please instead of stopp the import uses an alternative shader like you did for vraymtl?

anothe request ... it is possible to have an import to convert max layers to blender collections? and the max file we opened in blender seams to be locked, right?

many thanks! and if we could help you with some sampe files please let us know.

bye, jens

SkipzNL commented 3 months ago

Awesome plugin, I've got many older 3ds Max files I have direct access to now. But I have the same issue as @claro-lima .

It's with XFrog models which have a Multi-Sub-Object material with Standard materials under them. (As far as I can see now, could also be converted Arch & Design materials) I can email you an .MAX scene if you'd like, I don't want to attach it here due to license restrictions.

TLarchviz commented 5 days ago

Hey there, really nice plugin! Unfortunately got the same issue as others. And yes most likely 2 sided materials (so almost every proper made vegetation/tree/plant) are the culprit. It's a pity because I don't really mind having to set up materials from scratch (i dont expect to have the addon import ready made materials) but if you loose ALL IDs + UV then it's unusable. And as previously mentioned it should be possible with blender since if you just import FBX you get all IDS + UV kept the same way they were in 3ds max.

Fix this and it's gonna be golden!

nrgsille76 commented 4 days ago

@TLarchviz Yes I am aware of this problem, multi materials are not supported with editable mesh objects. I have not found the chunk where the material information is stored. In an editable poly object the info is stored inside the face chunk together with the face id but this is not the case with an editable mesh object. Below I printed out the chunk ids, chunk length and the first 4 bytes inside the bracets. meshchunks

0x906 unknown, includes only one number 0x908 is mesh id 0x914 vertex vectors 0x912 faces vert ids 0x924 flag, includes either 0 or 1 0x928 flag, includes either 0 or 1 0x92A flag, includes either 0 or 1 0x959 flag, includes either 0 or 1 0x2398 uv key,0 for boxmap, 1 for texture coordinates 0x2394 texture coordinates in UVW format 0x2396 uv face ids must be the same amount as 0x912

For material usually only one number per face is needed for the material slot but I do not know where this is stored in an editable mesh object. If anyone knows how to get that info, then I will be able to fix it.