INNER CODE UNIT · Python
delete_missing_textures
VITA-Group/Diffusion4D · rendering/blender.py:487
def delete_missing_textures() -> Dict[str, Any]:
"""Deletes all missing textures in the scene.
Returns:
Dict[str, Any]: Dictionary with keys "count", "files", and "file_path_to_color".
"count" is the number of missing textures, "files" is a list of the missing
texture file paths, and "file_path_to_color" is a dictionary mapping the
missing texture file paths to a random color.
"""
missing_file_count = 0
out_files = []
file_path_to_color = {}
# Check all materials in the scene
for material in bpy.data.materials:
if material.use_nodes:
for node in material.node_tree.nodes:
if node.type == "TEX_IMAGE":