Added to the Parameter Editor mode new stroke geometry modifier `Blueprint'
that produces a blueprint using circular, elliptic, and square contour strokes. Related changes and bug fixes were made as follows: * The randomness in radius and center has been transformed into optional parameters of the pyBluePrintCirclesShader and pyBluePrintEllipsesShader. Also a new optional parameter to control the randomness of backbone stretching has been added to the pyBluePrintSquaresShader. * A bug in the pyBluePrintSquaresShader that invisible stroke vertices at corners of rectangular contour strokes were not properly drawn. The problem was due to the changes of the / operator between Python 2.x to 3.x. Even when the two operands of the division operator are integers, Python 3.x gives a floating-point number when the quotient is not an integer. The fix was just to replace the / operator by the // operator for integer division. * An unpleasant discontinuity in circular and elliptical contour strokes was fixed. * The length parameter of the Backbone Stretcher geometry modifier has been renamed to `backbone_length' in line with the parameter of the same name in the pyBluePrintSquaresShader.
This commit is contained in:
@@ -973,7 +973,7 @@ def process(layer_name, lineset_name):
|
||||
m.frequency, m.amplitude, m.octaves, m.angle, _seed.get(m.seed)))
|
||||
elif m.type == "BACKBONE_STRETCHER":
|
||||
shaders_list.append(BackboneStretcherShader(
|
||||
m.amount))
|
||||
m.backbone_length))
|
||||
elif m.type == "TIP_REMOVER":
|
||||
shaders_list.append(TipRemoverShader(
|
||||
m.tip_length))
|
||||
@@ -983,6 +983,16 @@ def process(layer_name, lineset_name):
|
||||
elif m.type == "GUIDING_LINES":
|
||||
shaders_list.append(GuidingLinesShader(
|
||||
m.offset))
|
||||
elif m.type == "BLUEPRINT":
|
||||
if m.shape == "CIRCLES":
|
||||
shaders_list.append(pyBluePrintCirclesShader(
|
||||
m.rounds, m.random_radius, m.random_center))
|
||||
elif m.shape == "ELLIPSES":
|
||||
shaders_list.append(pyBluePrintEllipsesShader(
|
||||
m.rounds, m.random_radius, m.random_center))
|
||||
elif m.shape == "SQUARES":
|
||||
shaders_list.append(pyBluePrintSquaresShader(
|
||||
m.rounds, m.backbone_length, m.random_backbone))
|
||||
color = linestyle.color
|
||||
shaders_list.append(ConstantColorShader(color.r, color.g, color.b, linestyle.alpha))
|
||||
shaders_list.append(ConstantThicknessShader(linestyle.thickness))
|
||||
|
||||
@@ -959,15 +959,19 @@ class pyPerlinNoise2DShader(StrokeShader):
|
||||
stroke.UpdateLength()
|
||||
|
||||
class pyBluePrintCirclesShader(StrokeShader):
|
||||
def __init__(self, turns = 1):
|
||||
def __init__(self, turns = 1, random_radius = 3, random_center = 5):
|
||||
StrokeShader.__init__(self)
|
||||
self.__turns = turns
|
||||
self.__random_center = random_center
|
||||
self.__random_radius = random_radius
|
||||
def getName(self):
|
||||
return "pyBluePrintCirclesShader"
|
||||
def shade(self, stroke):
|
||||
p_min = Vector([10000, 10000])
|
||||
p_max = Vector([0, 0])
|
||||
it = stroke.strokeVerticesBegin()
|
||||
if it.isEnd():
|
||||
return
|
||||
p_min = it.getObject().getPoint()
|
||||
p_max = it.getObject().getPoint()
|
||||
while it.isEnd() == 0:
|
||||
p = it.getObject().getPoint()
|
||||
if (p.x < p_min.x):
|
||||
@@ -986,23 +990,30 @@ class pyBluePrintCirclesShader(StrokeShader):
|
||||
# print("max :", p_max.x, p_max.y) # DEBUG
|
||||
# print("----------------------") # DEBUG
|
||||
#######################################################
|
||||
sv_nb = sv_nb / self.__turns
|
||||
sv_nb = sv_nb // self.__turns
|
||||
center = (p_min + p_max) / 2
|
||||
radius = (center.x - p_min.x + center.y - p_min.y) / 2
|
||||
p_new = Vector([0, 0])
|
||||
#######################################################
|
||||
R = self.__random_radius
|
||||
C = self.__random_center
|
||||
i = 0
|
||||
it = stroke.strokeVerticesBegin()
|
||||
for j in range(self.__turns):
|
||||
radius = radius + randint(-3, 3)
|
||||
center.x = center.x + randint(-5, 5)
|
||||
center.y = center.y + randint(-5, 5)
|
||||
i = 0
|
||||
prev_radius = radius
|
||||
prev_center = center
|
||||
radius = radius + randint(-R, R)
|
||||
center = center + Vector([randint(-C, C), randint(-C, C)])
|
||||
while i < sv_nb and it.isEnd() == 0:
|
||||
p_new.x = center.x + radius * cos(2 * pi * float(i) / float(sv_nb - 1))
|
||||
p_new.y = center.y + radius * sin(2 * pi * float(i) / float(sv_nb - 1))
|
||||
t = float(i) / float(sv_nb - 1)
|
||||
r = prev_radius + (radius - prev_radius) * t
|
||||
c = prev_center + (center - prev_center) * t
|
||||
p_new.x = c.x + r * cos(2 * pi * t)
|
||||
p_new.y = c.y + r * sin(2 * pi * t)
|
||||
it.getObject().setPoint(p_new)
|
||||
i = i + 1
|
||||
it.increment()
|
||||
i = 1
|
||||
verticesToRemove = []
|
||||
while it.isEnd() == 0:
|
||||
verticesToRemove.append(it.getObject())
|
||||
@@ -1012,15 +1023,19 @@ class pyBluePrintCirclesShader(StrokeShader):
|
||||
stroke.UpdateLength()
|
||||
|
||||
class pyBluePrintEllipsesShader(StrokeShader):
|
||||
def __init__(self, turns = 1):
|
||||
def __init__(self, turns = 1, random_radius = 3, random_center = 5):
|
||||
StrokeShader.__init__(self)
|
||||
self.__turns = turns
|
||||
self.__random_center = random_center
|
||||
self.__random_radius = random_radius
|
||||
def getName(self):
|
||||
return "pyBluePrintEllipsesShader"
|
||||
def shade(self, stroke):
|
||||
p_min = Vector([10000, 10000])
|
||||
p_max = Vector([0, 0])
|
||||
it = stroke.strokeVerticesBegin()
|
||||
if it.isEnd():
|
||||
return
|
||||
p_min = it.getObject().getPoint()
|
||||
p_max = it.getObject().getPoint()
|
||||
while it.isEnd() == 0:
|
||||
p = it.getObject().getPoint()
|
||||
if (p.x < p_min.x):
|
||||
@@ -1034,25 +1049,30 @@ class pyBluePrintEllipsesShader(StrokeShader):
|
||||
it.increment()
|
||||
stroke.Resample(32 * self.__turns)
|
||||
sv_nb = stroke.strokeVerticesSize()
|
||||
sv_nb = sv_nb / self.__turns
|
||||
sv_nb = sv_nb // self.__turns
|
||||
center = (p_min + p_max) / 2
|
||||
radius_x = center.x - p_min.x
|
||||
radius_y = center.y - p_min.y
|
||||
radius = center - p_min
|
||||
p_new = Vector([0, 0])
|
||||
#######################################################
|
||||
R = self.__random_radius
|
||||
C = self.__random_center
|
||||
i = 0
|
||||
it = stroke.strokeVerticesBegin()
|
||||
for j in range(self.__turns):
|
||||
radius_x = radius_x + randint(-3, 3)
|
||||
radius_y = radius_y + randint(-3, 3)
|
||||
center.x = center.x + randint(-5, 5)
|
||||
center.y = center.y + randint(-5, 5)
|
||||
i = 0
|
||||
prev_radius = radius
|
||||
prev_center = center
|
||||
radius = radius + Vector([randint(-R, R), randint(-R, R)])
|
||||
center = center + Vector([randint(-C, C), randint(-C, C)])
|
||||
while i < sv_nb and it.isEnd() == 0:
|
||||
p_new.x = center.x + radius_x * cos(2 * pi * float(i) / float(sv_nb - 1))
|
||||
p_new.y = center.y + radius_y * sin(2 * pi * float(i) / float(sv_nb - 1))
|
||||
t = float(i) / float(sv_nb - 1)
|
||||
r = prev_radius + (radius - prev_radius) * t
|
||||
c = prev_center + (center - prev_center) * t
|
||||
p_new.x = c.x + r.x * cos(2 * pi * t)
|
||||
p_new.y = c.y + r.y * sin(2 * pi * t)
|
||||
it.getObject().setPoint(p_new)
|
||||
i = i + 1
|
||||
it.increment()
|
||||
i = 1
|
||||
verticesToRemove = []
|
||||
while it.isEnd() == 0:
|
||||
verticesToRemove.append(it.getObject())
|
||||
@@ -1063,18 +1083,21 @@ class pyBluePrintEllipsesShader(StrokeShader):
|
||||
|
||||
|
||||
class pyBluePrintSquaresShader(StrokeShader):
|
||||
def __init__(self, turns = 1, bb_len = 10):
|
||||
def __init__(self, turns = 1, bb_len = 10, bb_rand = 0):
|
||||
StrokeShader.__init__(self)
|
||||
self.__turns = turns
|
||||
self.__bb_len = bb_len
|
||||
self.__bb_rand = bb_rand
|
||||
|
||||
def getName(self):
|
||||
return "pyBluePrintSquaresShader"
|
||||
|
||||
def shade(self, stroke):
|
||||
p_min = Vector([10000, 10000])
|
||||
p_max = Vector([0, 0])
|
||||
it = stroke.strokeVerticesBegin()
|
||||
if it.isEnd():
|
||||
return
|
||||
p_min = it.getObject().getPoint()
|
||||
p_max = it.getObject().getPoint()
|
||||
while it.isEnd() == 0:
|
||||
p = it.getObject().getPoint()
|
||||
if (p.x < p_min.x):
|
||||
@@ -1089,23 +1112,37 @@ class pyBluePrintSquaresShader(StrokeShader):
|
||||
stroke.Resample(32 * self.__turns)
|
||||
sv_nb = stroke.strokeVerticesSize()
|
||||
#######################################################
|
||||
sv_nb = sv_nb / self.__turns
|
||||
first = sv_nb / 4
|
||||
sv_nb = sv_nb // self.__turns
|
||||
first = sv_nb // 4
|
||||
second = 2 * first
|
||||
third = 3 * first
|
||||
fourth = sv_nb
|
||||
vec_first = Vector([p_max.x - p_min.x + 2 * self.__bb_len, 0])
|
||||
vec_second = Vector([0, p_max.y - p_min.y + 2 * self.__bb_len])
|
||||
vec_third = vec_first * -1
|
||||
vec_fourth = vec_second * -1
|
||||
p_first = Vector([p_min.x - self.__bb_len, p_min.y])
|
||||
p_first_end = Vector([p_max.x + self.__bb_len, p_min.y])
|
||||
p_second = Vector([p_max.x, p_min.y - self.__bb_len])
|
||||
p_second_end = Vector([p_max.x, p_max.y + self.__bb_len])
|
||||
p_third = Vector([p_max.x + self.__bb_len, p_max.y])
|
||||
p_third_end = Vector([p_min.x - self.__bb_len, p_max.y])
|
||||
p_fourth = Vector([p_min.x, p_max.y + self.__bb_len])
|
||||
p_fourth_end = Vector([p_min.x, p_min.y - self.__bb_len])
|
||||
#######################################################
|
||||
R = self.__bb_rand
|
||||
r = self.__bb_rand // 2
|
||||
it = stroke.strokeVerticesBegin()
|
||||
visible = 1
|
||||
for j in range(self.__turns):
|
||||
p_first = p_first + Vector([randint(-R, R), randint(-r, r)])
|
||||
p_first_end = p_first_end + Vector([randint(-R, R), randint(-r, r)])
|
||||
p_second = p_second + Vector([randint(-r, r), randint(-R, R)])
|
||||
p_second_end = p_second_end + Vector([randint(-r, r), randint(-R, R)])
|
||||
p_third = p_third + Vector([randint(-R, R), randint(-r, r)])
|
||||
p_third_end = p_third_end + Vector([randint(-R, R), randint(-r, r)])
|
||||
p_fourth = p_fourth + Vector([randint(-r, r), randint(-R, R)])
|
||||
p_fourth_end = p_fourth_end + Vector([randint(-r, r), randint(-R, R)])
|
||||
vec_first = p_first_end - p_first
|
||||
vec_second = p_second_end - p_second
|
||||
vec_third = p_third_end - p_third
|
||||
vec_fourth = p_fourth_end - p_fourth
|
||||
i = 0
|
||||
while i < sv_nb and it.isEnd() == 0:
|
||||
if i < first:
|
||||
@@ -1156,20 +1193,10 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
||||
def shade(self, stroke):
|
||||
stroke.Resample(32 * self.__turns)
|
||||
p_mean = Vector([0, 0])
|
||||
p_min = Vector([10000, 10000])
|
||||
p_max = Vector([0, 0])
|
||||
it = stroke.strokeVerticesBegin()
|
||||
while it.isEnd() == 0:
|
||||
p = it.getObject().getPoint()
|
||||
p_mean = p_mean + p
|
||||
## if (p.x < p_min.x):
|
||||
## p_min.x = p.x
|
||||
## if (p.x > p_max.x):
|
||||
## p_max.x = p.x
|
||||
## if (p.y < p_min.y):
|
||||
## p_min.y = p.y
|
||||
## if (p.y > p_max.y):
|
||||
## p_max.y = p.y
|
||||
it.increment()
|
||||
sv_nb = stroke.strokeVerticesSize()
|
||||
p_mean = p_mean / sv_nb
|
||||
@@ -1202,8 +1229,8 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
||||
e1 = Vector([cos(theta), sin(theta)]) * sqrt(lambda1) * self.__mult
|
||||
e2 = Vector([cos(theta + pi / 2), sin(theta + pi / 2)]) * sqrt(lambda2) * self.__mult
|
||||
#######################################################
|
||||
sv_nb = sv_nb / self.__turns
|
||||
first = sv_nb / 4
|
||||
sv_nb = sv_nb // self.__turns
|
||||
first = sv_nb // 4
|
||||
second = 2 * first
|
||||
third = 3 * first
|
||||
fourth = sv_nb
|
||||
|
||||
@@ -550,6 +550,17 @@ class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, Panel):
|
||||
elif modifier.type == "GUIDING_LINES":
|
||||
box.prop(modifier, "offset")
|
||||
|
||||
elif modifier.type == "BLUEPRINT":
|
||||
row = box.row()
|
||||
row.prop(modifier, "shape", expand=True)
|
||||
box.prop(modifier, "rounds")
|
||||
if modifier.shape in ["CIRCLES", "ELLIPSES"]:
|
||||
box.prop(modifier, "random_radius")
|
||||
box.prop(modifier, "random_center")
|
||||
elif modifier.shape == "SQUARES":
|
||||
box.prop(modifier, "backbone_length")
|
||||
box.prop(modifier, "random_backbone")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ static char *modifier_name[LS_MODIFIER_NUM] = {
|
||||
"Tip Remover",
|
||||
"Calligraphy",
|
||||
"Polygonalization",
|
||||
"Guiding Lines"};
|
||||
"Guiding Lines",
|
||||
"Blueprint"};
|
||||
|
||||
static void default_linestyle_settings(FreestyleLineStyle *linestyle)
|
||||
{
|
||||
@@ -398,6 +399,9 @@ int FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type)
|
||||
case LS_MODIFIER_GUIDING_LINES:
|
||||
size = sizeof(LineStyleGeometryModifier_GuidingLines);
|
||||
break;
|
||||
case LS_MODIFIER_BLUEPRINT:
|
||||
size = sizeof(LineStyleGeometryModifier_Blueprint);
|
||||
break;
|
||||
default:
|
||||
return -1; /* unknown modifier type */
|
||||
}
|
||||
@@ -435,7 +439,7 @@ int FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type)
|
||||
((LineStyleGeometryModifier_PerlinNoise2D *)m)->angle = 45.0;
|
||||
break;
|
||||
case LS_MODIFIER_BACKBONE_STRETCHER:
|
||||
((LineStyleGeometryModifier_BackboneStretcher *)m)->amount = 10.0;
|
||||
((LineStyleGeometryModifier_BackboneStretcher *)m)->backbone_length = 10.0;
|
||||
break;
|
||||
case LS_MODIFIER_TIP_REMOVER:
|
||||
((LineStyleGeometryModifier_TipRemover *)m)->tip_length = 10.0;
|
||||
@@ -446,6 +450,14 @@ int FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type)
|
||||
case LS_MODIFIER_GUIDING_LINES:
|
||||
((LineStyleGeometryModifier_GuidingLines *)m)->offset = 0.0;
|
||||
break;
|
||||
case LS_MODIFIER_BLUEPRINT:
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->flags = LS_MODIFIER_BLUEPRINT_CIRCLES;
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->rounds = 1;
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->backbone_length = 10.f;
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->random_radius = 3;
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->random_center = 5;
|
||||
((LineStyleGeometryModifier_Blueprint *)m)->random_backbone = 5;
|
||||
break;
|
||||
}
|
||||
add_to_modifier_list(&linestyle->geometry_modifiers, m);
|
||||
return 0;
|
||||
@@ -474,6 +486,8 @@ void FRS_remove_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineS
|
||||
break;
|
||||
case LS_MODIFIER_GUIDING_LINES:
|
||||
break;
|
||||
case LS_MODIFIER_BLUEPRINT:
|
||||
break;
|
||||
}
|
||||
BLI_freelinkN(&linestyle->geometry_modifiers, m);
|
||||
}
|
||||
|
||||
@@ -2723,6 +2723,9 @@ static void write_linestyle_geometry_modifiers(WriteData *wd, ListBase *modifier
|
||||
case LS_MODIFIER_GUIDING_LINES:
|
||||
struct_name = "LineStyleGeometryModifier_GuidingLines";
|
||||
break;
|
||||
case LS_MODIFIER_BLUEPRINT:
|
||||
struct_name = "LineStyleGeometryModifier_Blueprint";
|
||||
break;
|
||||
default:
|
||||
struct_name = "LineStyleGeometryModifier"; // this should not happen
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ typedef struct LineStyleModifier {
|
||||
#define LS_MODIFIER_CALLIGRAPHY 13
|
||||
#define LS_MODIFIER_POLYGONIZATION 14
|
||||
#define LS_MODIFIER_GUIDING_LINES 15
|
||||
#define LS_MODIFIER_NUM 16
|
||||
#define LS_MODIFIER_BLUEPRINT 16
|
||||
#define LS_MODIFIER_NUM 17
|
||||
|
||||
/* LineStyleModifier::flags */
|
||||
#define LS_MODIFIER_ENABLED 1
|
||||
@@ -284,7 +285,7 @@ typedef struct LineStyleGeometryModifier_PerlinNoise2D {
|
||||
typedef struct LineStyleGeometryModifier_BackboneStretcher {
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float amount;
|
||||
float backbone_length;
|
||||
int pad;
|
||||
|
||||
} LineStyleGeometryModifier_BackboneStretcher;
|
||||
@@ -313,6 +314,23 @@ typedef struct LineStyleGeometryModifier_GuidingLines {
|
||||
|
||||
} LineStyleGeometryModifier_GuidingLines;
|
||||
|
||||
/* LineStyleGeometryModifier_BluePrintLines::shape */
|
||||
#define LS_MODIFIER_BLUEPRINT_CIRCLES 1
|
||||
#define LS_MODIFIER_BLUEPRINT_ELLIPSES 2
|
||||
#define LS_MODIFIER_BLUEPRINT_SQUARES 4
|
||||
|
||||
typedef struct LineStyleGeometryModifier_Blueprint {
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
int flags;
|
||||
unsigned int rounds;
|
||||
float backbone_length;
|
||||
unsigned int random_radius;
|
||||
unsigned int random_center;
|
||||
unsigned int random_backbone;
|
||||
|
||||
} LineStyleGeometryModifier_Blueprint;
|
||||
|
||||
/* Calligraphic thickness modifier */
|
||||
|
||||
typedef struct LineStyleThicknessModifier_Calligraphy {
|
||||
|
||||
@@ -299,6 +299,7 @@ extern StructRNA RNA_LineStyleColorModifier_Material;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_BackboneStretcher;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_BezierCurve;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_Blueprint;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_GuidingLines;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_PerlinNoise1D;
|
||||
extern StructRNA RNA_LineStyleGeometryModifier_PerlinNoise2D;
|
||||
|
||||
@@ -61,6 +61,7 @@ EnumPropertyItem linestyle_thickness_modifier_type_items[] ={
|
||||
EnumPropertyItem linestyle_geometry_modifier_type_items[] ={
|
||||
{LS_MODIFIER_BACKBONE_STRETCHER, "BACKBONE_STRETCHER", ICON_MODIFIER, "Backbone Stretcher", ""},
|
||||
{LS_MODIFIER_BEZIER_CURVE, "BEZIER_CURVE", ICON_MODIFIER, "Bezier Curve", ""},
|
||||
{LS_MODIFIER_BLUEPRINT, "BLUEPRINT", ICON_MODIFIER, "Blueprint", ""},
|
||||
{LS_MODIFIER_GUIDING_LINES, "GUIDING_LINES", ICON_MODIFIER, "Guiding Lines", ""},
|
||||
{LS_MODIFIER_PERLIN_NOISE_1D, "PERLIN_NOISE_1D", ICON_MODIFIER, "Perlin Noise 1D", ""},
|
||||
{LS_MODIFIER_PERLIN_NOISE_2D, "PERLIN_NOISE_2D", ICON_MODIFIER, "Perlin Noise 2D", ""},
|
||||
@@ -154,6 +155,8 @@ static StructRNA *rna_LineStyle_geometry_modifier_refine(struct PointerRNA *ptr)
|
||||
return &RNA_LineStyleGeometryModifier_Polygonalization;
|
||||
case LS_MODIFIER_GUIDING_LINES:
|
||||
return &RNA_LineStyleGeometryModifier_GuidingLines;
|
||||
case LS_MODIFIER_BLUEPRINT:
|
||||
return &RNA_LineStyleGeometryModifier_Blueprint;
|
||||
default:
|
||||
return &RNA_LineStyleGeometryModifier;
|
||||
}
|
||||
@@ -378,6 +381,12 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
static EnumPropertyItem blueprint_shape_items[] = {
|
||||
{LS_MODIFIER_BLUEPRINT_CIRCLES, "CIRCLES", 0, "Circles", "Draw a blueprint using circular contour strokes"},
|
||||
{LS_MODIFIER_BLUEPRINT_ELLIPSES, "ELLIPSES", 0, "Ellipses", "Draw a blueprint using elliptic contour strokes"},
|
||||
{LS_MODIFIER_BLUEPRINT_SQUARES, "SQUARES", 0, "Squares", "Draw a blueprint using square contour strokes"},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "LineStyleModifier", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Line Style Modifier", "Base type to define modifiers");
|
||||
|
||||
@@ -651,9 +660,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
|
||||
RNA_def_struct_ui_text(srna, "Backbone Stretcher", "Stretch the beginning and the end of stroke backbone");
|
||||
rna_def_geometry_modifier(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "amount", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "amount");
|
||||
RNA_def_property_ui_text(prop, "Amount", "Amount of stretching");
|
||||
prop= RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "backbone_length");
|
||||
RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
srna= RNA_def_struct(brna, "LineStyleGeometryModifier_TipRemover", "LineStyleGeometryModifier");
|
||||
@@ -683,6 +692,42 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Offset", "Displacement that is applied to the main direction line along its normal");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
srna= RNA_def_struct(brna, "LineStyleGeometryModifier_Blueprint", "LineStyleGeometryModifier");
|
||||
RNA_def_struct_ui_text(srna, "Blueprint", "Produce a blueprint using circular, elliptic, and square contour strokes");
|
||||
rna_def_geometry_modifier(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
|
||||
RNA_def_property_enum_items(prop, blueprint_shape_items);
|
||||
RNA_def_property_ui_text(prop, "Shape", "Select the shape of blueprint contour strokes");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "rounds");
|
||||
RNA_def_property_range(prop, 1, 1000);
|
||||
RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in contour strokes");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "backbone_length");
|
||||
RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "random_radius", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "random_radius");
|
||||
RNA_def_property_ui_text(prop, "Random Radius", "Randomness of the radius");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "random_center", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "random_center");
|
||||
RNA_def_property_ui_text(prop, "Random Center", "Randomness of the center");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "random_backbone", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "random_backbone");
|
||||
RNA_def_property_ui_text(prop, "Random Backbone", "Randomness of the backbone stretching");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
}
|
||||
|
||||
static void rna_def_linestyle(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user