2.5: RNA & UI

* Revert lamp sampling/buffers change. The right enum items should
  be defined in RNA, not the layout, so that it works in outliner,
  python api too.
* Also changed type popup to radio buttons again, and removed the
  icons. This is more consistent, and I don't think it's a good idea
  to start using icons for these things, too much clutter.

* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.

* Fix some naming conflicts in RNA, with "name" and "type" properties
  being defined twice in the same struct.

* context.scene.tool_settings -> context.tool_settings.
This commit is contained in:
Brecht Van Lommel 2009-07-21 00:55:20 +00:00
parent 0aebd5f144
commit 1f4fa869e4
17 changed files with 107 additions and 110 deletions

@ -19,9 +19,9 @@ class BONE_PT_context_bone(BoneButtonsPanel):
if not bone:
bone = context.edit_bone
split = layout.split(percentage=0.06)
split.itemL(text="", icon="ICON_BONE_DATA")
split.itemR(bone, "name", text="")
row = layout.row()
row.itemL(text="", icon="ICON_BONE_DATA")
row.itemR(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
__idname__ = "BONE_PT_transform"

@ -48,9 +48,7 @@ class DATA_PT_lamp(DataButtonsPanel):
lamp = context.lamp
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
split.itemR(lamp, "type", text="")
layout.itemR(lamp, "type", expand=True)
split = layout.split()
@ -165,13 +163,8 @@ class DATA_PT_shadow(DataButtonsPanel):
def draw(self, context):
layout = self.layout
lamp = context.lamp
row = layout.row(align=True)
row.item_enumR(lamp, "shadow_method", 'NOSHADOW')
row.item_enumR(lamp, "shadow_method", 'RAY_SHADOW')
if lamp.type == 'SPOT':
row.item_enumR(lamp, "shadow_method", 'BUFFER_SHADOW')
layout.itemR(lamp, "shadow_method", expand=True)
if lamp.shadow_method != 'NOSHADOW':
@ -186,12 +179,9 @@ class DATA_PT_shadow(DataButtonsPanel):
if lamp.shadow_method == 'RAY_SHADOW':
row = layout.row(align=True)
layout.itemL(text="Sampling:")
row.item_enumR(lamp, "shadow_ray_sampling_method", 'ADAPTIVE_QMC')
row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_QMC')
if lamp.type == 'AREA':
row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_JITTERED')
col = layout.column()
col.itemL(text="Sampling:")
col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'):
flow = layout.column_flow()

@ -29,9 +29,9 @@ class DATA_PT_context_mesh(DataButtonsPanel):
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_mesh(DataButtonsPanel):
__idname__ = "DATA_PT_mesh"
__label__ = "Mesh"
class DATA_PT_normals(DataButtonsPanel):
__idname__ = "DATA_PT_normals"
__label__ = "Normals"
def draw(self, context):
layout = self.layout
@ -48,48 +48,14 @@ class DATA_PT_mesh(DataButtonsPanel):
sub = split.column()
sub.itemR(mesh, "vertex_normal_flip")
sub.itemR(mesh, "double_sided")
layout.itemS()
layout.itemR(mesh, "texco_mesh")
class DATA_PT_materials(DataButtonsPanel):
__idname__ = "DATA_PT_materials"
__label__ = "Materials"
def poll(self, context):
return (context.object and context.object.type in ('MESH', 'CURVE', 'FONT', 'SURFACE'))
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.template_list(ob, "materials", ob, "active_material_index")
col = row.column(align=True)
col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
row = layout.row(align=True)
if context.edit_object:
row = layout.row(align=True)
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
row.itemO("object.material_slot_deselect", text="Deselect")
"""
layout.itemS()
box= layout.box()
row = box.row()
row.template_list(ob, "materials", ob, "active_material_index", compact=True)
subrow = row.row(align=True)
subrow.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
subrow.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
"""
row.itemO("MESH_OT_faces_shade_smooth")
row.itemO("MESH_OT_faces_shade_flat")
else:
row.itemO("OBJECT_OT_shade_smooth")
row.itemO("OBJECT_OT_shade_flat")
class DATA_PT_vertex_groups(DataButtonsPanel):
__idname__ = "DATA_PT_vertex_groups"
@ -114,6 +80,11 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
if ob.data.users > 1:
col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="")
group = ob.active_vertex_group
if group:
row = layout.row()
row.itemR(group, "name")
if context.edit_object:
row = layout.row(align=True)
@ -150,7 +121,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
col.itemS()
subcol = col.column(align=True)
subcol.itemR(ob, "shape_key_lock", icon="ICON_PINNED", text="")
subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="")
subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="")
if key.relative:
@ -158,6 +129,9 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.itemR(key, "relative")
row.itemL()
row = layout.row()
row.itemR(kb, "name")
if ob.active_shape_key_index != 0:
if not ob.shape_key_lock:
row = layout.row(align=True)
@ -173,6 +147,9 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.itemR(key, "relative")
row.itemR(key, "slurph")
row = layout.row()
row.itemR(kb, "name")
if context.edit_object:
layout.enabled = False
@ -186,12 +163,17 @@ class DATA_PT_uv_texture(DataButtonsPanel):
row = layout.row()
row.template_list(me, "uv_textures", me, "active_uv_texture_index")
col = row.column()
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="")
col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="")
lay = me.active_uv_texture
if lay:
layout.itemR(lay, "name")
class DATA_PT_vertex_colors(DataButtonsPanel):
__idname__ = "DATA_PT_vertex_colors"
__label__ = "Vertex Colors"
@ -201,16 +183,20 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
me = context.mesh
row = layout.row()
col = row.column()
row.template_list(me, "vertex_colors", me, "active_vertex_color_index")
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="")
col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="")
lay = me.active_vertex_color
if lay:
layout.itemR(lay, "name")
bpy.types.register(DATA_PT_context_mesh)
bpy.types.register(DATA_PT_mesh)
bpy.types.register(DATA_PT_materials)
bpy.types.register(DATA_PT_normals)
bpy.types.register(DATA_PT_vertex_groups)
bpy.types.register(DATA_PT_shape_keys)
bpy.types.register(DATA_PT_uv_texture)

