Blender V5.0
Freestyle::BlenderStrokeRenderer Class Reference

#include <BlenderStrokeRenderer.h>

Inherits Freestyle::StrokeRenderer.

Classes

struct  StrokeGroup

Public Member Functions

 BlenderStrokeRenderer (Render *re, int render_count)
virtual ~BlenderStrokeRenderer ()
virtual void RenderStrokeRep (StrokeRep *iStrokeRep) const
virtual void RenderStrokeRepBasic (StrokeRep *iStrokeRep) const
ObjectNewMesh () const
int GenerateScene ()
void GenerateStrokeMesh (StrokeGroup *group, bool hasTex)
void FreeStrokeGroups ()
RenderRenderScene (Render *re, bool render)
Public Member Functions inherited from Freestyle::StrokeRenderer
virtual ~StrokeRenderer ()

Static Public Member Functions

static MaterialGetStrokeShader (Main *bmain, bNodeTree *iNodeTree, bool do_id_user)
Static Public Member Functions inherited from Freestyle::StrokeRenderer
static bool loadTextures ()

Public Attributes

vector< StrokeGroup * > strokeGroups
vector< StrokeGroup * > texturedStrokeGroups

Protected Member Functions

int get_stroke_count () const
float get_stroke_vertex_z (void) const
uint get_stroke_mesh_id (void) const
bool test_triangle_visibility (StrokeVertexRep *svRep[3]) const
void test_strip_visibility (Strip::vertex_container &strip_vertices, int *visible_faces, int *visible_segments) const

Protected Attributes

Mainfreestyle_bmain
Sceneold_scene
Scenefreestyle_scene
Depsgraph * freestyle_depsgraph
bContext_context
float _width
float _height
float _z
float _z_delta
uint _mesh_id
bool _use_shading_nodes
struct GHash_nodetree_hash
vector< StrokeRep * > _strokeReps

Static Protected Attributes

static const char * uvNames [] = {"along_stroke", "along_stroke_tips"}

Additional Inherited Members

Static Public Attributes inherited from Freestyle::StrokeRenderer
static TextureManager_textureManager = nullptr

Detailed Description

Definition at line 30 of file BlenderStrokeRenderer.h.

Constructor & Destructor Documentation

◆ BlenderStrokeRenderer()

◆ ~BlenderStrokeRenderer()

Freestyle::BlenderStrokeRenderer::~BlenderStrokeRenderer ( )
virtual

Member Function Documentation

◆ FreeStrokeGroups()

void Freestyle::BlenderStrokeRenderer::FreeStrokeGroups ( )

Definition at line 551 of file BlenderStrokeRenderer.cpp.

References strokeGroups, and texturedStrokeGroups.

Referenced by ~BlenderStrokeRenderer().

◆ GenerateScene()

int Freestyle::BlenderStrokeRenderer::GenerateScene ( )

◆ GenerateStrokeMesh()

void Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh ( StrokeGroup * group,
bool hasTex )

Definition at line 584 of file BlenderStrokeRenderer.cpp.

References MLoopCol::a, Freestyle::StrokeVertexRep::alpha(), MLoopCol::b, BKE_id_attributes_active_color_set(), BKE_mesh_face_offsets_ensure_alloc(), BKE_mesh_validate(), BKE_object_add(), BKE_object_materials_sync_length(), BLI_assert, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_SET_DEFAULT, copy_v3fl_v3db(), blender::bke::Corner, Mesh::corner_data, Mesh::corners_num, CustomData_add_layer_named(), CustomData_get_layer_name(), CustomData_set_layer_active(), Object::data, DEG_relations_tag_update(), blender::bke::Edge, Mesh::edges_num, blender::bke::Face, Freestyle::BlenderStrokeRenderer::StrokeGroup::faces_num, Mesh::faces_num, blender::bke::SpanAttributeWriter< T >::finish(), freestyle_bmain, freestyle_scene, MLoopCol::g, get_stroke_vertex_z(), i, Material::id, Mesh::id, id_us_plus(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), L, linearrgb_to_srgb_uchar4(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), Mesh::mat, Freestyle::BlenderStrokeRenderer::StrokeGroup::materials, MEM_malloc_arrayN(), NewMesh(), OB_MESH, blender::bke::Point, Freestyle::StrokeVertexRep::point2d(), MLoopCol::r, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::bke::SpanAttributeWriter< T >::span, Freestyle::BlenderStrokeRenderer::StrokeGroup::strokes, test_strip_visibility(), test_triangle_visibility(), Freestyle::StrokeVertexRep::texCoord(), Mesh::totcol, Freestyle::BlenderStrokeRenderer::StrokeGroup::totedge, Freestyle::BlenderStrokeRenderer::StrokeGroup::totloop, Freestyle::BlenderStrokeRenderer::StrokeGroup::totvert, uvNames, v, Mesh::verts_num, Freestyle::VecMat::Vec2< T >::x(), and Freestyle::VecMat::Vec2< T >::y().

