Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-07Cleanup: unify struct declaration style for Python types, update namesCampbell Barton
Use struct identifiers in comments before the value. This has some advantages: - The struct identifiers didn't mix well with other code-comments, where other comments were wrapped onto the next line. - Minor changes could re-align all other comments in the struct. - PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line. Remove overly verbose comments copied from PyTypeObject (Python v2.x), these aren't especially helpful and get outdated. Also corrected some outdated names: - PyTypeObject.tp_print -> tp_vectorcall_offset - PyTypeObject.tp_reserved -> tp_as_async
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: use 'u' prefixed integer types for brevity & cast styleCampbell Barton
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-02-12PyAPI: remove Python 3.7x compatibility codeCampbell Barton
This removes Python version checks needed to build with 3.8+ and 3.7x. Ref D10381
2021-02-08Cleanup: Remove using-directive from freestyle headersOmar Emara
The header files in freestyle utilize the using-directive at the global file scope. This is a bad practice as it pollutes the global name space causing possible ambiguous reference compilation errors. In particular, the DNA files that are included by freestyle will cause those ambiguous reference errors when the developers adds a DNA member with a type name that also exist in the Freestyle name space, such as Curve and possibly others. This patch does the minimal work needed to resolve that by moving the using-directives from the headers into the corresponding translation units. Reviewed By: Brecht Differential Revision: https://developer.blender.org/D10351
2020-11-11Cleanup: use preprocessor version check for PyTypeObject declarationCampbell Barton
While `tp_print` was deprecated, Python 3.8+ uses this for 'tp_vectorcall_offset' which wasn't stated in the comment from efd71aad4f22ec0073d80b8dd296015d3f395aa8. Instead of suppressing clang-tidy, use preprocessor a check since this properly represents the difference between Python versions.
2020-11-10Cleanup: clang-formatCampbell Barton
2020-11-10Cleanup: clang-tidy suppress warnings for PyTypeObject.tp_printCampbell Barton
Clang-tidy behavior changes from Python 3.7 to 3.8+ so it's simplest to suppress the warning in this instance.
2020-11-09Fix T82520: error building freestyle with Python3.8Campbell Barton
Caused by 16732def37c5a66f3ea28dbe247b09cc6bca6677, This is a 'Py_ssize_t' in Python 3.8, replace with zero as this works in both 3.7 and 3.8.
2020-11-09Cleanup: clang-formatCampbell Barton
2020-11-06Cleanup: Clang-Tidy modernize-use-nullptrSybren A. Stüvel
Replace `NULL` with `nullptr` in C++ code. No functional changes.
2020-10-23Pydoc: Fix sphinx compile warnings about freestyleAaron Carlisle
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-07-29Cleanup: quiet possible comma misuse warning in feestyle PyAPICampbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-12-20Cleanup: remove redundant 'char *' castsCampbell Barton
2019-07-10Cleanup: avoid line breaks from trailing commentsCampbell Barton
2019-05-31Cleanup: style, use braces in source/Campbell Barton
Automated using clang-tidy.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
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-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-03Cleanup: trailing commasCampbell Barton
Needed for clan-format not to wrap onto one line.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
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.
2018-08-29Cleanup: indentationCampbell Barton
2015-03-27Freestyle: Code cleanup, prepare for strict C++ flagsSergey Sharybin
2014-09-19Freestyle: Python API documentation updates.Tamito Kajiyama
Fixed dead references of API identifiers (e.g., freestyle.types.Interface0D) due to relocations of the identifiers into submodules. Also made various minor revisions of mark-ups and typos.
2014-06-24Freestyle: use mathutils_array_parse() instead of its own helper functions.Tamito Kajiyama
Patch contribution by flokkievids (Folkert de Vries). Thanks!
2014-06-24Freestyle: use bool instead of int.Tamito Kajiyama
Patch contribution by flokkievids (Folkert de Vries). Thanks!
2013-03-31remove blender foundation copyright from freestyle files.Campbell Barton
this can be added back on case-by-case basis, but better not assume ownership of another projects work by default.
2013-03-08A big code clean-up patch from Bastien Montagne, many thanks!Tamito Kajiyama
2013-02-24Code clean-up and fix for typos in docstrings.Tamito Kajiyama
2013-02-23Added GNU GPL header blocks.Tamito Kajiyama
2013-02-21Freestyle Python API improvements - part 5.Tamito Kajiyama
Handling of keyword arguments in Python wrapper class constructors was revised. This revision is mainly focused on Interface0D, Interface1D, Iterator, and their subclasses, as well as a few additional view map component classes. 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. * Now the instantiation of ViewVertex is prohibited since the underlying C++ class is an abstract class. * Removed the .cast_to_interface0diterator() method from CurvePointIterator and StrokeVertexIterator. Instead the constructor of Interface0DIterator now accepts the instances of these two iterator classes to construct a nested Interface0DIterator instance that can be passed to Function0D functor objects. Specifically, an iterator 'it' is passed to a functor 'func' as follows: func(Interface0DIterator(it)) instead of: func(it.cast_to_interface0diterator()) * Boolean arguments of class constructors only accept values of boolean type. Input values of other types are considered as error. * Additional code clean-up was made.
2013-02-15Minor coding style clean-up.Tamito Kajiyama
2013-02-04* Added a generic helper function for parsing PyObject arguments as ↵Tamito Kajiyama
N-dimensional float array. * Local helpers were replaced with the generic one. This also fixed a memory leak in the setter function StrokeVertex_point_set. * Made minor code style changes.
2013-01-28Freestyle Python API improvements - part 1.Tamito Kajiyama
* The API syntax of StrokeVertex and StrokeAttribute was updated by means of getter/setter properties instead of class methods. Python style modules (including the Parameter Editor implementation) were updated accordingly. * Code clean-up was done for a few Python style modules, mostly by removing duplicated definitions of stroke shaders and fixing indentation.
2011-02-22Two minor fixes:Tamito Kajiyama
* Fixed a bug in MaterialF0D::operator() that an error condition was ignored due to a wrong return value. * Fixed a typo in the docstring of StrokeVertex::setPoint().
2010-08-12Python API documentation updates: a description of class hierarchyTamito Kajiyama
was added to the docstrings of most Python extension types.
2010-05-09Removed partial implementations of the __copy__ method of some PythonTamito Kajiyama
extension classes. Copy constructors should be used to duplicate objects.
2010-04-18Merged changes in the trunk up to revision 28247.Tamito Kajiyama
2010-04-18Major documentation updates. The original Freestyle API referenceTamito Kajiyama
(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-08Replaced PyObject_HEAD_INIT(NULL) with PyVarObject_HEAD_INIT(NULL, 0)Tamito Kajiyama
in the definitions of Python wrappers.
2009-09-27Made the Freestyle Python API compatible with Python 3.Tamito Kajiyama
2009-08-03Fixed the handling of constructor arguments in the following PythonTamito Kajiyama
types: Interface0D, SVertex, ViewVertex, StrokeVertex, NonTVertex, and TVertex.
2009-08-02SWIG/directors dependency removal (cont'd)Tamito Kajiyama
* Added to python/BPy_Convert.{cpp,h} 4 utility converters below for better introspection-based automatic type conversion. PyObject * Any_BPy_Interface0D_from_Interface0D( Interface0D& if0D ); PyObject * Any_BPy_Interface1D_from_Interface1D( Interface1D& if1D ); PyObject * Any_BPy_FEdge_from_FEdge( FEdge& fe ); PyObject * Any_BPy_ViewVertex_from_ViewVertex( ViewVertex& vv ); There are 4 corresponding converters without the "Any_" prefix. All calls of them in the code base were replaced with these new converters so that the introspection-based automatic conversion would take place universally. * python/BPy_Convert.{cpp,h}: Those C++ to Python converters having had a "_ptr" suffix were renamed to a name without the suffix, and their arguments were changed so as to take a reference (e.g., ViewVertex&) instead of a pointer (e.g., ViewVertex *). The changed converters and their new function prototypes are listed below. These converters now return a Python wrapper object that retains the passed reference, instead of retaining a newly created C++ object by the converters. // Interface0D converters PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D ); PyObject * BPy_CurvePoint_from_CurvePoint( CurvePoint& cp ); PyObject * BPy_StrokeVertex_from_StrokeVertex( StrokeVertex& sv ); PyObject * BPy_SVertex_from_SVertex( SVertex& sv ); PyObject * BPy_ViewVertex_from_ViewVertex( ViewVertex& vv ); PyObject * BPy_TVertex_from_TVertex( TVertex& tv ); PyObject * BPy_NonTVertex_from_NonTVertex( NonTVertex& ntv ); // Interface1D converters PyObject * BPy_Interface1D_from_Interface1D( Interface1D& if1D ); PyObject * BPy_Chain_from_Chain( Chain& c ); PyObject * BPy_FEdge_from_FEdge( FEdge& fe ); PyObject * BPy_FEdgeSharp_from_FEdgeSharp( FEdgeSharp& fes ); PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth( FEdgeSmooth& fes ); PyObject * BPy_Stroke_from_Stroke( Stroke& s ); PyObject * BPy_ViewEdge_from_ViewEdge( ViewEdge& ve ); PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewEdge& dve ); // some other converters PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs ); PyObject * BPy_SShape_from_SShape( SShape& ss ); PyObject * BPy_FrsMaterial_from_FrsMaterial( FrsMaterial& m ); PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute& sa ); * Added a "borrowed" flag to the definitions of Python types being used to wrap C++ components of Freestyle's internal data structures. The flag indicates whether or not a Python wrapper object has a reference to a C++ object that comprises the internal data structures. The deallocation routines of the Python types check this flag and release a wrapped C++ object only when it is not part of the internal data structures. The following files were modified: python/BPy_FrsMaterial.{cpp,h} python/BPy_Interface0D.{cpp,h} python/BPy_Interface1D.{cpp,h} python/BPy_SShape.{cpp,h} python/BPy_StrokeAttribute.{cpp,h} python/BPy_ViewShape.{cpp,h} python/Interface0D/BPy_CurvePoint.cpp python/Interface0D/BPy_SVertex.cpp python/Interface0D/BPy_ViewVertex.cpp python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp python/Interface0D/ViewVertex/BPy_NonTVertex.cpp python/Interface0D/ViewVertex/BPy_TVertex.cpp python/Interface1D/BPy_FEdge.cpp python/Interface1D/BPy_FrsCurve.cpp python/Interface1D/BPy_Stroke.cpp python/Interface1D/BPy_ViewEdge.cpp python/Interface1D/Curve/BPy_Chain.cpp python/Interface1D/FEdge/BPy_FEdgeSharp.cpp python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp * view_map/Interface[01]D.h, python/BPy_Interface[01]D.cpp: Removed from the Interface0D and Interface1D C++ classes a back pointer to a Python wrapper object and all "director" calls. These classes (and their subclasses) are used to build Freestyle's main data structures (such as a view map and strokes) and their class hierarchy is static. Python wrappers of these C++ classes are only used to access the data structures from the Python layer, and not intended to extend the data structures by subclassing the Python wrappers. Without the necessity of subclassing in the Python layer, the back pointer to a wrapping Python object and "director" calls would be useless (actually they were not used at all), so they were all removed. * python/Director.{cpp,h}: Removed the definitions of directors that were no longer used. * stroke/Stroke.{cpp,h}: Removed an (unused) back pointer to a Python wrapper object. * python/BPy_ViewMap.cpp: Fixed a possible null pointer reference. * python/Interface1D/BPy_FEdge.cpp: Fixed parameter checking in FEdge___init__().
2009-07-25* Better support for vector-like objects in method arguments.Tamito Kajiyama
Now the following methods in the Freestyle Python API accept not only Blender.Mathutils.Vector instances but also lists and tuples having an appropriate number of elements. FrsNoise::turbulence2() FrsNoise::turbulence3() FrsNoise::smoothNoise2() FrsNoise::smoothNoise3() SVertex::__init__() SVertex::setPoint3D() SVertex::setPoint2D() SVertex::AddNormal() FEdgeSharp::setNormalA() FEdgeSharp::setNormalB() FEdgeSmooth::setNormal() CalligraphicShader::__init__() StrokeAttribute::setAttributeVec2f() StrokeAttribute::setAttributeVec3f() StrokeAttribute::setColor() StrokeVertex::setPoint() * Added the following converters for the sake of the improvements mentioned above. Vec2f_ptr_from_PyObject() Vec3f_ptr_from_PyObject() Vec3r_ptr_from_PyObject() Vec2f_ptr_from_PyList() Vec3f_ptr_from_PyList() Vec3r_ptr_from_PyList() Vec2f_ptr_from_PyTuple() Vec3f_ptr_from_PyTuple() Vec3r_ptr_from_PyTuple() Those converters with the suffixes _PyList and _PyTuple accept only lists and tuples having an appropriate number of elements, respectively, while those with the suffix _PyObject accept lists, tuples, or Blender.Mathutils.Vector instances. * Fixed a null pointer reference in Interface0D___dealloc__(). * Corrected the names of 3 methods in the FEdgeSmooth class.
2009-03-30Improvements on error handling in the Python API.Tamito Kajiyama
2009-03-14Fixed StrokeVertex::setPoint() to accept a Blender Vector object as the ↵Tamito Kajiyama
argument. Now this method accepts 2D coordinates in the following three forms: a) Python list of 2 real numbers: setPoint([x, y]) b) Blender Vector of 2 elements: setPoint(Vector(x, y)) c) 2 real numbers: setPoint(x, y) [The log of Revision 19283 had a wrong message...]