@ -37,12 +37,19 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
if ob:
row = layout.row()
row.template_list(ob, "materials", ob, "active_material_index")
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
if context.edit_object:
row = layout.row(align=True)
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
row.itemO("object.material_slot_deselect", text="Deselect")
split = layout.split(percentage=0.65)
if ob and slot:

@ -14,9 +14,9 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
layout = self.layout
ob = context.object
split = layout.split(percentage=0.06)
split.itemL(text="", icon="ICON_OBJECT_DATA")
split.itemR(ob, "name", text="")
row = layout.row()
row.itemL(text="", icon="ICON_OBJECT_DATA")
row.itemR(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
__idname__ = "OBJECT_PT_transform"
@ -176,3 +176,4 @@ bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
bpy.types.register(OBJECT_PT_animation)

@ -196,3 +196,4 @@ bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
bpy.types.register(PHYSICS_PT_cloth_collision)
bpy.types.register(PHYSICS_PT_cloth_stiffness)

@ -114,9 +114,9 @@ class RENDER_PT_shading(RenderButtonsPanel):
col.itemR(rd, "render_textures", text="Textures")
col.itemR(rd, "render_shadows", text="Shadows")
col.itemR(rd, "render_sss", text="Subsurface Scattering")
col.itemR(rd, "render_envmaps", text="Environment Map")
col = split.column()
col.itemR(rd, "render_envmaps", text="Environment Map")
col.itemR(rd, "render_raytracing", text="Ray Tracing")
col.itemR(rd, "color_management")
col.itemR(rd, "alpha_mode", text="Alpha")
@ -330,7 +330,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
col.itemR(rd, "full_sample")
col = split.column()
col.itemR(rd, "pixel_filter", text="Filter")
col.itemR(rd, "pixel_filter", text="")
col.itemR(rd, "filter_size", text="Size", slider=True)
class RENDER_PT_dimensions(RenderButtonsPanel):

@ -16,7 +16,7 @@ class CONSOLE_HT_header(bpy.types.Header):
layout.template_header()
row = layout.row()
row.itemR(sc, "type", expand=True)
row.itemR(sc, "console_type", expand=True)
if sc.type == 'REPORT':

@ -9,7 +9,7 @@ class IMAGE_MT_view(bpy.types.Menu):
layout = self.layout
sima = context.space_data
uv = sima.uv_editor
settings = context.scene.tool_settings
settings = context.tool_settings
show_uvedit = sima.show_uvedit
@ -78,7 +78,7 @@ class IMAGE_MT_image(bpy.types.Menu):
show_render = sima.show_render
if ima:
if show_render:
if not show_render:
layout.itemO("image.replace")
layout.itemO("image.reload")
@ -157,7 +157,7 @@ class IMAGE_MT_uvs(bpy.types.Menu):
layout = self.layout
sima = context.space_data
uv = sima.uv_editor
settings = context.scene.tool_settings
settings = context.tool_settings
layout.itemR(uv, "snap_to_pixels")
layout.itemR(uv, "constrain_to_image_bounds")
@ -199,7 +199,7 @@ class IMAGE_HT_header(bpy.types.Header):
ima = sima.image
iuser = sima.image_user
layout = self.layout
settings = context.scene.tool_settings
settings = context.tool_settings
show_render = sima.show_render
show_paint = sima.show_paint
@ -223,7 +223,7 @@ class IMAGE_HT_header(bpy.types.Header):
if show_uvedit:
row.itemM("IMAGE_MT_uvs")
layout.template_ID(sima, "image", new="image.new") # open="image.open"
layout.template_ID(sima, "image", new="image.new")
"""
/* image select */

@ -170,8 +170,6 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
col.itemR(bg, "x_offset", text="X")
col.itemR(bg, "y_offset", text="Y")
bpy.types.register(VIEW3D_MT_view_navigation)
bpy.types.register(VIEW3D_MT_view)
bpy.types.register(VIEW3D_HT_header)
@ -179,3 +177,4 @@ bpy.types.register(VIEW3D_PT_3dview_properties)
bpy.types.register(VIEW3D_PT_3dview_display)
bpy.types.register(VIEW3D_PT_background_image)

@ -194,7 +194,7 @@ class VIEW3D_PT_tools_brush(bpy.types.Panel):
__label__ = "Brush"
def brush_src(self, context):
ts = context.scene.tool_settings
ts = context.tool_settings
if context.sculpt_object:
return ts.sculpt
elif context.vpaint_object:
@ -220,7 +220,7 @@ class VIEW3D_PT_tools_brush(bpy.types.Panel):
col = split.column()
col.itemR(brush, "size", slider=True)
if context.wpaint_object:
col.itemR(context.scene.tool_settings, "vertex_group_weight", text="Weight", slider=True)
col.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
col.itemR(brush, "strength", slider=True)
@ -247,7 +247,7 @@ class VIEW3D_PT_sculptoptions(bpy.types.Panel):
return context.sculpt_object
def draw(self, context):
sculpt = context.scene.tool_settings.sculpt
sculpt = context.tool_settings.sculpt
split = self.layout.split()

@ -114,6 +114,7 @@ void rna_def_brush(BlenderRNA *brna)
{SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""},
{SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""},
{SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""},
{SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Brush", "ID");

@ -225,7 +225,8 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them.");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use.");
}

@ -280,11 +280,11 @@ static void rna_def_lamp(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] = {
{LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source."},
{LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source."},
{LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source."},
{LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemisphere", "180 degree constant light source."},
{LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source."},
{LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source."},
{LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source."},
{LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source."},
{LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source."},
{LA_AREA, "AREA", 0, "Area", "Directional area light source."},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Lamp", "ID");
@ -389,20 +389,30 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
PropertyRNA *prop;
static EnumPropertyItem prop_shadow_items[] = {
{0, "NOSHADOW", 0, "No Shadow", ""},
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_spot_shadow_items[] = {
{0, "NOSHADOW", 0, "No Shadow", ""},
{LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer."},
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ray_sampling_method_items[] = {
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", "For Area lamps only."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_spot_ray_sampling_method_items[] = {
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
{0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_shadow_items);
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
@ -419,7 +429,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, prop_ray_sampling_method_items);
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);

@ -483,10 +483,10 @@ static void def_cmp_filter(StructRNA *srna)
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_ui_text(prop, "Filter Type", "");
}
static void def_cmp_map_value(StructRNA *srna)
@ -653,14 +653,14 @@ static void def_cmp_output_file(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_ui_text(prop, "Filename", "");
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop = RNA_def_property(srna, "image_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "imtype");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_ui_text(prop, "Image Type", "");
/* TODO: openexr only { */
@ -1092,10 +1092,10 @@ static void def_cmp_premul_key(StructRNA *srna)
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Blend Type", "Conversion between premultiplied alpha and key alpha");
RNA_def_property_ui_text(prop, "Mapping", "Conversion between premultiplied alpha and key alpha");
}
@ -1120,10 +1120,10 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeGlare", "storage");
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop = RNA_def_property(srna, "glare_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_ui_text(prop, "Glare Type", "");
prop = RNA_def_property(srna, "quality", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "quality");
@ -1181,10 +1181,10 @@ static void def_cmp_tonemap(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTonemap", "storage");
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop = RNA_def_property(srna, "tonemap_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_ui_text(prop, "Tonemap Type", "");
/* TODO: if type==0 { */
@ -1250,9 +1250,9 @@ static void def_tex_output(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "TexNodeOutput", "storage");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
prop = RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_ui_text(prop, "Output Name", "");
}
static void def_tex_image(StructRNA *srna)

@ -234,7 +234,7 @@ static int rna_VertexGroup_index_get(PointerRNA *ptr)
static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef));
return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef-1));
}
static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)

@ -1087,7 +1087,8 @@ static void rna_def_space_console(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text.");
RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "console_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, console_type_items);
RNA_def_property_ui_text(prop, "Type", "Console type.");
RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL);