Blender
V3.3
|
#include <BlenderStrokeRenderer.h>
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 |
Object * | NewMesh () const |
int | GenerateScene () |
void | GenerateStrokeMesh (StrokeGroup *group, bool hasTex) |
void | FreeStrokeGroups () |
Render * | RenderScene (Render *re, bool render) |
![]() | |
virtual | ~StrokeRenderer () |
Static Public Member Functions | |
static Material * | GetStrokeShader (Main *bmain, bNodeTree *iNodeTree, bool do_id_user) |
![]() | |
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 |
unsigned int | 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 | |
Main * | freestyle_bmain |
Scene * | old_scene |
Scene * | freestyle_scene |
Depsgraph * | freestyle_depsgraph |
bContext * | _context |
float | _width |
float | _height |
float | _z |
float | _z_delta |
unsigned int | _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 TextureManager * | _textureManager = nullptr |
Definition at line 28 of file BlenderStrokeRenderer.h.
Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer | ( | Render * | re, |
int | render_count | ||
) |
Definition at line 61 of file BlenderStrokeRenderer.cpp.
References _height, _mesh_id, _nodetree_hash, _width, _z, _z_delta, RenderData::alphamode, BKE_main_new(), BKE_object_add(), BKE_render_num_threads(), BKE_scene_add(), BKE_scene_copy_data_eevee(), BKE_scene_set_background(), BLI_ghash_ptr_new(), BLI_snprintf(), RenderData::border, CAM_ORTHO, Scene::camera, camera, RenderData::cfra, RenderData::color_mgt_flag, DAG_EVAL_RENDER, DEG_graph_id_tag_update(), DEG_graph_new(), DEG_graph_tag_relations_update(), Render::disprect, RenderData::dither_intensity, RenderData::engine, ListBase::first, RenderData::flag, freestyle_bmain, freestyle_depsgraph, freestyle_scene, G, G_DEBUG_FREESTYLE, Scene::id, IDP_CopyProperty_ex(), RenderData::im_format, ImageFormatData::imtype, ViewLayer::layflag, Render::main, max, MAX_ID_NAME, RenderData::mode, ID::name, OB_CAMERA, old_scene, RenderData::pic, ImageFormatData::planes, ID::properties, Scene::r, Render::r, R_ALPHAPREMUL, R_BORDER, R_EDGE_FRS, R_IMF_IMTYPE_PNG, R_IMF_PLANES_RGBA, R_MULTIVIEW, R_NO_FRAME_UPDATE, R_SINGLE_LAYER, Render::rectx, Render::recty, SCE_LAY_SOLID, RenderData::scemode, Render::scene, RenderData::size, STRNCPY, RenderData::threads, Scene::view_layers, Render::winx, Render::winy, Main::wm, RenderData::xasp, rctf::xmax, rcti::xmin, rctf::xmin, RenderData::xsch, RenderData::yasp, rctf::ymax, rcti::ymin, rctf::ymin, and RenderData::ysch.
|
virtual |
Definition at line 161 of file BlenderStrokeRenderer.cpp.
References _nodetree_hash, BKE_main_free(), BLI_ghash_free(), BLI_listbase_clear(), DEG_graph_free(), FreeStrokeGroups(), freestyle_bmain, freestyle_depsgraph, and Main::wm.
void Freestyle::BlenderStrokeRenderer::FreeStrokeGroups | ( | ) |
Definition at line 528 of file BlenderStrokeRenderer.cpp.
References strokeGroups, and texturedStrokeGroups.
Referenced by ~BlenderStrokeRenderer().
int Freestyle::BlenderStrokeRenderer::GenerateScene | ( | ) |
Definition at line 541 of file BlenderStrokeRenderer.cpp.
References GenerateStrokeMesh(), get_stroke_count(), strokeGroups, and texturedStrokeGroups.
Referenced by Freestyle::Controller::RenderStrokes().
void Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh | ( | StrokeGroup * | group, |
bool | hasTex | ||
) |
Definition at line 561 of file BlenderStrokeRenderer.cpp.
References MLoopCol::a, Freestyle::StrokeVertexRep::alpha(), MLoopCol::b, BKE_mesh_normals_tag_dirty(), BKE_mesh_update_customdata_pointers(), BKE_mesh_validate(), BKE_object_add(), BKE_object_materials_test(), BLI_assert, CD_CALLOC, CD_MEDGE, CD_MLOOP, CD_MLOOPUV, CD_MPOLY, CD_MVERT, CD_PROP_BYTE_COLOR, MVert::co, color, copy_v3fl_v3db(), CustomData_add_layer(), CustomData_add_layer_named(), CustomData_set_layer_active(), Object::data, DEG_relations_tag_update(), MLoop::e, Mesh::edata, ListBase::first, freestyle_bmain, freestyle_scene, MLoopCol::g, get_stroke_vertex_z(), Material::id, id_us_plus(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), L, Mesh::ldata, linearrgb_to_srgb_uchar4(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), MPoly::loopstart, Mesh::mat, MPoly::mat_nr, material, Freestyle::BlenderStrokeRenderer::StrokeGroup::materials, Mesh::medge, MEM_mallocN, mesh, Mesh::mloop, Mesh::mloopcol, Mesh::mloopuv, Mesh::mpoly, Mesh::mvert, NewMesh(), OB_MESH, Mesh::pdata, Freestyle::StrokeVertexRep::point2d(), r, MLoopCol::r, usdtokens::rgba(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), Freestyle::BlenderStrokeRenderer::StrokeGroup::strokes, test_strip_visibility(), test_triangle_visibility(), Freestyle::StrokeVertexRep::texCoord(), Mesh::totcol, Freestyle::BlenderStrokeRenderer::StrokeGroup::totedge, Mesh::totedge, Freestyle::BlenderStrokeRenderer::StrokeGroup::totloop, Mesh::totloop, MPoly::totloop, Freestyle::BlenderStrokeRenderer::StrokeGroup::totpoly, Mesh::totpoly, Freestyle::BlenderStrokeRenderer::StrokeGroup::totvert, Mesh::totvert, MLoopUV::uv, uvNames, v, MLoop::v, MEdge::v1, MEdge::v2, Mesh::vdata, Scene::view_layers, Freestyle::VecMat::Vec2< T >::x(), and Freestyle::VecMat::Vec2< T >::y().
Referenced by GenerateScene().
|
protected |
Definition at line 555 of file BlenderStrokeRenderer.cpp.
References strokeGroups, and texturedStrokeGroups.
Referenced by GenerateScene(), and RenderScene().
|
protected |
Definition at line 188 of file BlenderStrokeRenderer.cpp.
References _mesh_id.
Referenced by NewMesh().
Definition at line 177 of file BlenderStrokeRenderer.cpp.
References _z, _z_delta, and z.
Referenced by GenerateStrokeMesh().
|
static |
Definition at line 196 of file BlenderStrokeRenderer.cpp.
References BKE_material_add(), BKE_ntree_update_main_tree(), Material::blend_method, BLI_findlink(), BLI_findptr(), BLI_strncpy(), color, bNode::custom1, bNode::custom2, ListBase::first, bNodeLink::fromnode, bNodeLink::fromsock, Material::id, id_us_min(), if(), bNode::inputs, bNodeTree::links, bNode::locx, bNode::locy, MA_BM_HASHED, MA_RAMP_BLEND, NodeShaderAttribute::name, bNodeLink::next, node, NODE_DO_OUTPUT, nodeAddLink(), nodeAddStaticNode(), nodeRemSocketLinks(), bNodeTree::nodes, nodeSetActive(), Material::nodetree, ntree, ntreeAddTree(), ntreeCopyTree_ex(), bNode::outputs, RNA_float_get(), RNA_float_get_array(), RNA_float_set(), RNA_float_set_array(), RNA_pointer_create(), SH_NODE_ATTRIBUTE, SH_NODE_BSDF_TRANSPARENT, SH_NODE_EMISSION, SH_NODE_LIGHT_PATH, SH_NODE_MIX_RGB, SH_NODE_MIX_SHADER, SH_NODE_OUTPUT_LINESTYLE, SH_NODE_OUTPUT_MATERIAL, SH_NODE_UVALONGSTROKE, SH_NODE_UVMAP, bNode::storage, bNodeLink::tonode, bNodeLink::tosock, Material::use_nodes, NodeShaderUVMap::uv_map, and uvNames.
Referenced by RenderStrokeRepBasic().
Object * Freestyle::BlenderStrokeRenderer::NewMesh | ( | ) | const |
Definition at line 815 of file BlenderStrokeRenderer.cpp.
References BKE_collection_object_add(), BKE_mesh_add(), BKE_object_add_only_object(), BLI_snprintf(), Object::data, DEG_graph_id_tag_update(), DEG_graph_tag_relations_update(), freestyle_bmain, freestyle_depsgraph, freestyle_scene, get_stroke_mesh_id(), Object::id, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, Scene::master_collection, MAX_ID_NAME, and OB_MESH.
Referenced by GenerateStrokeMesh().
Definition at line 838 of file BlenderStrokeRenderer.cpp.
References _z, _z_delta, Scene::camera, camera, Object::data, DEG_graph_relations_update(), freestyle_bmain, freestyle_depsgraph, freestyle_scene, G, G_DEBUG_FREESTYLE, get_stroke_count(), if(), and RE_NewSceneRender().
Referenced by Freestyle::Controller::RenderStrokes().
Renders a stroke rep
Implements Freestyle::StrokeRenderer.
Definition at line 411 of file BlenderStrokeRenderer.cpp.
References RenderStrokeRepBasic().
Implements Freestyle::StrokeRenderer.
Definition at line 416 of file BlenderStrokeRenderer.cpp.
References _nodetree_hash, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BLI_ghash_insert(), BLI_ghash_lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), freestyle_bmain, Freestyle::StrokeRep::getNodeTree(), Freestyle::StrokeRep::getStrips(), GetStrokeShader(), Freestyle::StrokeRep::hasTex(), Freestyle::BlenderStrokeRenderer::StrokeGroup::materials, MAXMAT, MESH_MAX_VERTS, Freestyle::StrokeRep::setMaterial(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), Freestyle::BlenderStrokeRenderer::StrokeGroup::strokes, test_strip_visibility(), texturedStrokeGroups, Freestyle::BlenderStrokeRenderer::StrokeGroup::totedge, Freestyle::BlenderStrokeRenderer::StrokeGroup::totloop, Freestyle::BlenderStrokeRenderer::StrokeGroup::totpoly, and Freestyle::BlenderStrokeRenderer::StrokeGroup::totvert.
Referenced by RenderStrokeRep().
|
protected |
Definition at line 493 of file BlenderStrokeRenderer.cpp.
References test_triangle_visibility(), and v.
Referenced by GenerateStrokeMesh(), and RenderStrokeRepBasic().
|
protected |
Definition at line 468 of file BlenderStrokeRenderer.cpp.
References _height, _width, and Freestyle::StrokeVertexRep::point2d().
Referenced by GenerateStrokeMesh(), and test_strip_visibility().
|
protected |
Definition at line 65 of file BlenderStrokeRenderer.h.
|
protected |
Definition at line 66 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), and test_triangle_visibility().
|
protected |
Definition at line 68 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), and get_stroke_mesh_id().
|
protected |
Definition at line 70 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), RenderStrokeRepBasic(), and ~BlenderStrokeRenderer().
Definition at line 82 of file BlenderStrokeRenderer.h.
|
protected |
Definition at line 69 of file BlenderStrokeRenderer.h.
|
protected |
Definition at line 66 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), and test_triangle_visibility().
|
protected |
Definition at line 67 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), get_stroke_vertex_z(), and RenderScene().
|
protected |
Definition at line 67 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), get_stroke_vertex_z(), and RenderScene().
|
protected |
Definition at line 61 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), GenerateStrokeMesh(), NewMesh(), RenderScene(), RenderStrokeRepBasic(), and ~BlenderStrokeRenderer().
|
protected |
Definition at line 64 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), NewMesh(), RenderScene(), and ~BlenderStrokeRenderer().
|
protected |
Definition at line 63 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer(), GenerateStrokeMesh(), NewMesh(), and RenderScene().
|
protected |
Definition at line 62 of file BlenderStrokeRenderer.h.
Referenced by BlenderStrokeRenderer().
vector<StrokeGroup *> Freestyle::BlenderStrokeRenderer::strokeGroups |
Definition at line 50 of file BlenderStrokeRenderer.h.
Referenced by FreeStrokeGroups(), GenerateScene(), and get_stroke_count().
vector<StrokeGroup *> Freestyle::BlenderStrokeRenderer::texturedStrokeGroups |
Definition at line 50 of file BlenderStrokeRenderer.h.
Referenced by FreeStrokeGroups(), GenerateScene(), get_stroke_count(), and RenderStrokeRepBasic().
|
staticprotected |
Definition at line 72 of file BlenderStrokeRenderer.h.
Referenced by GenerateStrokeMesh(), and GetStrokeShader().