Fix various Freestyle rendering bugs.

This commit is contained in:
Brecht Van Lommel
2018-11-04 22:34:20 +01:00
parent 287c023b85
commit 4e37796976
4 changed files with 10 additions and 6 deletions

View File

@@ -391,7 +391,7 @@ class ColorDistanceFromObjectShader(ColorRampModifier):
# construct a model-view matrix
matrix = getCurrentScene().camera.matrix_world.inverted()
# get the object location in the camera coordinate
self.loc = matrix * target.location
self.loc = matrix @ target.location
def shade(self, stroke):
it = iter_distance_from_object(stroke, self.loc, *self.range)
@@ -411,7 +411,7 @@ class AlphaDistanceFromObjectShader(CurveMappingModifier):
# construct a model-view matrix
matrix = getCurrentScene().camera.matrix_world.inverted()
# get the object location in the camera coordinate
self.loc = matrix * target.location
self.loc = matrix @ target.location
def shade(self, stroke):
it = iter_distance_from_object(stroke, self.loc, *self.range)
@@ -434,7 +434,7 @@ class ThicknessDistanceFromObjectShader(ThicknessBlenderMixIn, CurveMappingModif
# construct a model-view matrix
matrix = getCurrentScene().camera.matrix_world.inverted()
# get the object location in the camera coordinate
self.loc = matrix * target.location
self.loc = matrix @ target.location
def shade(self, stroke):
it = iter_distance_from_object(stroke, self.loc, *self.range)
@@ -520,7 +520,7 @@ class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier):
dir = self.func(it)
if dir.length != 0.0:
dir.normalize()
fac = abs(dir.orthogonal() * self.orientation)
fac = abs(dir.orthogonal() @ self.orientation)
b = self.thickness.min + fac * self.thickness.delta
else:
b = self.thickness.min