Made the Freestyle Python API compatible with Python 3.
[blender.git] / source / blender / freestyle / intern / python / StrokeShader / BPy_SpatialNoiseShader.cpp
1 #include "BPy_SpatialNoiseShader.h"
2
3 #include "../../stroke/AdvancedStrokeShaders.h"
4 #include "../BPy_Convert.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 ///////////////////////////////////////////////////////////////////////////////////////////
11
12 /*---------------  Python API function prototypes for SpatialNoiseShader instance  -----------*/
13 static int SpatialNoiseShader___init__( BPy_SpatialNoiseShader* self, PyObject *args);
14
15 /*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/
16
17 PyTypeObject SpatialNoiseShader_Type = {
18         PyObject_HEAD_INIT(NULL)
19         "SpatialNoiseShader",          /* tp_name */
20         sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */
21         0,                              /* tp_itemsize */
22         0,                              /* tp_dealloc */
23         0,                              /* tp_print */
24         0,                              /* tp_getattr */
25         0,                              /* tp_setattr */
26         0,                              /* tp_reserved */
27         0,                              /* tp_repr */
28         0,                              /* tp_as_number */
29         0,                              /* tp_as_sequence */
30         0,                              /* tp_as_mapping */
31         0,                              /* tp_hash  */
32         0,                              /* tp_call */
33         0,                              /* tp_str */
34         0,                              /* tp_getattro */
35         0,                              /* tp_setattro */
36         0,                              /* tp_as_buffer */
37         Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
38         "SpatialNoiseShader objects",  /* tp_doc */
39         0,                              /* tp_traverse */
40         0,                              /* tp_clear */
41         0,                              /* tp_richcompare */
42         0,                              /* tp_weaklistoffset */
43         0,                              /* tp_iter */
44         0,                              /* tp_iternext */
45         0,                              /* tp_methods */
46         0,                              /* tp_members */
47         0,                              /* tp_getset */
48         &StrokeShader_Type,             /* tp_base */
49         0,                              /* tp_dict */
50         0,                              /* tp_descr_get */
51         0,                              /* tp_descr_set */
52         0,                              /* tp_dictoffset */
53         (initproc)SpatialNoiseShader___init__, /* tp_init */
54         0,                              /* tp_alloc */
55         0,                              /* tp_new */
56 };
57
58 //------------------------INSTANCE METHODS ----------------------------------
59
60 int SpatialNoiseShader___init__( BPy_SpatialNoiseShader* self, PyObject *args)
61 {
62         float f1, f2;
63         int i3;
64         PyObject *obj4 = 0, *obj5 = 0;
65         
66         if(!( PyArg_ParseTuple(args, "ffiOO", &f1, &f2, &i3, &obj4, &obj5) ))
67                 return -1;
68
69         self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5) );
70         return 0;
71 }
72
73 ///////////////////////////////////////////////////////////////////////////////////////////
74
75 #ifdef __cplusplus
76 }
77 #endif