Commit Graph

37 Commits

Author SHA1 Message Date
Aaron Carlisle
baa24f1c91 Pydoc: Fix sphinx compile warnings about freestyle
Sphinx expects functions and methods with the same name and different
parameters to be written using one directive. See:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#basic-markup

Unfortunately this makes giving different descriptions for each harder.
This was already a request for better support for this in sphinx, see:
https://github.com/sphinx-doc/sphinx/issues/7787

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9170
2020-10-22 17:22:05 -04:00
f891d4e2ad Clang-Tidy: Fix readability-delete-null-pointer warnings
Also enable it in the configuration.
2020-07-03 16:32:51 +02:00
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
9a9f39e466 Cleanup: remove redundant 'char *' casts 2019-12-20 10:42:57 +11:00
d8dbd49a2f Cleanup: style, use braces in source/
Automated using clang-tidy.
2019-05-31 22:55:15 +10:00
1e8697cd80 Cleanup: comments (long lines) in freestyle 2019-05-01 07:58:27 +10:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
410880552b Cleanup: trailing space for freestyle 2018-06-17 17:05:14 +02:00
de6b546e15 Fix 8 memory leaks from bad PyList_Append use 2015-01-04 20:35:16 +11:00
829a2cc1b0 remove blender foundation copyright from freestyle files.
this can be added back on case-by-case basis, but better not assume ownership of another projects work by default.
2013-03-31 01:11:07 +00:00
4a92d82626 A big code clean-up patch from Bastien Montagne, many thanks! 2013-03-07 23:17:23 +00:00
d38a335d47 Code clean-up and fix for typos in docstrings. 2013-02-24 02:32:56 +00:00
ad7c43744c Added GNU GPL header blocks. 2013-02-23 18:32:28 +00:00
025feb240d Code clean-up: removed empty PyMethodDef. 2013-02-22 03:04:52 +00:00
a4a7341aef Missing code updates in the previous commit.
Also improved __repr__() so that the .getName() is no longer necessary in user-defined
Function0D and Function1D subclasses.
2013-02-22 02:48:41 +00:00
33f34e1a7b Freestyle Python API improvements - part 6.
Fix for PyGetSetDef and proper handling of keyword arguments were done in
Function0D and Function1D classes.  Additional code clean-up was also made.
2013-02-22 01:57:20 +00:00
f510faed6c Python API documentation updates: a description of class hierarchy
was added to the docstrings of most Python extension types.
2010-08-12 12:17:47 +00:00
db158b42de Documentation updates: Replaced "string" with "str". 2010-05-28 18:42:11 +00:00
d15f2b562e Fixed the __call__ method of UnaryFunction0DVectorViewShape and
UnaryFunction1DVectorViewShape.  The __call__ method now returns
a list whose elements are either a ViewShape or None.
2010-05-27 21:12:09 +00:00
2212564f18 Fixed invalid use of PyUnicode_FromFormat() where PyUnicode_FromString()
should have been used.
2010-05-23 12:10:31 +00:00
d7e08f2d33 Major documentation updates. The original Freestyle API reference
(http://freestyle.sourceforge.net/doc/html/index.html) has been
incorporated into the Blender/Freestyle Python API implementation
in the form of Sphinx-based embedded docstrings.  Some C++-specific
descriptions of classes and functions were revised so that they are
suitable for Python programmers.  Missing docstrings were filled,
and sparse descriptions were extended.  By means of the new
documentation system for Blender, an up-to-date Freestyle Python
API reference will be part of the Blender 2.5 documentation.
2010-04-17 23:47:47 +00:00
d131a8db48 Replaced PyObject_HEAD_INIT(NULL) with PyVarObject_HEAD_INIT(NULL, 0)
in the definitions of Python wrappers.
2010-04-08 01:13:54 +00:00
94711098e4 * Fixed compiler warnings concerning the lack of a newline at the
end of a file.

* Fixed compiler warnings due to an invalid argument to PyList_New().
NULL was used instead of 0 to create an empty list.
2009-10-15 19:38:45 +00:00
069d21dddf Made the Freestyle Python API compatible with Python 3. 2009-09-27 00:32:20 +00:00
d4ff63fe20 * Fixed uninitialized pointers in "__init__" methods of UnaryFunction1D types.
There was a known issue for a long time that we occasionally encountered
strange "TypeError: an integer is required" and "RuntimeWarning: tp_compare
didn't return -1 or -2 for exception", as shown in the following unit test
log.  The source of the former error was PyInt_AsLong(obj) being used by
IntegrationType_from_BPy_IntegrationType(obj), where "obj" was not properly
initialized in "__init__" before the converter was called.  The TypeError
was left unattended for a while and showed up when a comparison occurred
and the TypeError was detected, which resulted in the latter warning.

> runTest (__main__.UnaryFunction1DDoubleInitTestCase) ...
> .\blender:211: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
> ERROR
> 
> ======================================================================
> ERROR: runTest (__main__.UnaryFunction1DDoubleInitTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "init_tests.py", line 211, in runTest
> TypeError: an integer is required
> 
> ----------------------------------------------------------------------

* Also removed unnecessary error messages in "__init__" methods of
UnaryFunction1D types.
2009-08-03 14:38:15 +00:00
d62f844b12 Fixed typoes in error messages. 2009-07-31 21:44:02 +00:00
fe5b6a556c * Fixed compiler errors in UnaryFunction0DVectorViewShape::__call__()
and UnaryFunction1DVectorViewShape::__call__().

* Added a Python wrapper of ViewEdge::qi().
2009-07-27 19:34:52 +00:00
52f639277b Second attempt to fix a null pointer reference in deallocators of
built-in types (the first was in revision 21877).  When an exception
has raised within from the __init__ method of a user-defined class
derived from a built-in type (e.g., UnaryPredicate0D and
BinaryPredicate1D), some member variables of the base type are
left uninitialized, leading to a null pointer reference in the
"__dealloc__" function in the base type.  To avoid this, pointer
checking was added in the deallocators of those built-in types that
can be used to define a subclass by a user.
2009-07-26 20:20:25 +00:00
730fb1021c Made predicate and function types callable in the sense that
callable(I, T) returns True when I is an object of a type T or
of a subtype of T.  Also implemented a measure to avoid an
infinite loop when user-defined predicate and function classes
do not properly overload the __call__ method (including the
cases of directly instantiating the base classes such as
UnaryPredicate0D and BinaryPredicate1D).
2009-07-26 16:15:28 +00:00
0c7e5323e8 Improvements in error handling at Python-C++ boundaries. 2009-03-20 22:41:27 +00:00
6ba34d18b5 Fixed incorrect argument checking. 2009-03-14 13:27:41 +00:00
Maxime Curioni
7565990db2 soc-2008-mxcurioni: made considerable changes to support cross-language polymorphism for UnaryFunction0D, Interface0D, Interface1D. Add to change UnaryFunction1D<void> to static UnaryFunction1D_void. Resolved namespace collision on the Image class (changed to FrsImage). There is greater support for style modules but somehow, some do not show anything yet (japanese_bigbrush being an example). 2008-08-01 21:55:58 +00:00
Maxime Curioni
2b2df54aef soc-2008-mxcurioni: ported ALL 1D unary functions, representing 32 new classes. 2008-07-27 11:27:59 +00:00
Maxime Curioni
a9789d90ae soc-2008-mxcurioni: renamed all Freestyle API related files with 'BPy_' prefix to avoid library name collision.
Included MediumType's initialization at proper time to avoid Blender's crash.
2008-07-23 07:56:08 +00:00