I'm trying to follow the advice given on using mental ray user data in maya given on the Los Angelese Mental Ray User Group ( http://www.lamrug.org/resources/userdatatips.html ) but I've hit a problem and I just cannot figure out where I'm going wrong. I've copied the provided .c and .mi files, compiled the shader, and added it to my mental ray search paths so that the nodes appear in maya. In my scene I create a cube, and assign a lambert to it, then create an instance_color node and connect that to the colour of my lambert. Then I add an miData message attribute to my cube shape, create a color_data node, and connect the message output of that to the miData attribute, but when I try to render the colour from my instance_color node always comes out as black.
I've done some exploring in the shader and it seems like the shader is failing when it gets to the line mi_query(miQ_DATA_PARAM_SIZE, state, user_data_tag, &size) - this query returns a false. I've tried exporting my scene as an .mi file, and it looks like the color_data is in there, and is connected to the cube object, so I'm completely stumped as to where I'm going wrong. Has anyone tried using that LAMRUG tutorial? Is there something I'm missing?
Thanks in advance for your help!