Material_Id issue when identifying a ON_Material

Hi Experts,

I assigned the same on_material to different Rhino objects. I am trying to check if the on_material attached these different Rhino objects are the same by m_material_id, I found these m_material_id of on_material attached on these Rhino objects are completely different.

In the file “opennurbs_material.h”, there are such comments for m_material_id as below:
// The only reliable and persistent way to reference
// materials is by the material_id.
ON_UUID m_material_id;

My question is: Is m_material_id the only way to identify a ON_Material object from another ON_Material object? If yes, then can i say the same on_material attached on Rhino objects should have the same m_material_id?

Here are some sample codes to get the m_material_id:
ON_Material onMaterial;
pONxModel->GetRenderMaterial(pONxObj->m_attributes, onMaterial);
ON_UUID uuid = onMaterial.m_material_id;

Appreciated for your help.

Thanks
Qin

Objects track their render material by its index in the material table.

ON_3dmObjectAttributes::m_material_index

Does this help?