Blender Git Commit Log

Git Commits -> Revision cc1a6b3

Revision cc1a6b3 by Maxime Curioni (master)
July 15, 2008, 05:33 (GMT)
soc-2008-mxcurioni: reimplemented the initialization/allocation for base classes. The Python object type tp_new slot is now set to PyType_GenericNew, instead of the former custom functions. As a note, by default, Python does not set this slot: it is therefore mandatory for the base classes. For children classes, only __init__ is needed.

To make our base classes subclasses, the Py_TPFLAGS_BASETYPE flag was added to the object type tp_flags slot.

Finally, I began to implement CurvePoint, descendant of Interface0D. This commit allowed me to verify that my SWIG replacement method works: interfaces are well taken into account by children. For a test, use the following code:

================================

import Blender
from Blender import Freestyle
from Blender.Freestyle import *

print Interface0D()
print CurvePoint()

================================

The __repr__ method is only implemented in Interface0D:

PyObject * Interface0D___repr__(BPy_Interface0D* self)
{
return PyString_FromFormat("type: %s - address: %p", self->if0D->getExactTypeName().c_str(), self->if0D );}

and the result is of the form:

type: Interface0D - address: 0x18e5ccc0
type: CurvePoint - address: 0x18e473f0

As you can see, the correct getExactTypeName of the class is called.

Commit Details:

Full Hash: cc1a6b398da9bd2cec78c4242c5b205f079aa4a6
SVN Revision: 15581
Parent Commit: 96e52b0
Lines Changed: +315, -250

1 Added Path:

/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h (+31, -0) (View)

8 Modified Paths:

/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp (+8, -13) (Diff)
/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp (+7, -13) (Diff)
/source/blender/freestyle/intern/python/Freestyle.cpp (+2, -0) (Diff)
/source/blender/freestyle/intern/python/Id.cpp (+10, -24) (Diff)
/source/blender/freestyle/intern/python/Interface0D.cpp (+13, -13) (Diff)
/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp (+236, -174) (Diff)
/source/blender/freestyle/intern/python/Interface1D.cpp (+7, -13) (Diff)
/source/blender/freestyle/SConscript (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021