This script is problematic. It’s better than nothing, but it doesn’t detect all materials and it creates multiple materials with the same name - not ideal. The FBX import, now official, is better in that multiple materials with the same name are given a number. This actually makes the situation a little worse. [edit, nevermind, it always did that, see below]
I have a new (relatively… forgot to post about it), much smaller script that does the same thing better. The old script’s original intention was to convert Architectural materials as best it could to Standard. As the versions progressed past 2011 (most of the work was done by April 2011), new Architectural material types were added. This means that for some materials, the old script fails and completely skips over them.
The new script accepts all materials and assigns a random color that you can fix later… but it still creates multiple materials with the same name. On small projects this should be ok - its the name you want, and you can fix the multiple material problem in Blender if you don’t have too many of them.
I have tested the new Blender FBX importer in the official release. Architectural materials are still completely unsupported. Just like before, Blender will simply not see the material, not even the name. If you have 3DSMax to run the script in, give my workflow a shot, and you’ll be able to work around it.
Edit/Update:
It appears I forgot my own workflow. If you don’t want multiple same-name materials as explained above, you’re still going to have to export to OBJ from Max, and avoid using Blender’s FBX importer. The 3DSMAX OBJ exporter will solve the multiple materials problem.
/*
Material Converter by Christian Storay
September 12th, 2013
*/
fn allMats objectsInScene objMatType index =
(
if index == -1 then -- IF NOT INSIDE A MULTIMAT
(
--remember original name
originalName = objectsInScene.material.name
-- change material to Standard
objectsInScene.material = Standardmaterial ()
--apply name and random color
objectsInScene.material.name = originalName
r = random 0 255
g = random 0 255
b = random 0 255
objectsInScene.material.diffuse = color r g b
)
else -- IF INSIDE A MULTIMAT
(
--remember original name
originalName = objectsInScene.material.materialList[index].name
-- change material to Standard
objectsInScene.material.materialList[index] = Standardmaterial ()
--apply name and random color
objectsInScene.material.materialList[index].name = originalName
r = random 0 255
g = random 0 255
b = random 0 255
objectsInScene.material.materialList[index].diffuse = color r g b
)
)
for objInScn in geometry do
(
matType = objInScn.material as string -- material name and type return as string
-- Parse Multimaterials by index and apply the same rules above
if matchPattern matType pattern:"#Multi/Sub-Object:*" then
(
indexCount = 1
for miniMats in objInScn.material.materialList do
(
miniMatType = miniMats as string -- this will give a name, like MaterialName:Standard
-- evaluate in Multimat Mode
allMats objInScn miniMatType indexCount
indexCount = indexCount + 1
)
)
else
(
-- evaluate
allMats objInScn matType -1
)
)
Save to materialconvert18.ms
edit:
scale your final model by 0.08333 (1/12) if you want 1 blender unit = 1 foot. If you don’t, and assuming you didn’t use clamp in the obj importer, 1 unit = 1 inch.