|
Blender V5.3
|
#include <mesh.h>
Inherits Geometry.
Inherited by Volume.
Classes | |
| struct | Triangle |
| struct | SubdFace |
| struct | SubdEdgeCrease |
Public Member Functions | |
| NODE_DECLARE size_t | num_verts () const |
| Triangle | get_triangle (const size_t i) const |
| size_t | num_triangles () const |
| SubdEdgeCrease | get_subd_crease (const size_t i) const |
| bool | need_tessellation () |
| Mesh () | |
| void | resize_mesh (const int numverts, const int numtris) |
| void | resize_subd_faces (const int numfaces, const int numcorners) |
| void | reserve_subd_creases (const size_t num_creases) |
| void | clear_non_sockets () |
| void | clear (bool preserve_shaders=false) override |
| void | add_edge_crease (const int v0, const int v1, const float weight) |
| void | add_vertex_crease (const int v, const float weight) |
| void | copy_center_to_motion_step (const int motion_step) |
| void | compute_bounds () override |
| void | apply_transform (const Transform &tfm, const bool apply_to_motion) override |
| void | add_vertex_normals () |
| void | add_undisplaced (Scene *scene) |
| void | update_generated (Scene *scene) |
| void | update_tangents (Scene *scene, bool undisplaced) |
| void | get_uv_tiles (ustring map, unordered_set< int > &tiles) override |
| void | pack_shaders (Scene *scene, uint *shader) |
| void | pack_triangles (packed_uint3 *tri_vindex) |
| bool | has_motion_blur () const override |
| PrimitiveType | primitive_type () const override |
| void | tessellate (SubdParams ¶ms) |
| SubdFace | get_subd_face (const size_t index) const |
| size_t | get_num_subd_faces () const |
| void | set_num_subd_faces (const size_t num_subd_faces_) |
| size_t | get_num_subd_base_verts () const |
| Public Member Functions inherited from Geometry | |
| const packed_float3 * | get_position () const |
| packed_float3 * | get_position_for_write () |
| void | tag_position_modified () |
| bool | position_is_modified () const |
| const float * | get_radius () const |
| float * | get_radius_for_write () |
| void | tag_radius_modified () |
| bool | radius_is_modified () const |
| Geometry (const NodeType *node_type, const Type type) | |
| ~Geometry () override | |
| bool | need_attribute (const Scene *scene, AttributeStandard std) |
| bool | need_attribute (Scene *scene, ustring name) |
| AttributeRequestSet | needed_attributes () |
| float | motion_time (const int step) const |
| int | motion_step (const float time) const |
| void | compute_bvh (Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, const size_t n, size_t total) |
| bool | need_build_bvh (BVHLayout layout) const |
| bool | is_instanced () const |
| bool | has_true_displacement () const |
| bool | has_voxel_attributes () const |
| bool | is_mesh () const |
| bool | is_hair () const |
| bool | is_pointcloud () const |
| bool | is_volume () const |
| bool | is_light () const |
| void | tag_update (Scene *scene, bool rebuild) |
| Public Member Functions inherited from Node | |
| Node (const NodeType *type, ustring name=ustring()) | |
| virtual | ~Node ()=0 |
| void | set (const SocketType &input, bool value) |
| void | set (const SocketType &input, const int value) |
| void | set (const SocketType &input, const uint value) |
| void | set (const SocketType &input, const uint64_t value) |
| void | set (const SocketType &input, const float value) |
| void | set (const SocketType &input, const float2 value) |
| void | set (const SocketType &input, const float3 value) |
| void | set (const SocketType &input, const char *value) |
| void | set (const SocketType &input, ustring value) |
| void | set (const SocketType &input, const Transform &value) |
| void | set (const SocketType &input, Node *value) |
| template<class ValueType, std::enable_if_t< std::is_enum_v< ValueType >, bool > = true> | |
| void | set (const SocketType &input, const ValueType &value) |
| void | set (const SocketType &input, array< bool > &value) |
| void | set (const SocketType &input, array< int > &value) |
| void | set (const SocketType &input, array< float > &value) |
| void | set (const SocketType &input, array< float2 > &value) |
| void | set (const SocketType &input, array< packed_float3 > &value) |
| void | set (const SocketType &input, array< ustring > &value) |
| void | set (const SocketType &input, array< Transform > &value) |
| void | set (const SocketType &input, array< Node * > &value) |
| bool | get_bool (const SocketType &input) const |
| int | get_int (const SocketType &input) const |
| uint | get_uint (const SocketType &input) const |
| uint64_t | get_uint64 (const SocketType &input) const |
| float | get_float (const SocketType &input) const |
| float2 | get_float2 (const SocketType &input) const |
| float3 | get_float3 (const SocketType &input) const |
| ustring | get_string (const SocketType &input) const |
| Transform | get_transform (const SocketType &input) const |
| Node * | get_node (const SocketType &input) const |
| const array< bool > & | get_bool_array (const SocketType &input) const |
| const array< int > & | get_int_array (const SocketType &input) const |
| const array< float > & | get_float_array (const SocketType &input) const |
| const array< float2 > & | get_float2_array (const SocketType &input) const |
| const array< packed_float3 > & | get_float3_array (const SocketType &input) const |
| const array< ustring > & | get_string_array (const SocketType &input) const |
| const array< Transform > & | get_transform_array (const SocketType &input) const |
| const array< Node * > & | get_node_array (const SocketType &input) const |
| bool | has_default_value (const SocketType &input) const |
| void | set_default_value (const SocketType &input) |
| bool | equals_value (const Node &other, const SocketType &socket) const |
| void | copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| void | set_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| bool | equals (const Node &other) const |
| void | hash (MD5Hash &md5) |
| size_t | get_total_size_in_bytes () const |
| bool | is_a (const NodeType *type) |
| bool | socket_is_modified (const SocketType &input) const |
| bool | is_modified () const |
| void | tag_modified () |
| void | clear_modified () |
| void | print_modified_sockets () const |
| const NodeOwner * | get_owner () const |
| void | set_owner (const NodeOwner *owner_) |
| int | reference_count () const |
| void | reference () |
| void | dereference () |
| void | clear_reference_count () |
Public Attributes | |
| AttributeSet | subd_attributes |
| size_t | face_offset |
| size_t | corner_offset |
| Public Attributes inherited from Geometry | |
| Type | geometry_type |
| AttributeSet | attributes |
| BoundBox | bounds |
| bool | transform_applied |
| bool | transform_negative_scaled |
| Transform | transform_normal |
| unique_ptr< BVH > | bvh |
| size_t | attr_map_offset |
| size_t | prim_offset |
| bool | has_volume |
| bool | has_surface_bssrdf |
| bool | need_update_rebuild |
| bool | need_update_bvh_for_offset |
| size_t | index |
| Public Attributes inherited from Node | |
| ustring | name |
| const NodeType * | type |
| InternalNode | internal |
| LeafNode | leaf |
Protected Member Functions | |
| Mesh (const NodeType *node_type_, Type geom_type_) | |
| void | clear (bool preserve_shaders, bool preserve_voxel_data) |
| void | add_builtin_attributes () |
| Protected Member Functions inherited from Node | |
| template<typename T> | |
| void | set_if_different (const SocketType &input, T value) |
| void | set_if_different (const SocketType &input, Node *value) |
| template<typename T> | |
| void | set_if_different (const SocketType &input, array< T > &value) |
| void | set_if_different (const SocketType &input, array< Node * > &value) |
| void | dereference_all_used_nodes () |
Friends | |
| class | BVH2 |
| class | BVHBuild |
| class | BVHSpatialSplit |
| class | DiagSplit |
| class | EdgeDice |
| class | GeometryManager |
| class | ObjectManager |
Additional Inherited Members | |
| Static Public Attributes inherited from Geometry | |
| static const uint | MAX_MOTION_STEPS = 129 |
| Static Protected Member Functions inherited from Node | |
| template<typename T> | |
| static T & | get_socket_value (const Node *node, const SocketType &socket) |
| Protected Attributes inherited from Node | |
| const NodeOwner * | owner |
| int | ref_count {0} |
| SocketModifiedFlags | socket_modified |
Definition at line 39 of file scene/mesh.h.
| Enumerator | |
|---|---|
| SUBDIVISION_ADAPTIVE_SPACE_PIXEL | |
| SUBDIVISION_ADAPTIVE_SPACE_OBJECT | |
Definition at line 134 of file scene/mesh.h.
| Enumerator | |
|---|---|
| SUBDIVISION_BOUNDARY_NONE | |
| SUBDIVISION_BOUNDARY_EDGE_ONLY | |
| SUBDIVISION_BOUNDARY_EDGE_AND_CORNER | |
Definition at line 119 of file scene/mesh.h.
Definition at line 125 of file scene/mesh.h.
| Enumerator | |
|---|---|
| SUBDIVISION_NONE | |
| SUBDIVISION_LINEAR | |
| SUBDIVISION_CATMULL_CLARK | |
Definition at line 113 of file scene/mesh.h.
Definition at line 334 of file scene/mesh.cpp.
References add_builtin_attributes(), ATTR_PRIM_SUBD, corner_offset, face_offset, Geometry::Geometry(), subd_attributes, and SUBDIVISION_NONE.
Referenced by Mesh(), Mesh::SubdFace::normal(), ObjectManager, and Volume::Volume().
| Mesh::Mesh | ( | ) |
Definition at line 348 of file scene/mesh.cpp.
References Geometry::Geometry(), Geometry::MESH, and Mesh().
|
protected |
Definition at line 350 of file scene/mesh.cpp.
References AttributeSet::add(), ATTR_STD_POSITION, and Geometry::attributes.
| void Mesh::add_edge_crease | ( | const int | v0, |
| const int | v1, | ||
| const float | weight ) |
Definition at line 437 of file scene/mesh.cpp.
Referenced by create_subd_mesh(), and ObjectManager.
| void Mesh::add_undisplaced | ( | Scene * | scene | ) |
Definition at line 762 of file scene/mesh.cpp.
References AttributeSet::add(), ATTR_PRIM_GEOMETRY, ATTR_STD_CORNER_NORMAL, ATTR_STD_NORMAL_UNDISPLACED, ATTR_STD_POSITION_UNDISPLACED, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, Attribute::buffer_size(), Attribute::data(), Attribute::data_for_write(), Attribute::element, AttributeSet::find(), Geometry::get_position(), Geometry::need_attribute(), Attribute::standard_name(), and Attribute::std.
Referenced by GeometryManager::displace(), and ObjectManager.
| void Mesh::add_vertex_crease | ( | const int | v, |
| const float | weight ) |
Definition at line 448 of file scene/mesh.cpp.
Referenced by create_subd_mesh(), and ObjectManager.
| void Mesh::add_vertex_normals | ( | ) |
Definition at line 641 of file scene/mesh.cpp.
References AttributeSet::add(), Attribute::add_motion(), ATTR_STD_CORNER_NORMAL, ATTR_STD_POSITION, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, Mesh::Triangle::compute_normal(), Attribute::data(), Attribute::data_for_write(), AttributeSet::find(), get_num_subd_faces(), Geometry::get_position(), get_subd_face(), get_triangle(), Attribute::has_motion(), has_motion_blur(), Mesh::SubdFace::normal(), normalize, Mesh::SubdFace::num_corners, Attribute::num_motion_steps(), num_triangles(), num_verts(), packed_normal::packed_normal(), AttributeSet::remove(), Mesh::SubdFace::start_corner, subd_attributes, Geometry::transform_negative_scaled, Mesh::Triangle::v, and zero_float3().
Referenced by GeometryManager::device_update(), and ObjectManager.
|
overridevirtual |
Implements Geometry.
Definition at line 552 of file scene/mesh.cpp.
References ATTR_PRIM_GEOMETRY, ATTR_STD_CORNER_NORMAL, ATTR_STD_NORMAL_UNDISPLACED, ATTR_STD_POSITION, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, Attribute::buffer_size(), Attribute::data_for_write(), AttributeSet::find(), Geometry::get_position_for_write(), Attribute::has_motion(), Attribute::motion, normalize, num_verts(), packed_normal::packed_normal(), step, Geometry::tag_position_modified(), transform_direction(), Geometry::transform_normal, transform_point(), and transform_transposed_inverse().
Referenced by ObjectManager.
|
protected |
Definition at line 393 of file scene/mesh.cpp.
References add_builtin_attributes(), Geometry::attributes, AttributeSet::clear(), Geometry::clear(), clear_non_sockets(), smooth, subd_attributes, and SUBDIVISION_NONE.
|
overridevirtual |
Reimplemented from Geometry.
Reimplemented in Volume.
Definition at line 421 of file scene/mesh.cpp.
References clear().
Referenced by clear(), Volume::clear(), and ObjectManager.
| void Mesh::clear_non_sockets | ( | ) |
Definition at line 385 of file scene/mesh.cpp.
References Geometry::clear().
Referenced by clear(), and ObjectManager.
|
overridevirtual |
Implements Geometry.
Definition at line 504 of file scene/mesh.cpp.
References ATTR_STD_POSITION, Geometry::attributes, Geometry::bounds, Attribute::data(), BoundBox::empty, AttributeSet::find(), Geometry::get_position(), BoundBox::grow(), BoundBox::grow_safe(), Attribute::has_motion(), Attribute::num_motion_steps(), num_verts(), BoundBox::valid(), and zero_float3().
Referenced by ObjectManager.
| void Mesh::copy_center_to_motion_step | ( | const int | motion_step | ) |
Definition at line 457 of file scene/mesh.cpp.
References ATTR_STD_CORNER_NORMAL, ATTR_STD_POSITION, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, Attribute::data(), Attribute::data_for_write(), AttributeSet::find(), Attribute::has_motion(), Geometry::motion_step(), N, P, Attribute::size, and subd_attributes.
Referenced by ObjectManager.
|
inline |
Definition at line 229 of file scene/mesh.h.
References num_verts().
Referenced by EdgeDice::EdgeDice(), and Attribute::element_size().
|
inline |
Definition at line 221 of file scene/mesh.h.
References get_num_subd_faces().
Referenced by add_vertex_normals(), Attribute::element_size(), GeometryManager::geom_calc_offset(), get_num_subd_faces(), SubdAttributeInterpolation::setup(), and tessellate().
|
inline |
Definition at line 102 of file scene/mesh.h.
References Mesh::SubdEdgeCrease::crease, and Mesh::SubdEdgeCrease::v.
| Mesh::SubdFace Mesh::get_subd_face | ( | const size_t | index | ) | const |
Definition at line 426 of file scene/mesh.cpp.
References Geometry::index, Mesh::SubdFace::num_corners, Mesh::SubdFace::ptex_offset, Mesh::SubdFace::shader, Mesh::SubdFace::smooth, and Mesh::SubdFace::start_corner.
Referenced by add_vertex_normals(), ObjectManager, SubdAttributeInterpolation::setup_attribute_corner_linear(), SubdAttributeInterpolation::setup_attribute_vertex_linear(), and tessellate().
|
inline |
Definition at line 67 of file scene/mesh.h.
Referenced by BVHBuild::add_reference_triangles(), add_vertex_normals(), apply_corner_normal_delta(), compute_vertex_normals(), LightManager::device_update_distribution(), fill_shader_input(), MikkMeshWrapper::GetNormal(), LightTreeEmitter::LightTreeEmitter(), read_shader_output(), BVH2::refit_primitives(), BVHSpatialSplit::split_triangle_primitive(), and store_vertex_normals().
|
overridevirtual |
Implements Geometry.
Definition at line 482 of file scene/mesh.cpp.
References ATTR_PRIM_GEOMETRY, ATTR_PRIM_SUBD, ATTR_STD_UV, Geometry::attributes, AttributeSet::find(), Attribute::get_uv_tiles(), subd_attributes, and tiles.
Referenced by ObjectManager.
|
overridevirtual |
Reimplemented from Geometry.
Definition at line 916 of file scene/mesh.cpp.
References ATTR_STD_POSITION, Geometry::attributes, AttributeSet::find(), Attribute::has_motion(), subd_attributes, and SUBDIVISION_NONE.
Referenced by BVHBuild::add_reference_triangles(), add_vertex_normals(), ObjectManager, primitive_type(), recompute_displaced_corner_normals(), recompute_displaced_vertex_normals(), and save_pre_displacement_normals().
| bool Mesh::need_tessellation | ( | ) |
Definition at line 326 of file scene/mesh.cpp.
References Geometry::position_is_modified(), and SUBDIVISION_NONE.
Referenced by GeometryManager::device_update(), and GeometryManager::device_update_preprocess().
|
inline |
Definition at line 73 of file scene/mesh.h.
Referenced by BVHBuild::add_reference_triangles(), add_vertex_normals(), apply_corner_normal_delta(), LightTree::build(), compute_vertex_normals(), count_primitives(), LightManager::device_update_distribution(), GeometryManager::device_update_mesh(), GeometryManager::displace(), Attribute::element_size(), fill_shader_input(), GeometryManager::geom_calc_offset(), MikkMeshWrapper::GetNumFaces(), pack_shaders(), pack_triangles(), read_shader_output(), save_pre_displacement_normals(), BVHSpatialSplit::split_object_reference(), store_vertex_normals(), update_generated(), and update_tangents().
| size_t Mesh::num_verts | ( | ) | const |
Definition at line 252 of file scene/mesh.cpp.
References ATTR_STD_POSITION, Geometry::attributes, AttributeSet::find(), and Attribute::size.
Referenced by add_vertex_normals(), apply_transform(), attr_create_motion_from_velocity(), attr_create_pointiness(), compute_bounds(), GeometryManager::displace(), Attribute::element_size(), fill_shader_input(), get_num_subd_base_verts(), read_shader_output(), recompute_displaced_corner_normals(), recompute_displaced_vertex_normals(), save_pre_displacement_normals(), store_vertex_normals(), and xml_read_mesh().
| void Mesh::pack_shaders | ( | Scene * | scene, |
| uint * | shader ) |
Definition at line 873 of file scene/mesh.cpp.
References ATTR_STD_CORNER_NORMAL, Geometry::attributes, Scene::default_surface, AttributeSet::find(), INT_MAX, num_triangles(), Scene::shader_manager, and smooth.
Referenced by GeometryManager::device_update_mesh(), and ObjectManager.
| void Mesh::pack_triangles | ( | packed_uint3 * | tri_vindex | ) |
Definition at line 905 of file scene/mesh.cpp.
References make_packed_uint3(), and num_triangles().
Referenced by GeometryManager::device_update_mesh(), and ObjectManager.
|
overridevirtual |
Implements Geometry.
Definition at line 925 of file scene/mesh.cpp.
References has_motion_blur(), PRIMITIVE_MOTION_TRIANGLE, and PRIMITIVE_TRIANGLE.
Referenced by BVHBuild::add_reference_triangles(), and ObjectManager.
| void Mesh::reserve_subd_creases | ( | const size_t | num_creases | ) |
Definition at line 379 of file scene/mesh.cpp.
Referenced by create_subd_mesh(), and ObjectManager.
| void Mesh::resize_mesh | ( | const int | numverts, |
| const int | numtris ) |
Definition at line 355 of file scene/mesh.cpp.
References AttributeSet::add(), ATTR_STD_POSITION, Geometry::attributes, Attribute::resize(), AttributeSet::resize(), and smooth.
Referenced by create_mesh(), GeometryManager::create_volume_mesh(), EdgeDice::EdgeDice(), ObjectManager, and xml_read_mesh().
| void Mesh::resize_subd_faces | ( | const int | numfaces, |
| const int | numcorners ) |
Definition at line 366 of file scene/mesh.cpp.
References AttributeSet::resize(), and subd_attributes.
Referenced by create_mesh(), ObjectManager, and xml_read_mesh().
|
inline |
Definition at line 225 of file scene/mesh.h.
| CCL_NAMESPACE_BEGIN void Mesh::tessellate | ( | SubdParams & | params | ) |
Definition at line 18 of file mesh_subdivision.cpp.
References ATTR_STD_POSITION, Attribute::data(), DiagSplit, EdgeDice::dice(), EdgeDice, AttributeSet::find(), float, Patch::from_ngon, get_num_subd_faces(), get_subd_face(), LinearQuadPatch::hull, Mesh::SubdFace::is_quad(), mod, Mesh::SubdFace::num_corners, Patch::patch_index, Mesh::SubdFace::ptex_offset, Mesh::SubdFace::shader, Patch::shader, Mesh::SubdFace::smooth, Patch::smooth, Mesh::SubdFace::start_corner, subd_attributes, SUBDIVISION_CATMULL_CLARK, SUBDIVISION_LINEAR, and zero_float3().
Referenced by ObjectManager.
| void Mesh::update_generated | ( | Scene * | scene | ) |
Definition at line 796 of file scene/mesh.cpp.
References AttributeSet::add(), ATTR_STD_GENERATED, ATTR_STD_POSITION, Geometry::attributes, Attribute::data(), AttributeSet::find(), Geometry::need_attribute(), num_triangles(), Attribute::size, and subd_attributes.
Referenced by GeometryManager::device_update(), and ObjectManager.
| void Mesh::update_tangents | ( | Scene * | scene, |
| bool | undisplaced ) |
Definition at line 819 of file scene/mesh.cpp.
References assert, ATTR_ELEMENT_CORNER, ATTR_STD_CORNER_NORMAL, ATTR_STD_UV, ATTR_STD_UV_TANGENT, ATTR_STD_UV_TANGENT_SIGN, ATTR_STD_UV_TANGENT_SIGN_UNDISPLACED, ATTR_STD_UV_TANGENT_UNDISPLACED, ATTR_STD_VERTEX_NORMAL, AttributeSet::attributes, Geometry::attributes, Attribute::element, AttributeSet::find(), mikk_compute_tangents(), Attribute::name, Geometry::need_attribute(), num_triangles(), and Attribute::type.
Referenced by GeometryManager::displace(), and ObjectManager.
|
friend |
|
friend |
|
friend |
Definition at line 181 of file scene/mesh.h.
References BVHSpatialSplit.
Referenced by BVHSpatialSplit.
|
friend |
Definition at line 182 of file scene/mesh.h.
References DiagSplit.
Referenced by DiagSplit, and tessellate().
|
friend |
Definition at line 183 of file scene/mesh.h.
References EdgeDice.
Referenced by EdgeDice, and tessellate().
|
friend |
Definition at line 184 of file scene/mesh.h.
References GeometryManager.
Referenced by GeometryManager.
|
friend |
Definition at line 185 of file scene/mesh.h.
References add_edge_crease(), add_undisplaced(), add_vertex_crease(), add_vertex_normals(), apply_transform(), clear(), clear_non_sockets(), compute_bounds(), copy_center_to_motion_step(), get_subd_face(), get_uv_tiles(), has_motion_blur(), Geometry::index, Mesh(), Geometry::motion_step(), ObjectManager, pack_shaders(), pack_triangles(), primitive_type(), reserve_subd_creases(), resize_mesh(), resize_subd_faces(), tessellate(), tiles, update_generated(), and update_tangents().
Referenced by ObjectManager.
| size_t Mesh::corner_offset |
Definition at line 173 of file scene/mesh.h.
Referenced by GeometryManager::geom_calc_offset(), and Mesh().
| size_t Mesh::face_offset |
Definition at line 172 of file scene/mesh.h.
Referenced by GeometryManager::geom_calc_offset(), and Mesh().
| AttributeSet Mesh::subd_attributes |
Definition at line 169 of file scene/mesh.h.
Referenced by add_vertex_normals(), attr_create_generic(), attr_create_motion_from_velocity(), attr_create_pointiness(), attr_create_random_per_island(), attr_create_subd_uv_map(), clear(), copy_center_to_motion_step(), create_mesh(), ObjectManager::device_update_object_transform(), GeometryManager::device_update_preprocess(), get_uv_tiles(), has_motion_blur(), Mesh(), Mesh::SubdFace::normal(), resize_subd_faces(), SubdAttributeInterpolation::setup(), tessellate(), update_generated(), and xml_read_mesh().