Hi
this may seem a bit dumb, as i'm new to mel scripting, but i 'm trying to write a script that assigns materials to objects. by watching the mel produced by the gui i have worked out that i need to create a shadergroup (set containing objects to be textured) and connect the outColor attribute of my shader to the surfaceShader attribute of my new surface something like so -
shadingNode -asShader lambert -n shader;
sets -name shaderSG;
connectAttr -f glshader.outColor glshaderSG.surfaceShader;
Unfortunately i get an error saying 'The destination attribute cannot be found' despite the fact that this is the way the gui does it. i realise i'm probably missing something silly here but it is most frustrating. hope somebody can help me here or suggest an alternative way to assign a material to an object in mel.
thanks in advance
tom