[MAXScript] Get HLSL annotations in MaxScript

max
shaders

#1

Hey guys,

I’m currently working on a scripted material plugin for Max 2013 that extends the DirectX_9_Shader class, overrides its interface (replaceUI:true) and tries to build its own UI so that I get more control over what the user can actually see and do. The problem is that once I’ve loaded and compiled a FX file into my shader, I can access all the properties from the HLSL source code using their variable names but I cannot find the UINames declared through annotations. For example, given this code:

texture _0Texture00 : DIFFUSE <
string ResourceName = "";
string UIName = "Diffuse_Map";
>;

The delegate (DirectX_9_Shader) of my own class will have the property “._0Texture00 : bitmap”, but it doesn’t seem to store the UIName annotation value anywhere.
Max does load those annotation, since the default DirectX_9_Shader class use them to build its own UI but it doesn’t seem to expose them to MaxScript. Is there any way to find those values somewhere?

Cheers!