Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp')
-rw-r--r--source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp62
1 files changed, 46 insertions, 16 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp
index 27ac0bf15a5..4df76f6646b 100644
--- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp
+++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp
@@ -8,8 +8,51 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for TextureAssignerShader instance -----------*/
-static int TextureAssignerShader___init__( BPy_TextureAssignerShader* self, PyObject *args);
+//------------------------INSTANCE METHODS ----------------------------------
+
+static char TextureAssignerShader___doc__[] =
+"[Texture shader]\n"
+"\n"
+".. method:: __init__(id)\n"
+"\n"
+" Builds a TextureAssignerShader object.\n"
+"\n"
+" :arg id: The preset number to use.\n"
+" :type id: int\n"
+"\n"
+".. method:: shade(s)\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`, `MediumType.HUMID_MEDIUM`\n"
+" * 1: `/brushes/washbrushAlpha.bmp`, `MediumType.HUMID_MEDIUM`\n"
+" * 2: `/brushes/oil.bmp`, `MediumType.HUMID_MEDIUM`\n"
+" * 3: `/brushes/oilnoblend.bmp`, `MediumType.HUMID_MEDIUM`\n"
+" * 4: `/brushes/charcoalAlpha.bmp`, `MediumType.DRY_MEDIUM`\n"
+" * 5: `/brushes/washbrushAlpha.bmp`, `MediumType.DRY_MEDIUM`\n"
+" * 6: `/brushes/opaqueDryBrushAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
+" * 7: `/brushes/opaqueBrushAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
+"\n"
+" Any other value will lead to the following preset:\n"
+"\n"
+" * Default: `/brushes/smoothAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
+"\n"
+" :arg s: A Stroke object.\n"
+" :type s: :class:`Stroke`\n";
+
+static int TextureAssignerShader___init__( BPy_TextureAssignerShader* self, PyObject *args)
+{
+ int i;
+
+ if(!( PyArg_ParseTuple(args, "i", &i) ))
+ return -1;
+
+ self->py_ss.ss = new StrokeShaders::TextureAssignerShader(i);
+ return 0;
+}
/*-----------------------BPy_TextureAssignerShader type definition ------------------------------*/
@@ -34,7 +77,7 @@ PyTypeObject TextureAssignerShader_Type = {
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "TextureAssignerShader objects", /* tp_doc */
+ TextureAssignerShader___doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
@@ -54,19 +97,6 @@ PyTypeObject TextureAssignerShader_Type = {
0, /* tp_new */
};
-//------------------------INSTANCE METHODS ----------------------------------
-
-int TextureAssignerShader___init__( BPy_TextureAssignerShader* self, PyObject *args)
-{
- int i;
-
- if(!( PyArg_ParseTuple(args, "i", &i) ))
- return -1;
-
- self->py_ss.ss = new StrokeShaders::TextureAssignerShader(i);
- return 0;
-}
-
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus