Notifications
Clear all

[Closed] Accessing maps in non-standard materials

Hi all,

This is my 1st script so sorry if it’s a redundant question. We’re using 2 custom shaders in Max. One is the shader for export to our engine and the other is a .fx file that emulates the former in the Max viewer. I’m writing a script that allows the artist to easily go between the two. So far I’m able to get at all the parameters via the Listener. However, I can’t seem to find a way to access the multiple texture maps we are using in either. I’ve seen reference to accessing them in a standard material but they don’t seem to work for a custom material. Any help would be appreciated.

Thanks in advance
Jonathan

2 Replies

A question
Which channel do you hold the texturemap in your custom material ?

It really depends on the material. Different materials use different approaches to expose their maps. For example, Max’ materials use different methods than, say, Brazil’s materials.

One way would be to use showProperties on an instance of the corresponding material to see what properties it exposes.
Another way would be to check the TrackView structure of the material and use indexed access to the sub-tracks to access the maps. (Some shaders, unfortunately, don’t let you set values there, just get them).

Lastly, if you know the guy who wrote the custom material, you could just ask him how he has exposed the maps to MAXscript…