﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ARef%2FRelease_Notes%2F2.70%2FFreestyle</id>
	<title>Dev:Ref/Release Notes/2.70/Freestyle - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ARef%2FRelease_Notes%2F2.70%2FFreestyle"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Ref/Release_Notes/2.70/Freestyle&amp;action=history"/>
	<updated>2026-08-01T14:14:59Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Ref/Release_Notes/2.70/Freestyle&amp;diff=146025&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Ref/Release_Notes/2.70/Freestyle&amp;diff=146025&amp;oldid=prev"/>
		<updated>2018-06-28T21:07:07Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 21:07時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Ref/Release_Notes/2.70/Freestyle&amp;diff=146024&amp;oldid=prev</id>
		<title>2014年3月3日 (月) 22:38にwiki&gt;Brechtによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Ref/Release_Notes/2.70/Freestyle&amp;diff=146024&amp;oldid=prev"/>
		<updated>2014-03-03T22:38:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Blender 2.70: Freestyle NPR Rendering=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Freestyle is designed to be a highly programmable non-photorealistic (NPR) rendering engine that allows users to develop their own line stylization options using the Python programming language.  The present Blender 2.70 release has incorporated major revisions of the Freestyle Python application program interface (API) that may break existing application programs (style modules), now that some breakage of backwards compatibility is allowed with the 2.7x series.  Python style modules written for Blender 2.67-2.69 are likely to need (minor) code updates.  It is also noted that the API changes are totally internal, so that there is no artist-visible effects on Freestyle rendering results.&lt;br /&gt;
