This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/freestyle/intern/python/Convert.h
T
Maxime Curioni e4748940c0 soc-2008-mxcurioni: SWIG removal - completed SVertex and CurvePoint classes migration. Stabilized a lot of the code for C++ -> Python conversion. Added the correct rich comparison operator and tested it. Corrected 'dupplicate' typo and changde to __copy__ for Python API.
From now on, when a set should be output (PySet_Type), it is given as a list (PyList_Type). The reason is that it doesn't really matter what we bring back to the Python interpreter. The set is guaranteed in memory on the C++ side.

For the CurvePoint class, the userdata variable is not yet ported (and will probably available as a list or a dictionary). The CurvePoint implementation works except for the initialization from other CurvePoints: somehow, the inner variables don't seem to be correctly handled. I do not know if it is a bug in Freestyle or if the CurvePoint object's state is correct for my test case. CurvePoint needs more testing.
2008-07-17 06:35:30 +00:00

37 lines
800 B
C++

#ifndef FREESTYLE_PYTHON_CONVERT_H
#define FREESTYLE_PYTHON_CONVERT_H
#include "../geometry/Geom.h"
using namespace Geometry;
#include "Id.h"
#include "Interface0D/SVertex.h"
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////////////////
#include <Python.h>
#include "api2_2x/vector.h"
#include "api2_2x/gen_utils.h"
PyObject *PyBool_from_bool( bool b );
PyObject *Vector_from_Vec2f( Vec2f v );
PyObject *Vector_from_Vec3f( Vec3f v );
PyObject *Vector_from_Vec3r( Vec3r v );
PyObject *BPy_Id_from_Id( Id id );
PyObject *BPy_SVertex_from_SVertex( SVertex sv );
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif /* FREESTYLE_PYTHON_CONVERT_H */