diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-07-20 03:17:30 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-07-20 03:17:30 +0400 |
commit | 5fed0560d9184d9dd64625ce6af70f67e0ad0960 (patch) | |
tree | bf7c1675ebfa339ece476a66015d7225383084f6 /source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp | |
parent | 1cb1d0e6e96e60bb64fc42056e1a3d77b28cf1a4 (diff) |
* Introspection-based automatic type conversion from a generic C++ object
to a specific Python object. The conversion takes place in the following
places.
- Interface0DIterator_getObject (BPy_Interface0DIterator.cpp)
- Director_BPy_BinaryPredicate1D___call__ (Director.cpp)
- Director_BPy_UnaryPredicate1D___call__ (Director.cpp)
- SVertex_viewvertex (BPy_SVertex.cpp)
- BPy_FEdge_from_FEdge (BPy_Convert.cpp)
This is a tentative list and more conversions are expected to be added.
* Added the following two converter functions to BPy_Convert.{cpp,h}:
- BPy_NonTVertex_from_NonTVertex_ptr
- BPy_TVertex_from_TVertex_ptr
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index db27f343ebc..87d3ef4ecd0 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -181,7 +181,13 @@ PyObject * SVertex_normalsSize( BPy_SVertex *self ) { } PyObject * SVertex_viewvertex( BPy_SVertex *self ) { - return BPy_ViewVertex_from_ViewVertex_ptr( self->sv->viewvertex() ); + ViewVertex *vv = self->sv->viewvertex(); + if (!vv) + Py_RETURN_NONE; + if (typeid(*vv) == typeid(NonTVertex)) + return BPy_NonTVertex_from_NonTVertex_ptr( dynamic_cast<NonTVertex*>(vv) ); + else + return BPy_TVertex_from_TVertex_ptr( dynamic_cast<TVertex*>(vv) ); } PyObject *SVertex_setPoint3D( BPy_SVertex *self , PyObject *args) { |