I was wondering if one of you knows how to read the property "Emit Diffuse" of a light node through the API (typically a MFnPointLight or a MFnSpotLight).
Regarding the API documentation, this can be accessed through the lightDiffuse() method of the class MFnLight, which returns a boolean value, and which is supposed to be const.
Here's the core of the problem: in a plug-in I'm writing, I've plugged callbacks that are triggered when the lights are modified within Maya, in which I update several properties of associated user-defined data regarding the light properties.
Everything's fine, except when I call at this point the lightDiffuse() method: even if this method is declared const, it seems to modify the Maya light object on which it has been called, resulting in an update callback, resulting in... an ugly stack overflow :)
What I know for sure is that this method does give the "Emit Diffuse" flag since I read it when I initialize side data, before the update callbacks are attached.
As a side interrogation, contrary to other light properties, this lightDiffuse() method does not seem to have a corresponding setter method, so maybe I'm not accessing it the proper way.
What I'm wondering is whether one of you guys know a workaround or another way to read this flag, and only read it :)
Just in case this is relevant, I'm working on both Maya 2012 and 2013 (SP2), on Win7_64.
Thanks in advance for any answer!