Hiding variables in HLSL/CGFX shaders in Maya

I’m trying to hide some variables from showing up in the attribute editor on a HLSL shader by using the <string UIWidget = “None”;> annotation, but that doesn’t seem to stop maya from still creating UI elements.

What i am basically doing is exposing UV Repeat, UV Offset and UV Rotate to the HLSL shader so a place2dTexture Node can be plugged in. However, I don’t want these values to show up with the rest of the shader’s options.

Anyone have any luck controlling which variables are exposed as visible versus hidden attributes on a HLSL shader?


Try using the “SasUiVisible” annotation. I don’t see UIWidget as being handled.

BTW, if you look at hlslShader.cpp that ships with the Maya dev-kit, you can see the other annotations and parameters supported by the hlslShader.


thanks for the tip!

So I tried out:
float2 UV_Offset < bool SasUiVisible = false; >;
it not only hid the attribute from the AE, it also removed it completely from the Shader… :frowning:

after looking through the .cpp file, the only way I can hide attributes is to embed certain strings in their name, like “color” or “diffuse”…
For example, if i do:
float2 UV_Offset = {0.0, 0.0};
the attribute is visible in the AE as expected, however, if i name it like so:
float2 Diffuse_UV_Offset = {0.0, 0.0};
the attribute gets hidden without using an additional annotations…