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:
authorCampbell Barton <ideasman42@gmail.com>2009-09-09 04:10:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-09 04:10:12 +0400
commit850abb3580f97f44562b081bf115c845abf31ca1 (patch)
tree7902742b6ddc10212be9f2d746e5b1076563c1b3 /release
parente6965c46fc1305a37a2778fb1746216f3d482295 (diff)
curve.textboxes collection access for the UI + minor UI tweaks for poly curves
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_data_curve.py101
-rw-r--r--release/ui/buttons_data_text.py45
2 files changed, 80 insertions, 66 deletions
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index 95f9a98da74..1124dfd1ae8 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -15,7 +15,7 @@ class DataButtonsPanelCurve(DataButtonsPanel):
'''
def poll(self, context):
return (context.object and context.object.type == 'CURVE' and context.curve)
-
+
class DataButtonsPanelActive(DataButtonsPanel):
'''
Same as above but for curves only
@@ -80,7 +80,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U")
-
+
if is_surf:
sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V")
@@ -150,59 +150,70 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
curve = context.curve
act_spline = curve.active_spline
is_surf = (ob.type == 'SURFACE')
+ is_poly = (act_spline.type == 'POLY')
split = layout.split()
- col = split.column()
- col.itemL(text="Cyclic:")
- if act_spline.type == 'NURBS':
- col.itemL(text="Bezier:")
- col.itemL(text="Endpoint:")
- col.itemL(text="Order:")
- col.itemL(text="Resolution:")
-
- col = split.column()
- col.itemR(act_spline, "cyclic_u", text="U")
+ if is_poly:
+ # These settings are below but its easier to have
+ # poly's set aside since they use so few settings
+ col = split.column()
+ col.itemL(text="Cyclic:")
+ col.itemR(act_spline, "smooth")
+ col = split.column()
+ col.itemR(act_spline, "cyclic_u", text="U")
- if act_spline.type == 'NURBS':
- sub = col.column()
- sub.active = (not act_spline.cyclic_u)
- sub.itemR(act_spline, "bezier_u", text="U")
- sub.itemR(act_spline, "endpoint_u", text="U")
+ else:
+ col = split.column()
+ col.itemL(text="Cyclic:")
+ if act_spline.type == 'NURBS':
+ col.itemL(text="Bezier:")
+ col.itemL(text="Endpoint:")
+ col.itemL(text="Order:")
- sub = col.column()
- sub.itemR(act_spline, "order_u", text="U")
- col.itemR(act_spline, "resolution_u", text="U")
-
- if is_surf:
+ col.itemL(text="Resolution:")
+
col = split.column()
- col.itemR(act_spline, "cyclic_v", text="V")
+ col.itemR(act_spline, "cyclic_u", text="U")
- # its a surface, assume its a nurb.
- sub = col.column()
- sub.active = (not act_spline.cyclic_v)
- sub.itemR(act_spline, "bezier_v", text="V")
- sub.itemR(act_spline, "endpoint_v", text="V")
- sub = col.column()
- sub.itemR(act_spline, "order_v", text="V")
- sub.itemR(act_spline, "resolution_v", text="V")
+ if act_spline.type == 'NURBS':
+ sub = col.column()
+ # sub.active = (not act_spline.cyclic_u)
+ sub.itemR(act_spline, "bezier_u", text="U")
+ sub.itemR(act_spline, "endpoint_u", text="U")
+
+ sub = col.column()
+ sub.itemR(act_spline, "order_u", text="U")
+ col.itemR(act_spline, "resolution_u", text="U")
+
+ if is_surf:
+ col = split.column()
+ col.itemR(act_spline, "cyclic_v", text="V")
+
+ # its a surface, assume its a nurb.
+ sub = col.column()
+ sub.active = (not act_spline.cyclic_v)
+ sub.itemR(act_spline, "bezier_v", text="V")
+ sub.itemR(act_spline, "endpoint_v", text="V")
+ sub = col.column()
+ sub.itemR(act_spline, "order_v", text="V")
+ sub.itemR(act_spline, "resolution_v", text="V")
-
- if not is_surf:
+
+ if not is_surf:
+ split = layout.split()
+ col = split.column()
+ col.active = (not curve.curve_2d)
+
+ col.itemL(text="Interpolation:")
+ col.itemR(act_spline, "tilt_interpolation", text="Tilt")
+ col.itemR(act_spline, "radius_interpolation", text="Radius")
+
split = layout.split()
col = split.column()
- col.active = (not curve.curve_2d)
-
- col.itemL(text="Interpolation:")
- col.itemR(act_spline, "tilt_interpolation", text="Tilt")
- col.itemR(act_spline, "radius_interpolation", text="Radius")
-
-
- split = layout.split()
- col = split.column()
- col.itemR(act_spline, "smooth")
-
-
+ col.itemR(act_spline, "smooth")
+
+
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index 4db5803c4eb..d0e7ea09a92 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -44,8 +44,10 @@ class DATA_PT_shape_text(DataButtonsPanel):
col = split.column()
col.itemL(text="Caps:")
- col.itemR(curve, "front")
- col.itemR(curve, "back")
+ row = col.row()
+ row .itemR(curve, "front")
+ row .itemR(curve, "back")
+ # col = split.column()
col.itemL(text="Textures:")
col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace")
@@ -55,11 +57,12 @@ class DATA_PT_shape_text(DataButtonsPanel):
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U")
+
+ # resolution_v is not used for text
+
sub = col.column(align=True)
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_v", text="Render V")
col.itemL(text="Display:")
- col.itemR(curve, "fast")
+ col.itemR(curve, "fast", text="Fast Editing")
class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry"
@@ -93,19 +96,19 @@ class DATA_PT_font(DataButtonsPanel):
text = context.curve
char = context.curve.edit_format
-
+
layout.itemR(text, "font")
row = layout.row()
row.itemR(text, "text_size", text="Size")
row.itemR(text, "shear")
-
+
split = layout.split()
- col = split.column()
+ col = split.column()
col.itemL(text="Object Font:")
col.itemR(text, "family", text="")
-
+
col = split.column()
col.itemL(text="Text on Curve:")
col.itemR(text, "text_on_curve", text="")
@@ -158,19 +161,19 @@ class DATA_PT_textboxes(DataButtonsPanel):
layout = self.layout
text = context.curve
- box = context.curve.textbox
-
- split = layout.box().split()
-
- col = split.column(align=True)
- col.itemL(text="Dimensions:")
- col.itemR(box, "width", text="Width")
- col.itemR(box, "height", text="Height")
- col = split.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(box, "x", text="X")
- col.itemR(box, "y", text="Y")
+ for box in text.textboxes:
+ split = layout.box().split()
+
+ col = split.column(align=True)
+ col.itemL(text="Dimensions:")
+ col.itemR(box, "width", text="Width")
+ col.itemR(box, "height", text="Height")
+
+ col = split.column(align=True)
+ col.itemL(text="Offset:")
+ col.itemR(box, "x", text="X")
+ col.itemR(box, "y", text="Y")
bpy.types.register(DATA_PT_context_text)
bpy.types.register(DATA_PT_shape_text)