在“灯光编辑器”(Light Editor)中,通过修改每个灯光对应的 LE*Template.xml 文件(例如,LEareaLightTemplate.xml),可以自定义为每个灯光显示的属性列表。
模板文件位于安装目录的 ../scripts/AETemplates 文件夹中并带有前缀 LE。
或者,您也可以设置 MAYA_CUSTOM_TEMPLATE_PATH 环境变量。这与如何在属性编辑器中自定义属性的显示十分类似。请参见“属性编辑器”(Attribute Editor)模板。
将灯光属性添加到灯光编辑器(Light Editor)
<!-- 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>
<description>View used by Light Editor</description> ... ... <property name='shadowColor'/> <property name='coneAngle'/>
“灯光编辑器”(Light Editor)显示各种模板中列出的所有属性对应的列。但是,仅当特定灯光类型存在某个属性时,才能为灯光修改该属性。
在此示例中,“灯光编辑器”(Light Editor)中将创建“阴影颜色”(Shadow Color)列,且您可在“灯光编辑器”(Light Editor)中针对所有灯光进行修改。另一方面,尽管还会创建“圆锥体角度”(Cone Angle)列,但只能针对聚光灯进行修改,因为它不适用于区域光等其他灯光。