I am not a blender developer, but a python developer. I wanna create some validation scripts that I can use to assure that we don't keep orphan nodes in the blend file. One thing that I wanna do is to find out if there are any NOT used materials in the file. I wanna implement the is_used method below, that should return True only if the material is used in the blend file, and False if it is an orphan material that is just remaining in the blend file.
def is_used(material): pass for material in bpy.data.materials: if not is_used(material): print('material %s is not used' % material)