forked from bartvdbraak/blender
curve.textboxes collection access for the UI + minor UI tweaks for poly curves
This commit is contained in:
parent
e6965c46fc
commit
850abb3580
@ -150,15 +150,27 @@ 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()
|
||||
|
||||
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")
|
||||
|
||||
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:")
|
||||
|
||||
col.itemL(text="Resolution:")
|
||||
|
||||
col = split.column()
|
||||
@ -166,7 +178,7 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
|
||||
|
||||
if act_spline.type == 'NURBS':
|
||||
sub = col.column()
|
||||
sub.active = (not act_spline.cyclic_u)
|
||||
# sub.active = (not act_spline.cyclic_u)
|
||||
sub.itemR(act_spline, "bezier_u", text="U")
|
||||
sub.itemR(act_spline, "endpoint_u", text="U")
|
||||
|
||||
@ -197,7 +209,6 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
|
||||
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")
|
||||
|
@ -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"
|
||||
@ -158,8 +161,8 @@ class DATA_PT_textboxes(DataButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
box = context.curve.textbox
|
||||
|
||||
for box in text.textboxes:
|
||||
split = layout.box().split()
|
||||
|
||||
col = split.column(align=True)
|
||||
|
@ -159,6 +159,14 @@ static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max)
|
||||
*max= cu->totcol-1;
|
||||
}
|
||||
|
||||
static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max)
|
||||
{
|
||||
Curve *cu= (Curve*)ptr->id.data;
|
||||
*min= 0;
|
||||
*max= cu->totbox-1;
|
||||
}
|
||||
|
||||
|
||||
static void rna_Curve_2d_set(PointerRNA *ptr, int value)
|
||||
{
|
||||
Curve *cu= (Curve*)ptr->id.data;
|
||||
@ -509,11 +517,15 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
|
||||
RNA_def_property_ui_text(prop, "Underline Thickness", "");
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
|
||||
|
||||
prop= RNA_def_property(srna, "textboxes", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox");
|
||||
RNA_def_property_struct_type(prop, "TextBox");
|
||||
RNA_def_property_ui_text(prop, "Textboxes", "");
|
||||
|
||||
prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "actbox");
|
||||
RNA_def_property_range(prop, 0, 100);
|
||||
RNA_def_property_ui_text(prop, "The active text box", "");
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
|
||||
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range");
|
||||
|
||||
/* strings */
|
||||
prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
|
||||
@ -540,11 +552,6 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
|
||||
RNA_def_property_ui_text(prop, "Font", "");
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
|
||||
|
||||
prop= RNA_def_property(srna, "textbox", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tb");
|
||||
RNA_def_property_ui_text(prop, "Textbox", "");
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
|
||||
|
||||
prop= RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
|
||||
RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting.");
|
||||
|
Loading…
Reference in New Issue
Block a user