Couldnt find a better title so here it goes:
Im writing my own little create panel, so I can have the createtools to the right instead of having to have
the left toolbar open all the time. YES, I know I can just go to add>lamp or spacebar>add>lamp, but Id like
to eliminate those and just have everything in one place. Im completly new to scripting and have no what so
ever experience so this is my first time trying to actually write a script (Thanks CG Cookie).
Heres the error I get:
IndentationError: expected an indented block
Layout.operator_enum(“object.lamp.add”, “type”)
Heres my script:
import bpy
class LayoutDemoPanel(bpy.types.Panel):
“”“Creates a Panel in the scene context of the properties editor”""
bl_label = “Create”
bl_idname = “SCENE_PT_layout”
bl_space_type = ‘PROPERTIES’
bl_region_type = ‘WINDOW’
bl_context = “scene”
def draw(self, context):
layout = self.layout
scene = context.scene
# Create a simple row.
layout.label(text="Create:")
#Buttons for adding models
#Add a cube
row = layout.row()
props = row.operator("mesh.primitive_cube_add", text="Cube")
del row
#Add a sphere
row = layout.row()
props = row.operator("mesh.primitive_uv_sphere_add", text="Sphere")
del row
#Add a cynlinder
row = layout.row()
props = row.operator("mesh.primitive_cylinder_add", text="Cylinder")
del row
#Add light
row = layout.row()
@staticmethod
def draw_add_lamp(layout):
layout.operator_enum("object.lamp_add", "type")
del row
def register():
bpy.utils.register_class(LayoutDemoPanel)
def unregister():
bpy.utils.unregister_class(LayoutDemoPanel)
if name == “main”:
register()
Hope someone have time to help.