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>2015-05-31 11:46:58 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2015-05-31 17:16:45 +0300
commit3ca0870023bb71bc929925a8fc8d172c09df710f (patch)
tree8164c8c5bc86cd6e4344cd3ae625e26d18a566c6 /release/scripts/freestyle/modules/freestyle/functions.py
parent3100fbef5e0e3943eb53e451e00dd23a11bf3017 (diff)
Improvements to the Freestyle Python API (needed by the SVG Exporter)
This patch adds some new functionality to the Freestyle Python API, notably: - MaterialBP1D, checks whether the supplied arguments have the same material - Fixes a potential crash in CurvePoint.fedge (due to NULL pointer) - Makes (error handling in) boolean predicates more robust - Adds a BoundingBox type, to make working with bounding boxes easier - Adds several new functions (get_object_name, get_strokes, is_poly_clockwise, material_from_fedge) - Adds a StrokeCollector StrokeShader, that collects all the strokes from a specific call to Operators.create() - Adds hashing and rich comparison to the FrsMaterial type These new features (most of them, anyway) are needed for making a more robust SVG exporter that supports holes in fills. Reviewers: kjym3, campbellbarton Subscribers: campbellbarton Projects: #bf_blender Differential Revision: https://developer.blender.org/D1245
Diffstat (limited to 'release/scripts/freestyle/modules/freestyle/functions.py')
-rw-r--r--release/scripts/freestyle/modules/freestyle/functions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/release/scripts/freestyle/modules/freestyle/functions.py b/release/scripts/freestyle/modules/freestyle/functions.py
index 48d9b2e2b39..426d344e8ab 100644
--- a/release/scripts/freestyle/modules/freestyle/functions.py
+++ b/release/scripts/freestyle/modules/freestyle/functions.py
@@ -189,11 +189,13 @@ class CurveMaterialF0D(UnaryFunction0DMaterial):
priority is used to pick one of the two materials at material
boundaries.
- Note: expects instances of CurvePoint to be iterated over
+ Notes: expects instances of CurvePoint to be iterated over
+ can return None if no fedge can be found
"""
def __call__(self, inter):
fe = inter.object.fedge
- assert(fe is not None), "CurveMaterialF0D: fe is None"
+ if fe is None:
+ return None
if fe.is_smooth:
return fe.material
else: