I want to manage a list of image in a collection, but I need to search the image in bpy.images.data, but is a Panel class, so it make a lot of refresh. I've create a ID prop to bpy.type.Image, so each image ave a unique ID wich I assign in other process. The collections prop have the ID of the image, bat the only way is to make a for:
name = "no image" images = bpy.data.images if bpy.context.scene.paintPBR_index > -1: for img in images: if img.id_pbrpainter == layer.image_ID and img.id_pbrpainter != 0: #print("get_image") name = img.name return name
There is a way to search the image in bpy.data.images by the custom prop?