PDA

View Full Version : Getter on the "Emit Diffuse" flag in the API


gsourima
11-13-2012, 07:31 AM
Good morning everyone,

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!

CGTalk Moderation
11-13-2012, 07:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.