ScriptSpot

Forum topic · General Scripting

Material to mxs

By JokerMartini · 2011-11-23

Description

So I'm thinking about working on a script that will take the actively selected material in the material editor and convert it to maxscript.

The returned maxscript will then recreate that shader when exectued.

I however want to make it so the script itself will bypass anything images or texture maps. So it is only really controlling values and properties.

Does anyone know if anything out there is already created to do this? Otherwise I'm not going to mess around with it.

Comments (3)

Cool

JokerMartini · 2011-11-23

Thanks Anubis I'll check it out

A start

JokerMartini · 2011-11-23

Here is the start.
Why does this bug out? It actually works for the first bit of it if you comment out some of the properties

mat = meditMaterials[1]
type = classof meditMaterials[1]

clearlistener()

format "%%\n" type " \\"

for p in getPropNames mat do
(
format "%:% " (substring (p as string) 1 -1) (getProperty mat p)
)