mmFalloffSpotLight.mel
 |
|

Description:
Creates a spotlight that gives you precise control over it's brightness
in relation to it's distance. Regions can be intuitively adjusted in
Maya's viewport by using the light's standard decay-region
manipulators. The light will give you control over 5 different regions.
Works both with Mental Ray and Maya Software Renderer.
- Max Brightness Region: The shines with the highest, constant intensity in this area.
- Near
Fallof & Far Falloff Cone: Area in which the light;s intensity will
be defined by a linear falloff, ranging from it's maxBrightness to it's
near- or farBrightness region.
- Near
Brigthess & Far Brightness Region: In this area the light shines
with a constant intensity (which is in all cases must be less or equal
to it's maxBrightness).
|
|

Instructions:
- Copy the mel-file into Maya's script directory and source the script (source "mmFalloffSpotLight.mel";)
- To create a light, type the following command mmFalloffSpotlight(); or assign it to a shelf-button.
- A new spotlight will be created. At the first glance, it's indistinguishable from Maya's default-spotlight,
except
for a couple of new attributes. You will also notice that the light's
intensity attribute has an incoming connection. It's intensity must be
controlled using maxBrightness, nearBrightness and farBrightness
The maxBrightness controls the spotlight's intensity in the
maxBrightness region. It's an absolute value and the light intensity in
that area will be constant.
|
|
The nearBrightness and farBrightness attributes are relative values,
which are indicating their intensity in relation to the maxBrightness
(0 means "no light", 1 means "as bright as maxBrightness", 0.4 means
"40% intensity of maxBrightness" and so on...)
The fields nearValue and Far Value indicate the light intensity in
these areas as absolute values. The values from the example above will
result in the followong light distribution:

-
In order to adjust the light's decay in various areas, select it and
press "T". A manipulator will pop-up. Click on it for 5 times (until
the indicator is at 7 o`clock). Left- or middle-mouse drag any of the
four circles. The space between the 1st & 2nd and between the 3rd
& 4th circle are the falloff regions with linear light decay. The
space in the middle is the maxBrightness region. The area before and
after the regions mentioned above are the Near- and Far Brightness.
|

|
|

Bugs, Limitations and Workarounds:
- Deleting
a mmFalloffSpotLight: The script creates the spotlight and a couple of
additional shading nodes. Deleting the light from the outliner will not
remove those nodes from the scene. To get rid of the nodes, manually
delete the whole network, using the hyperShade or use "delete unused
nodes" after deleting the light.
- There
are two more circle-shaped manipulators, both set to zero. Don't touch
them, they don't have any effect. Also leave the checkbox for "Use
Decay Regions" unchecked in the attribute editor. Activating that
attribute will result in unpredictable light dsitribution.
|
Please use the
Bug System to report any bugs.
Please use the
Feature Requests to give me ideas.
Please use the
Support Forum if you have any questions or problems.
Please rate and review in the
Review section.