Referenced by GenerateScene().

◆ get_stroke_count()

int Freestyle::BlenderStrokeRenderer::get_stroke_count ( ) const
protected

Definition at line 578 of file BlenderStrokeRenderer.cpp.

References strokeGroups, and texturedStrokeGroups.

Referenced by GenerateScene(), and RenderScene().

◆ get_stroke_mesh_id()

uint Freestyle::BlenderStrokeRenderer::get_stroke_mesh_id ( void ) const
protected

Definition at line 198 of file BlenderStrokeRenderer.cpp.

References _mesh_id, BlenderStrokeRenderer(), and self.

Referenced by NewMesh().

◆ get_stroke_vertex_z()

float Freestyle::BlenderStrokeRenderer::get_stroke_vertex_z ( void ) const
protected

Definition at line 187 of file BlenderStrokeRenderer.cpp.

References _z, _z_delta, BlenderStrokeRenderer(), self, and z().

Referenced by GenerateStrokeMesh().

◆ GetStrokeShader()

◆ NewMesh()

◆ RenderScene()

◆ RenderStrokeRep()

void Freestyle::BlenderStrokeRenderer::RenderStrokeRep ( StrokeRep * iStrokeRep) const
virtual

Renders a stroke rep

Implements Freestyle::StrokeRenderer.

Definition at line 433 of file BlenderStrokeRenderer.cpp.

References RenderStrokeRepBasic().

◆ RenderStrokeRepBasic()

◆ test_strip_visibility()

void Freestyle::BlenderStrokeRenderer::test_strip_visibility ( Strip::vertex_container & strip_vertices,
int * visible_faces,
int * visible_segments ) const
protected

Definition at line 516 of file BlenderStrokeRenderer.cpp.

References test_triangle_visibility(), and v.

Referenced by GenerateStrokeMesh(), and RenderStrokeRepBasic().

◆ test_triangle_visibility()

bool Freestyle::BlenderStrokeRenderer::test_triangle_visibility ( StrokeVertexRep * svRep[3]) const
protected

Member Data Documentation

◆ _context

bContext* Freestyle::BlenderStrokeRenderer::_context
protected

Definition at line 65 of file BlenderStrokeRenderer.h.

◆ _height

float Freestyle::BlenderStrokeRenderer::_height
protected

Definition at line 66 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer(), and test_triangle_visibility().

◆ _mesh_id

uint Freestyle::BlenderStrokeRenderer::_mesh_id
protected

Definition at line 68 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer(), and get_stroke_mesh_id().

◆ _nodetree_hash

struct GHash* Freestyle::BlenderStrokeRenderer::_nodetree_hash
protected

◆ _strokeReps

vector<StrokeRep *> Freestyle::BlenderStrokeRenderer::_strokeReps
protected

Definition at line 82 of file BlenderStrokeRenderer.h.

◆ _use_shading_nodes

bool Freestyle::BlenderStrokeRenderer::_use_shading_nodes
protected

Definition at line 69 of file BlenderStrokeRenderer.h.

◆ _width

float Freestyle::BlenderStrokeRenderer::_width
protected

Definition at line 66 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer(), and test_triangle_visibility().

◆ _z

float Freestyle::BlenderStrokeRenderer::_z
protected

Definition at line 67 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer(), get_stroke_vertex_z(), and RenderScene().

◆ _z_delta

float Freestyle::BlenderStrokeRenderer::_z_delta
protected

Definition at line 67 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer(), get_stroke_vertex_z(), and RenderScene().

◆ freestyle_bmain

Main* Freestyle::BlenderStrokeRenderer::freestyle_bmain
protected

◆ freestyle_depsgraph

Depsgraph* Freestyle::BlenderStrokeRenderer::freestyle_depsgraph
protected

◆ freestyle_scene

Scene* Freestyle::BlenderStrokeRenderer::freestyle_scene
protected

◆ old_scene

Scene* Freestyle::BlenderStrokeRenderer::old_scene
protected

Definition at line 62 of file BlenderStrokeRenderer.h.

Referenced by BlenderStrokeRenderer().

◆ strokeGroups

vector<StrokeGroup *> Freestyle::BlenderStrokeRenderer::strokeGroups

Definition at line 50 of file BlenderStrokeRenderer.h.

Referenced by FreeStrokeGroups(), GenerateScene(), and get_stroke_count().

◆ texturedStrokeGroups

vector<StrokeGroup *> Freestyle::BlenderStrokeRenderer::texturedStrokeGroups

Definition at line 50 of file BlenderStrokeRenderer.h.

Referenced by FreeStrokeGroups(), GenerateScene(), and get_stroke_count().

◆ uvNames

const char * Freestyle::BlenderStrokeRenderer::uvNames = {"along_stroke", "along_stroke_tips"}
staticprotected

Definition at line 72 of file BlenderStrokeRenderer.h.

Referenced by GenerateStrokeMesh(), and GetStrokeShader().


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