diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-31 11:46:58 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-31 17:16:45 +0300 |
commit | 3ca0870023bb71bc929925a8fc8d172c09df710f (patch) | |
tree | 8164c8c5bc86cd6e4344cd3ae625e26d18a566c6 /source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp | |
parent | 3100fbef5e0e3943eb53e451e00dd23a11bf3017 (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 'source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp index 1ef29792d56..9f0660baa9b 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp @@ -188,7 +188,10 @@ static PyObject *CurvePoint_fedge_get(BPy_CurvePoint *self, void *UNUSED(closure { SVertex *A = self->cp->A(); Interface0D *B = (Interface0D *)self->cp->B(); - return Any_BPy_Interface1D_from_Interface1D(*(A->getFEdge(*B))); + // B can be NULL under certain circumstances + if (B) + return Any_BPy_Interface1D_from_Interface1D(*(A->getFEdge(*B))); + Py_RETURN_NONE; } PyDoc_STRVAR(CurvePoint_t2d_doc, |