|
Blender V5.0
|
#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 |
| Object * | NewMesh () const |
| int | GenerateScene () |
| void | GenerateStrokeMesh (StrokeGroup *group, bool hasTex) |
| void | FreeStrokeGroups () |
| Render * | RenderScene (Render *re, bool render) |
| Public Member Functions inherited from Freestyle::StrokeRenderer | |
| virtual | ~StrokeRenderer () |
Static Public Member Functions | |
| static Material * | GetStrokeShader (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 | |
| Main * | freestyle_bmain |
| Scene * | old_scene |
| Scene * | freestyle_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 |
Definition at line 30 of file BlenderStrokeRenderer.h.
| Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer | ( | Render * | re, |
| int | render_count ) |
Definition at line 69 of file BlenderStrokeRenderer.cpp.
References _height, _mesh_id, _nodetree_hash, _width, _z, _z_delta, 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(), CAM_ORTHO, Camera::clip_end, Camera::clip_start, DAG_EVAL_RENDER, Object::data, DEG_graph_id_tag_update(), DEG_graph_new(), DEG_graph_tag_relations_update(), Render::disprect, freestyle_bmain, freestyle_depsgraph, freestyle_scene, G, G_DEBUG_FREESTYLE, Object::id, Scene::id, IDP_CopyProperty_ex(), ViewLayer::layflag, Object::loc, Render::main, max, MAX_ID_NAME, ID::name, name, OB_CAMERA, old_scene, Camera::ortho_scale, printf, 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, SNPRINTF, STRNCPY(), Camera::type, Render::winx, Render::winy, Main::wm, rcti::xmin, and rcti::ymin.
Referenced by get_stroke_mesh_id(), get_stroke_vertex_z(), and RenderStrokeRepBasic().
|
virtual |
Definition at line 171 of file BlenderStrokeRenderer.cpp.
References _nodetree_hash, BKE_main_free(), BLI_ghash_free(), BLI_listbase_clear(), DEG_graph_free(), FreeStrokeGroups(), freestyle_bmain, and freestyle_depsgraph.
| void Freestyle::BlenderStrokeRenderer::FreeStrokeGroups | ( | ) |
Definition at line 551 of file BlenderStrokeRenderer.cpp.
References strokeGroups, and texturedStrokeGroups.
Referenced by ~BlenderStrokeRenderer().
| int Freestyle::BlenderStrokeRenderer::GenerateScene | ( | ) |
Definition at line 564 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 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().
|
protected |
Definition at line 578 of file BlenderStrokeRenderer.cpp.
References strokeGroups, and texturedStrokeGroups.
Referenced by GenerateScene(), and RenderScene().
|
protected |
Definition at line 198 of file BlenderStrokeRenderer.cpp.
References _mesh_id, BlenderStrokeRenderer(), and self.
Referenced by NewMesh().
|
protected |
Definition at line 187 of file BlenderStrokeRenderer.cpp.
References _z, _z_delta, BlenderStrokeRenderer(), self, and z().
Referenced by GenerateStrokeMesh().
|
static |
Definition at line 206 of file BlenderStrokeRenderer.cpp.
References BKE_material_add(), BKE_ntree_update_after_single_tree_change(), Material::blend_method, BLI_findlink(), BLI_findptr(), bNode::custom1, bNode::custom2, bNodeLink::fromnode, bNodeLink::fromsock, Material::id, id_us_min(), bNode::inputs, bNodeTree::links, LISTBASE_FOREACH, bNode::location, MA_BM_HASHED, MA_RAMP_BLEND, NodeShaderAttribute::name, blender::bke::node_add_link(), blender::bke::node_add_static_node(), NODE_DO_OUTPUT, blender::bke::node_remove_socket_links(), blender::bke::node_set_active(), blender::bke::node_tree_add_tree_embedded(), blender::bke::node_tree_copy_tree_ex(), bNodeTree::nodes, Material::nodetree, offsetof, bNode::outputs, RNA_float_get(), RNA_float_get_array(), RNA_float_set(), RNA_float_set_array(), RNA_pointer_create_discrete(), SH_NODE_ATTRIBUTE, SH_NODE_BSDF_TRANSPARENT, SH_NODE_EMISSION, SH_NODE_LIGHT_PATH, SH_NODE_MIX_RGB_LEGACY, SH_NODE_MIX_SHADER, SH_NODE_OUTPUT_LINESTYLE, SH_NODE_OUTPUT_MATERIAL, SH_NODE_UVALONGSTROKE, SH_NODE_UVMAP, bNode::storage, STRNCPY(), bNodeLink::tonode, bNodeLink::tosock, NodeShaderUVMap::uv_map, and uvNames.
Referenced by FRS_create_stroke_material(), and RenderStrokeRepBasic().
| Object * Freestyle::BlenderStrokeRenderer::NewMesh | ( | ) | const |
Definition at line 842 of file BlenderStrokeRenderer.cpp.
References BKE_collection_object_add(), BKE_mesh_add(), BKE_object_add_only_object(), 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, MAX_ID_NAME, name, OB_MESH, and SNPRINTF.
Referenced by GenerateStrokeMesh().
Definition at line 865 of file BlenderStrokeRenderer.cpp.
References _z, _z_delta, Camera::clip_end, Camera::clip_start, DEG_graph_relations_update(), freestyle_bmain, freestyle_depsgraph, freestyle_scene, G, G_DEBUG_FREESTYLE, get_stroke_count(), and RE_NewSceneRender().
Referenced by Freestyle::Controller::RenderStrokes().
|
virtual |
Renders a stroke rep
Implements Freestyle::StrokeRenderer.
Definition at line 433 of file BlenderStrokeRenderer.cpp.
References RenderStrokeRepBasic().
|
virtual |
Implements Freestyle::StrokeRenderer.
Definition at line 438 of file BlenderStrokeRenderer.cpp.
References _nodetree_hash, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BlenderStrokeRenderer(), BLI_ghash_insert(), BLI_ghash_lookup(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), Freestyle::BlenderStrokeRenderer::StrokeGroup::faces_num, freestyle_bmain, Freestyle::StrokeRep::getNodeTree(), Freestyle::StrokeRep::getStrips(), GetStrokeShader(), Freestyle::StrokeRep::hasTex(), Freestyle::BlenderStrokeRenderer::StrokeGroup::materials, MAXMAT, MESH_MAX_VERTS, self, Freestyle::StrokeRep::setMaterial(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), Freestyle::BlenderStrokeRenderer::StrokeGroup::strokes, test_strip_visibility(), Freestyle::BlenderStrokeRenderer::StrokeGroup::totedge, Freestyle::BlenderStrokeRenderer::StrokeGroup::totloop, and Freestyle::BlenderStrokeRenderer::StrokeGroup::totvert.
Referenced by RenderStrokeRep().
|
protected |
Definition at line 516 of file BlenderStrokeRenderer.cpp.
References test_triangle_visibility(), and v.
Referenced by GenerateStrokeMesh(), and RenderStrokeRepBasic().
|
protected |
Definition at line 491 of file BlenderStrokeRenderer.cpp.
References _height, _width, i, 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(), and get_stroke_count().
|
staticprotected |
Definition at line 72 of file BlenderStrokeRenderer.h.
Referenced by GenerateStrokeMesh(), and GetStrokeShader().