material conversion script.

hi guys, i need to do one of two things… hoping somebody has a trick.

EITHER : change wirecolor of all objects to match diffuse swatch color in assigned material - i have “wirecolor toolbox” script, which does this, but it does not work with autodesk physical material, and the models i have are using those.

i have contacted the author of the script, but ive not heard back, and its super urgent.

OR: convert all physical materials in scene to architectural or standard materials, keeping diffuse colour the same. -this would allow me to use the above script.

any suggestions? ideally i need a solution today!

could probably be made simpler and add error checking, but this should do the job assuming all geometry has physcial materials applied:


(
obj = for o in geometry collect o
for i = 1 to obj.count do obj[i].wirecolor = obj[i].material.base_color
)

if you mean the generic autodesk material, then try this one instead:


(
obj = for o in geometry collect o
for i = 1 to obj.count do obj[i].wirecolor = obj[i].material.Generic_Color
)

you’ll get errors if there’s other types of materials in scene (somebody else can chime in with error checking or making it simpler)

thanks Morne that worked a treat. i really need to learn some simple scripting.. been saying it for years.