Blender V5.3
subdiv_mesh.cc File Reference
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BLI_array.hh"
#include "BLI_array_utils.hh"
#include "BLI_listbase_iterator.hh"
#include "BLI_math_vector.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_math_vector_types.hh"
#include "BKE_attribute.hh"
#include "BKE_attribute_math.hh"
#include "BKE_customdata.hh"
#include "BKE_deform.hh"
#include "BKE_key.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_subdiv.hh"
#include "BKE_subdiv_deform.hh"
#include "BKE_subdiv_eval.hh"
#include "BKE_subdiv_foreach.hh"
#include "BKE_subdiv_mesh.hh"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Classes

struct  blender::bke::subdiv::SubdivMeshContext
struct  blender::bke::subdiv::LoopsOfPtex
struct  blender::bke::subdiv::VerticesForInterpolation
struct  blender::bke::subdiv::LoopsForInterpolation
struct  blender::bke::subdiv::SubdivMeshTLS

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke
namespace  blender::bke::subdiv

Functions

Subdivision context
static void blender::bke::subdiv::subdiv_mesh_ctx_cache_uv_layers (SubdivMeshContext *ctx)
static void blender::bke::subdiv::subdiv_mesh_ctx_cache_custom_data_layers (SubdivMeshContext *ctx)
static void blender::bke::subdiv::subdiv_mesh_prepare_accumulator (SubdivMeshContext *ctx, int num_vertices)
static void blender::bke::subdiv::subdiv_mesh_context_free (SubdivMeshContext *ctx)
Loop custom data copy helpers
static void blender::bke::subdiv::loops_of_ptex_get (LoopsOfPtex *loops_of_ptex, const IndexRange coarse_face, const int ptex_of_face_index)
Vertex custom data interpolation helpers
static float3 blender::bke::subdiv::mix_normals (const Span< float3 > src, const Span< int > src_indices, const Span< float > weights)
static float3 blender::bke::subdiv::mix_normals (const Span< float3 > src, const std::array< int, 4 > &src_indices, const float4 &weights)
static float3 blender::bke::subdiv::mix_normals (const Span< float3 > src, const std::array< int, 2 > &src_indices, const float factor)
static void blender::bke::subdiv::mix_attrs (const Span< GSpan > src, const std::array< int, 2 > &src_indices, const float factor, const int dst_index, const Span< GMutableSpan > dst)
static void blender::bke::subdiv::mix_attrs (const Span< GSpan > src, const std::array< int, 4 > &src_indices, const float4 &weights, const int dst_index, const Span< GMutableSpan > dst)
static void blender::bke::subdiv::mix_attrs (const Span< GSpan > src, const Span< int > src_indices, const Span< float > weights, const int dst_index, const Span< GMutableSpan > dst)
static void blender::bke::subdiv::copy_attrs (const Span< GSpan > src, const int src_index, const int dst_index, const Span< GMutableSpan > dst)
static void blender::bke::subdiv::vert_interpolation_from_face (const SubdivMeshContext *ctx, VerticesForInterpolation *vert_interpolation, const IndexRange coarse_face)
static void blender::bke::subdiv::vert_interpolation_from_corner (const SubdivMeshContext *ctx, VerticesForInterpolation *vert_interpolation, const IndexRange coarse_face, const int corner)
Loop custom data interpolation helpers
static void blender::bke::subdiv::loop_interpolation_from_face (const SubdivMeshContext *ctx, LoopsForInterpolation *loop_interpolation, const IndexRange coarse_face)
static void blender::bke::subdiv::loop_interpolation_from_corner (const SubdivMeshContext *ctx, LoopsForInterpolation *loop_interpolation, const IndexRange coarse_face, const int corner)
TLS
static void blender::bke::subdiv::subdiv_mesh_tls_free (void *tls_v)
Evaluation helper functions
static void blender::bke::subdiv::subdiv_vert_orco_evaluate (const SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, const int subdiv_vert_index)
Accumulation helpers
static void blender::bke::subdiv::subdiv_accumulate_vert_displacement (SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, const int subdiv_vert_index)
Callbacks
static void blender::bke::subdiv::create_attrs_and_retrieve_interp_spans (const AttributeAccessor src_attrs, const bke::AttrDomain domain, const Set< StringRef > &skip_names, MutableAttributeAccessor dst_attrs, Vector< GVArraySpan > &coarse_varray_spans, Vector< GSpan > &coarse_spans, Vector< GSpanAttributeWriter > &dst_writers, Vector< GMutableSpan > &dst_spans)
static bool blender::bke::subdiv::subdiv_mesh_topology_info (const ForeachContext *foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_faces, const Span< int >)
Vertex subdivision process
static void blender::bke::subdiv::subdiv_vert_data_copy (const SubdivMeshContext *ctx, const int coarse_vert_index, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_vert_data_interpolate (const SubdivMeshContext *ctx, const int subdiv_vert_index, VerticesForInterpolation *vert_interpolation, const float u, const float v)
static void blender::bke::subdiv::evaluate_vert_and_apply_displacement_copy (const SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, const int coarse_vert_index, const int subdiv_vert_index)
static void blender::bke::subdiv::evaluate_vert_and_apply_displacement_interpolate (const SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, VerticesForInterpolation *vert_interpolation, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_vert_displacement_every_corner_or_edge (const ForeachContext *foreach_context, void *, const int ptex_face_index, const float u, const float v, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_vert_displacement_every_corner (const ForeachContext *foreach_context, void *tls, const int ptex_face_index, const float u, const float v, const int, const int, const int, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_vert_displacement_every_edge (const ForeachContext *foreach_context, void *tls, const int ptex_face_index, const float u, const float v, const int, const int, const int, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_vert_corner (const ForeachContext *foreach_context, void *, const int ptex_face_index, const float u, const float v, const int coarse_vert_index, const int, const int, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_ensure_vert_interpolation (SubdivMeshContext *ctx, SubdivMeshTLS *tls, const int coarse_face_index, const int coarse_corner)
static void blender::bke::subdiv::subdiv_mesh_vert_edge (const ForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int, const int coarse_face_index, const int coarse_corner, const int subdiv_vert_index)
static bool blender::bke::subdiv::subdiv_mesh_is_center_vert (const IndexRange coarse_face, const float u, const float v)
static void blender::bke::subdiv::subdiv_mesh_tag_center_vert (const IndexRange coarse_face, const int subdiv_vert_index, const float u, const float v, SubdivMeshContext *ctx)
static void blender::bke::subdiv::subdiv_mesh_vert_inner (const ForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int coarse_face_index, const int coarse_corner, const int subdiv_vert_index)
Edge subdivision process
static void blender::bke::subdiv::subdiv_copy_edge_data (SubdivMeshContext *ctx, const int subdiv_edge_index, const int coarse_edge_index)
static void blender::bke::subdiv::subdiv_mesh_edge (const ForeachContext *foreach_context, void *, const int coarse_edge_index, const int subdiv_edge_index, const bool, const int subdiv_v1, const int subdiv_v2)
Loops creation/interpolation
static void blender::bke::subdiv::subdiv_interpolate_corner_data (const SubdivMeshContext *ctx, const int subdiv_loop_index, const LoopsForInterpolation *loop_interpolation, const float u, const float v)
static void blender::bke::subdiv::subdiv_eval_uv_layer (SubdivMeshContext *ctx, const int corner_index, const int ptex_face_index, const float u, const float v)
static void blender::bke::subdiv::subdiv_mesh_ensure_loop_interpolation (SubdivMeshContext *ctx, SubdivMeshTLS *tls, const int coarse_face_index, const int coarse_corner)
static void blender::bke::subdiv::subdiv_mesh_loop (const ForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int, const int coarse_face_index, const int coarse_corner, const int subdiv_loop_index, const int subdiv_vert_index, const int subdiv_edge_index)
Polygons subdivision process
static void blender::bke::subdiv::subdiv_mesh_face (const ForeachContext *foreach_context, OffsetIndices< int > subdiv_faces_by_base_face)
Loose elements subdivision process
static void blender::bke::subdiv::subdiv_mesh_vert_loose (const ForeachContext *foreach_context, void *, const int coarse_vert_index, const int subdiv_vert_index)
static std::array< std::optional< int2 >, 2 > blender::bke::subdiv::find_edge_neighbors (const Span< int2 > coarse_edges, const GroupedSpan< int > vert_to_edge_map, const int edge_index)
static std::array< float3, 4 > blender::bke::subdiv::find_loose_edge_interpolation_positions (const Span< float3 > coarse_positions, const int2 &coarse_edge, const std::array< std::optional< int2 >, 2 > &neighbors)
float3 blender::bke::subdiv::mesh_interpolate_position_on_edge (Span< float3 > coarse_positions, Span< int2 > coarse_edges, GroupedSpan< int > vert_to_edge_map, int coarse_edge_index, bool is_simple, float u)
static void blender::bke::subdiv::subdiv_mesh_vert_of_loose_edge_interpolate (SubdivMeshContext *ctx, const int2 &coarse_edge, const float u, const int subdiv_vert_index)
static void blender::bke::subdiv::subdiv_mesh_vert_of_loose_edge (const ForeachContext *foreach_context, void *, const int coarse_edge_index, const float u, const int subdiv_vert_index)
Initialization
static void blender::bke::subdiv::setup_foreach_callbacks (const SubdivMeshContext *subdiv_context, ForeachContext *foreach_context)
Public entry point
Mesh * blender::bke::subdiv::subdiv_to_mesh (Subdiv *subdiv, const ToMeshSettings *settings, const Mesh *coarse_mesh)
Limit surface
void blender::bke::subdiv::calculate_limit_positions (Mesh *mesh, MutableSpan< float3 > limit_positions)