I have a code where I create a shader and apply it to an object.
However when i run the code again it creates entirely new nodes and applies 
to the object.
Is there a way to delete the previous node so it doesnt clog up the 
hypershade?

exampleCode:

testPlane = cmds.polyPlane(name = 'test', width = widthTop/100, height = 
heightTop/100, sx=0, sy = 0)

shaderT = cmds.shadingNode('testNode', asShader=True)

shading_group1 = cmds.sets(renderable=True, noSurfaceShader=True, empty=True)

cmds.connectAttr('%s.outColor' % shaderT, '%s.surfaceShader' % shading_group1)

cmds.select('test')
cmds.hyperShade(assign = shading_group1)



-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2fbf6ebd-47f6-47c1-b53e-1f3e42127c68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to