&lt;br /&gt;
==Part 1: Python API Module Reorganization==&lt;br /&gt;
&lt;br /&gt;
Freestyle-related Python modules have been reorganized in line with the bpy module and its submodules ([https://developer.blender.org/T37565 T37565]).  The API updates aim to address the following issues observed in the present Freestyle implementation:&lt;br /&gt;
&lt;br /&gt;
# Freestyle API constructs for style module writing in Python were not logically organized. The API modules were partly organized in terms of implementation languages (C and Python) and partly based on implemented roles (predicates, chaining iterators, and so on).&lt;br /&gt;
# All Python scripts for Freestyle, i.e., both API modules and application programs (style modules), were stored in the same 'release/scripts/freestyle/style_modules' directory. This made it difficult for new users to find style modules.&lt;br /&gt;
&lt;br /&gt;
===New Python module organization===&lt;br /&gt;
&lt;br /&gt;
The new Python module directory structure is organized as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;release/scripts/freestyle/modules&amp;lt;/code&amp;gt; - Freestyle API modules&lt;br /&gt;
* &amp;lt;code&amp;gt;release/scripts/freestyle/styles&amp;lt;/code&amp;gt; - predefined style modules&lt;br /&gt;
&lt;br /&gt;
In Python, the Freestyle API modules are reorganized as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle&amp;lt;/code&amp;gt; - top-level package just containing the following submodules.&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.types&amp;lt;/code&amp;gt; - classes for core data structures, and base classes for user-defined stylization rules (i.e., chaining iterators, predicates, functions, and shaders).&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.chainingiterators&amp;lt;/code&amp;gt; - predefined chaining iterators.&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.predicates&amp;lt;/code&amp;gt; - predefined 0D and 1D predicates.&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.functions&amp;lt;/code&amp;gt; - predefined 0D and 1D functions.&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.shaders&amp;lt;/code&amp;gt; - predefined stroke shaders.&lt;br /&gt;
* &amp;lt;code&amp;gt;freestyle.utils&amp;lt;/code&amp;gt; - utility functions for style module writing.&lt;br /&gt;
&lt;br /&gt;
===Code examples before/after the API revision===&lt;br /&gt;
&lt;br /&gt;
The effects of the API changes are illustrated below by taking the japanese_bigbrush.py style module as example.  With the previous API organization (before the API updates), the import statements in the beginning of the style module were written as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantColorShader, \&lt;br /&gt;
    ConstantThicknessShader, IntegrationType, Operators, QuantitativeInvisibilityUP1D, \&lt;br /&gt;
    SamplingShader, TextureAssignerShader, TipRemoverShader&lt;br /&gt;
from Functions0D import pyInverseCurvature2DAngleF0D&lt;br /&gt;
from PredicatesB1D import pyLengthBP1D&lt;br /&gt;
from PredicatesU0D import pyParameterUP0D&lt;br /&gt;
from PredicatesU1D import pyDensityUP1D, pyHigherLengthUP1D, pyHigherNumberOfTurnsUP1D&lt;br /&gt;
from logical_operators import NotUP1D&lt;br /&gt;
from shaders import pyNonLinearVaryingThicknessShader, pySamplingShader&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the updated Python API, these import statements are written as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from freestyle.chainingiterators import ChainSilhouetteIterator&lt;br /&gt;
from freestyle.functions import pyInverseCurvature2DAngleF0D&lt;br /&gt;
from freestyle.predicates import (&lt;br /&gt;
    NotUP1D,&lt;br /&gt;
    QuantitativeInvisibilityUP1D,&lt;br /&gt;
    pyDensityUP1D,&lt;br /&gt;
    pyHigherLengthUP1D,&lt;br /&gt;
    pyHigherNumberOfTurnsUP1D,&lt;br /&gt;
    pyLengthBP1D,&lt;br /&gt;
    pyParameterUP0D,&lt;br /&gt;
    )&lt;br /&gt;
from freestyle.shaders import (&lt;br /&gt;
    BezierCurveShader,&lt;br /&gt;
    ConstantColorShader,&lt;br /&gt;
    ConstantThicknessShader,&lt;br /&gt;
    SamplingShader,&lt;br /&gt;
    TextureAssignerShader,&lt;br /&gt;
    TipRemoverShader,&lt;br /&gt;
    pyNonLinearVaryingThicknessShader,&lt;br /&gt;
    pySamplingShader,&lt;br /&gt;
    )&lt;br /&gt;
from freestyle.types import IntegrationType, Operators&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the applicative perspective, the new organization will be much easier for style module writers to find relevant Python constructs from the freestyle.* submodules.  It is remarked that there is no functional difference (no visual effects in rendering results) between the present and new module organizations.&lt;br /&gt;
&lt;br /&gt;
==Part 2: Better Support for the Python Iterator Protocol==&lt;br /&gt;
&lt;br /&gt;
Freestyle iterators now provide a better support for Python's iterator protocol ([https://developer.blender.org/T38213 T38213]).  Taking the StrokeVertexIterator (used in a stroke shader) as example, iteration over stroke vertices has been traditionally written using a C++-style iterator object (&amp;lt;code&amp;gt;it&amp;lt;/code&amp;gt;) as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
it = stroke.stroke_vertices_begin()&lt;br /&gt;
while not it.is_end:&lt;br /&gt;
    # do something&lt;br /&gt;
    it.increment()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from Blender 2.70, the same iteration can be written using the Python iterator protocol as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
it = iter(stroke)&lt;br /&gt;
for vert in it:&lt;br /&gt;
    # do something&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second form of iteration over vertices could be used previously, but was not working as most users might expect.  The problem was that the iterator object &amp;lt;code&amp;gt;it&amp;lt;/code&amp;gt; and the for-loop get out of sync: specifically, &amp;lt;code&amp;gt;it.object&amp;lt;/code&amp;gt; refers to the next vertex of the one seen as &amp;lt;code&amp;gt;vert&amp;lt;/code&amp;gt; within the for-loop.  Since the iterator object is often passed to predicates and functions as an argument to perform operations at each of the vertices in a loop, the second notation was not applicable because of the inconsistency between the iterator object and the for-loop.  Now this form of for-loop is fully operational, and the iterator and for-loop go through the vertices in sync.&lt;br /&gt;
&lt;br /&gt;
In addition, next(it) now also works reliably, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
it = iter(stroke)&lt;br /&gt;
first_vert = next(it)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is noted that iteration over vertices in the reversed order can be written as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
it = stroke.stroke_vertices_end()&lt;br /&gt;
for svert in it:&lt;br /&gt;
    # do something&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Acknowledgement==&lt;br /&gt;
The key contributor of the API updates is Folkert de Vries (flokkievids) through the tasks [http://developer.blender.org/T37565 T37565] and [http://developer.blender.org/T38213 T38213].  Thanks also go to Campbell Barton for code review and discussions.&lt;/div&gt;</summary>
		<author><name>wiki&gt;Brecht</name></author>
		
	</entry>
</feed>