2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
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-11-14 13:35:44 +00:00
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
from bpy.types import Curve, SurfaceCurve, TextCurve
|
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2015-01-29 15:35:06 +11: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):
|
2013-12-11 22:03:21 +11:00
|
|
|
return (context.curve is not None)
|
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):
|
2013-12-11 22:03:21 +11:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (type(context.curve) is Curve)
|
|
|
|
|
|
|
|
|
|
|
|
class CurveButtonsPanelSurface(CurveButtonsPanel):
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (type(context.curve) is SurfaceCurve)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
class CurveButtonsPanelText(CurveButtonsPanel):
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2013-12-11 22:03:21 +11:00
|
|
|
return (type(context.curve) is TextCurve)
|
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):
|
2012-07-03 09:02:41 +00:00
|
|
|
"""Same as above but for curves only"""
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
curve = context.curve
|
2013-12-11 22:03:21 +11:00
|
|
|
return (curve and type(curve) is not 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
|
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
obj = context.object
|
2009-10-31 19:31:45 +00:00
|
|
|
curve = context.curve
|
|
|
|
space = context.space_data
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
if obj:
|
|
|
|
layout.template_ID(obj, "data")
|
2010-08-06 15:17:44 +00:00
|
|
|
elif curve:
|
2013-12-11 22:03:21 +11:00
|
|
|
layout.template_ID(space, "pin_id")
|
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):
|
2011-09-21 15:18:38 +00:00
|
|
|
bl_label = "Shape"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
curve = context.curve
|
2013-12-11 22:03:21 +11:00
|
|
|
is_surf = type(curve) is SurfaceCurve
|
|
|
|
is_curve = type(curve) is Curve
|
|
|
|
is_text = type(curve) is TextCurve
|
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
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(curve, "resolution_u", text="Resolution Preview U")
|
|
|
|
if is_surf:
|
|
|
|
sub.prop(curve, "resolution_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(curve, "render_resolution_u", text="Render U")
|
2018-06-01 18:44:06 +02:00
|
|
|
if is_surf:
|
|
|
|
sub.prop(curve, "render_resolution_v", text="V")
|
|
|
|
col.separator()
|
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
if is_curve:
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(curve, "twist_mode")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(curve, "twist_smooth", text="Smooth")
|
2012-04-05 09:52:03 +00:00
|
|
|
elif is_text:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(curve, "use_fast_edit", text="Fast Editing")
|
2009-11-19 23:59:37 +00:00
|
|
|
|
2012-08-17 18:36:20 +00:00
|
|
|
if is_curve or is_text:
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.separator()
|
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
sub = col.column()
|
2020-09-19 22:13:23 -05:00
|
|
|
sub.active = (curve.dimensions == '2D' or (curve.bevel_mode != 'OBJECT' and curve.dimensions == '3D'))
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(curve, "fill_mode")
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2012-02-28 11:18:05 +00:00
|
|
|
if is_curve:
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.separator()
|
|
|
|
|
2020-12-07 13:35:50 -08:00
|
|
|
sub = col.column(heading="Curve Deform", align=True)
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(curve, "use_radius")
|
|
|
|
sub.prop(curve, "use_stretch")
|
2012-02-28 11:18:05 +00:00
|
|
|
sub.prop(curve, "use_deform_bounds")
|
|
|
|
|
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-09-15 13:20:18 +00:00
|
|
|
bl_label = "Texture Space"
|
2011-06-17 13:53:47 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2022-07-25 09:08:54 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2011-06-17 13:53:47 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
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
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(curve, "use_auto_texspace")
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(curve, "texspace_location")
|
|
|
|
col.prop(curve, "texspace_size")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
Move curve's boundbox and texspace calculation out of modifier stack
There were several issues with how bounding box and texture space
are calculated:
- This was done at the same time as applying modifiers, meaning if
several objects are sharing the same curve datablock, bounding
box and texture space will be calculated multiple times.
Further, allocating bounding box wasn't safe for threading.
- Bounding box and texture space were evaluated after pre-tessellation
modifiers are applied. This means Curve-level data is actually
depends on object data, and it's really bad because different
objects could have different modifiers and this leads to
conflicts (curve's data depends on object evaluation order)
and doesn't behave in a predictable way.
This commit moves bounding box and texture space evaluation from
modifier stack to own utility functions, just like it's was done
for meshes.
This makes curve objects update thread-safe, but gives some
limitations as well. Namely, with such approach it's not so
clear how to preserve the same behavior of texture space:
before this change texture space and bounding box would match
beveled curve as accurate as possible.
Old behavior was nice for quick texturing -- in most cases you
didn't need to modify texture space at all. But texture space
was depending on render/preview settings which could easily lead
to situations, when final result would be far different from
preview one.
Now we're using CV points coordinates and their radius to approximate
the bounding box. This doesn't give the same exact texture space,
but it helps a lot keeping texture space in a nice predictable way.
We could make approximation smarter in the future, but fir now
added operator to match texture space to fully tessellated curve
called "Match Texture Space".
Review link:
https://codereview.appspot.com/15410043/
Brief description:
http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2013/Results#Curve_Texture_Space
2013-10-20 14:41:33 +02:00
|
|
|
layout.operator("curve.match_texture_space")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2013-12-12 18:08:41 +06:00
|
|
|
class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Geometry"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-12-15 01:32:36 +11:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (type(context.curve) in {Curve, TextCurve})
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
curve = context.curve
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
2010-08-20 06:09:58 +00:00
|
|
|
col.prop(curve, "offset")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column()
|
2020-09-16 10:20:38 -05:00
|
|
|
sub.active = (curve.bevel_mode != 'OBJECT')
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(curve, "extrude")
|
|
|
|
|
|
|
|
col.prop(curve, "taper_object")
|
2021-03-23 18:26:13 +11:00
|
|
|
col.prop(curve, "taper_radius_mode")
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2019-07-08 22:44:57 +02:00
|
|
|
if type(curve) is not TextCurve:
|
|
|
|
# This setting makes no sense for texts, since we have no control over start/end of the bevel object curve.
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = curve.taper_object is not None
|
|
|
|
sub.prop(curve, "use_map_taper")
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel):
|
|
|
|
bl_label = "Bevel"
|
|
|
|
bl_parent_id = "DATA_PT_geometry_curve"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (type(context.curve) in {Curve, TextCurve})
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
curve = context.curve
|
2020-09-16 10:20:38 -05:00
|
|
|
layout.prop(curve, "bevel_mode", expand=True)
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2020-09-16 10:20:38 -05:00
|
|
|
layout.use_property_split = True
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2020-09-16 10:20:38 -05:00
|
|
|
col = layout.column()
|
|
|
|
if curve.bevel_mode == 'OBJECT':
|
|
|
|
col.prop(curve, "bevel_object", text="Object")
|
|
|
|
else:
|
|
|
|
col.prop(curve, "bevel_depth", text="Depth")
|
|
|
|
col.prop(curve, "bevel_resolution", text="Resolution")
|
|
|
|
col.prop(curve, "use_fill_caps")
|
2009-09-07 15:02:43 +00:00
|
|
|
|
2020-09-21 19:19:21 -05:00
|
|
|
if curve.bevel_mode == 'PROFILE':
|
|
|
|
col.template_curveprofile(curve, "bevel_profile")
|
2014-07-04 15:11:51 +06:00
|
|
|
|
2014-03-28 16:41:56 +06:00
|
|
|
|
2020-09-21 19:19:21 -05:00
|
|
|
class DATA_PT_geometry_curve_start_end(CurveButtonsPanelCurve, Panel):
|
|
|
|
bl_label = "Start & End Mapping"
|
|
|
|
bl_parent_id = "DATA_PT_geometry_curve"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2012-11-08 08:16:44 +00:00
|
|
|
|
2020-09-21 19:19:21 -05:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
# Text objects don't support these properties
|
2022-05-12 14:07:15 +10:00
|
|
|
return (type(context.curve) == Curve)
|
2020-09-21 19:19:21 -05:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
curve = context.curve
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.active = (
|
2020-10-09 16:26:28 -05:00
|
|
|
((curve.bevel_depth > 0.0) or (curve.extrude > 0.0)) or
|
|
|
|
((curve.bevel_mode == 'OBJECT') and curve.bevel_object is not None)
|
2020-09-21 19:19:21 -05:00
|
|
|
)
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(curve, "bevel_factor_start", text="Factor Start")
|
|
|
|
sub.prop(curve, "bevel_factor_end", text="End")
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(curve, "bevel_factor_mapping_start", text="Mapping Start")
|
|
|
|
sub.prop(curve, "bevel_factor_mapping_end", text="End")
|
2020-09-16 10:20:38 -05:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Path Animation"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
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
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
curve = context.curve
|
|
|
|
|
|
|
|
layout.active = curve.use_path
|
|
|
|
|
2010-01-31 23:41:38 +00:00
|
|
|
col = layout.column()
|
2012-04-08 13:11:25 +00:00
|
|
|
col.prop(curve, "path_duration", text="Frames")
|
|
|
|
col.prop(curve, "eval_time")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2012-02-28 11:18:05 +00:00
|
|
|
# these are for paths only
|
2018-06-01 18:44:06 +02:00
|
|
|
col.separator()
|
|
|
|
|
2021-05-20 20:41:10 +02:00
|
|
|
col.prop(curve, "use_path_clamp")
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(curve, "use_path_follow")
|
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):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Active Spline"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
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
|
2013-12-11 22:03:21 +11:00
|
|
|
is_surf = type(curve) is SurfaceCurve
|
2009-10-31 19:31:45 +00:00
|
|
|
is_poly = (act_spline.type == 'POLY')
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if is_poly:
|
|
|
|
# These settings are below but its easier to have
|
2012-02-08 04:37:37 +00:00
|
|
|
# polys set aside since they use so few settings
|
2012-01-06 21:24:10 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(act_spline, "use_cyclic_u")
|
|
|
|
col.prop(act_spline, "use_smooth")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
sub = col.column(heading="Cyclic", align=True)
|
|
|
|
sub.prop(act_spline, "use_cyclic_u", text="U")
|
2018-06-01 18:44:06 +02:00
|
|
|
if is_surf:
|
|
|
|
sub.prop(act_spline, "use_cyclic_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if act_spline.type == 'NURBS':
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
sub = col.column(heading="Bezier", align=True)
|
2010-08-19 17:31:10 +00:00
|
|
|
# sub.active = (not act_spline.use_cyclic_u)
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
sub.prop(act_spline, "use_bezier_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
if is_surf:
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.prop(act_spline, "use_bezier_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
sub = col.column(heading="Endpoint", align=True)
|
|
|
|
sub.prop(act_spline, "use_endpoint_u", text="U")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
if is_surf:
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.prop(act_spline, "use_endpoint_v", text="V")
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(act_spline, "order_u", text="Order U")
|
|
|
|
|
|
|
|
if is_surf:
|
|
|
|
sub.prop(act_spline, "order_v", text="V")
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(act_spline, "resolution_u", text="Resolution U")
|
|
|
|
if is_surf:
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(act_spline, "resolution_v", text="V")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2015-08-05 20:28:31 +10:00
|
|
|
if act_spline.type == 'BEZIER':
|
2018-06-01 18:44:06 +02:00
|
|
|
|
|
|
|
col.separator()
|
2012-01-06 21:24:10 +00:00
|
|
|
|
2012-01-05 16:04:25 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (curve.dimensions == '3D')
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt")
|
2012-01-06 21:24:10 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
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")
|
2022-03-10 18:34:27 -06:00
|
|
|
if act_spline.type == 'NURBS':
|
2022-03-11 15:18:14 +11:00
|
|
|
col = None
|
|
|
|
for direction in range(2):
|
|
|
|
message = act_spline.valid_message(direction)
|
|
|
|
if not message:
|
|
|
|
continue
|
|
|
|
if col is None:
|
|
|
|
layout.separator()
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text=message, icon='INFO')
|
|
|
|
del col
|
2009-09-09 00:10:12 +00:00
|
|
|
|
2009-11-19 23:59:37 +00:00
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
class DATA_PT_font(CurveButtonsPanelText, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Font"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
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
|
2019-10-09 13:53:27 +11:00
|
|
|
char = text.edit_format
|
|
|
|
mode = context.mode
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-08-28 12:38:54 +10:00
|
|
|
row = layout.split(factor=0.25)
|
2011-09-21 15:18:38 +00:00
|
|
|
row.label(text="Regular")
|
2010-12-06 04:05:34 +00:00
|
|
|
row.template_ID(text, "font", open="font.open", unlink="font.unlink")
|
2018-08-28 12:38:54 +10:00
|
|
|
row = layout.split(factor=0.25)
|
2011-09-21 15:18:38 +00:00
|
|
|
row.label(text="Bold")
|
2010-12-06 04:05:34 +00:00
|
|
|
row.template_ID(text, "font_bold", open="font.open", unlink="font.unlink")
|
2018-08-28 12:38:54 +10:00
|
|
|
row = layout.split(factor=0.25)
|
2011-09-21 15:18:38 +00:00
|
|
|
row.label(text="Italic")
|
2010-12-06 04:05:34 +00:00
|
|
|
row.template_ID(text, "font_italic", open="font.open", unlink="font.unlink")
|
2018-08-28 12:38:54 +10:00
|
|
|
row = layout.split(factor=0.25)
|
2011-09-21 15:18:38 +00:00
|
|
|
row.label(text="Bold & Italic")
|
2010-12-06 04:05:34 +00:00
|
|
|
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-10-09 13:53:27 +11:00
|
|
|
if mode == 'EDIT_TEXT':
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(char, "use_bold", toggle=True)
|
|
|
|
row.prop(char, "use_italic", toggle=True)
|
|
|
|
row.prop(char, "use_underline", toggle=True)
|
|
|
|
row.prop(char, "use_small_caps", toggle=True)
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class DATA_PT_font_transform(CurveButtonsPanelText, Panel):
|
|
|
|
bl_label = "Transform"
|
|
|
|
bl_parent_id = "DATA_PT_font"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
text = context.curve
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.separator()
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(text, "size", text="Size")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "shear")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col.separator()
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(text, "family")
|
|
|
|
col.prop(text, "follow_curve")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col.separator()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2012-04-05 09:52:03 +00:00
|
|
|
sub = col.column(align=True)
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(text, "underline_position", text="Underline Position")
|
|
|
|
sub.prop(text, "underline_height", text="Underline Thickness")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(text, "small_caps_scale", text="Small Caps Scale")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Paragraph"
|
2009-11-18 01:30:28 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
def draw(self, context):
|
2018-09-11 18:15:55 +10:00
|
|
|
# Parent panel
|
|
|
|
pass
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel):
|
|
|
|
bl_parent_id = "DATA_PT_paragraph"
|
|
|
|
bl_label = "Alignment"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-09-05 11:21:12 +10:00
|
|
|
layout.use_property_split = True
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
text = context.curve
|
|
|
|
|
2018-09-05 11:21:12 +10:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(text, "align_x", text="Horizontal")
|
|
|
|
col.prop(text, "align_y", text="Vertical")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel):
|
|
|
|
bl_parent_id = "DATA_PT_paragraph"
|
|
|
|
bl_label = "Spacing"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
text = context.curve
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.prop(text, "space_character", text="Character Spacing")
|
|
|
|
col.prop(text, "space_word", text="Word Spacing")
|
|
|
|
col.prop(text, "space_line", text="Line Spacing")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.prop(text, "offset_x", text="Offset X")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "offset_y", text="Y")
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
|
2013-12-11 22:03:21 +11:00
|
|
|
class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Text Boxes"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-11-19 23:59:37 +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
|
|
|
|
2018-10-01 10:45:50 +02:00
|
|
|
layout.operator("font.textbox_add", icon='ADD')
|
2018-09-12 13:00:30 -03:00
|
|
|
layout.prop(text, "overflow", text="Overflow")
|
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
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = row.column()
|
|
|
|
col.use_property_split = True
|
2010-06-22 21:31:26 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(box, "width", text="Size X")
|
|
|
|
sub.prop(box, "height", text="Y")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(box, "x", text="Offset X")
|
|
|
|
sub.prop(box, "y", text="Y")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2012-06-19 22:17:19 +00:00
|
|
|
row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i
|
2010-07-05 22:22:22 +00:00
|
|
|
|
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):
|
2022-07-25 09:08:54 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
|
2010-08-12 19:36:10 +00:00
|
|
|
_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
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
|
|
|
|
classes = (
|
|
|
|
DATA_PT_context_curve,
|
2017-03-20 02:34:32 +11:00
|
|
|
DATA_PT_shape_curve,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_curve_texture_space,
|
|
|
|
DATA_PT_geometry_curve,
|
2018-06-04 12:20:40 +02:00
|
|
|
DATA_PT_geometry_curve_bevel,
|
2020-09-21 19:19:21 -05:00
|
|
|
DATA_PT_geometry_curve_start_end,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_pathanim,
|
2017-03-20 02:34:32 +11:00
|
|
|
DATA_PT_active_spline,
|
|
|
|
DATA_PT_font,
|
2018-06-04 12:20:40 +02:00
|
|
|
DATA_PT_font_transform,
|
2017-03-20 02:34:32 +11:00
|
|
|
DATA_PT_paragraph,
|
2018-06-04 12:20:40 +02:00
|
|
|
DATA_PT_paragraph_alignment,
|
|
|
|
DATA_PT_paragraph_spacing,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_text_boxes,
|
2017-03-20 02:34:32 +11:00
|
|
|
DATA_PT_custom_props_curve,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|