[Bf-committers] Freestyle branch - request for code review

Tamito KAJIYAMA rd6t-kjym at asahi-net.or.jp
Mon Feb 25 02:09:48 CET 2013

Dear all,

I would like to ask for code review of the Freestyle branch aiming at a trunk
merger in view of the upcoming 2.67 release.  The reference revision for the
code review is 54826.

Since the first round of branch code review, all the comments, suggestions
and requested changes have been addressed as briefly summarized below.

Any support and response concerning this code review request are duly

With best regards,


A summary of changes since the first round of branch code review

1. Freestyle Python API

1.1) Most get/set methods of Python API classes were transformed into
properties (attributes) written using PyGetSetDef.  Vector get/setters have
been implemented using mathutils Vector callbacks.

1.2) The naming of methods and attributes was fixed to follow the naming
conventions of the Blender Python API (i.e., lower case + underscores for
methods and attributes, and CamelCase for classes).

1.3) Per-coordinate get/setters (e.g., .getX and .setX) were removed in
favor of vector get/setters (e.g., .point_3d).  Exceptions are
Interface0D.projected_[xyz], because Interface0D.projected_z is the only
property that gives access to the Z component of a projected point from the
3D camera to 2D image space.  The other two component-wise properties are
redundant but kept for consistency.

1.4) Proper handling of keyword arguments has been implemented in all class
constructors and methods.

  [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.]

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

1.6) "__getitem__" methods were removed and the Sequence protocol has been
used instead.

1.7) Fix for wild card import (e.g., "from Freestyle import *") was done.
Now import statements are either without using "from" or with all imported
names explicitly listed.

2. User interface

2.1) The new "Freestyle" panel has been added to the Render properties.  The
new panel accommodates global Freestyle options, and the global Freestyle
toggle button is shown in the panel header.

2.2) The new "Render Layers" tab has been created and all per-layer options
have been move from the Render tab to the new tab.

2.3) Old and slow raycasting algorithms were removed.  Now only two
variations (culling and non-culling) of the fastest raycasting algorithms
are available, and they are switched by a toggle button.

2.4) Factory settings contain more meaningful initial Freestyle settings
that generate plain strokes by just enabling Freestyle and rendering.

2.5) General placement of UI controls has been improved.

3. Code

3.1) The entire branch has been updated for better coding style conformance.

3.2) A compiler flag for disabling Freestyle has been added.

3.3) The new --debug-freestyle option has been added for enabling debug
information in Freestyle.


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

More information about the Bf-committers mailing list