How to know if a material is emissive or not?


So, I have a CRhinoMaterial, and would like to know if it has an emissive property or not.

What would be the correct way of doing this?

Is this pseudo-code okay :

ON_Color rhinoColorEmissive = currentMaterial.Emission();
	if (rhinoColorEmissive != NULL)
		// THe material contains emission ?

Is this the way to proceed ? Thanks!

If ON_Color is not black you have an emission.

Hi @jesterking,
Thank you for the answer. Could you provide with a bit more explanation on why and how is it so?
Also, how would I determine if the material has other properties like specular, metallic or not? Is there any way of knowing that?

Emissivr color is added to the shaded result. When it is black there is no change to the normal shaded result. It isn’t proper emission, mind you.

Asking for the other properties is a good reason to use the RDK materials, as explained by @andy earlier. See the SmellsLike functions on the base CRhRdkMaterial class.