If different parts of the object belong to different shading
groups, then the list of lights is the union of object and shading
group linked lights, where the ignored lights have been
removed. The code to compute lightList will look like:
for each face group on the object, corresponding to each shading
engine, do the following:
MObject nullObj; // A void component object
getLinkedLights(objectPath, nullObj, ObjectLink); // Lights linked to the whole object
getIgnoredLights(objectPath, nullObj, ObjectIgnore); // Lights ignored on the whole object
getLinkedLights(objectPath, component, FaceLink); // Lights linked to the face component
getIgnoredLights(objectPath, component, FaceIgnore); // Lights ignored for the face component
For the given face group, the set of lights illuminating it are
then (ObjectLink - FaceIgnore) + (FaceLink - ObjectIgnore). It is important to note that component linking works at the
granularity of a shading group on a surface. In order to get
results from the MLightLinks API, it is necessary to pass in
components that correspond exactly to all the faces on that object
in a particular shading group. For example, if
pPlaneShape1.f[0:10] belongs to a shading group which is linked to
a given light, then there will be no result from
MLightLinks::getLinkedLights() if the argument is set to
pPlaneShape1.f[0], or pPlaneShape1.f[0:5], or pPlaneShape1.f[10],
etc - it must be exactly pPlaneShape1.f[0:10].