2.5 Preview render

* Added Preview panel to the lamp buttons.
This commit is contained in:
Thomas Dinges 2009-06-07 11:42:13 +00:00
parent 0d75ad3001
commit 349f5df595
2 changed files with 14 additions and 4 deletions

@ -8,6 +8,16 @@ class DataButtonsPanel(bpy.types.Panel):
def poll(self, context):
return (context.lamp != None)
class DATA_PT_preview(DataButtonsPanel):
__idname__= "DATA_PT_preview"
__label__ = "Preview"
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.template_preview(lamp)
class DATA_PT_lamp(DataButtonsPanel):
__idname__ = "DATA_PT_lamp"
@ -218,9 +228,9 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
layout.template_curve_mapping(lamp.falloff_curve)
bpy.types.register(DATA_PT_preview)
bpy.types.register(DATA_PT_lamp)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_falloff_curve)
bpy.types.register(DATA_PT_falloff_curve)

@ -1294,8 +1294,8 @@ void uiTemplatePreview(uiLayout *layout, ID *id)
uiBlock *block;
Material *ma;
if(!id || !ELEM3(GS(id->name), ID_MA, ID_TE, ID_WO)) {
printf("uiTemplatePreview: expected ID of type material, texture or world.\n");
if(!id || !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
printf("uiTemplatePreview: expected ID of type material, texture, lamp or world.\n");
return;
}