diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-07 19:04:25 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-07 19:04:25 +0400 |
commit | 9a1217e55980f9b0a501fbe03ab2ea559638392d (patch) | |
tree | 28b4c5bcf547d2d9f63d7d687ff6f43064cc0dc5 /source/blender/freestyle/intern/python | |
parent | 1baf09110b2c3bd4a6eea128b61ca9a0017f81dd (diff) |
soc-2008-mxcurioni: first version of lib3ds code. It does NOT work yet and has to be debugged. It can be activate in app_blender/api.cpp by replacing the FRS_scene_3ds_export call in FRS_prepare, by FRS_load_mesh.
All of the reference to the original Material class were renamed to FrsMaterial to resolve a name collision with Blender. To keep the window context necessary to draw the strokes after RE_Database_FromScene has been called, the display_clear function is used.
Diffstat (limited to 'source/blender/freestyle/intern/python')
9 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index 5f4b7098f29..38eeced6958 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -190,9 +190,9 @@ PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs ) { return py_vs; } -PyObject * BPy_FrsMaterial_from_Material( Material& m ){ +PyObject * BPy_FrsMaterial_from_FrsMaterial( FrsMaterial& m ){ PyObject *py_m = FrsMaterial_Type.tp_new( &FrsMaterial_Type, 0, 0 ); - ((BPy_FrsMaterial*) py_m)->m = new Material( m ); + ((BPy_FrsMaterial*) py_m)->m = new FrsMaterial( m ); return py_m; } diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h index 10efb2e5246..4ddfbe38d54 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.h +++ b/source/blender/freestyle/intern/python/BPy_Convert.h @@ -20,8 +20,8 @@ using namespace Geometry; // Interface1D #include "../view_map/Interface1D.h" -// Material -#include "../scene_graph/Material.h" +// FrsMaterial +#include "../scene_graph/FrsMaterial.h" // Nature::VertexNature, Nature::EdgeNature #include "../winged_edge/Nature.h" @@ -78,7 +78,7 @@ PyObject * BPy_Id_from_Id( Id& id ); PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D ); PyObject * BPy_Interface1D_from_Interface1D( Interface1D& if1D ); PyObject * BPy_IntegrationType_from_IntegrationType( int i ); -PyObject * BPy_FrsMaterial_from_Material( Material& m ); +PyObject * BPy_FrsMaterial_from_FrsMaterial( FrsMaterial& m ); PyObject * BPy_Nature_from_Nature( unsigned short n ); PyObject * BPy_MediumType_from_MediumType( int n ); PyObject * BPy_SShape_from_SShape( SShape& ss ); diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp index 052583e4621..6f7d4ba5015 100644 --- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp +++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp @@ -180,17 +180,17 @@ int FrsMaterial___init__(BPy_FrsMaterial *self, PyObject *args, PyObject *kwds) return -1; if( !obj1 ){ - self->m = new Material(); + self->m = new FrsMaterial(); } else if( BPy_FrsMaterial_Check(obj1) ) { if( ((BPy_FrsMaterial *) obj1)->m ) - self->m = new Material(*( ((BPy_FrsMaterial *) obj1)->m )); + self->m = new FrsMaterial(*( ((BPy_FrsMaterial *) obj1)->m )); else return -1; } else if( PyFloat_Check(obj1) ) { f1 = PyFloat_AsDouble(obj1); - self->m = new Material(&f1, &f2, &f3, &f4, f5); + self->m = new FrsMaterial(&f1, &f2, &f3, &f4, f5); } else { return -1; diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.h b/source/blender/freestyle/intern/python/BPy_FrsMaterial.h index b25ddfc77bc..95264180f2f 100644 --- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.h +++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.h @@ -1,7 +1,7 @@ #ifndef FREESTYLE_PYTHON_FRSMATERIAL_H #define FREESTYLE_PYTHON_FRSMATERIAL_H -#include "../scene_graph/Material.h" +#include "../scene_graph/FrsMaterial.h" #ifdef __cplusplus extern "C" { @@ -18,7 +18,7 @@ extern PyTypeObject FrsMaterial_Type; /*---------------------------Python BPy_FrsMaterial structure definition----------*/ typedef struct { PyObject_HEAD - Material *m; + FrsMaterial *m; } BPy_FrsMaterial; /*---------------------------Python BPy_FrsMaterial visible prototypes-----------*/ diff --git a/source/blender/freestyle/intern/python/Director.cpp b/source/blender/freestyle/intern/python/Director.cpp index 153ea79eabf..b56cd59e2f6 100644 --- a/source/blender/freestyle/intern/python/Director.cpp +++ b/source/blender/freestyle/intern/python/Director.cpp @@ -109,7 +109,7 @@ void Director_BPy_UnaryFunction0D___call__( void *uf0D, PyObject *obj, Interface ((UnaryFunction0D<Id> *) uf0D)->result = *( ((BPy_Id *) result)->id ); } else if ( BPy_UnaryFunction0DMaterial_Check(obj) ) { - ((UnaryFunction0D<Material> *) uf0D)->result = *( ((BPy_FrsMaterial *) result)->m ); + ((UnaryFunction0D<FrsMaterial> *) uf0D)->result = *( ((BPy_FrsMaterial *) result)->m ); } else if ( BPy_UnaryFunction0DUnsigned_Check(obj) ) { ((UnaryFunction0D<unsigned> *) uf0D)->result = PyInt_AsLong(result); diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp index 22a4dbc378e..336331d92d5 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp @@ -166,21 +166,21 @@ PyObject * FEdgeSharp_normalB( BPy_FEdgeSharp *self ) { } PyObject * FEdgeSharp_aMaterialIndex( BPy_FEdgeSharp *self ) { - return PyInt_FromLong( self->fes->aMaterialIndex() ); + return PyInt_FromLong( self->fes->aFrsMaterialIndex() ); } PyObject * FEdgeSharp_bMaterialIndex( BPy_FEdgeSharp *self ) { - return PyInt_FromLong( self->fes->bMaterialIndex() ); + return PyInt_FromLong( self->fes->bFrsMaterialIndex() ); } PyObject * FEdgeSharp_aMaterial( BPy_FEdgeSharp *self ) { - Material m( self->fes->aMaterial() ); - return BPy_FrsMaterial_from_Material(m); + FrsMaterial m( self->fes->aFrsMaterial() ); + return BPy_FrsMaterial_from_FrsMaterial(m); } PyObject * FEdgeSharp_bMaterial( BPy_FEdgeSharp *self ) { - Material m( self->fes->aMaterial() ); - return BPy_FrsMaterial_from_Material(m); + FrsMaterial m( self->fes->aFrsMaterial() ); + return BPy_FrsMaterial_from_FrsMaterial(m); } PyObject * FEdgeSharp_setNormalA( BPy_FEdgeSharp *self, PyObject *args ) { @@ -225,7 +225,7 @@ PyObject * FEdgeSharp_setaMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) Py_RETURN_NONE; } - self->fes->setaMaterialIndex( i ); + self->fes->setaFrsMaterialIndex( i ); Py_RETURN_NONE; } @@ -238,7 +238,7 @@ PyObject * FEdgeSharp_setbMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) Py_RETURN_NONE; } - self->fes->setbMaterialIndex( i ); + self->fes->setbFrsMaterialIndex( i ); Py_RETURN_NONE; } diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp index 6a11b6c1e98..0970e22a726 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp @@ -152,13 +152,13 @@ PyObject * FEdgeSmooth_normal( BPy_FEdgeSmooth *self ) { } PyObject * FEdgeSmooth_materialIndex( BPy_FEdgeSmooth *self ) { - return PyInt_FromLong( self->fes->materialIndex() ); + return PyInt_FromLong( self->fes->frs_materialIndex() ); } PyObject * FEdgeSmooth_material( BPy_FEdgeSmooth *self ) { - Material m( self->fes->material() ); - return BPy_FrsMaterial_from_Material(m); + FrsMaterial m( self->fes->frs_material() ); + return BPy_FrsMaterial_from_FrsMaterial(m); } PyObject * FEdgeSmooth_setNormal( BPy_FEdgeSmooth *self, PyObject *args ) { @@ -186,7 +186,7 @@ PyObject * FEdgeSmooth_setMaterialIndex( BPy_FEdgeSmooth *self, PyObject *args ) Py_RETURN_NONE; } - self->fes->setMaterialIndex( i ); + self->fes->setFrsMaterialIndex( i ); Py_RETURN_NONE; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp index 2aef794617a..b719f6df71b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp @@ -134,7 +134,7 @@ PyMODINIT_FUNC UnaryFunction0DMaterial_Init( PyObject *module ) { int UnaryFunction0DMaterial___init__(BPy_UnaryFunction0DMaterial* self) { - self->uf0D_material = new UnaryFunction0D<Material>(); + self->uf0D_material = new UnaryFunction0D<FrsMaterial>(); self->uf0D_material->py_uf0D = (PyObject *)self; return 0; } @@ -165,8 +165,8 @@ PyObject * UnaryFunction0DMaterial___call__( BPy_UnaryFunction0DMaterial *self, return NULL; } - Material m( self->uf0D_material->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) ); - return BPy_FrsMaterial_from_Material( m ); + FrsMaterial m( self->uf0D_material->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) ); + return BPy_FrsMaterial_from_FrsMaterial( m ); } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.h b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.h index 5e932213128..ec4b3e1214d 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.h +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.h @@ -3,7 +3,7 @@ #include "../BPy_UnaryFunction0D.h" -#include "../../scene_graph/Material.h" +#include "../../scene_graph/FrsMaterial.h" #ifdef __cplusplus extern "C" { @@ -20,7 +20,7 @@ extern PyTypeObject UnaryFunction0DMaterial_Type; /*---------------------------Python BPy_UnaryFunction0DMaterial structure definition----------*/ typedef struct { BPy_UnaryFunction0D py_uf0D; - UnaryFunction0D<Material> *uf0D_material; + UnaryFunction0D<FrsMaterial> *uf0D_material; } BPy_UnaryFunction0DMaterial; /*---------------------------Python BPy_UnaryFunction0DMaterial visible prototypes-----------*/ |