2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-19 15:38:36 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Panel
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
class CurveButtonsPanel():
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "data"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2011-03-07 13:23:45 +00:00
|
|
|
return (context.object and context.object.type in {'CURVE', 'SURFACE', 'FONT'} and context.curve)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
class CurveButtonsPanelCurve(CurveButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
'''Same as above but for curves only'''
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
return (context.object and context.object.type == 'CURVE' and context.curve)
|
2009-09-09 00:10:12 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
class CurveButtonsPanelActive(CurveButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
'''Same as above but for curves only'''
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
curve = context.curve
|
2010-07-13 19:24:35 +00:00
|
|
|
return (curve and type(curve) is not bpy.types.TextCurve and curve.splines.active)
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_context_curve(CurveButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
curve = context.curve
|
|
|
|
space = context.space_data
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
if ob:
|
2010-12-30 12:22:28 +00:00
|
|
|
layout.template_ID(ob, "data")
|
2010-08-06 15:17:44 +00:00
|
|
|
elif curve:
|
2011-01-01 07:20:34 +00:00
|
|
|
layout.template_ID(space, "pin_id") # XXX: broken
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Shape"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
curve = context.curve
|
|
|
|
is_surf = (ob.type == 'SURFACE')
|
2009-11-14 23:24:15 +00:00
|
|
|
is_curve = (ob.type == 'CURVE')
|
2010-11-10 07:44:48 +00:00
|
|
|
is_text = (ob.type == 'FONT')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
if is_curve:
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(curve, "dimensions", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Resolution:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(curve, "resolution_u", text="Preview U")
|
|
|
|
sub.prop(curve, "render_resolution_u", text="Render U")
|
2009-11-14 23:24:15 +00:00
|
|
|
if is_curve:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Twisting:")
|
|
|
|
col.prop(curve, "twist_mode", text="")
|
|
|
|
col.prop(curve, "twist_smooth", text="Smooth")
|
2009-11-14 23:24:15 +00:00
|
|
|
if is_text:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Display:")
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(curve, "use_fast_edit", text="Fast Editing")
|
2009-11-19 23:59:37 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-20 20:40:29 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if is_surf:
|
2010-11-10 19:37:58 +00:00
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="")
|
2010-11-10 19:37:58 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(curve, "resolution_v", text="Preview V")
|
|
|
|
sub.prop(curve, "render_resolution_v", text="Render V")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-09-15 08:38:29 +00:00
|
|
|
if (is_curve or is_text):
|
2011-03-25 22:02:50 +00:00
|
|
|
col.label(text="Fill:")
|
2009-11-14 23:24:15 +00:00
|
|
|
sub = col.column()
|
2011-08-16 12:37:23 +00:00
|
|
|
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
|
2010-08-19 17:31:10 +00:00
|
|
|
sub.prop(curve, "use_fill_front")
|
|
|
|
sub.prop(curve, "use_fill_back")
|
2011-03-25 22:02:50 +00:00
|
|
|
col.prop(curve, "use_fill_deform", text="Fill Deformed")
|
2011-06-21 17:17:51 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
|
2011-06-17 13:53:47 +00:00
|
|
|
bl_label = "Texture Space"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2011-06-17 13:53:47 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2011-06-17 13:53:47 +00:00
|
|
|
curve = context.curve
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-06-17 13:53:47 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(curve, "use_auto_texspace")
|
|
|
|
row.prop(curve, "use_uv_as_generated")
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2011-06-04 08:09:34 +00:00
|
|
|
row = layout.row()
|
2011-06-17 13:53:47 +00:00
|
|
|
row.column().prop(curve, "texspace_location", text="Location")
|
|
|
|
row.column().prop(curve, "texspace_size", text="Size")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Geometry"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-11-30 19:24:13 +00:00
|
|
|
obj = context.object
|
|
|
|
if obj and obj.type == 'SURFACE':
|
|
|
|
return False
|
|
|
|
|
2009-12-03 14:20:35 +00:00
|
|
|
return context.curve
|
2009-11-30 19:24:13 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
curve = context.curve
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Modification:")
|
2010-08-20 06:09:58 +00:00
|
|
|
col.prop(curve, "offset")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(curve, "extrude")
|
|
|
|
col.label(text="Taper Object:")
|
|
|
|
col.prop(curve, "taper_object", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Bevel:")
|
|
|
|
col.prop(curve, "bevel_depth", text="Depth")
|
|
|
|
col.prop(curve, "bevel_resolution", text="Resolution")
|
|
|
|
col.label(text="Bevel Object:")
|
|
|
|
col.prop(curve, "bevel_object", text="")
|
2009-09-07 15:02:43 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Path Animation"
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
curve = context.curve
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(curve, "use_path", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
curve = context.curve
|
|
|
|
|
|
|
|
layout.active = curve.use_path
|
|
|
|
|
2010-01-31 23:41:38 +00:00
|
|
|
col = layout.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
layout.prop(curve, "path_duration", text="Frames")
|
2010-01-31 23:41:38 +00:00
|
|
|
layout.prop(curve, "eval_time")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(curve, "use_path_follow")
|
|
|
|
col.prop(curve, "use_stretch")
|
2010-08-06 08:27:07 +00:00
|
|
|
col.prop(curve, "use_deform_bounds")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(curve, "use_radius")
|
|
|
|
col.prop(curve, "use_time_offset", text="Offset Children")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Active Spline"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
curve = context.curve
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
act_spline = curve.splines.active
|
2009-10-31 19:31:45 +00:00
|
|
|
is_surf = (ob.type == 'SURFACE')
|
|
|
|
is_poly = (act_spline.type == 'POLY')
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
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()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Cyclic:")
|
2010-08-18 07:14:10 +00:00
|
|
|
col.prop(act_spline, "use_smooth")
|
2009-10-31 19:31:45 +00:00
|
|
|
col = split.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(act_spline, "use_cyclic_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
else:
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Cyclic:")
|
2009-10-31 19:31:45 +00:00
|
|
|
if act_spline.type == 'NURBS':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Bezier:")
|
|
|
|
col.label(text="Endpoint:")
|
|
|
|
col.label(text="Order:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Resolution:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(act_spline, "use_cyclic_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if act_spline.type == 'NURBS':
|
|
|
|
sub = col.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
# sub.active = (not act_spline.use_cyclic_u)
|
|
|
|
sub.prop(act_spline, "use_bezier_u", text="U")
|
|
|
|
sub.prop(act_spline, "use_endpoint_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(act_spline, "order_u", text="U")
|
|
|
|
col.prop(act_spline, "resolution_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if is_surf:
|
|
|
|
col = split.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(act_spline, "use_cyclic_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# its a surface, assume its a nurb.
|
|
|
|
sub = col.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
sub.active = (not act_spline.use_cyclic_v)
|
|
|
|
sub.prop(act_spline, "use_bezier_v", text="V")
|
|
|
|
sub.prop(act_spline, "use_endpoint_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(act_spline, "order_v", text="V")
|
|
|
|
sub.prop(act_spline, "resolution_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if not is_surf:
|
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
2009-10-31 23:35:56 +00:00
|
|
|
col.active = (curve.dimensions == '3D')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Interpolation:")
|
|
|
|
col.prop(act_spline, "tilt_interpolation", text="Tilt")
|
|
|
|
col.prop(act_spline, "radius_interpolation", text="Radius")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
layout.prop(act_spline, "use_smooth")
|
2009-09-09 00:10:12 +00:00
|
|
|
|
2009-11-19 23:59:37 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_font(CurveButtonsPanel, Panel):
|
2009-11-14 23:24:15 +00:00
|
|
|
bl_label = "Font"
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-10 07:44:48 +00:00
|
|
|
return (context.object and context.object.type == 'FONT' and context.curve)
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
text = context.curve
|
|
|
|
char = context.curve.edit_format
|
|
|
|
|
2010-12-06 04:05:34 +00:00
|
|
|
row = layout.split(percentage=0.25)
|
|
|
|
row.label(text="Regular")
|
|
|
|
row.template_ID(text, "font", open="font.open", unlink="font.unlink")
|
|
|
|
row = layout.split(percentage=0.25)
|
|
|
|
row.label(text="Bold")
|
|
|
|
row.template_ID(text, "font_bold", open="font.open", unlink="font.unlink")
|
|
|
|
row = layout.split(percentage=0.25)
|
|
|
|
row.label(text="Italic")
|
|
|
|
row.template_ID(text, "font_italic", open="font.open", unlink="font.unlink")
|
|
|
|
row = layout.split(percentage=0.25)
|
|
|
|
row.label(text="Bold & Italic")
|
|
|
|
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
#layout.prop(text, "font")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(text, "size", text="Size")
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "shear")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Object Font:")
|
|
|
|
col.prop(text, "family", text="")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Text on Curve:")
|
2010-08-18 08:26:18 +00:00
|
|
|
col.prop(text, "follow_curve", text="")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-07-13 22:21:59 +00:00
|
|
|
col = split.column()
|
|
|
|
colsub = col.column(align=True)
|
|
|
|
colsub.label(text="Underline:")
|
2010-08-19 17:31:10 +00:00
|
|
|
colsub.prop(text, "underline_position", text="Position")
|
|
|
|
colsub.prop(text, "underline_height", text="Thickness")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Character:")
|
2010-08-20 06:09:58 +00:00
|
|
|
col.prop(char, "use_bold")
|
|
|
|
col.prop(char, "use_italic")
|
|
|
|
col.prop(char, "use_underline")
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2011-02-26 16:04:14 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(text, "small_caps_scale", text="Small Caps")
|
|
|
|
row.prop(char, "use_small_caps")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_paragraph(CurveButtonsPanel, Panel):
|
2009-11-14 23:24:15 +00:00
|
|
|
bl_label = "Paragraph"
|
2009-11-18 01:30:28 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-10 07:44:48 +00:00
|
|
|
return (context.object and context.object.type == 'FONT' and context.curve)
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
text = context.curve
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.label(text="Align:")
|
2010-08-19 17:31:10 +00:00
|
|
|
layout.prop(text, "align", expand=True)
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Spacing:")
|
2010-08-19 17:31:10 +00:00
|
|
|
col.prop(text, "space_character", text="Character")
|
|
|
|
col.prop(text, "space_word", text="Word")
|
|
|
|
col.prop(text, "space_line", text="Line")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Offset:")
|
|
|
|
col.prop(text, "offset_x", text="X")
|
|
|
|
col.prop(text, "offset_y", text="Y")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_text_boxes(CurveButtonsPanel, Panel):
|
2009-11-14 23:24:15 +00:00
|
|
|
bl_label = "Text Boxes"
|
2009-11-19 23:59:37 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-10 07:44:48 +00:00
|
|
|
return (context.object and context.object.type == 'FONT' and context.curve)
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
text = context.curve
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-21 23:20:44 +00:00
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
|
|
|
col.operator("font.textbox_add", icon='ZOOMIN')
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
for i, box in enumerate(text.text_boxes):
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-21 23:20:44 +00:00
|
|
|
boxy = layout.box()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-22 21:31:26 +00:00
|
|
|
row = boxy.row()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-22 21:31:26 +00:00
|
|
|
split = row.split()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-22 21:31:26 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
|
|
|
|
col.label(text="Dimensions:")
|
|
|
|
col.prop(box, "width", text="Width")
|
|
|
|
col.prop(box, "height", text="Height")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column(align=True)
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-22 21:31:26 +00:00
|
|
|
col.label(text="Offset:")
|
|
|
|
col.prop(box, "x", text="X")
|
|
|
|
col.prop(box, "y", text="Y")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
|
|
|
row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
|
|
|
|
|
2010-01-08 08:54:41 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel):
|
2010-08-12 19:36:10 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
_context_path = "object.data"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Curve
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|