Blender V4.3
Freestyle::StrokeShader Class Reference

#include <StrokeShader.h>

Inherited by Freestyle::CalligraphicShader, Freestyle::OmissionShader, Freestyle::SmoothingShader, Freestyle::SpatialNoiseShader, Freestyle::StrokeShaders::BackboneStretcherShader, Freestyle::StrokeShaders::BezierCurveShader, Freestyle::StrokeShaders::BlenderTextureShader, Freestyle::StrokeShaders::ColorNoiseShader, Freestyle::StrokeShaders::ConstantColorShader, Freestyle::StrokeShaders::ConstantExternThicknessShader, Freestyle::StrokeShaders::ConstantThicknessShader, Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader, Freestyle::StrokeShaders::ExternalContourStretcherShader, Freestyle::StrokeShaders::GuidingLinesShader, Freestyle::StrokeShaders::IncreasingColorShader, Freestyle::StrokeShaders::IncreasingThicknessShader, Freestyle::StrokeShaders::LengthDependingThicknessShader, Freestyle::StrokeShaders::MaterialColorShader, Freestyle::StrokeShaders::PolygonalizationShader, Freestyle::StrokeShaders::SamplingShader, Freestyle::StrokeShaders::StrokeTextureStepShader, Freestyle::StrokeShaders::ThicknessNoiseShader, and Freestyle::StrokeShaders::TipRemoverShader.

Public Member Functions

 StrokeShader ()
 
virtual ~StrokeShader ()
 
virtual string getName () const
 
virtual int shade (Stroke &ioStroke) const
 

Public Attributes

void * py_ss
 

Detailed Description

Base class for Stroke Shaders. Any Stroke Shader must inherit from this class and overload the shade() method. A StrokeShader is designed to modify any Stroke's attribute such as Thickness, Color, Geometry, Texture, Blending mode... The basic way to achieve this operation consists in iterating over the StrokeVertices of the Stroke and to modify each one's StrokeAttribute. Here is a python code example of such an iteration:

it = ioStroke.strokeVerticesBegin() while not it.isEnd(): att =
it.getObject().attribute()
## perform here any attribute modification
it.increment()

Here is a C++ code example of such an iteration:

for (StrokeInternal::StrokeVertexIterator v = ioStroke.strokeVerticesBegin(), vend =
ioStroke.strokeVerticesEnd(); v != vend;
++v)
{
StrokeAttribute& att = v->attribute();
// perform any attribute modification here...
}
ATTR_WARN_UNUSED_RESULT const BMVert * v

Definition at line 52 of file StrokeShader.h.

Constructor & Destructor Documentation

◆ StrokeShader()

Freestyle::StrokeShader::StrokeShader ( )
inline

Default constructor.

Definition at line 57 of file StrokeShader.h.

References py_ss.

◆ ~StrokeShader()

virtual Freestyle::StrokeShader::~StrokeShader ( )
inlinevirtual

Destructor.

Definition at line 63 of file StrokeShader.h.

Member Function Documentation

◆ getName()

◆ shade()

int Freestyle::StrokeShader::shade ( Stroke & ioStroke) const
virtual

Member Data Documentation

◆ py_ss

void* Freestyle::StrokeShader::py_ss

Definition at line 54 of file StrokeShader.h.

Referenced by Director_BPy_StrokeShader_shade(), and StrokeShader().


The documentation for this class was generated from the following files: