how to get texture Image Contents Hash property.

I want to write a function that can delete the same texture in my project, even those textures content are same, but have different name, just like the texture duplicated from the other one. At the beginning, i use GetPixels() function to get pixels for texture’s comparison, but the data is gigantic, then i found “Image Contents Hash” property(Byte[16]) of the texture in Debug mode, and i found even if a pixel change in a texture, this property will change too, so i want to use this property for comparison, now i can get all the textures in the project by script, but i don’t know how to get this one. can anyone tell me, i am really appreciate about it. Sorry for my poor English.

@canonner You can use SerializedProperty to get it. What you do with the bytes is up to you! For example:

Texture tex = Selection.activeObject as Texture;
if (tex == null)
{
	return;
}
List<byte> bytes = new List<byte> (16);
SerializedProperty sp = new SerializedObject (tex).FindProperty ("m_ImageContentsHash");
while (sp.Next (true) && sp.propertyPath.StartsWith ("m_ImageContentsHash"))
	bytes.Add ((byte)sp.intValue);

Hi,

Here is a discussion that shares your proposed solution. Perhaps contacting those authors directly will help you find a solution.

Best wishes!

-Sam