2.5 Preview render
authorThomas Dinges <blender@dingto.org>
Sun, 7 Jun 2009 11:42:13 +0000 (11:42 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 7 Jun 2009 11:42:13 +0000 (11:42 +0000)
* Added Preview panel to the lamp buttons.

release/ui/buttons_data_lamp.py
source/blender/editors/interface/interface_templates.c

index 86be9cd1a68b5ee600c27db8544eb8029ba941ad..532098cf786ca99e356b6fbae7ff18973f57f7a8 100644 (file)
@@ -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)
\ No newline at end of file
index e895d4eea1620211d9023a836611f6cf93984ba7..d5b48c3da6dca40dda4fbb84979d7cdd91226c56 100644 (file)
@@ -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;
        }