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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-12 00:35:03 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-12 00:35:03 +0400
commite7a4d454350beb1ce20f3d7d2d091451a885eefe (patch)
tree4709f76bb57fadbd7dcf85204be2ff5cd0d5b13e /source/blender/blenkernel/intern/linestyle.c
parent80e398e7b2cfbdf0192b11734cb02b378b423d65 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/linestyle.c')
-rw-r--r--source/blender/blenkernel/intern/linestyle.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index a8d8038e7f9..0c48590410e 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -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);
}