Blender Git Loki

Git Commits -> Revision 39f8c6e

Revision 39f8c6e by Tamito Kajiyama (master)
February 21, 2013, 02:57 (GMT)
Freestyle Python API improvements - part 5.

Handling of keyword arguments in Python wrapper class constructors was revised.
This revision is mainly focused on Interface0D, Interface1D, Iterator, and
their subclasses, as well as a few additional view map component classes.

Implementation notes: Because of the extensive use of constructor overloading
in the underlying C++ classes, the corresponding Python wrappers try to parse
arguments through multiple calls of PyArg_ParseTupleAndKeywords() if needed.
The downside of this implementation is that most argument errors result in the
same error message ("invalid argument(s)") without indicating what is wrong.
For now this issue is left for future work.

* Now the instantiation of ViewVertex is prohibited since the underlying
C++ class is an abstract class.

* Removed the .cast_to_interface0diterator() method from CurvePointIterator
and StrokeVertexIterator. Instead the constructor of Interface0DIterator now
accepts the instances of these two iterator classes to construct a nested
Interface0DIterator instance that can be passed to Function0D functor objects.
Specifically, an iterator 'it' is passed to a functor 'func' as follows:

func(Interface0DIterator(it))

instead of:

func(it.cast_to_interface0diterator())

* Boolean arguments of class constructors only accept values of boolean type.
Input values of other types are considered as error.

* Additional code clean-up was made.

Commit Details:

Full Hash: 39f8c6e189c89f4097f5d979612cb71bd8773030
SVN Revision: 54698
Parent Commit: 92436c9
Lines Changed: +905, -902

38 Modified Paths:

/release/scripts/freestyle/style_modules/ChainingIterators.py (+15, -15) (Diff)
/release/scripts/freestyle/style_modules/parameter_editor.py (+5, -5) (Diff)
/release/scripts/freestyle/style_modules/shaders.py (+9, -11) (Diff)
/source/blender/freestyle/intern/python/BPy_BBox.cpp (+11, -6) (Diff)
/source/blender/freestyle/intern/python/BPy_Convert.cpp (+1, -0) (Diff)
/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp (+50, -45) (Diff)
/source/blender/freestyle/intern/python/BPy_Id.cpp (+25, -25) (Diff)
/source/blender/freestyle/intern/python/BPy_Interface0D.cpp (+3, -1) (Diff)
/source/blender/freestyle/intern/python/BPy_Interface1D.cpp (+3, -1) (Diff)
/source/blender/freestyle/intern/python/BPy_Iterator.cpp (+16, -2) (Diff)
/source/blender/freestyle/intern/python/BPy_SShape.cpp (+10, -12) (Diff)
/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp (+113, -115) (Diff)
/source/blender/freestyle/intern/python/BPy_ViewMap.cpp (+4, -0) (Diff)
/source/blender/freestyle/intern/python/BPy_ViewShape.cpp (+45, -25) (Diff)
/source/blender/freestyle/intern/python/BPy_ViewShape.h (+3, -0) (Diff)
/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp (+47, -45) (Diff)
/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp (+29, -30) (Diff)
/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp (+3, -18) (Diff)
/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp (+71, -53) (Diff)
/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp (+10, -23) (Diff)
/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp (+6, -9) (Diff)
/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp (+23, -23) (Diff)
/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp (+21, -23) (Diff)
/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp (+9, -36) (Diff)
/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp (+11, -5) (Diff)
/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp (+17, -19) (Diff)
/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp (+23, -21) (Diff)
/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp (+23, -23) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp (+37, -34) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp (+32, -27) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp (+49, -61) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp (+29, -26) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp (+32, -45) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp (+39, -9) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp (+7, -13) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp (+10, -35) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp (+38, -38) (Diff)
/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp (+26, -23) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021