Commit Graph

15 Commits

Author SHA1 Message Date
Campbell Barton
eb495b2a8a use lowercase name for freestyle module (as with all other blender modules). 2013-04-07 11:22:54 +00:00
Tamito Kajiyama
5841d1c814 Added header comments to indicate the author(s) of original files.
Suggested by Sergey Sharybin through a code review of the branch.

The information was mostly recovered from the AUTHORS file [1] of the
stand-alone Freestyle package version 2.2.0.

[1] http://freestyle.cvs.sourceforge.net/viewvc/freestyle/freestyle/AUTHORS.TXT
2013-03-24 00:53:05 +00:00
Tamito Kajiyama
21c10788d7 Freestyle Python API improvements - part 9.
* Fix for wild card import statements (e.g., "from Freestyle import *") was done.
Now import statements are either without using "from" or with all imported names
explicitly listed.

* GNU GPL header blocks were added to Python programs.  Additional code clean-up
was also made.

* Removed freestyle_init.py and extra-lines.sml that were no longer used.
2013-02-24 23:43:40 +00:00
Tamito Kajiyama
3df023ae82 Freestyle Python API improvements - part 8.
* Proper handling of keyword arguments was implemented in Operators and ContextFunctions,
as well as in methods of Interface0D, Interface1D, Iterator, their subclasses, Noise and
IntegrationType.

* Operators' methods and functions in the ContextFunctions module were renamed from
CamelCase to lower cases + underscores.  Style modules were updated accordingly.

* Additional code clean-up was also made.
2013-02-24 02:39:38 +00:00
Tamito Kajiyama
7b3a5f6901 Fix for __repr__() depending on .getName() and .getExactTypeName().
API users no longer need to define them in user-defined Functions, Predicates and StrokeShaders.
Also removed all .getName() and .getExactTypeName() definitions in pre-defined Functions,
Predicates and StrokeShaders subclasses.
2013-02-23 12:17:40 +00:00
Tamito Kajiyama
b35a893249 Freestyle Python API improvements - part 4.
Major API updates were made as in part 3 to address code review comments.
This revision focuses on Python wrappers of C++ iterators.

* Most getter/setter methods were reimplemented as attributes using PyGetSetDef.

* 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).  The only irregular naming change is the following, to
better indicate the functionality:

- ChainingIterator: getVertex --> next_vertex

* In addition, some code clean-up was done in both C++ and Python.  Also duplicated
definitions of predicate classes were removed.
2013-02-16 14:21:40 +00:00
Tamito Kajiyama
731d08d497 Freestyle Python API improvements - part 3.
Major API updates were made to address code review comments.
This revision mostly focuses on Python wrappers of C++ 0D and 1D elements (i.e.,
Interface0D and Interface1D, as well as their subclasses).

* Most getter/setter methods were reimplemented as attributes using PyGetSetDef.
Vector attributes are now implemented based on mathutils callbacks.  Boolean
attributes now only accept boolean values.

* The __getitem__ method was removed and the Sequence protocol was used instead.

* 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).  Some naming inconsistency within the Freestyle Python
API was also addressed.

* The Freestyle API had a number of method names including prefix/suffix "A" and
"B", and their meanings were inconsistent (i.e., referring to different things
depending on the classes).  The names with these two letters were replaced with
more straightforward names.  Also some attribute names were changed so as to indicate
the type of the value (e.g., FEdge.next_fedge instead of FEdge.next_edge) in line
with other names explicitly indicating what the value is (e.g., SVertex.viewvertex).

* In addition, some code clean-up was done in both C++ and Python.

Notes:

In summary, the following irregular naming changes were made through this revision
(those resulting from regular changes of naming conventions are not listed):

- CurvePoint: {A,B} --> {first,second}_svertex
- FEdge: vertex{A,B} --> {first,second}_svertex
- FEdge: {next,previous}Edge --> {next,previous}_fedge
- FEdgeSharp: normal{A,B} --> normal_{right,left}
- FEdgeSharp: {a,b}FaceMark --> face_mark_{right,left}
- FEdgeSharp: {a,b}Material --> material_{right,left}
- FEdgeSharp: {a,b}MaterialIndex --> material_index_{right,left}
- FrsCurve: empty --> is_empty
- FrsCurve: nSegments --> segments_size
- TVertex: mate() --> get_mate()
- ViewEdge: fedge{A,B} --> {first,last}_fedge
- ViewEdge: setaShape, aShape --> occlude
- ViewEdge: {A,B} --> {first,last}_viewvertex
- ViewMap: getScene3dBBox --> scene_bbox
2013-02-14 23:48:34 +00:00
Tamito Kajiyama
acae0e7b1f Further fix for svn:executable. 2012-12-11 23:05:04 +00:00
Tamito Kajiyama
28cc31ba11 Stability improvements for the Face Smoothness option.
The instability considered here is due to a persistent failure of the
getFEdge() method in the Interface0D class and its subclasses in the
presence of smooth FEdges.  When the Face Smoothness option is
enabled, the view map is populated with not only sharp FEdges (i.e.,
edges in the original meshes) but also smooth FEdges (i.e., newly
built edges lying on triangular surfaces).  The failure of getFEdge()
caused many related issues because the method is widely used in other
predicates and functions that rely on it.  The most prominent example
of related user-visible problems is a constant failure of the built-in
MaterialF0D.

