forked from bartvdbraak/blender
2.5 Preview render
* Added Preview panel to the lamp buttons.
This commit is contained in:
parent
0d75ad3001
commit
349f5df595
@ -8,6 +8,16 @@ class DataButtonsPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
return (context.lamp != None)
|
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):
|
class DATA_PT_lamp(DataButtonsPanel):
|
||||||
__idname__ = "DATA_PT_lamp"
|
__idname__ = "DATA_PT_lamp"
|
||||||
@ -218,9 +228,9 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
|
|||||||
|
|
||||||
layout.template_curve_mapping(lamp.falloff_curve)
|
layout.template_curve_mapping(lamp.falloff_curve)
|
||||||
|
|
||||||
|
bpy.types.register(DATA_PT_preview)
|
||||||
bpy.types.register(DATA_PT_lamp)
|
bpy.types.register(DATA_PT_lamp)
|
||||||
bpy.types.register(DATA_PT_shadow)
|
bpy.types.register(DATA_PT_shadow)
|
||||||
bpy.types.register(DATA_PT_sunsky)
|
bpy.types.register(DATA_PT_sunsky)
|
||||||
bpy.types.register(DATA_PT_spot)
|
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;
|
uiBlock *block;
|
||||||
Material *ma;
|
Material *ma;
|
||||||
|
|
||||||
if(!id || !ELEM3(GS(id->name), ID_MA, ID_TE, ID_WO)) {
|
if(!id || !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
|
||||||
printf("uiTemplatePreview: expected ID of type material, texture or world.\n");
|
printf("uiTemplatePreview: expected ID of type material, texture, lamp or world.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user