Vray User Scalar tutorial

I use the same technique.
The switch node is bad because with have a connection between shaders and shapes. If you export shaders, your connection with the swtich node will be broken.