The main issue and related problems were addressed as follows:

* A bug in the construction of smooth FEdges was fixed.  Individual
smooth FEdges, even when they were detected as a series of smooth
FEdges that constitute one smooth ViewEdge, may have some irregular
geometry in the form of non-uniform OWXFaceLayer::order values.  The
OWXFaceLayer::order values were used in an inappropriate way, so that
resulting smooth ViewEdges may have an FEdge between two subsequent
SVertices that were indeed the same SVertex object.  This was an
unexpected situation that getFEdge() could not handle.

* Another issue in the construction of smooth FEdges was resolved.
When sharp FEdges are constructed, two SVertices at both ends of an
FEdge are generated only when no SVertex exists in a given 3D position
(this way, the original mesh topology is reconstructed from a bunch of
independent triangles that the BlenderFileLoader class passes to the
view map creation process).  This sharing of SVertices was used also
for the generation of SVertices at the two ends of each smooth FEdge,
causing the getFEdge() failure in the presence of smooth FEdges.  The
workaround implemented here is to simply suppress the sharing of
generated SVertices when smooth FEdges are created.

* In the Parameter Editor mode, the built-in MaterialF0D was replaced
with a better implementation that works well with Curves and Strokes.
MaterialF0D does not work with these 1D data types.
2011-10-10 19:57:06 +00:00
Tamito Kajiyama
d347a27a97 * Bug fixes by Stéphane Grabli with respect to pyZDependingThicknessShader,
pyMaterialColorShader, pyBluePrintEllipsesShader and pyBluePrintSquaresShader.

* Fixes for Vector instantiation that now takes only a sequence object of
2, 3, or 4 elements -- an API change in revision 28417.

* Deleted vector.py that is no longer used.
2010-07-06 20:07:07 +00:00
Tamito Kajiyama
1ff038397f Made standard style modules compatible with Python 3. 2009-09-27 00:58:38 +00:00
Tamito Kajiyama
1ed4d4cbfb Reverted all changes (i.e., deletion) in release/scripts/freestyle. 2009-09-19 22:02:15 +00:00
Tamito Kajiyama
be50ce61be Merged
https://svn.blender.org/svnroot/bf-blender/branches/soc-2008-mxcurioni (r22789) and
https://svn.blender.org/svnroot/bf-blender/trunk/blender (r23338)
with the "Ignore ancestry" and "Ignore line endings" options enabled (using
TortoiseSVN on Windows).

After the merge operation, all changes (i.e., deletion) in source/blender/freestyle/
were reverted in order to keep the primary source tree of the Freestyle renderer.
2009-09-18 22:25:49 +00:00
Tamito Kajiyama
9f79d8ae67 * freestyle_init.py: Removed all classes for wrapping extension types.
This allows users to test the types of those objects that are returned
by API functions, by means of usual Python idioms such as "type(I) is T"
and "isinstance(I, T)".

* Removed all occurrences of ViewVertex::castToTVertex() in the following
modules and rewrote the code segments using it by means of the "type(I)
is T" idiom mentioned above:

  ChainingIterators.py
  PredicatesU1D.py

* Replaced all occurrences of vector.Vec2, vector.Vec3, Vec2f and Vec3f
by Blender.Mathutils.Vector in the following modules:

  anisotropic_diffusion.py
  Functions0D.py
  shaders.py
  sketchy_topology_broken.py

* shaders.py: Fixed NameError's concerning math.pow().

* shaders.py: Added a Python equivalent of getFEdge function, defined
in source\blender\freestyle\intern\view_map\Functions0D.cpp as follows:

  FEdge* Functions0D::getFEdge(Interface0D& it1, Interface0D& it2) {
    return it1.getFEdge(it2);
  }

* shaders.py: Replaced fe.qi() by fe.viewedge().qi().

* contour.py: Fixed the import statement for freestyle_init.py.
2009-07-27 20:13:47 +00:00
Maxime Curioni
204f48c74e soc-2008-mxcurioni: sending files in release/scripts/freestyle folder 2008-09-30 04:17:39 +00:00