I'm writing a script that creates a few bpy.data.textures
objects, adds textures to them then adds a few custom properties. These textures will then be applied to the materials in the scene but before export, I need to get those properties again.
I found a code that gets all texture nodes from scene objects but I don't understand how to get the data object from the 'TEX_IMAGE' node.
import bpy
textures = []
for ob in bpy.data.objects:
if ob.type == "MESH":
for mat_slot in ob.material_slots:
if mat_slot.material:
if mat_slot.material.node_tree:
textures.extend([x for x in mat_slot.material.node_tree.nodes if x.type=='TEX_IMAGE'])
print(textures)
```
bpy.data.textures
, then create a loop whereimage_texture_node.image
compared withdata_texture.image
$\endgroup$