@publisher(LOOK_DEV_TYPES)
def check_objects_still_using_default_shader():
    # skip if this is a representation
    v = staging.get('version')
    if v and Representation.repr_separator in v.take_name:
        return

    objects_with_default_material = mc.sets('initialShadingGroup', q=1)
    if objects_with_default_material and len(objects_with_default_material):
        mc.select(objects_with_default_material)
        raise PublishError(
            'There are objects still using <b>initialShadingGroup</b><br><br>'
            '%s<br><br>Please assign a proper material to them' %
            '<br>'.join(
                objects_with_default_material[:MAX_NODE_DISPLAY]
            )
        )
check if there are objects still using the default shader
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/publish.py/check_objects_still_using_default_shader