D801: Freestyle: remove old and unused stroke shaders
This patch removes several stroke shaders written in C++ that are unused and don't serve a real purpose any more. The removed shaders are: - BPy_ColorVariationPatternShader - BPy_StrokeTextureShader - BPy_TextureAssignerShader - BPy_ThicknessVariationPatternShader - BPy_fstreamShader - BPy_streamShader and a few more that weren't even exposed to the Python API. Some minor edits were made by the reviewer. Differential Revision: https://developer.blender.org/D801 Reviewed by: kjym3
This commit is contained in:
@@ -32,11 +32,9 @@
|
||||
#include "StrokeShader/BPy_BlenderTextureShader.h"
|
||||
#include "StrokeShader/BPy_CalligraphicShader.h"
|
||||
#include "StrokeShader/BPy_ColorNoiseShader.h"
|
||||
#include "StrokeShader/BPy_ColorVariationPatternShader.h"
|
||||
#include "StrokeShader/BPy_ConstantColorShader.h"
|
||||
#include "StrokeShader/BPy_ConstantThicknessShader.h"
|
||||
#include "StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h"
|
||||
#include "StrokeShader/BPy_fstreamShader.h"
|
||||
#include "StrokeShader/BPy_GuidingLinesShader.h"
|
||||
#include "StrokeShader/BPy_IncreasingColorShader.h"
|
||||
#include "StrokeShader/BPy_IncreasingThicknessShader.h"
|
||||
@@ -44,12 +42,8 @@
|
||||
#include "StrokeShader/BPy_SamplingShader.h"
|
||||
#include "StrokeShader/BPy_SmoothingShader.h"
|
||||
#include "StrokeShader/BPy_SpatialNoiseShader.h"
|
||||
#include "StrokeShader/BPy_streamShader.h"
|
||||
#include "StrokeShader/BPy_StrokeTextureShader.h"
|
||||
#include "StrokeShader/BPy_StrokeTextureStepShader.h"
|
||||
#include "StrokeShader/BPy_TextureAssignerShader.h"
|
||||
#include "StrokeShader/BPy_ThicknessNoiseShader.h"
|
||||
#include "StrokeShader/BPy_ThicknessVariationPatternShader.h"
|
||||
#include "StrokeShader/BPy_TipRemoverShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -94,11 +88,6 @@ int StrokeShader_Init(PyObject *module)
|
||||
Py_INCREF(&ColorNoiseShader_Type);
|
||||
PyModule_AddObject(module, "ColorNoiseShader", (PyObject *)&ColorNoiseShader_Type);
|
||||
|
||||
if (PyType_Ready(&ColorVariationPatternShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ColorVariationPatternShader_Type);
|
||||
PyModule_AddObject(module, "ColorVariationPatternShader", (PyObject *)&ColorVariationPatternShader_Type);
|
||||
|
||||
if (PyType_Ready(&ConstantColorShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ConstantColorShader_Type);
|
||||
@@ -115,11 +104,6 @@ int StrokeShader_Init(PyObject *module)
|
||||
PyModule_AddObject(module, "ConstrainedIncreasingThicknessShader",
|
||||
(PyObject *)&ConstrainedIncreasingThicknessShader_Type);
|
||||
|
||||
if (PyType_Ready(&fstreamShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&fstreamShader_Type);
|
||||
PyModule_AddObject(module, "fstreamShader", (PyObject *)&fstreamShader_Type);
|
||||
|
||||
if (PyType_Ready(&GuidingLinesShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GuidingLinesShader_Type);
|
||||
@@ -155,36 +139,16 @@ int StrokeShader_Init(PyObject *module)
|
||||
Py_INCREF(&SpatialNoiseShader_Type);
|
||||
PyModule_AddObject(module, "SpatialNoiseShader", (PyObject *)&SpatialNoiseShader_Type);
|
||||
|
||||
if (PyType_Ready(&streamShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&streamShader_Type);
|
||||
PyModule_AddObject(module, "streamShader", (PyObject *)&streamShader_Type);
|
||||
|
||||
if (PyType_Ready(&StrokeTextureShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&StrokeTextureShader_Type);
|
||||
PyModule_AddObject(module, "StrokeTextureShader", (PyObject *)&StrokeTextureShader_Type);
|
||||
|
||||
if (PyType_Ready(&StrokeTextureStepShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&StrokeTextureStepShader_Type);
|
||||
PyModule_AddObject(module, "StrokeTextureStepShader", (PyObject *)&StrokeTextureStepShader_Type);
|
||||
|
||||
if (PyType_Ready(&TextureAssignerShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TextureAssignerShader_Type);
|
||||
PyModule_AddObject(module, "TextureAssignerShader", (PyObject *)&TextureAssignerShader_Type);
|
||||
|
||||
if (PyType_Ready(&ThicknessNoiseShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ThicknessNoiseShader_Type);
|
||||
PyModule_AddObject(module, "ThicknessNoiseShader", (PyObject *)&ThicknessNoiseShader_Type);
|
||||
|
||||
if (PyType_Ready(&ThicknessVariationPatternShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ThicknessVariationPatternShader_Type);
|
||||
PyModule_AddObject(module, "ThicknessVariationPatternShader", (PyObject *)&ThicknessVariationPatternShader_Type);
|
||||
|
||||
if (PyType_Ready(&TipRemoverShader_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TipRemoverShader_Type);
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_ColorVariationPatternShader.h"
|
||||
|
||||
#include "../../stroke/BasicStrokeShaders.h"
|
||||
#include "../BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char ColorVariationPatternShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ColorVariationPatternShader`\n"
|
||||
"\n"
|
||||
"[Color shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__(pattern_name, stretch=True)\n"
|
||||
"\n"
|
||||
" Builds a ColorVariationPatternShader object.\n"
|
||||
"\n"
|
||||
" :arg pattern_name: The file name of the texture file to use as\n"
|
||||
" pattern.\n"
|
||||
" :type pattern_name: str\n"
|
||||
" :arg stretch: Tells whether the texture must be strecthed or\n"
|
||||
" repeted to fit the stroke.\n"
|
||||
" :type stretch: bool\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Applies a pattern to vary the original color. The new color is the\n"
|
||||
" result of the multiplication of the pattern and the original color.\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int ColorVariationPatternShader___init__(BPy_ColorVariationPatternShader *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"pattern_name", "stretch", NULL};
|
||||
const char *s;
|
||||
PyObject *obj = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O!", (char **)kwlist, &s, &PyBool_Type, &obj))
|
||||
return -1;
|
||||
bool b = (!obj) ? true : bool_from_PyBool(obj);
|
||||
self->py_ss.ss = new StrokeShaders::ColorVariationPatternShader(s, b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_ColorVariationPatternShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject ColorVariationPatternShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"ColorVariationPatternShader", /* tp_name */
|
||||
sizeof(BPy_ColorVariationPatternShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
ColorVariationPatternShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)ColorVariationPatternShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H__
|
||||
#define __FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject ColorVariationPatternShader_Type;
|
||||
|
||||
#define BPy_ColorVariationPatternShader_Check(v) \
|
||||
(PyObject_IsInstance((PyObject *)v, (PyObject *)&ColorVariationPatternShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_ColorVariationPatternShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_ColorVariationPatternShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H__ */
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_StrokeTextureShader.h"
|
||||
|
||||
#include "../../stroke/BasicStrokeShaders.h"
|
||||
#include "../BPy_Convert.h"
|
||||
#include "../BPy_MediumType.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char StrokeTextureShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`StrokeTextureShader`\n"
|
||||
"\n"
|
||||
"[Texture shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__(texture_file, medium_type=Stroke.OPAQUE_MEDIUM, tips=False)\n"
|
||||
"\n"
|
||||
" Builds a StrokeTextureShader object.\n"
|
||||
"\n"
|
||||
" :arg texture_file: \n"
|
||||
" :type texture_file: str\n"
|
||||
" :arg medium_type: The medium type and therefore, the blending mode\n"
|
||||
" that must be used for the rendering of this stroke.\n"
|
||||
" :type medium_type: :class:`freestyle.types.MediumType`\n"
|
||||
" :arg tips: Tells whether the texture includes tips or not. If it\n"
|
||||
" is the case, the texture image must respect the following format.\n"
|
||||
" :type tips: bool\n"
|
||||
"\n"
|
||||
" The format of a texture image including tips::\n"
|
||||
"\n"
|
||||
" ___________\n"
|
||||
" | |\n"
|
||||
" | A |\n"
|
||||
" |___________|\n"
|
||||
" | | |\n"
|
||||
" | B | C |\n"
|
||||
" |_____|_____|\n"
|
||||
"\n"
|
||||
" * A : The stroke's corpus texture.\n"
|
||||
" * B : The stroke's left extremity texture.\n"
|
||||
" * C : The stroke's right extremity texture.\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Assigns a texture and a blending mode to the stroke in order to\n"
|
||||
" simulate its marks system.\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int StrokeTextureShader___init__(BPy_StrokeTextureShader *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"texture_file", "medium_type", "tips", NULL};
|
||||
const char *s1;
|
||||
PyObject *obj2 = 0, *obj3 = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O!O!", (char **)kwlist,
|
||||
&s1, &MediumType_Type, &obj2, &PyBool_Type, &obj3))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
Stroke::MediumType mt = (!obj2) ? Stroke::OPAQUE_MEDIUM : MediumType_from_BPy_MediumType(obj2);
|
||||
bool b = (!obj3) ? false : bool_from_PyBool(obj3);
|
||||
self->py_ss.ss = new StrokeShaders::StrokeTextureShader(s1, mt, b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_StrokeTextureShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject StrokeTextureShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"StrokeTextureShader", /* tp_name */
|
||||
sizeof(BPy_StrokeTextureShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
StrokeTextureShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)StrokeTextureShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_STROKETEXTURESHADER_H__
|
||||
#define __FREESTYLE_PYTHON_STROKETEXTURESHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject StrokeTextureShader_Type;
|
||||
|
||||
#define BPy_StrokeTextureShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&StrokeTextureShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_StrokeTextureShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_StrokeTextureShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_STROKETEXTURESHADER_H__ */
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_TextureAssignerShader.h"
|
||||
|
||||
#include "../../stroke/BasicStrokeShaders.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char TextureAssignerShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`TextureAssignerShader`\n"
|
||||
"\n"
|
||||
"[Texture shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__(preset)\n"
|
||||
"\n"
|
||||
" Builds a TextureAssignerShader object.\n"
|
||||
"\n"
|
||||
" :arg preset: The preset number to use.\n"
|
||||
" :type preset: int\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Assigns a texture to the stroke in order to simulate its marks\n"
|
||||
" system. This shader takes as input an integer value telling which\n"
|
||||
" texture and blending mode to use among a set of predefined\n"
|
||||
" textures. Here are the different presets:\n"
|
||||
"\n"
|
||||
" * 0: `/brushes/charcoalAlpha.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 1: `/brushes/washbrushAlpha.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 2: `/brushes/oil.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 3: `/brushes/oilnoblend.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 4: `/brushes/charcoalAlpha.bmp`, `Stroke.DRY_MEDIUM`\n"
|
||||
" * 5: `/brushes/washbrushAlpha.bmp`, `Stroke.DRY_MEDIUM`\n"
|
||||
" * 6: `/brushes/opaqueDryBrushAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
" * 7: `/brushes/opaqueBrushAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
"\n"
|
||||
" Any other value will lead to the following preset:\n"
|
||||
"\n"
|
||||
" * Default: `/brushes/smoothAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int TextureAssignerShader___init__(BPy_TextureAssignerShader *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"preset", NULL};
|
||||
int i;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist, &i))
|
||||
return -1;
|
||||
self->py_ss.ss = new StrokeShaders::TextureAssignerShader(i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_TextureAssignerShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject TextureAssignerShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"TextureAssignerShader", /* tp_name */
|
||||
sizeof(BPy_TextureAssignerShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
TextureAssignerShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)TextureAssignerShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H__
|
||||
#define __FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject TextureAssignerShader_Type;
|
||||
|
||||
#define BPy_TextureAssignerShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&TextureAssignerShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_TextureAssignerShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_TextureAssignerShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H__ */
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_ThicknessVariationPatternShader.h"
|
||||
|
||||
#include "../../stroke/BasicStrokeShaders.h"
|
||||
#include "../BPy_Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char ThicknessVariationPatternShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ThicknessVariationPatternShader`\n"
|
||||
"\n"
|
||||
"[Thickness shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__(pattern_name, thickness_min=1.0, thickness_max=5.0, stretch=True)\n"
|
||||
"\n"
|
||||
" Builds a ThicknessVariationPatternShader object.\n"
|
||||
"\n"
|
||||
" :arg pattern_name: The texture file name.\n"
|
||||
" :type pattern_name: str\n"
|
||||
" :arg thickness_min: The minimum thickness we don't want to exceed.\n"
|
||||
" :type thickness_min: float\n"
|
||||
" :arg thickness_max: The maximum thickness we don't want to exceed.\n"
|
||||
" :type thickness_max: float\n"
|
||||
" :arg stretch: Tells whether the pattern texture must be stretched\n"
|
||||
" or repeated to fit the stroke.\n"
|
||||
" :type stretch: bool\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Applies a pattern (texture) to vary thickness. The new thicknesses\n"
|
||||
" are the result of the multiplication of the pattern and the\n"
|
||||
" original thickness.\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int ThicknessVariationPatternShader___init__(BPy_ThicknessVariationPatternShader *self,
|
||||
PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"pattern_name", "thickness_min", "thickness_max", "stretch", NULL};
|
||||
const char *s1;
|
||||
float f2 = 1.0, f3 = 5.0;
|
||||
PyObject *obj4 = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|ffO!", (char **)kwlist, &s1, &f2, &f3, &PyBool_Type, &obj4))
|
||||
return -1;
|
||||
bool b = (!obj4) ? true : bool_from_PyBool(obj4);
|
||||
self->py_ss.ss = new StrokeShaders::ThicknessVariationPatternShader(s1, f2, f3, b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_ThicknessVariationPatternShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject ThicknessVariationPatternShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"ThicknessVariationPatternShader", /* tp_name */
|
||||
sizeof(BPy_ThicknessVariationPatternShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
ThicknessVariationPatternShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)ThicknessVariationPatternShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H__
|
||||
#define __FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject ThicknessVariationPatternShader_Type;
|
||||
|
||||
#define BPy_ThicknessVariationPatternShader_Check(v) \
|
||||
(PyObject_IsInstance((PyObject *)v, (PyObject *)&ThicknessVariationPatternShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_ThicknessVariationPatternShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_ThicknessVariationPatternShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H__ */
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_fstreamShader.h"
|
||||
|
||||
#include "../../stroke/AdvancedStrokeShaders.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char fstreamShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`fstreamShader`\n"
|
||||
"\n"
|
||||
"[Output shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__(filename)\n"
|
||||
"\n"
|
||||
" Builds a fstreamShader object.\n"
|
||||
"\n"
|
||||
" :arg filename: The output file name.\n"
|
||||
" :type filename: str\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Streams the Stroke in a file.\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int fstreamShader___init__(BPy_fstreamShader *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"filename", NULL};
|
||||
const char *s;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &s))
|
||||
return -1;
|
||||
self->py_ss.ss = new StrokeShaders::fstreamShader(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_fstreamShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject fstreamShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"fstreamShader", /* tp_name */
|
||||
sizeof(BPy_fstreamShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
fstreamShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)fstreamShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_FSTREAMSHADER_H__
|
||||
#define __FREESTYLE_PYTHON_FSTREAMSHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject fstreamShader_Type;
|
||||
|
||||
#define BPy_fstreamShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&fstreamShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_fstreamShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_fstreamShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_FSTREAMSHADER_H__ */
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.cpp
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#include "BPy_streamShader.h"
|
||||
|
||||
#include "../../stroke/BasicStrokeShaders.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
static char streamShader___doc__[] =
|
||||
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`streamShader`\n"
|
||||
"\n"
|
||||
"[Output shader]\n"
|
||||
"\n"
|
||||
".. method:: __init__()\n"
|
||||
"\n"
|
||||
" Builds a streamShader object.\n"
|
||||
"\n"
|
||||
".. method:: shade(stroke)\n"
|
||||
"\n"
|
||||
" Streams the Stroke into stdout.\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
||||
|
||||
static int streamShader___init__(BPy_streamShader *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[] = {NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "", (char **)kwlist))
|
||||
return -1;
|
||||
self->py_ss.ss = new StrokeShaders::streamShader();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------BPy_streamShader type definition ------------------------------*/
|
||||
|
||||
PyTypeObject streamShader_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"streamShader", /* tp_name */
|
||||
sizeof(BPy_streamShader), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
streamShader___doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&StrokeShader_Type, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)streamShader___init__, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0, /* tp_new */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_STREAMSHADER_H__
|
||||
#define __FREESTYLE_PYTHON_STREAMSHADER_H__
|
||||
|
||||
#include "../BPy_StrokeShader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern PyTypeObject streamShader_Type;
|
||||
|
||||
#define BPy_streamShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&streamShader_Type))
|
||||
|
||||
/*---------------------------Python BPy_streamShader structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_StrokeShader py_ss;
|
||||
} BPy_streamShader;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FREESTYLE_PYTHON_STREAMSHADER_H__ */
|
||||
Reference in New Issue
Block a user