Blender V4.3
DNA_mesh_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "DNA_ID.h"
13#include "DNA_defs.h"
15
17#ifdef __cplusplus
18
19# include <optional>
20
23
24namespace blender {
25template<typename T> struct Bounds;
26namespace offset_indices {
27template<typename T> struct GroupedSpan;
28template<typename T> class OffsetIndices;
29} // namespace offset_indices
30using offset_indices::GroupedSpan;
31using offset_indices::OffsetIndices;
32template<typename T> class MutableSpan;
33template<typename T> class Span;
34namespace bke {
35struct MeshRuntime;
36class AttributeAccessor;
37class MutableAttributeAccessor;
38struct LooseVertCache;
39struct LooseEdgeCache;
40enum class MeshNormalDomain : int8_t;
41} // namespace bke
42} // namespace blender
44#else
46#endif
47
48struct AnimData;
49struct Ipo;
50struct Key;
51struct MCol;
52struct MEdge;
53struct MFace;
54struct Material;
55
56typedef struct Mesh {
58
59 ID id;
61 struct AnimData *adt;
62
64 struct Ipo *ipo DNA_DEPRECATED;
65 struct Key *key;
66
72 struct Material **mat;
73
82
90
95
103
111
120
123
134
141
146
151
152 float smoothresh_legacy DNA_DEPRECATED;
153
157
159 /* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
160 * default and Face Sets can be used without affecting the color of the mesh. */
162
167
173
176
178 short totcol;
179
185 char cd_flag DNA_DEPRECATED;
186 char subdiv DNA_DEPRECATED;
187 char subdivr DNA_DEPRECATED;
188 char subsurftype DNA_DEPRECATED;
189
191 struct MPoly *mpoly DNA_DEPRECATED;
193 struct MLoop *mloop DNA_DEPRECATED;
194
196 struct MVert *mvert DNA_DEPRECATED;
198 struct MEdge *medge DNA_DEPRECATED;
202 struct MTFace *mtface DNA_DEPRECATED;
204 struct TFace *tface DNA_DEPRECATED;
206 struct MCol *mcol DNA_DEPRECATED;
208 struct MFace *mface DNA_DEPRECATED;
209
217 /* Deprecated size of #fdata. */
219
220 char _pad1[4];
221
229#ifdef __cplusplus
233 blender::Span<blender::float3> vert_positions() const;
235 blender::MutableSpan<blender::float3> vert_positions_for_write();
242 blender::Span<blender::int2> edges() const;
244 blender::MutableSpan<blender::int2> edges_for_write();
256 blender::Span<int> face_offsets() const;
258 blender::MutableSpan<int> face_offsets_for_write();
259
269 blender::Span<int> corner_verts() const;
271 blender::MutableSpan<int> corner_verts_for_write();
272
278 blender::Span<int> corner_edges() const;
280 blender::MutableSpan<int> corner_edges_for_write();
281
283 blender::bke::MutableAttributeAccessor attributes_for_write();
284
291 blender::MutableSpan<MDeformVert> deform_verts_for_write();
292
296 blender::Span<blender::int3> corner_tris() const;
297
301 blender::Span<int> corner_tri_faces() const;
302
306 std::optional<blender::Bounds<blender::float3>> bounds_min_max() const;
307
309 void bounds_set_eager(const blender::Bounds<blender::float3> &bounds);
310
314 blender::Span<int> corner_to_face_map() const;
318 blender::OffsetIndices<int> vert_to_face_map_offsets() const;
322 blender::GroupedSpan<int> vert_to_corner_map() const;
326 blender::GroupedSpan<int> vert_to_face_map() const;
327
331 const blender::bke::LooseEdgeCache &loose_edges() const;
335 const blender::bke::LooseVertCache &loose_verts() const;
339 const blender::bke::LooseVertCache &verts_no_face() const;
348 bool no_overlapping_topology() const;
349
357 void tag_loose_edges_none() const;
365 void tag_loose_verts_none() const;
367 void tag_overlapping_none();
368
382 blender::bke::MeshNormalDomain normals_domain(const bool support_sharp_face = false) const;
386 blender::Span<blender::float3> face_normals() const;
391 blender::Span<blender::float3> vert_normals() const;
399 blender::Span<blender::float3> corner_normals() const;
400
401 void count_memory(blender::MemoryCounter &memory) const;
402
404 void tag_positions_changed();
406 void tag_positions_changed_uniformly();
408 void tag_positions_changed_no_normals();
410 void tag_sharpness_changed();
412 void tag_custom_normals_changed();
414 void tag_face_winding_changed();
416 void tag_edges_split();
418 void tag_topology_changed();
419#endif
421
422/* deprecated by MTFace, only here for file reading */
423#ifdef DNA_DEPRECATED_ALLOW
424typedef struct TFace {
426
427
428 void *tpage;
429 float uv[4][2];
430 unsigned int col[4];
431 char flag, transp;
432 short mode, tile, unwrap;
433} TFace;
434#endif
435
436/* **************** MESH ********************* */
437
439enum {
442};
443
445enum {
447 ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */
448 ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */
449
453};
454
455/* Helper macro to see if vertex group X mirror is on. */
456#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me) \
457 (((_me)->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && ((_me)->symmetry & ME_SYMMETRY_X))
458
459/* We can't have both flags enabled at once,
460 * flags defined in DNA_scene_types.h */
461#define ME_EDIT_PAINT_SEL_MODE(_me) \
462 (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \
463 ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
464 0)
465
467enum {
468 ME_FLAG_UNUSED_0 = 1 << 0, /* cleared */
469 ME_FLAG_UNUSED_1 = 1 << 1, /* cleared */
470 ME_FLAG_DEPRECATED_2 = 1 << 2, /* deprecated */
471 ME_FLAG_UNUSED_3 = 1 << 3, /* cleared */
472 ME_FLAG_UNUSED_4 = 1 << 4, /* cleared */
473 ME_AUTOSMOOTH_LEGACY = 1 << 5, /* deprecated */
474 ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */
475 ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */
477 ME_DS_EXPAND = 1 << 9,
485 ME_FLAG_UNUSED_8 = 1 << 12, /* deprecated */
488 ME_FLAG_UNUSED_9 = 1 << 15, /* deprecated */
489};
490
491#ifdef DNA_DEPRECATED_ALLOW
493enum {
494 ME_CDFLAG_VERT_BWEIGHT = 1 << 0,
495 ME_CDFLAG_EDGE_BWEIGHT = 1 << 1,
496 ME_CDFLAG_EDGE_CREASE = 1 << 2,
497 ME_CDFLAG_VERT_CREASE = 1 << 3,
498};
499#endif
500
502enum {
505};
506
508enum {
511};
512
519
520#define MESH_MAX_VERTS 2000000000L
ID and Library types, which are fundamental for SDNA.
enum eAnimEdit_AutoSnap DNA_DEPRECATED
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:66
@ ME_REMESH_REPROJECT_ATTRIBUTES
@ ME_FLAG_UNUSED_6
@ ME_REMESH_REPROJECT_VOLUME
@ ME_FLAG_UNUSED_9
@ ME_FLAG_UNUSED_4
@ ME_FLAG_UNUSED_3
@ ME_DS_EXPAND
@ ME_FLAG_UNUSED_7
@ ME_FLAG_UNUSED_8
@ ME_FLAG_UNUSED_1
@ ME_REMESH_FIX_POLES
@ ME_FLAG_DEPRECATED_2
@ ME_AUTOSMOOTH_LEGACY
@ ME_SCULPT_DYNAMIC_TOPOLOGY
@ ME_FLAG_UNUSED_0
@ ME_NO_OVERLAPPING_TOPOLOGY
struct Mesh Mesh
eMeshSymmetryType
@ ME_SYMMETRY_X
@ ME_SYMMETRY_Y
@ ME_SYMMETRY_Z
@ ME_CC_SUBSURF
@ ME_SIMPLE_SUBSURF
@ ME_EDIT_MIRROR_VERTEX_GROUPS
@ ME_EDIT_PAINT_VERT_SEL
@ ME_EDIT_PAINT_FACE_SEL
@ ME_EDIT_MIRROR_Z
@ ME_EDIT_MIRROR_Y
@ ME_EDIT_MIRROR_TOPO
@ ME_TEXSPACE_FLAG_AUTO
@ ME_TEXSPACE_FLAG_AUTO_EVALUATED
@ REMESH_QUAD
@ REMESH_VOXEL
struct MeshRuntimeHandle MeshRuntimeHandle
static void deform_verts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)
BoundBox bounds
AttributeSet attributes
uint col
ccl_global const KernelWorkTile * tile
static char faces[256]
VKBatch * unwrap(Batch *batch)
Definition vk_batch.hh:34
unsigned short uint16_t
Definition stdint.h:79
signed char int8_t
Definition stdint.h:75
Definition DNA_ID.h:413
float texspace_size[3]
float remesh_voxel_adaptivity
struct Mesh * texcomesh
int corners_num
CustomData edge_data
char symmetry
char texspace_flag
int edges_num
MeshRuntimeHandle * runtime
struct AnimData * adt
uint16_t flag
struct Material ** mat
CustomData corner_data
float remesh_voxel_size
CustomData face_data
int act_face
char * default_color_attribute
ListBase vertex_group_names
int * face_offset_indices
char editflag
char _pad1[4]
CustomData vert_data
short totcol
int face_sets_color_seed
int attributes_active_index
int vertex_group_active_index
int face_sets_color_default
struct Key * key
int totselect
CustomData fdata_legacy
char remesh_mode
int totface_legacy
float texspace_location[3]
int faces_num
struct MSelect * mselect
int verts_num
char * active_color_attribute
uint8_t flag
Definition wm_window.cc:138