miContourEnable is enabled but still it doesnt gets updated on selection ch
def update():
shapes = cmds.ls(sl = True, o = True, dag = True, s = True)
if len(shapes) == 0:
materials = "lambert1";
else:
shadingEngines = str(cmds.listConnections(shapes, type = "shadingEngine")[0])
#connected materials
materials = str(cmds.ls(cmds.listConnections(shadingEngines), materials = True)[0])
print cmds.nodeType(materials)
if cmds.nodeType(materials)=='surfaceShader':
contourControl=cmds.attrControlGrp("contourControl",edit= True,attribute='contourSG.miContourWidth', l='Contour Width' )
return contourControl
else:
contourControl=cmds.attrControlGrp("contourControl",edit= True,attribute=shadingEngines+'.miContourWidth', l='Contour Width' )
return contourControl
cmds.window( title='Contour Widths' )
cmds.columnLayout()
cmds.attrControlGrp("contourControl",attribute='initialShadingGroup.miContourWidth', l='Contour Width' )
cmds.scriptJob(parent="wirewidthControl",e=["SelectionChanged","update()"])
cmds.showWindow()