Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-19 21:13:33 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-19 21:13:33 +0400
commit40ae17d2f6e2d5dbbe89321491572035c304872c (patch)
tree7f39fe42977a45878352e34d7bfdc1820ed980ff /release
parent861398542f8ba71dd4783886adda21544d939763 (diff)
UI
* Fix buttons jumping around when resizing and zoom. Part of this was adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the rounding is unpredictable (used to be 0.375f, but that was disabled). * Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is now taken into account in more places in the view2d code, to avoid zooming into the center or panning out of the view. * Remove "Free" align mode in buttons window (it's not really useful). * View3D/Graph/Image editors now use the same PanelType system as the buttons window, means some deprecated panel code could be removed. * Some small visual tweaks for panels. * View 2D Reset operator (Home key), to reset zoom and panning for panels. * Added argument to set number buttons as sliders (slider=True for itemR). * Ignore labels for button alignment (doesn't look right). * Fix some use of context.main in py scripts, should get data from active object instead. * Fix autotexspace -> auto_texspace in py script.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_data_camera.py4
-rw-r--r--release/ui/buttons_data_curve.py2
-rw-r--r--release/ui/buttons_data_lamp.py17
-rw-r--r--release/ui/buttons_data_lattice.py2
-rw-r--r--release/ui/buttons_data_text.py2
-rw-r--r--release/ui/buttons_material.py22
6 files changed, 24 insertions, 25 deletions
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py
index 24006b5e7cc..3bca07c319d 100644
--- a/release/ui/buttons_data_camera.py
+++ b/release/ui/buttons_data_camera.py
@@ -15,7 +15,7 @@ class DATA_PT_cameralens(DataButtonsPanel):
__label__ = "Lens"
def draw(self, context):
- cam = context.main.cameras[0]
+ cam = context.active_object.data
layout = self.layout
if not cam:
@@ -55,7 +55,7 @@ class DATA_PT_cameradisplay(DataButtonsPanel):
__label__ = "Display"
def draw(self, context):
- cam = context.main.cameras[0]
+ cam = context.active_object.data
layout = self.layout
if not cam:
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index 4d6817d0fe8..a51ce50b047 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -33,7 +33,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
sub.itemL(text="Textures:")
sub.itemR(curve, "uv_orco")
- sub.itemR(curve, "autotexspace")
+ sub.itemR(curve, "auto_texspace")
sub = split.column()
sub.itemL(text="Resolution:")
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index 9b64748032d..2005481d38b 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -15,7 +15,7 @@ class DATA_PT_lamp(DataButtonsPanel):
__label__ = "Lamp"
def draw(self, context):
- lamp = context.main.lamps[0]
+ lamp = context.active_object.data
layout = self.layout
if not lamp:
@@ -61,11 +61,10 @@ class DATA_PT_sunsky(DataButtonsPanel):
def poll(self, context):
ob = context.active_object
- lamp = context.main.lamps[0]
- return (ob.type == 'LAMP' and lamp.type == 'SUN')
+ return (ob.type == 'LAMP' and ob.data.type == 'SUN')
def draw(self, context):
- lamp = context.main.lamps[0].sky
+ lamp = context.active_object.data
layout = self.layout
if not lamp:
@@ -107,11 +106,10 @@ class DATA_PT_shadow(DataButtonsPanel):
def poll(self, context):
ob = context.active_object
- lamp = context.main.lamps[0]
- return (ob.type == 'LAMP' and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
+ return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 'SPOT', 'AREA'))
def draw(self, context):
- lamp = context.main.lamps[0]
+ lamp = context.active_object.data
layout = self.layout
if not lamp:
@@ -190,11 +188,10 @@ class DATA_PT_spot(DataButtonsPanel):
def poll(self, context):
ob = context.active_object
- lamp = context.main.lamps[0]
- return (ob.type == 'LAMP' and lamp.type == 'SPOT')
+ return (ob.type == 'LAMP' and ob.data.type == 'SPOT')
def draw(self, context):
- lamp = context.main.lamps[0]
+ lamp = context.active_object.data
layout = self.layout
if not lamp:
diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py
index 0446f3916a1..c7d5b9cfe4a 100644
--- a/release/ui/buttons_data_lattice.py
+++ b/release/ui/buttons_data_lattice.py
@@ -15,7 +15,7 @@ class DATA_PT_lattice(DataButtonsPanel):
__label__ = "Lattice"
def draw(self, context):
- lat = context.main.lattices[0]
+ lat = context.active_object.data
layout = self.layout
if not lat:
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index 8fbcf083c98..8db1d0316a9 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -32,7 +32,7 @@ class DATA_PT_shape_text(DataButtonsPanel):
sub.itemL(text="Textures:")
sub.itemR(curve, "uv_orco")
- sub.itemR(curve, "autotexspace")
+ sub.itemR(curve, "auto_texspace")
sub = split.column()
sub.itemL(text="Resolution:")
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index a80ae8d4624..551a62cfc84 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -64,18 +64,20 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_raymir"
__label__ = "Ray Mirror"
+ def poll(self, context):
+ ob = context.active_object
+ return (ob and ob.active_material)
+
+ def draw_header(self, context):
+ raym = context.active_object.active_material.raytrace_mirror
+
+ layout = self.layout
+ layout.itemR(raym, "enabled", text=self.__label__)
+
def draw(self, context):
layout = self.layout
- try:
- raym = context.active_object.active_material.raytrace_mirror
- except:
- raym = None
-
- if not raym:
- return
-
- layout.itemR(raym, "enabled", text="Enable")
-
+ raym = context.active_object.active_material.raytrace_mirror
+
split = layout.split()
sub = split.column()