Hello,
in my code, i have a raycast like so:
obj, point, _ = own.rayCast(some_other_obj, None, 100)
i know how to check objects for a property (that is, if "property" in obj
)
but how do i check if obj
has a material (say Wall-01
) or not?
after a quick look at the docs, i found the solution
https://docs.blender.org/api/blender_python_api_2_62_release/bge.types.html#bge.types.KX_MeshProxy
for i in obj.meshes:
for j in i.materials:
if j.material == "Material_name":
# obj has the material
print( obj )