[Bf-blender-cvs] [840891e] master: D545: Freestyle Python API: new methods for Stroke and StrokeVertexIterator.

Tamito KAJIYAMA rd6t-kjym at asahi-net.or.jp
Mon Jun 16 03:21:57 CEST 2014


Important information was missing in the commit log: The patch was
contributed by flokkievids (Folkert de Vries). Thanks a lot!

-- 
KAJIYAMA, Tamito <rd6t-kjym at asahi-net.or.jp>


On 16/06/2014 10:13, Tamito Kajiyama wrote:
> Commit: 840891e22a12c7bbb7c3b8d086ef0c6ff11a24d9
> Author: Tamito Kajiyama
> Date:   Mon Jun 16 09:56:58 2014 +0900
> https://developer.blender.org/rB840891e22a12c7bbb7c3b8d086ef0c6ff11a24d9
>
> D545: Freestyle Python API: new methods for Stroke and StrokeVertexIterator.
>
> This revision extends the Freestyle Python API to make for style module writing
> easier.
>
> - freestyle.types.Stroke: A proper support for reversed() is implemented.  It
> works the same with other Python sequence objects (returns an iterator starting
> from the end).  This is in effect equivalent to Stroke.stroke_vertices_end().
>
> - freestyle.types.StrokeVertexIterator: An incremented, decremented and reversed
> method are added.  The first two methods return a new StrokeVertexIterator
> object that has been incremented and decremented, respectively. The reversed
> method returns a new StrokeVertexIterator object that will traverse stroke
> vertices in the opposite direction.
>
> - freestyle.types.Interface0DIterator: Its constructor now accepts a Stroke
> object to create an Interface0DIterator that traverses stroke vertices.  This is
> in effect equivalent to Stroke.vertices_begin().  The new API makes stroke
> shaders involving function calls much simpler as illustrated below:
>
>    # in the old API
>    it = stroke.stroke_vertices_begin()
>    for vert in it:
>        result = somefunc(Interface0DIterator(it))
>
>    # in the new API
>    it = Interface0DIterator(stroke)
>    for vert in it:
>        result = somefunc(it)
>
>
> Differential Revision: https://developer.blender.org/D545
>
> Reviewers: kjym3



More information about the Bf-blender-cvs mailing list