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.
This commit is contained in:
@@ -60,28 +60,28 @@ app_sources = env.Glob(prefix + '/*.cpp')
|
||||
prefix = 'intern/python'
|
||||
# python_sources = env.Glob(prefix + '/*.cpp')
|
||||
python_sources = [
|
||||
prefix + '/Freestyle.cpp',
|
||||
prefix + '/Convert.cpp',
|
||||
prefix + '/BinaryPredicate0D.cpp',
|
||||
prefix + '/BinaryPredicate1D.cpp',
|
||||
prefix + '/Id.cpp',
|
||||
prefix + '/IntegrationType.cpp',
|
||||
prefix + '/Interface0D.cpp',
|
||||
prefix + '/Interface0D/CurvePoint.cpp',
|
||||
prefix + '/Interface0D/CurvePoint/StrokeVertex.cpp',
|
||||
prefix + '/Interface0D/SVertex.cpp',
|
||||
prefix + '/Interface0D/ViewVertex.cpp',
|
||||
prefix + '/Interface1D.cpp',
|
||||
prefix + '/Interface1D/FEdge.cpp',
|
||||
prefix + '/Interface1D/Stroke.cpp',
|
||||
prefix + '/Nature.cpp',
|
||||
prefix + '/MediumType.cpp',
|
||||
prefix + '/StrokeAttribute.cpp',
|
||||
prefix + '/StrokeShader.cpp',
|
||||
prefix + '/UnaryFunction0D.cpp',
|
||||
prefix + '/UnaryFunction1D.cpp',
|
||||
prefix + '/UnaryPredicate0D.cpp',
|
||||
prefix + '/UnaryPredicate1D.cpp',
|
||||
prefix + '/BPy_Freestyle.cpp',
|
||||
prefix + '/BPy_Convert.cpp',
|
||||
prefix + '/BPy_BinaryPredicate0D.cpp',
|
||||
prefix + '/BPy_BinaryPredicate1D.cpp',
|
||||
prefix + '/BPy_Id.cpp',
|
||||
prefix + '/BPy_IntegrationType.cpp',
|
||||
prefix + '/BPy_Interface0D.cpp',
|
||||
prefix + '/Interface0D/BPy_CurvePoint.cpp',
|
||||
prefix + '/Interface0D/CurvePoint/BPy_StrokeVertex.cpp',
|
||||
prefix + '/Interface0D/BPy_SVertex.cpp',
|
||||
prefix + '/Interface0D/BPy_ViewVertex.cpp',
|
||||
prefix + '/BPy_Interface1D.cpp',
|
||||
prefix + '/Interface1D/BPy_FEdge.cpp',
|
||||
prefix + '/Interface1D/BPy_Stroke.cpp',
|
||||
prefix + '/BPy_MediumType.cpp',
|
||||
prefix + '/BPy_Nature.cpp',
|
||||
prefix + '/BPy_StrokeAttribute.cpp',
|
||||
prefix + '/BPy_StrokeShader.cpp',
|
||||
prefix + '/BPy_UnaryFunction0D.cpp',
|
||||
prefix + '/BPy_UnaryFunction1D.cpp',
|
||||
prefix + '/BPy_UnaryPredicate0D.cpp',
|
||||
prefix + '/BPy_UnaryPredicate1D.cpp',
|
||||
]
|
||||
|
||||
sources = system_sources + image_sources + geometry_sources + scene_graph_sources \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "BinaryPredicate0D.h"
|
||||
#include "BPy_BinaryPredicate0D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "Interface0D.h"
|
||||
#include "BPy_Convert.h"
|
||||
#include "BPy_Interface0D.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "BinaryPredicate1D.h"
|
||||
#include "BPy_BinaryPredicate1D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "Interface1D.h"
|
||||
#include "BPy_Convert.h"
|
||||
#include "BPy_Interface1D.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -82,7 +82,7 @@ PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute& sa ) {
|
||||
return py_sa;
|
||||
}
|
||||
|
||||
PyObject * BPy_MediumType_from_MediumType( unsigned short n ) {
|
||||
PyObject * BPy_MediumType_from_MediumType( int n ) {
|
||||
PyObject *py_mt = MediumType_Type.tp_new( &MediumType_Type, 0, 0 );
|
||||
|
||||
PyObject *args = PyTuple_New(1);
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "../geometry/Geom.h"
|
||||
using namespace Geometry;
|
||||
|
||||
#include "Id.h"
|
||||
#include "IntegrationType.h"
|
||||
#include "Interface0D.h"
|
||||
#include "Interface0D/CurvePoint/StrokeVertex.h"
|
||||
#include "Interface0D/SVertex.h"
|
||||
#include "Interface1D/FEdge.h"
|
||||
#include "Nature.h"
|
||||
#include "MediumType.h"
|
||||
#include "StrokeAttribute.h"
|
||||
#include "BPy_Id.h"
|
||||
#include "BPy_IntegrationType.h"
|
||||
#include "BPy_Interface0D.h"
|
||||
#include "Interface0D/CurvePoint/BPy_StrokeVertex.h"
|
||||
#include "Interface0D/BPy_SVertex.h"
|
||||
#include "Interface1D/BPy_FEdge.h"
|
||||
#include "BPy_Nature.h"
|
||||
#include "BPy_MediumType.h"
|
||||
#include "BPy_StrokeAttribute.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -34,7 +34,7 @@ PyObject * BPy_FEdge_from_FEdge( FEdge& fe );
|
||||
PyObject * BPy_Id_from_Id( Id& id );
|
||||
PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D );
|
||||
PyObject * BPy_Nature_from_Nature( unsigned short n );
|
||||
PyObject * BPy_MediumType_from_MediumType( unsigned short n );
|
||||
PyObject * BPy_MediumType_from_MediumType( int n );
|
||||
PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute& sa );
|
||||
PyObject * BPy_StrokeVertex_from_StrokeVertex( StrokeVertex& sv );
|
||||
PyObject * BPy_SVertex_from_SVertex( SVertex& sv );
|
||||
@@ -1,19 +1,20 @@
|
||||
#include "Freestyle.h"
|
||||
#include "BPy_Freestyle.h"
|
||||
|
||||
#include "BinaryPredicate0D.h"
|
||||
#include "BinaryPredicate1D.h"
|
||||
#include "Id.h"
|
||||
#include "IntegrationType.h"
|
||||
#include "Interface0D.h"
|
||||
#include "Interface0D/CurvePoint.h"
|
||||
#include "Interface1D.h"
|
||||
#include "Nature.h"
|
||||
#include "StrokeAttribute.h"
|
||||
#include "StrokeShader.h"
|
||||
#include "UnaryFunction0D.h"
|
||||
#include "UnaryFunction1D.h"
|
||||
#include "UnaryPredicate0D.h"
|
||||
#include "UnaryPredicate1D.h"
|
||||
#include "BPy_BinaryPredicate0D.h"
|
||||
#include "BPy_BinaryPredicate1D.h"
|
||||
#include "BPy_Id.h"
|
||||
#include "BPy_IntegrationType.h"
|
||||
#include "BPy_Interface0D.h"
|
||||
#include "Interface0D/BPy_CurvePoint.h"
|
||||
#include "BPy_Interface1D.h"
|
||||
#include "BPy_MediumType.h"
|
||||
#include "BPy_Nature.h"
|
||||
#include "BPy_StrokeAttribute.h"
|
||||
#include "BPy_StrokeShader.h"
|
||||
#include "BPy_UnaryFunction0D.h"
|
||||
#include "BPy_UnaryFunction1D.h"
|
||||
#include "BPy_UnaryPredicate0D.h"
|
||||
#include "BPy_UnaryPredicate1D.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -128,14 +129,19 @@ PyObject *Freestyle_Init( void )
|
||||
// initialize modules
|
||||
module = Py_InitModule3( "Blender.Freestyle", M_Freestyle_methods, M_Freestyle_doc );
|
||||
|
||||
|
||||
// attach its classes (adding the object types to the module)
|
||||
|
||||
// those classes have to be initialized before the others
|
||||
MediumType_Init( module );
|
||||
Nature_Init( module );
|
||||
|
||||
BinaryPredicate0D_Init( module );
|
||||
BinaryPredicate1D_Init( module );
|
||||
Id_Init( module );
|
||||
IntegrationType_Init( module );
|
||||
Interface0D_Init( module );
|
||||
Interface1D_Init( module );
|
||||
Nature_Init( module );
|
||||
StrokeAttribute_Init( module );
|
||||
StrokeShader_Init( module );
|
||||
UnaryFunction0D_Init( module );
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Id.h"
|
||||
#include "BPy_Id.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "IntegrationType.h"
|
||||
#include "BPy_IntegrationType.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "Interface0D.h"
|
||||
#include "BPy_Interface0D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "Interface0D/CurvePoint.h"
|
||||
#include "Interface0D/CurvePoint/StrokeVertex.h"
|
||||
#include "Interface0D/SVertex.h"
|
||||
#include "Interface0D/ViewVertex.h"
|
||||
#include "Interface1D/FEdge.h"
|
||||
#include "Nature.h"
|
||||
#include "BPy_Convert.h"
|
||||
#include "Interface0D/BPy_CurvePoint.h"
|
||||
#include "Interface0D/CurvePoint/BPy_StrokeVertex.h"
|
||||
#include "Interface0D/BPy_SVertex.h"
|
||||
#include "Interface0D/BPy_ViewVertex.h"
|
||||
#include "Interface1D/BPy_FEdge.h"
|
||||
#include "BPy_Nature.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "Interface1D.h"
|
||||
#include "BPy_Interface1D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "Interface1D/FEdge.h"
|
||||
#include "Interface1D/Stroke.h"
|
||||
#include "MediumType.h"
|
||||
#include "BPy_Convert.h"
|
||||
#include "Interface1D/BPy_FEdge.h"
|
||||
#include "Interface1D/BPy_Stroke.h"
|
||||
#include "BPy_MediumType.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "MediumType.h"
|
||||
#include "BPy_MediumType.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -103,6 +103,18 @@ PyTypeObject MediumType_Type = {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
PyMODINIT_FUNC MediumType_Init( PyObject *module )
|
||||
{
|
||||
if( module == NULL )
|
||||
return;
|
||||
|
||||
if( PyType_Ready( &MediumType_Type ) < 0 )
|
||||
return;
|
||||
Py_INCREF( &MediumType_Type );
|
||||
PyModule_AddObject(module, "MediumType", (PyObject *)&MediumType_Type);
|
||||
|
||||
}
|
||||
|
||||
int MediumType___init__(BPy_MediumType *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
if (PyInt_Type.tp_init((PyObject *)self, args, kwds) < 0)
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Nature.h"
|
||||
#include "BPy_Nature.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "StrokeAttribute.h"
|
||||
#include "BPy_StrokeAttribute.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "StrokeShader.h"
|
||||
#include "BPy_StrokeShader.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "Interface1D/Stroke.h"
|
||||
#include "BPy_Convert.h"
|
||||
#include "Interface1D/BPy_Stroke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UnaryFunction0D.h"
|
||||
#include "BPy_UnaryFunction0D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UnaryFunction1D.h"
|
||||
#include "BPy_UnaryFunction1D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UnaryPredicate0D.h"
|
||||
#include "BPy_UnaryPredicate0D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UnaryPredicate1D.h"
|
||||
#include "BPy_UnaryPredicate1D.h"
|
||||
|
||||
#include "Convert.h"
|
||||
#include "BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "CurvePoint.h"
|
||||
#include "BPy_CurvePoint.h"
|
||||
|
||||
#include "../Convert.h"
|
||||
#include "../BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FREESTYLE_PYTHON_CURVEPOINT_H
|
||||
#define FREESTYLE_PYTHON_CURVEPOINT_H
|
||||
|
||||
#include "../Interface0D.h"
|
||||
#include "../BPy_Interface0D.h"
|
||||
#include "../../stroke/Curve.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "SVertex.h"
|
||||
#include "BPy_SVertex.h"
|
||||
|
||||
#include "../Convert.h"
|
||||
#include "../Id.h"
|
||||
#include "../BPy_Convert.h"
|
||||
#include "../BPy_Id.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -2,7 +2,7 @@
|
||||
#define FREESTYLE_PYTHON_SVERTEX_H
|
||||
|
||||
#include "../../view_map/Silhouette.h"
|
||||
#include "../Interface0D.h"
|
||||
#include "../BPy_Interface0D.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "ViewVertex.h"
|
||||
#include "BPy_ViewVertex.h"
|
||||
|
||||
#include "../Convert.h"
|
||||
#include "../BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -2,7 +2,7 @@
|
||||
#define FREESTYLE_PYTHON_VIEWVERTEX_H
|
||||
|
||||
#include "../../view_map/ViewMap.h"
|
||||
#include "../Interface0D.h"
|
||||
#include "../BPy_Interface0D.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "StrokeVertex.h"
|
||||
#include "BPy_StrokeVertex.h"
|
||||
|
||||
#include "../../Convert.h"
|
||||
#include "../../StrokeAttribute.h"
|
||||
#include "../../BPy_Convert.h"
|
||||
#include "../../BPy_StrokeAttribute.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FREESTYLE_PYTHON_STROKEVERTEX_H
|
||||
#define FREESTYLE_PYTHON_STROKEVERTEX_H
|
||||
|
||||
#include "../CurvePoint.h"
|
||||
#include "../BPy_CurvePoint.h"
|
||||
#include "../../../stroke/Stroke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "FEdge.h"
|
||||
#include "BPy_FEdge.h"
|
||||
|
||||
#include "../Convert.h"
|
||||
#include "../Interface0D/SVertex.h"
|
||||
#include "../BPy_Convert.h"
|
||||
#include "../Interface0D/BPy_SVertex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FREESTYLE_PYTHON_FEDGE_H
|
||||
#define FREESTYLE_PYTHON_FEDGE_H
|
||||
|
||||
#include "../Interface1D.h"
|
||||
#include "../BPy_Interface1D.h"
|
||||
#include "../../view_map/Silhouette.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Stroke.h"
|
||||
#include "BPy_Stroke.h"
|
||||
|
||||
#include "../Convert.h"
|
||||
#include "../Interface0D/SVertex.h"
|
||||
#include "../BPy_Convert.h"
|
||||
#include "../Interface0D/BPy_SVertex.h"
|
||||
#include "../../stroke/StrokeIterators.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FREESTYLE_PYTHON_STROKE_H
|
||||
#define FREESTYLE_PYTHON_STROKE_H
|
||||
|
||||
#include "../Interface1D.h"
|
||||
#include "../BPy_Interface1D.h"
|
||||
#include "../../stroke/Stroke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user