Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/freestyle/modules/parameter_editor.py
| Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | class CurveMappingModifier(ScalarBlendModifier): | ||||
| def LINEAR(self, t): | def LINEAR(self, t): | ||||
| return (1.0 - t) if self.invert else t | return (1.0 - t) if self.invert else t | ||||
| def CURVE(self, t): | def CURVE(self, t): | ||||
| # deprecated: return evaluateCurveMappingF(self.curve, 0, t) | # deprecated: return evaluateCurveMappingF(self.curve, 0, t) | ||||
| curve = self.curve | curve = self.curve | ||||
| curve.initialize() | curve.initialize() | ||||
| result = curve.curves[0].evaluate(t) | result = curve.evaluate(curve=curve.curves[0], position=t) | ||||
| # float precision errors in t can give a very weird result for evaluate. | # float precision errors in t can give a very weird result for evaluate. | ||||
| # therefore, bound the result by the curve's min and max values | # therefore, bound the result by the curve's min and max values | ||||
| return bound(curve.clip_min_y, result, curve.clip_max_y) | return bound(curve.clip_min_y, result, curve.clip_max_y) | ||||
| class ThicknessModifierMixIn: | class ThicknessModifierMixIn: | ||||
| def __init__(self): | def __init__(self): | ||||
| scene = getCurrentScene() | scene = getCurrentScene() | ||||
| ▲ Show 20 Lines • Show All 1,369 Lines • Show Last 20 Lines | |||||