diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-03 13:51:53 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-03 13:54:59 +0400 |
commit | b7f085d9c128f31d576c732c6439b5a71e8922ee (patch) | |
tree | 8a1fdc2e95470f61d9121b18b125dc272e87d536 /release/scripts | |
parent | 6ec2d72eca618be05e9bf0723886b10e6d5efa46 (diff) |
Patch D246: Texture Marks for freestyle strokes, written and contributed by Paolo Acampora.
Reviewers: brecht, kjym3, #freestyle
Reviewed By: brecht, kjym3
Differential Revision: https://developer.blender.org/D246
Diffstat (limited to 'release/scripts')
4 files changed, 58 insertions, 1 deletions
diff --git a/release/scripts/freestyle/modules/freestyle/shaders.py b/release/scripts/freestyle/modules/freestyle/shaders.py index a6ff61653be..ca14df7ac97 100644 --- a/release/scripts/freestyle/modules/freestyle/shaders.py +++ b/release/scripts/freestyle/modules/freestyle/shaders.py @@ -30,6 +30,7 @@ to be a collection of examples for shader definition in Python from _freestyle import ( BackboneStretcherShader, BezierCurveShader, + BlenderTextureShader, CalligraphicShader, ColorNoiseShader, ColorVariationPatternShader, @@ -44,6 +45,7 @@ from _freestyle import ( SmoothingShader, SpatialNoiseShader, StrokeTextureShader, + StrokeTextureStepShader, TextureAssignerShader, ThicknessNoiseShader, ThicknessVariationPatternShader, diff --git a/release/scripts/freestyle/modules/parameter_editor.py b/release/scripts/freestyle/modules/parameter_editor.py index 73ae0f4712c..a2109d72ae8 100644 --- a/release/scripts/freestyle/modules/parameter_editor.py +++ b/release/scripts/freestyle/modules/parameter_editor.py @@ -66,12 +66,14 @@ from freestyle.predicates import ( from freestyle.shaders import ( BackboneStretcherShader, BezierCurveShader, + BlenderTextureShader, ConstantColorShader, GuidingLinesShader, PolygonalizationShader, SamplingShader, SpatialNoiseShader, StrokeShader, + StrokeTextureStepShader, TipRemoverShader, pyBluePrintCirclesShader, pyBluePrintEllipsesShader, @@ -1368,6 +1370,14 @@ def process(layer_name, lineset_name): shaders_list.append(Transform2DShader( m.pivot, m.scale_x, m.scale_y, m.angle, m.pivot_u, m.pivot_x, m.pivot_y)) color = linestyle.color + if linestyle.use_texture: + has_tex = False + for slot in linestyle.texture_slots: + if slot is not None: + shaders_list.append(BlenderTextureShader(slot)) + has_tex = True + if has_tex: + shaders_list.append(StrokeTextureStepShader(linestyle.texture_spacing)) if (not linestyle.use_chaining) or (linestyle.chaining == 'PLAIN' and linestyle.use_same_object): thickness_position = linestyle.thickness_position else: diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index 63e4f4aa5f6..e979c031b43 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -674,6 +674,19 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, for modifier in linestyle.geometry_modifiers: self.draw_geometry_modifier(context, modifier) + elif linestyle.panel == 'TEXTURE': + layout.separator() + + row = layout.row() + row.prop(linestyle, "use_texture", text="Use Textures") + row.prop(linestyle, "texture_spacing", text="Spacing Along Stroke") + + row = layout.row() + op = row.operator("wm.properties_context_change", + text="Go to Linestyle Textures Properties", + icon='TEXTURE') + op.context = 'TEXTURE' + elif linestyle.panel == 'MISC': pass diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 009309479ec..9aa137ca9ea 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -25,6 +25,7 @@ from bpy.types import (Brush, Material, Object, ParticleSettings, + FreestyleLineStyle, Texture, World) @@ -94,6 +95,10 @@ def context_tex_datablock(context): if idblock: return idblock + idblock = context.line_style + if idblock: + return idblock + if context.particle_system: idblock = context.particle_system.settings @@ -134,6 +139,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): context.world or context.lamp or context.texture or + context.line_style or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings) or context.texture_user) and @@ -952,11 +958,28 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): split.label(text="Object:") split.prop(tex, "object", text="") + elif tex.texture_coords == 'ALONG_STROKE': + split = layout.split(percentage=0.3) + split.label(text="Use Tips:") + split.prop(tex, "use_tips", text="") + if isinstance(idblock, Brush): if context.sculpt_object or context.image_paint_object: brush_texture_settings(layout, idblock, context.sculpt_object) else: - if isinstance(idblock, Material): + if isinstance(idblock, FreestyleLineStyle): + split = layout.split(percentage=0.3) + split.label(text="Projection:") + split.prop(tex, "mapping", text="") + + split = layout.split(percentage=0.3) + split.separator() + row = split.row() + row.prop(tex, "mapping_x", text="") + row.prop(tex, "mapping_y", text="") + row.prop(tex, "mapping_z", text="") + + elif isinstance(idblock, Material): split = layout.split(percentage=0.3) split.label(text="Projection:") split.prop(tex, "mapping", text="") @@ -1129,6 +1152,15 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): factor_but(col, "use_map_kink", "kink_factor", "Kink") factor_but(col, "use_map_rough", "rough_factor", "Rough") + elif isinstance(idblock, FreestyleLineStyle): + split = layout.split() + + col = split.column() + factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color") + col = split.column() + factor_but(col, "use_map_alpha", "alpha_factor", "Alpha") + + layout.separator() if not isinstance(idblock, ParticleSettings): |