forked from bartvdbraak/blender
2.5 Preview render
* Added Preview panel to the lamp buttons.
This commit is contained in:
parent
0d75ad3001
commit
349f5df595
@ -9,6 +9,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"
|
||||
__label__ = "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)
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user