so i started learning the blender game engine, and while browsing tutorials on blender cookie, couldn’t stop myself from trying one out. However, it wont work! it seems to be all correct to me but the panel wont appear. Help is appreciated.
import bpy
class addObjectPrimitives(bpy.types.Panel):
bl_label = "Add Object Primitives"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bl_context = "objectmode"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
if bpy.context.object:
col.prop(bpy.context.object, "name")
col = layout.column(align=True)
col.operator("mesh.primitive_plane_add", icon = "MESH_PLANE")
col.operator("mesh.primitive_cube_add", icon = "MESH_cUBE")
col.operator("mesh.primitive_circle_add",icon = "MESH_cIRCLE")
col.operator("mesh.primitive_uv_sphere_add", icon = "MESH_UVSPHERE")
col.operator("mesh.primitive_ico_sphere_add", icon = "MESH_ICOSPHERE")
col.operator("mesh.primitive_cylinder_add", icon = "MESH_CYLINDER")
col.operator("mesh.primitive_cone_add", icon = "MESH_CONE")
col.operator("mesh.primitive_grid_add", icon = "MESH_GRID")
col.operator("mesh.primitive_monkey_add", icon = "MESH_MONKEY")
col.operator("mesh.primitive_torus_add", icon = "MESH_TORUS")
class addMeshPrimitives(bpy.types.Panel):
bl_label = "Add Object Primitives"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bl_context = "mesh_edit"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
if bpy.context.object:
col.prop(bpy.context.object, "name")
col = layout.column(align=True)
col.operator("mesh.primitive_plane_add", icon = "MESH_PLANE")
col.operator("mesh.primitive_cube_add", icon = "MESH_cUBE")
col.operator("mesh.primitive_circle_add",icon = "MESH_cIRCLE")
col.operator("mesh.primitive_uv_sphere_add", icon = "MESH_UVSPHERE")
col.operator("mesh.primitive_ico_sphere_add", icon = "MESH_ICOSPHERE")
col.operator("mesh.primitive_cylinder_add", icon = "MESH_CYLINDER")
col.operator("mesh.primitive_cone_add", icon = "MESH_CONE")
col.operator("mesh.primitive_grid_add", icon = "MESH_GRID")
col.operator("mesh.primitive_monkey_add", icon = "MESH_MONKEY")
col.operator("mesh.primitive_torus_add", icon = "MESH_TORUS")
]
here is a link to the tutorial: