Freestyle: Fix for git merge glitches.

Also made minor code cleanup.
This commit is contained in:
2014-07-28 12:25:26 +09:00
parent b606520791
commit dd13952080
2 changed files with 18 additions and 23 deletions

View File

@@ -1075,20 +1075,7 @@ def process(layer_name, lineset_name):
elif m.type == '2D_TRANSFORM':
shaders_list.append(Transform2DShader(
m.pivot, m.scale_x, m.scale_y, m.angle, m.pivot_u, m.pivot_x, m.pivot_y))
has_tex = False
if scene.render.use_shading_nodes:
if linestyle.use_nodes and linestyle.node_tree:
shaders_list.append(BlenderTextureShader(linestyle.node_tree))
has_tex = True
else:
if linestyle.use_texture:
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))
color = linestyle.color
# -- Base color, alpha and thickness -- #
if (not linestyle.use_chaining) or (linestyle.chaining == 'PLAIN' and linestyle.use_same_object):
thickness_position = linestyle.thickness_position
else:
@@ -1097,11 +1084,10 @@ def process(layer_name, lineset_name):
if bpy.app.debug_freestyle:
print("Warning: Thickness position options are applied when chaining is disabled\n"
" or the Plain chaining is used with the Same Object option enabled.")
shaders_list.append(ConstantColorShader(*(linestyle.color), alpha=linestyle.alpha))
shaders_list.append(BaseThicknessShader(linestyle.thickness, thickness_position,
linestyle.thickness_ratio))
# -- Modifiers and textures -- #
# -- Modifiers -- #
for m in linestyle.color_modifiers:
if not m.use:
continue
@@ -1166,11 +1152,20 @@ def process(layer_name, lineset_name):
thickness_position, linestyle.thickness_ratio,
m.blend, m.influence,
m.orientation, m.thickness_min, m.thickness_max))
if linestyle.use_texture:
textures = tuple(BlenderTextureShader(slot) for slot in linestyle.texture_slots if slot is not None)
if textures:
shaders_list.extend(textures)
shaders_list.append(StrokeTextureStepShader(linestyle.texture_spacing))
# -- Textures -- #
has_tex = False
if scene.render.use_shading_nodes:
if linestyle.use_nodes and linestyle.node_tree:
shaders_list.append(BlenderTextureShader(linestyle.node_tree))
has_tex = True
else:
if linestyle.use_texture:
textures = tuple(BlenderTextureShader(slot) for slot in linestyle.texture_slots if slot is not None)
if textures:
shaders_list.extend(textures)
has_tex = True
if has_tex:
shaders_list.append(StrokeTextureStepShader(linestyle.texture_spacing))
# -- Stroke caps -- #
if linestyle.caps == 'ROUND':
shaders_list.append(RoundCapShader())