在灯光编辑器中自定义灯光属性列表

“灯光编辑器”(Light Editor)中,通过修改每个灯光对应的 LE*Template.xml 文件(例如,LEareaLightTemplate.xml),可以自定义为每个灯光显示的属性列表。

模板文件位于安装目录的 ../scripts/AETemplates 文件夹中并带有前缀 LE

或者,您也可以设置 MAYA_CUSTOM_TEMPLATE_PATH 环境变量。这与如何在属性编辑器中自定义属性的显示十分类似。请参见“属性编辑器”(Attribute Editor)模板

将灯光属性添加到灯光编辑器(Light Editor)

  1. .xml 模板文件的第一部分中声明灯光属性,如下所示:
    <!-- 
    Declaration of the attributes that should be visible for this light type in the Light Editor.
    -->
    ...
    ...
    <attribute name='shadowColor' type='maya.float3'>
        <label>Shadow Color</label>;
    </attribute>
    <attribute name='coneAngle' type='maya.float'>
        <label>Cone Angle</label>;
    </attribute>
    注: 通过参考 Maya 帮助的“技术文档”(Technical Documentation)部分中的“节点”(Nodes)文档,可以找到灯光属性名称。
  2. 将灯光属性添加到 .xml 模板文件的模板视图部分(最后一部分),如下所示:
    <description>View used by Light Editor</description>
    ...
    ...
    <property name='shadowColor'/>
    <property name='coneAngle'/>

“灯光编辑器”(Light Editor)显示各种模板中列出的所有属性对应的列。但是,仅当特定灯光类型存在某个属性时,才能为灯光修改该属性。

在此示例中,“灯光编辑器”(Light Editor)中将创建“阴影颜色”(Shadow Color)列,且您可在“灯光编辑器”(Light Editor)中针对所有灯光进行修改。另一方面,尽管还会创建“圆锥体角度”(Cone Angle)列,但只能针对聚光灯进行修改,因为它不适用于区域光等其他灯光。

注: 若要从“灯光编辑器”(Light Editor)中移除列,则必须从显示列的每个模板中移除相应的灯光属性。不需要编辑 LEapi*Template.xml 文件。