From 01b0cc7f2108fb1c33f8d95da41e18c5f3cead50 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 20 Nov 2011 00:32:39 +0000 Subject: [PATCH] UI/RNA: * Code cleanup. --- release/scripts/startup/bl_ui/properties_particle.py | 4 ---- release/scripts/startup/bl_ui/properties_scene.py | 7 +++---- release/scripts/startup/bl_ui/space_clip.py | 10 ++++------ release/scripts/startup/bl_ui/space_view3d.py | 10 +++------- source/blender/makesrna/intern/rna_scene.c | 2 +- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index a541f43be66..f7f67527b63 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -262,10 +262,6 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): return psys.settings.type == 'HAIR' and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): - #cloth = context.cloth.collision_settings - - #self.layout.active = cloth_panel_enabled(context.cloth) - #self.layout.prop(cloth, "use_collision", text="") psys = context.particle_system self.layout.prop(psys, "use_hair_dynamics", text="") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 86880b9ddec..05f4887a542 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -195,14 +195,13 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER'} def draw_header(self, context): - scene = context.scene - rd = scene.render + rd = context.scene.render self.layout.prop(rd, "use_simplify", text="") def draw(self, context): layout = self.layout - scene = context.scene - rd = scene.render + + rd = context.scene.render layout.active = rd.use_simplify diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 237dd7f998d..a70d632e8b0 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -474,16 +474,14 @@ class CLIP_PT_stabilization(Panel): return sc.mode == 'RECONSTRUCTION' and sc.clip def draw_header(self, context): - sc = context.space_data - tracking = sc.clip.tracking - stab = tracking.stabilization - + stab = context.space_data.clip.tracking.stabilization + self.layout.prop(stab, "use_2d_stabilization", text="") def draw(self, context): layout = self.layout - sc = context.space_data - tracking = sc.clip.tracking + + tracking = context.space_data.clip.tracking stab = tracking.stabilization layout.active = stab.use_2d_stabilization diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 6547fb7ad9f..295b7421017 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2192,10 +2192,9 @@ class VIEW3D_PT_view3d_motion_tracking(Panel): return (view) def draw_header(self, context): - layout = self.layout view = context.space_data - layout.prop(view, "show_reconstruction", text="") + self.layout.prop(view, "show_reconstruction", text="") def draw(self, context): layout = self.layout @@ -2277,10 +2276,9 @@ class VIEW3D_PT_background_image(Panel): bl_options = {'DEFAULT_CLOSED'} def draw_header(self, context): - layout = self.layout view = context.space_data - layout.prop(view, "show_background_images", text="") + self.layout.prop(view, "show_background_images", text="") def draw(self, context): layout = self.layout @@ -2359,14 +2357,12 @@ class VIEW3D_PT_transform_orientations(Panel): layout = self.layout view = context.space_data + orientation = view.current_orientation col = layout.column() - col.prop(view, "transform_orientation") col.operator("transform.create_orientation", text="Create") - orientation = view.current_orientation - if orientation: col.prop(orientation, "name") col.operator("transform.delete_orientation", text="Delete") diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index e1fe34d5baf..50a58e43a80 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1123,8 +1123,8 @@ static void rna_def_transform_orientation(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); }