Blender V5.3
Mesh Class Reference

#include <mesh.h>

Inherits Geometry.

Inherited by Volume.

Classes

struct  Triangle
struct  SubdFace
struct  SubdEdgeCrease

Public Types

enum  SubdivisionType { SUBDIVISION_NONE , SUBDIVISION_LINEAR , SUBDIVISION_CATMULL_CLARK }
enum  SubdivisionBoundaryInterpolation { SUBDIVISION_BOUNDARY_NONE , SUBDIVISION_BOUNDARY_EDGE_ONLY , SUBDIVISION_BOUNDARY_EDGE_AND_CORNER }
enum  SubdivisionFVarInterpolation {
  SUBDIVISION_FVAR_LINEAR_NONE , SUBDIVISION_FVAR_LINEAR_CORNERS_ONLY , SUBDIVISION_FVAR_LINEAR_CORNERS_PLUS1 , SUBDIVISION_FVAR_LINEAR_CORNERS_PLUS2 ,
  SUBDIVISION_FVAR_LINEAR_BOUNDARIES , SUBDIVISION_FVAR_LINEAR_ALL
}
enum  SubdivisionAdaptiveSpace { SUBDIVISION_ADAPTIVE_SPACE_PIXEL , SUBDIVISION_ADAPTIVE_SPACE_OBJECT }
Public Types inherited from Geometry
enum  Type {
  MESH , HAIR , VOLUME , POINTCLOUD ,
  AREA_LIGHT , BACKGROUND_LIGHT , POINT_LIGHT , SPOT_LIGHT ,
  SUN_LIGHT
}

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 &params)
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

Detailed Description

Definition at line 39 of file scene/mesh.h.

Member Enumeration Documentation

◆ SubdivisionAdaptiveSpace

Enumerator
SUBDIVISION_ADAPTIVE_SPACE_PIXEL 
SUBDIVISION_ADAPTIVE_SPACE_OBJECT 

Definition at line 134 of file scene/mesh.h.

◆ SubdivisionBoundaryInterpolation

Enumerator
SUBDIVISION_BOUNDARY_NONE 
SUBDIVISION_BOUNDARY_EDGE_ONLY 
SUBDIVISION_BOUNDARY_EDGE_AND_CORNER 

Definition at line 119 of file scene/mesh.h.

◆ SubdivisionFVarInterpolation

Enumerator
SUBDIVISION_FVAR_LINEAR_NONE 
SUBDIVISION_FVAR_LINEAR_CORNERS_ONLY 
SUBDIVISION_FVAR_LINEAR_CORNERS_PLUS1 
SUBDIVISION_FVAR_LINEAR_CORNERS_PLUS2 
SUBDIVISION_FVAR_LINEAR_BOUNDARIES 
SUBDIVISION_FVAR_LINEAR_ALL 

Definition at line 125 of file scene/mesh.h.

◆ SubdivisionType

Enumerator
SUBDIVISION_NONE 
SUBDIVISION_LINEAR 
SUBDIVISION_CATMULL_CLARK 

Definition at line 113 of file scene/mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

Mesh::Mesh ( const NodeType * node_type_,
Type geom_type_ )
protected

◆ Mesh() [2/2]

Mesh::Mesh ( )

Definition at line 348 of file scene/mesh.cpp.

References Geometry::Geometry(), Geometry::MESH, and Mesh().

Member Function Documentation

◆ add_builtin_attributes()

void Mesh::add_builtin_attributes ( )
protected

Definition at line 350 of file scene/mesh.cpp.

References AttributeSet::add(), ATTR_STD_POSITION, and Geometry::attributes.

Referenced by clear(), and Mesh().

◆ add_edge_crease()

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.

◆ add_undisplaced()

◆ add_vertex_crease()

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.

◆ add_vertex_normals()

◆ apply_transform()

◆ clear() [1/2]

void Mesh::clear ( bool preserve_shaders,
bool preserve_voxel_data )
protected

◆ clear() [2/2]

void Mesh::clear ( bool preserve_shaders = false)
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.

◆ clear_non_sockets()

void Mesh::clear_non_sockets ( )

Definition at line 385 of file scene/mesh.cpp.

References Geometry::clear().

Referenced by clear(), and ObjectManager.

◆ compute_bounds()

◆ copy_center_to_motion_step()

◆ get_num_subd_base_verts()

size_t Mesh::get_num_subd_base_verts ( ) const
inline

Definition at line 229 of file scene/mesh.h.

References num_verts().

Referenced by EdgeDice::EdgeDice(), and Attribute::element_size().

◆ get_num_subd_faces()

size_t Mesh::get_num_subd_faces ( ) const
inline

◆ get_subd_crease()

SubdEdgeCrease Mesh::get_subd_crease ( const size_t i) const
inline

Definition at line 102 of file scene/mesh.h.

References Mesh::SubdEdgeCrease::crease, and Mesh::SubdEdgeCrease::v.

◆ get_subd_face()

◆ get_triangle()

◆ get_uv_tiles()

void Mesh::get_uv_tiles ( ustring map,
unordered_set< int > & tiles )
overridevirtual

◆ has_motion_blur()

◆ need_tessellation()

bool Mesh::need_tessellation ( )

◆ num_triangles()

◆ num_verts()

◆ pack_shaders()

void Mesh::pack_shaders ( Scene * scene,
uint * shader )

◆ pack_triangles()

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.

◆ primitive_type()

PrimitiveType Mesh::primitive_type ( ) const
overridevirtual

◆ reserve_subd_creases()

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.

◆ resize_mesh()

void Mesh::resize_mesh ( const int numverts,
const int numtris )

◆ resize_subd_faces()

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().

◆ set_num_subd_faces()

void Mesh::set_num_subd_faces ( const size_t num_subd_faces_)
inline

Definition at line 225 of file scene/mesh.h.

◆ tessellate()

◆ update_generated()

◆ update_tangents()

◆ BVH2

friend class BVH2
friend

Definition at line 179 of file scene/mesh.h.

References BVH2.

Referenced by BVH2.

◆ BVHBuild

friend class BVHBuild
friend

Definition at line 180 of file scene/mesh.h.

References BVHBuild.

Referenced by BVHBuild.

◆ BVHSpatialSplit

friend class BVHSpatialSplit
friend

Definition at line 181 of file scene/mesh.h.

References BVHSpatialSplit.

Referenced by BVHSpatialSplit.

◆ DiagSplit

friend class DiagSplit
friend

Definition at line 182 of file scene/mesh.h.

References DiagSplit.

Referenced by DiagSplit, and tessellate().

◆ EdgeDice

friend class EdgeDice
friend

Definition at line 183 of file scene/mesh.h.

References EdgeDice.

Referenced by EdgeDice, and tessellate().

◆ GeometryManager

friend class GeometryManager
friend

Definition at line 184 of file scene/mesh.h.

References GeometryManager.

Referenced by GeometryManager.

◆ ObjectManager

Member Data Documentation

◆ corner_offset

size_t Mesh::corner_offset

Definition at line 173 of file scene/mesh.h.

Referenced by GeometryManager::geom_calc_offset(), and Mesh().

◆ face_offset

size_t Mesh::face_offset

Definition at line 172 of file scene/mesh.h.

Referenced by GeometryManager::geom_calc_offset(), and Mesh().

◆ subd_attributes


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