import bpy
+# ********** Header ****************
+
+class VIEW3D_HT_header(bpy.types.Header):
+ __space_type__ = "VIEW_3D"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.template_header()
+
+ # menus
+ if context.area.show_menus:
+ row = layout.row()
+ row.itemM("VIEW3D_MT_view")
+
+ layout.template_header_3D()
+
+# ********** Menu ****************
+
class VIEW3D_MT_view_navigation(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Navigation"
layout.itemO("screen.region_foursplit", text="Toggle Quad View")
layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
-class VIEW3D_HT_header(bpy.types.Header):
- __space_type__ = "VIEW_3D"
-
- def draw(self, context):
- layout = self.layout
-
- layout.template_header()
-
- # menus
- if context.area.show_menus:
- row = layout.row()
- row.itemM("VIEW3D_MT_view")
-
- layout.template_header_3D()
+# ********** Panel ****************
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
__space_type__ = "VIEW_3D"
return (view)
def draw(self, context):
+ layout = self.layout
+
view = context.space_data
scene = context.scene
- layout = self.layout
- split = layout.split()
- col = split.column()
+ col = layout.column()
col.itemR(view, "camera")
col.itemR(view, "lens")
+
col.itemL(text="Clip:")
col.itemR(view, "clip_start", text="Start")
col.itemR(view, "clip_end", text="End")
+
col.itemL(text="Grid:")
col.itemR(view, "grid_spacing", text="Spacing")
col.itemR(view, "grid_subdivisions", text="Subdivisions")
return (view)
def draw(self, context):
- view = context.space_data
layout = self.layout
+ view = context.space_data
- split = layout.split()
- col = split.column()
+ col = layout.column()
col.itemR(view, "display_floor", text="Grid Floor")
col.itemR(view, "display_x_axis", text="X Axis")
col.itemR(view, "display_y_axis", text="Y Axis")
col.itemR(view, "all_object_centers")
col.itemR(view, "relationship_lines")
col.itemR(view, "textured_solid")
-
+
+ layout.itemS()
+
+ layout.itemO("screen.region_foursplit")
+
+ col = layout.column()
+ col.itemR(view, "lock_rotation")
+ col.itemR(view, "box_preview")
+ col.itemR(view, "box_clip")
+
class VIEW3D_PT_background_image(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "UI"
__label__ = "Background Image"
+ __default_closed__ = True
def poll(self, context):
view = context.space_data
layout.itemR(view, "display_background_image", text="")
def draw(self, context):
+ layout = self.layout
+
view = context.space_data
bg = context.space_data.background_image
- layout = self.layout
layout.active = view.display_background_image
split = layout.split()
bpy.types.register(VIEW3D_PT_3dview_properties)
bpy.types.register(VIEW3D_PT_3dview_display)
bpy.types.register(VIEW3D_PT_background_image)
-
-
RNA_def_property_enum_items(prop, transform_orientation_items);
RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
+
+ prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED);
+ RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation");
+
+ prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW);
+ RNA_def_property_ui_text(prop, "Box", "");
+ prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP);
+ RNA_def_property_ui_text(prop, "Clip", "");
}
static void rna_def_space_buttons(BlenderRNA *brna)