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
2009-09-20Reverted all changes (i.e., deletion) in release/scripts/freestyle.Tamito Kajiyama
2009-09-19Try to fix EOLs and props so the branch follows trunk style.Guillermo S. Romero
Other parts outside source/blender/freestyle/ seem to have been overriden in the merge r23341 (by just using trunk version?), so it probably does not build or builds without Freestyle. source/blender/CMakeLists.txt does not make any reference to freestyle/, for example.
2009-09-19MergedTamito Kajiyama
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-08-26Made an attempt to fix a crash due to undo. An undo invalidatedTamito Kajiyama
some Freestyle-related pointers, which led to a crash when the rendering was initiated or the Freestyle panel (in the Scene buttons) was redrawn.
2009-08-25Fixed a crash due to a missing call for FRS_initialize in the caseTamito Kajiyama
of running Blender in the background rendering mode using the '-b' command option.
2009-08-23Fixed a bug in PythonInterpreter::interpretFile() that a temporaryTamito Kajiyama
text object storing a Python script was not properly freed when an error occurred during the execution of the script.
2009-08-08Fixed refcount issues in the Python API.Tamito Kajiyama
2009-08-08Added missing #include <typeinfo> to BPy_Convert.h.Tamito Kajiyama
2009-08-04Fixed compiler errors (tested with VC++ 2009 Express Edition, CMake 2.6.3).Tamito Kajiyama
2009-08-04Removed unnecessary initialization argumentMaxime Curioni
2009-08-04Removed unnecessary initializationMaxime Curioni
2009-08-04SUMMARY:Maxime Curioni
The main contribution of this commit is the possibility to save Freestyle configuration information inside .blend files. It required an extensive refactoring of the previous interface code. The code has been tested and does not crash on my machine. If you encounter issues, please let me know (and if possible, sending me an sample .blend file). DETAILS: - refactored code to notify Freestyle when adding/removing render layers (FRS_freestyle_config.{h,cpp}) - corrected the freeing of style modules when files are read from / written to disk - moved Freestyle configuration information into scene renderlayers, to allow loading / saving .blend files (DNA_scene_types.h DNA_freestyle_types.h FRS_freestyle.cpp) - inserted temporary trick to prevent crashes when orthographic camera is used (SilhouetteGeomEngine.cpp), but outputting incorrect feature line calculations
2009-08-03Fixed argument checking in __init__ methods of Interface1D, Predicates,Tamito Kajiyama
Functions, and StrokeShader types.
2009-08-03* Fixed uninitialized pointers in "__init__" methods of UnaryFunction1D types.Tamito Kajiyama
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-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
Removed all castToSomething() methods from Interface0D's subclasses. These methods are useless, because introspection-based automatic type conversion takes place whenever it is applicable. If you need to rewrite old style modules that rely on the cast methods, apply the following rewriting rules: - SVertex.castToSVertex() - TVertex.castToViewVertex() - TVertex.castToTVertex() - NonTVertex.castToViewVertex() - NonTVertex.castToNonTVertex() These 5 methods return an object itself, so just removing a method call will suffice. If you need to handle objects in a different way depending on their types, then you can use Python's type checking idioms such as "type(obj) is T" and "isinstance(obj, T)". Example: [Original] v = it.getObject() # try to convert v into a TVertex object vertex = v.castToTVertex() if vertex != None: ... # do something on the TVertex object # try to convert v into a NonTVertex object vertex = v.castToNonTVertex() if vertex != None: ... # do something on the NonTVertex object [Rewritten] vertex = it.getObject() if type(vertex) is TVertex: ... # do something on the TVertex object elif type(vertex) is NonTVertex: ... # do something on the NonTVertex object - SVertex.castToViewVertex() - SVertex.castToTVertex() - SVertex.castToNonTVertex() Use SVertex.viewvertex() instead. You don't need to care about which cast method is appropriate. SVertex.viewvertex() does, if necessary, introspection-based automatic type conversion for you. - NonTVertex.castToSVertex() Use NonTVertex.svertex() instead. - CurvePoint.castToSVertex() Let cp be a CurvePoint object, then this method can be expressed as follows: if cp.t2d() == 0.0: return cp.A() # returns an SVertex elif cp.t2d() == 1.0: return cp.B() # returns an SVertex return None - CurvePoint.castToViewVertex() - CurvePoint.castToTVertex() - CurvePoint.castToNonVertex() Similarly, these 3 methods can be expressed as follows: if cp.t2d() == 0.0: return cp.A().viewvertex() elif cp.t2d() == 1.0: return cp.B().viewvertex() return None
2009-08-02Fixed the argument parsing in CurvePoint.__init__().Tamito Kajiyama
2009-08-02* Fixed __init__() method so as to corecttly handle arguments.Tamito Kajiyama
* Fixed refcount issues in diffuse(), specular(), ambient() and emission() methods. Also changed the type of their returned values from list to tuple.
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-08-01Changed the type of returned value of ↵Tamito Kajiyama
BPy_directedViewEdge_from_directedViewEdge() from list to tuple.
2009-08-01Disabled the Python wrapper of ViewVertex::edgesEnd(), since theTamito Kajiyama
method returns a non-functional orientedViewEdgeIterator instance. The iteration from the end to the beginning of the sequence relies on orientedViewEdgeIterator::decrement() which is not actually implemented in the C++ class. As a quick fix, the edgesEnd method now raises a NotImplementedError.
2009-08-01Added boundary checking to Iterator::increment() and Iterator::decrement()Tamito Kajiyama
to avoid an immediate crash. Now these methods raise a RuntimeError when the iteration is already at the end.
2009-08-01* Implemented Python's iterator protocol in Interface0DIterator andTamito Kajiyama
orientedViewEdgeIterator. * Simplified Python-related error handling in C++ class definitions. The definitions of the following C++ methods were simplified and most code segments using the C/Python API were moved to Director.cpp. ChainingIterator::init() ChainingIterator::traverse() UnaryPredicate0D::operator()() UnaryPredicate1D::operator()() BinaryPredicate0D::operator()() BinaryPredicate1D::operator()() UnaryFunction0D::operator()() UnaryFunction1D::operator()() StrokeShader.shade() * Moved part of the introspection-based automatic type conversion code from BPy_Interface0DIterator.cpp and Director.cpp to BPy_Convert.cpp for the sake of better code organization. * Fixed an uninitialized member in StrokeVertexIterator___init__().
2009-08-01Fixed typoes in error messages.Tamito Kajiyama
2009-08-01Fixed typoes in error messages.Tamito Kajiyama
2009-08-01Added Python error handling to StrokeShader::shade(). Also madeTamito Kajiyama
a measure to avoid an infinite loop due to non-proper overriding of the shade method.
2009-07-29Added minor changes.Tamito Kajiyama
2009-07-29Added changes to the AdjacencyIterator type to support Python'sTamito Kajiyama
iterator protocol. Now the following code in the conventional SWIG-based syntax: it = AdjacencyIterator(iter) while not it.isEnd(): ve = it.getObject() ... it.increment() can be written using the iterator protocol as follows: for ve in AdjacencyIterator(iter): ...
2009-07-29Implemented a measure to avoid an infinite loop triggered whenTamito Kajiyama
ChainingIterator::init() and ChainingIterator::traverse() were not properly overloaded in a subclass.
2009-07-28Replaced missing integrateDouble() by integrate() newly implementedTamito Kajiyama
in revision 21954.
2009-07-28* BPy_IntegrationType.cpp: Added a Python wrapper of integrate function.Tamito Kajiyama
* Fixed uninitialized fields in the "__init__" methods of UnaryFunction0D types. Also added missing argument validation codes to some of the types, and removed redundant validation error messages.
2009-07-28* freestyle_init.py: Removed all classes for wrapping extension types.Tamito Kajiyama
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* Fixed compiler errors in UnaryFunction0DVectorViewShape::__call__()Tamito Kajiyama
and UnaryFunction1DVectorViewShape::__call__(). * Added a Python wrapper of ViewEdge::qi().
2009-07-27Changed DIR_SEP for WIN32 from "\\\\" (double backslashes) toTamito Kajiyama
"\\" (single backslash).
2009-07-27Second attempt to fix a null pointer reference in deallocators ofTamito Kajiyama
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-26Reverted the change in revision 21877 in Interface0D___dealloc__().Tamito Kajiyama
2009-07-26Made predicate and function types callable in the sense thatTamito Kajiyama
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-26Implemented Python wrappers of context functions (such as GetTimeStampCF).Tamito Kajiyama
2009-07-25Fixed a problem related to AdjacencyIterator. In the Python layer,Tamito Kajiyama
AdjacencyIterator::isBegin() and AdjacencyIterator::isEnd() always returned a False value and printed a "not implemented" warning message. This caused an infinite loop in a few chaining iterators, resulting in a crash of the program. The origin of the issue seemed to be a fact that in the C++ layer, the AdjacencyIterator class had not properly overloaded the definitions of the methods in the Iterator superclass. The fix here looks okay, although I'm not sure why this inconsistency was not addressed for a long time.
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-07-25Fixed a minor memory leak in Controller::LoadMesh().Tamito Kajiyama
2009-07-25Fixed compiler errors caused by the changes in revision 21700.Tamito Kajiyama
2009-07-23Second attempt for properly releasing temporary objects and their dataTamito Kajiyama
blocks in BlenderStrokeRenderer::~BlenderStrokeRenderer().
2009-07-22Made changes for releasing temporary objects and their data blocksTamito Kajiyama
in BlenderStrokeRenderer::~BlenderStrokeRenderer().
2009-07-21Fixed a refcount bug concerning ChainPredicateIterator.Tamito Kajiyama
2009-07-20* Introspection-based automatic type conversion from a generic C++ objectTamito Kajiyama
to a specific Python object. The conversion takes place in the following places. - Interface0DIterator_getObject (BPy_Interface0DIterator.cpp) - Director_BPy_BinaryPredicate1D___call__ (Director.cpp) - Director_BPy_UnaryPredicate1D___call__ (Director.cpp) - SVertex_viewvertex (BPy_SVertex.cpp) - BPy_FEdge_from_FEdge (BPy_Convert.cpp) This is a tentative list and more conversions are expected to be added. * Added the following two converter functions to BPy_Convert.{cpp,h}: - BPy_NonTVertex_from_NonTVertex_ptr - BPy_TVertex_from_TVertex_ptr
2009-07-20Added a missing wrapper for AdjacencyIterator::isIncoming().Tamito Kajiyama
2009-07-20Fixed uninitialized pointers in ViewVertex instances returned by theTamito Kajiyama
castToViewVertex method.
2009-07-19Fixed uninitialized pointers in Interface0DIterator instances returned byTamito Kajiyama
the castToInterface0DIterator method.
2009-07-18Fixed a bug that the parameter panel did not correctly work whenTamito Kajiyama
a new file was created or an existing file was loaded.