you need to select the mesh first then assign. Thats my bad so: pm.select(i) then use hypershade to assign. Don't have maya on this laptop so cant test :(
Lol, no worries. That got rid of the 'No renderable object is selected' error, but it's still saying 'No shader is selected to be assigned.' Is, "myShader = pm.shadingNode('surfaceShader', asShader = True, n = 'mySurfaceShader')" not enough to create a variable containing my shader? Did I not create my shader correctly? I…
From what I see you need to do something like ssn = pm.ls(type = 'mesh')for i in ssn: assign shader Hopefully I understood your problem but just to clarify you want to assign the mesh to all meshes in the scene right? Does that include the near and far planes? If not then you can just filter them as I see you explicity…
I've written a script in Maya using Pymel that generates a set of visual controls for a depth of field pass. It works (see image)! But the last thing on the wish list is for the surface shader that's required for the render to work be applied to all the objects in the scene. This is my first script, and oddly enough, out…