Since the aforementioned attribute is simply an attribute of a DAG object, we can obtain it very easily in many ways. For example, it can be obtained in Python or MEL through the following scripts.
import maya.cmds as cmds centerOfIllumination = cmds.getAttr("lightName.centerOfIllumination") ---- float $centerOfIllumination = `getAttr "lightName.centerOfIllumination"`;
The attribute can also be obtained using the C++ API with any object that is, or inherits from, MFnLight, as the following example shows.
const MFnLight light(mayaObjectOrDagPath); const double centerOfIllumination = light.centerOfIllumination();
This attribute is easy to edit within Maya and easy to acquire for exporting. It is not ideal for work strictly within Maya, as it does not directly affect the resulting lighting, and is not visible in the default viewports. It is, however, a good option for exporting, and a fantastic option for viewport overrides within Maya that could use this attribute for their light sources’ radius and range.