[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21869] branches/blender2.5/blender: 2. 5 3DView Properties Panel:
Thomas Dinges
dingto at gmx.de
Sat Jul 25 00:09:30 CEST 2009
Revision: 21869
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21869
Author: dingto
Date: 2009-07-25 00:09:30 +0200 (Sat, 25 Jul 2009)
Log Message:
-----------
2.5 3DView Properties Panel:
* Some Code cleanup.
* Added 3-Split Operator into the panel and some options (which don't work yet)
* Added RNA for RegionView3D lock and box options.
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/space_view3d.py
branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
Modified: branches/blender2.5/blender/release/ui/space_view3d.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d.py 2009-07-24 21:12:01 UTC (rev 21868)
+++ branches/blender2.5/blender/release/ui/space_view3d.py 2009-07-24 22:09:30 UTC (rev 21869)
@@ -1,6 +1,25 @@
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"
@@ -76,21 +95,8 @@
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"
+# ********** Panel ****************
- 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()
-
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "UI"
@@ -101,17 +107,19 @@
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")
@@ -127,11 +135,10 @@
return (view)
def draw(self, context):
+ layout = self.layout
view = context.space_data
- layout = self.layout
- 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")
@@ -140,11 +147,21 @@
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
@@ -158,9 +175,10 @@
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()
@@ -179,5 +197,3 @@
bpy.types.register(VIEW3D_PT_3dview_properties)
bpy.types.register(VIEW3D_PT_3dview_display)
bpy.types.register(VIEW3D_PT_background_image)
-
-
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c 2009-07-24 21:12:01 UTC (rev 21868)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c 2009-07-24 22:09:30 UTC (rev 21869)
@@ -646,7 +646,18 @@
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)
More information about the Bf-blender-cvs
mailing list