126 if (mesh.
runtime->edit_mesh !=
nullptr) {
128 return *editmesh_eval_final;
214 MeshBufferCache &cache);
245 return uint2(corner, corner_next);
255 for (const int i : range) {
256 const int2 edge = edges[loose_edges[i]];
257 gpu_data[i * 2 + 0] = vert_data[edge[0]];
258 gpu_data[i * 2 + 1] = vert_data[edge[1]];
263gpu::VertBufPtr extract_positions(
const MeshRenderData &mr);
264gpu::VertBufPtr extract_positions_subdiv(
const DRWSubdivCache &subdiv_cache,
265 const MeshRenderData &mr,
266 gpu::VertBufPtr *orco_vbo);
268gpu::VertBufPtr extract_face_dots_position(
const MeshRenderData &mr);
269void extract_face_dots_subdiv(
const DRWSubdivCache &subdiv_cache,
270 gpu::VertBufPtr &fdots_pos,
271 gpu::VertBufPtr *fdots_nor,
272 gpu::IndexBufPtr &fdots);
274gpu::VertBufPtr extract_normals(
const MeshRenderData &mr,
bool use_hq);
275gpu::VertBufPtr extract_normals_subdiv(
const MeshRenderData &mr,
276 const DRWSubdivCache &subdiv_cache,
278gpu::VertBufPtr extract_vert_normals(
const MeshRenderData &mr);
279gpu::VertBufPtr extract_face_dot_normals(
const MeshRenderData &mr,
bool use_hq);
280gpu::VertBufPtr extract_edge_factor(
const MeshRenderData &mr);
281gpu::VertBufPtr extract_edge_factor_subdiv(
const DRWSubdivCache &subdiv_cache,
282 const MeshRenderData &mr,
285gpu::IndexBufPtr extract_tris(
const MeshRenderData &mr,
const SortedFaceData &face_sorted);
286void create_material_subranges(
const SortedFaceData &face_sorted,
287 gpu::IndexBuf &tris_ibo,
289gpu::IndexBufPtr extract_tris_subdiv(
const DRWSubdivCache &subdiv_cache, MeshBatchCache &cache);
291void extract_lines(
const MeshRenderData &mr,
292 gpu::IndexBufPtr *lines,
293 gpu::IndexBufPtr *lines_loose,
294 bool &no_loose_wire);
295void extract_lines_subdiv(
const DRWSubdivCache &subdiv_cache,
296 const MeshRenderData &mr,
297 gpu::IndexBufPtr *lines,
298 gpu::IndexBufPtr *lines_loose,
299 bool &no_loose_wire);
301gpu::IndexBufPtr extract_points(
const MeshRenderData &mr);
302gpu::IndexBufPtr extract_points_subdiv(
const MeshRenderData &mr,
303 const DRWSubdivCache &subdiv_cache);
305gpu::VertBufPtr extract_edit_data(
const MeshRenderData &mr);
306gpu::VertBufPtr extract_edit_data_subdiv(
const MeshRenderData &mr,
307 const DRWSubdivCache &subdiv_cache);
309gpu::VertBufPtr extract_tangents(
const MeshRenderData &mr,
310 const MeshBatchCache &cache,
312gpu::VertBufPtr extract_tangents_subdiv(
const MeshRenderData &mr,
313 const DRWSubdivCache &subdiv_cache,
314 const MeshBatchCache &cache);
316gpu::VertBufPtr extract_vert_index(
const MeshRenderData &mr);
317gpu::VertBufPtr extract_edge_index(
const MeshRenderData &mr);
318gpu::VertBufPtr extract_face_index(
const MeshRenderData &mr);
319gpu::VertBufPtr extract_face_dot_index(
const MeshRenderData &mr);
321gpu::VertBufPtr extract_vert_index_subdiv(
const DRWSubdivCache &subdiv_cache,
322 const MeshRenderData &mr);
323gpu::VertBufPtr extract_edge_index_subdiv(
const DRWSubdivCache &subdiv_cache,
324 const MeshRenderData &mr);
325gpu::VertBufPtr extract_face_index_subdiv(
const DRWSubdivCache &subdiv_cache,
326 const MeshRenderData &mr);
328gpu::VertBufPtr extract_weights(
const MeshRenderData &mr,
const MeshBatchCache &cache);
329gpu::VertBufPtr extract_weights_subdiv(
const MeshRenderData &mr,
330 const DRWSubdivCache &subdiv_cache,
331 const MeshBatchCache &cache);
333gpu::IndexBufPtr extract_face_dots(
const MeshRenderData &mr);
335gpu::VertBufPtr extract_face_dots_uv(
const MeshRenderData &mr);
336gpu::VertBufPtr extract_face_dots_edituv_data(
const MeshRenderData &mr);
338gpu::IndexBufPtr extract_lines_paint_mask(
const MeshRenderData &mr);
339gpu::IndexBufPtr extract_lines_paint_mask_subdiv(
const MeshRenderData &mr,
340 const DRWSubdivCache &subdiv_cache);
342gpu::IndexBufPtr extract_lines_adjacency(
const MeshRenderData &mr,
bool &r_is_manifold);
343gpu::IndexBufPtr extract_lines_adjacency_subdiv(
const DRWSubdivCache &subdiv_cache,
344 bool &r_is_manifold);
346gpu::VertBufPtr extract_uv_maps(
const MeshRenderData &mr,
const MeshBatchCache &cache);
347gpu::VertBufPtr extract_uv_maps_subdiv(
const DRWSubdivCache &subdiv_cache,
348 const MeshBatchCache &cache);
349gpu::VertBufPtr extract_edituv_stretch_area(
const MeshRenderData &mr,
352gpu::VertBufPtr extract_edituv_stretch_area_subdiv(
const MeshRenderData &mr,
353 const DRWSubdivCache &subdiv_cache,
356gpu::VertBufPtr extract_edituv_stretch_angle(
const MeshRenderData &mr);
357gpu::VertBufPtr extract_edituv_stretch_angle_subdiv(
const MeshRenderData &mr,
358 const DRWSubdivCache &subdiv_cache,
359 const MeshBatchCache &cache);
360gpu::VertBufPtr extract_edituv_data(
const MeshRenderData &mr);
361gpu::VertBufPtr extract_edituv_data_subdiv(
const MeshRenderData &mr,
362 const DRWSubdivCache &subdiv_cache);
363gpu::IndexBufPtr extract_edituv_tris(
const MeshRenderData &mr,
bool edit_uvs);
364gpu::IndexBufPtr extract_edituv_tris_subdiv(
const MeshRenderData &mr,
365 const DRWSubdivCache &subdiv_cache);
373gpu::IndexBufPtr extract_edituv_lines(
const MeshRenderData &mr, UvExtractionMode mode);
375 const DRWSubdivCache &subdiv_cache,
376 UvExtractionMode mode);
379 const DRWSubdivCache &subdiv_cache);
388 const DRWSubdivCache &subdiv_cache);
394 const DRWSubdivCache &subdiv_cache,
399gpu::VertBufPtr extract_paint_overlay_flags_subdiv(
const MeshRenderData &mr,
400 const DRWSubdivCache &subdiv_cache);
General operations, lookup, etc. for blender objects.
const Mesh * BKE_object_get_editmesh_eval_final(const Object *object)
#define BM_ELEM_CD_GET_FLOAT_P(ele, offset)
#define BM_elem_index_get(ele)
BLI_INLINE BMEdge * BM_edge_at_index(BMesh *bm, const int index)
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
constexpr IndexRange index_range() const
int face_corner_next(const IndexRange face, const int corner)
const CustomData & mesh_cd_ldata_get_from_mesh(const Mesh &mesh)
BLI_INLINE BMFace * bm_original_face_get(const MeshRenderData &mr, int idx)
void mesh_render_data_update_face_normals(MeshRenderData &mr)
BLI_INLINE BMVert * bm_original_vert_get(const MeshRenderData &mr, int idx)
BLI_INLINE BMEdge * bm_original_edge_get(const MeshRenderData &mr, int idx)
void mesh_render_data_loop_flag(const MeshRenderData &mr, const BMLoop *l, const BMUVOffsets &offsets, EditLoopData &eattr)
const CustomData & mesh_cd_edata_get_from_mesh(const Mesh &mesh)
uint2 edge_from_corners(const IndexRange face, const int corner)
void mesh_render_data_face_flag(const MeshRenderData &mr, const BMFace *efa, const BMUVOffsets &offsets, EditLoopData &eattr)
void mesh_render_data_loop_edge_flag(const MeshRenderData &mr, const BMLoop *l, const BMUVOffsets &offsets, EditLoopData &eattr)
const Mesh & editmesh_final_or_this(const Object &object, const Mesh &mesh)
BLI_INLINE const float * bm_face_no_get(const MeshRenderData &mr, const BMFace *efa)
void mesh_render_data_update_corner_normals(MeshRenderData &mr)
const SortedFaceData & mesh_render_data_faces_sorted_ensure(const MeshRenderData &mr, MeshBufferCache &cache)
const CustomData & mesh_cd_vdata_get_from_mesh(const Mesh &mesh)
BLI_INLINE const float * bm_vert_no_get(const MeshRenderData &mr, const BMVert *eve)
MeshRenderData mesh_render_data_create(Object &object, Mesh &mesh, const bool is_editmode, const bool is_paint_mode, const bool do_final, const bool do_uvedit, const bool use_hide, const ToolSettings *ts)
void mesh_render_data_update_loose_geom(MeshRenderData &mr, MeshBufferCache &cache)
void extract_mesh_loose_edge_data(const Span< T > vert_data, const Span< int2 > edges, const Span< int > loose_edges, MutableSpan< T > gpu_data)
BLI_INLINE const float * bm_vert_co_get(const MeshRenderData &mr, const BMVert *eve)
const CustomData & mesh_cd_pdata_get_from_mesh(const Mesh &mesh)
std::unique_ptr< IndexBuf, IndexBufDeleter > IndexBufPtr
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< uint32_t, 2 > uint2
MatBase< float, 4, 4 > float4x4
MeshRuntimeHandle * runtime
VArraySpan< bool > hide_vert
const char * default_color_name
Span< float3 > bm_vert_coords
VArraySpan< bool > hide_edge
Span< float3 > bm_vert_normals
bke::EditMeshData * edit_data
const int * orig_index_vert
bool use_simplify_normals
const ToolSettings * toolsettings
Span< float3 > vert_positions
MeshExtractType extract_type
const int * orig_index_face
VArraySpan< bool > select_vert
VArraySpan< bool > sharp_faces
const char * active_color_name
int bm_free_normal_offset_face
VArraySpan< bool > select_poly
VArraySpan< bool > select_edge
Span< float3 > bm_face_normals
Span< float3 > face_normals
int bm_free_normal_offset_corner
const int * orig_index_edge
Span< float3 > corner_normals
VArraySpan< int > material_indices
VArraySpan< bool > hide_poly
OffsetIndices< int > faces
bke::MeshNormalDomain normals_domain
int bm_free_normal_offset_vert
Array< float3 > bm_loop_normals