material.py 819 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos and contributors.
  2. # All rights reserved.
  3. # Code licensed under the BSD License.
  4. # http://www.anki3d.org/LICENSE
  5. # keep methods in alphabetical order
  6. # blender imports
  7. import bpy
  8. bl_info = {"author": "A. A. Kalugin Jr."}
  9. def get_texture_images_nodes():
  10. """
  11. Gets the blender images using the materials
  12. """
  13. bl_images = []
  14. mats = bpy.data.materials
  15. for mat in mats:
  16. for slot in mat.texture_slots:
  17. if slot:
  18. if slot.texture.type == 'IMAGE':
  19. if (slot.texture.image != None):
  20. bl_images.append(slot.texture.image)
  21. return bl_images
  22. def check_material(self, material):
  23. if material is not None:
  24. if material.use_nodes:
  25. if material.active_node_material is not None:
  26. return True
  27. return False
  28. return True
  29. return False