Blender  V3.3
Classes | Macros | Typedefs | Functions
subdiv_converter_mesh.c File Reference
#include "subdiv_converter.h"
#include <string.h>
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BLI_bitmap.h"
#include "BLI_utildefines.h"
#include "BKE_customdata.h"
#include "BKE_mesh_mapping.h"
#include "BKE_subdiv.h"
#include "MEM_guardedalloc.h"
#include "opensubdiv_capi.h"
#include "opensubdiv_converter_capi.h"
#include "bmesh_class.h"

Go to the source code of this file.

Classes

struct  ConverterStorage
 

Macros

#define BUGGY_SIMPLE_SCHEME_WORKAROUND   1
 

Typedefs

typedef struct ConverterStorage ConverterStorage
 

Functions

static OpenSubdiv_SchemeType get_scheme_type (const OpenSubdiv_Converter *converter)
 
static OpenSubdiv_VtxBoundaryInterpolation get_vtx_boundary_interpolation (const struct OpenSubdiv_Converter *converter)
 
static OpenSubdiv_FVarLinearInterpolation get_fvar_linear_interpolation (const OpenSubdiv_Converter *converter)
 
static bool specifies_full_topology (const OpenSubdiv_Converter *UNUSED(converter))
 
static int get_num_faces (const OpenSubdiv_Converter *converter)
 
static int get_num_edges (const OpenSubdiv_Converter *converter)
 
static int get_num_vertices (const OpenSubdiv_Converter *converter)
 
static int get_num_face_vertices (const OpenSubdiv_Converter *converter, int manifold_face_index)
 
static void get_face_vertices (const OpenSubdiv_Converter *converter, int manifold_face_index, int *manifold_face_vertices)
 
static void get_edge_vertices (const OpenSubdiv_Converter *converter, int manifold_edge_index, int *manifold_edge_vertices)
 
static float get_edge_sharpness (const OpenSubdiv_Converter *converter, int manifold_edge_index)
 
static bool is_infinite_sharp_vertex (const OpenSubdiv_Converter *converter, int manifold_vertex_index)
 
static float get_vertex_sharpness (const OpenSubdiv_Converter *converter, int manifold_vertex_index)
 
static int get_num_uv_layers (const OpenSubdiv_Converter *converter)
 
static void precalc_uv_layer (const OpenSubdiv_Converter *converter, const int layer_index)
 
static void finish_uv_layer (const OpenSubdiv_Converter *UNUSED(converter))
 
static int get_num_uvs (const OpenSubdiv_Converter *converter)
 
static int get_face_corner_uv_index (const OpenSubdiv_Converter *converter, const int face_index, const int corner)
 
static void free_user_data (const OpenSubdiv_Converter *converter)
 
static void init_functions (OpenSubdiv_Converter *converter)
 
static void initialize_manifold_index_array (const BLI_bitmap *used_map, const int num_elements, int **r_indices, int **r_indices_reverse, int *r_num_manifold_elements)
 
static void initialize_manifold_indices (ConverterStorage *storage)
 
static void init_user_data (OpenSubdiv_Converter *converter, const SubdivSettings *settings, const Mesh *mesh)
 
void BKE_subdiv_converter_init_for_mesh (struct OpenSubdiv_Converter *converter, const SubdivSettings *settings, const Mesh *mesh)
 

Macro Definition Documentation

◆ BUGGY_SIMPLE_SCHEME_WORKAROUND

#define BUGGY_SIMPLE_SCHEME_WORKAROUND   1

Definition at line 31 of file subdiv_converter_mesh.c.

Typedef Documentation

◆ ConverterStorage

Function Documentation

◆ BKE_subdiv_converter_init_for_mesh()

void BKE_subdiv_converter_init_for_mesh ( struct OpenSubdiv_Converter converter,
const SubdivSettings settings,
const Mesh mesh 
)

Definition at line 390 of file subdiv_converter_mesh.c.

References init_functions(), init_user_data(), and mesh.

◆ finish_uv_layer()

static void finish_uv_layer ( const OpenSubdiv_Converter UNUSEDconverter)
static

Definition at line 230 of file subdiv_converter_mesh.c.

Referenced by init_functions().

◆ free_user_data()

static void free_user_data ( const OpenSubdiv_Converter converter)
static

Definition at line 249 of file subdiv_converter_mesh.c.

References MEM_freeN, MEM_SAFE_FREE, OpenSubdiv_Converter::user_data, and user_data.

Referenced by init_functions().

◆ get_edge_sharpness()

static float get_edge_sharpness ( const OpenSubdiv_Converter converter,
int  manifold_edge_index 
)
static

◆ get_edge_vertices()

static void get_edge_vertices ( const OpenSubdiv_Converter converter,
int  manifold_edge_index,
int *  manifold_edge_vertices 
)
static

◆ get_face_corner_uv_index()

static int get_face_corner_uv_index ( const OpenSubdiv_Converter converter,
const int  face_index,
const int  corner 
)
static

◆ get_face_vertices()

static void get_face_vertices ( const OpenSubdiv_Converter converter,
int  manifold_face_index,
int *  manifold_face_vertices 
)
static

◆ get_fvar_linear_interpolation()

static OpenSubdiv_FVarLinearInterpolation get_fvar_linear_interpolation ( const OpenSubdiv_Converter converter)
static

◆ get_num_edges()

static int get_num_edges ( const OpenSubdiv_Converter converter)
static

◆ get_num_face_vertices()

static int get_num_face_vertices ( const OpenSubdiv_Converter converter,
int  manifold_face_index 
)
static

◆ get_num_faces()

static int get_num_faces ( const OpenSubdiv_Converter converter)
static

◆ get_num_uv_layers()

static int get_num_uv_layers ( const OpenSubdiv_Converter converter)
static

◆ get_num_uvs()

static int get_num_uvs ( const OpenSubdiv_Converter converter)
static

◆ get_num_vertices()

static int get_num_vertices ( const OpenSubdiv_Converter converter)
static

◆ get_scheme_type()

static OpenSubdiv_SchemeType get_scheme_type ( const OpenSubdiv_Converter converter)
static

◆ get_vertex_sharpness()

static float get_vertex_sharpness ( const OpenSubdiv_Converter converter,
int  manifold_vertex_index 
)
static

◆ get_vtx_boundary_interpolation()

static OpenSubdiv_VtxBoundaryInterpolation get_vtx_boundary_interpolation ( const struct OpenSubdiv_Converter converter)
static

◆ init_functions()

static void init_functions ( OpenSubdiv_Converter converter)
static

Definition at line 260 of file subdiv_converter_mesh.c.

References finish_uv_layer(), OpenSubdiv_Converter::finishUVLayer, free_user_data(), OpenSubdiv_Converter::freeUserData, get_edge_sharpness(), get_edge_vertices(), get_face_corner_uv_index(), get_face_vertices(), get_fvar_linear_interpolation(), get_num_edges(), get_num_face_vertices(), get_num_faces(), get_num_uv_layers(), get_num_uvs(), get_num_vertices(), get_scheme_type(), get_vertex_sharpness(), get_vtx_boundary_interpolation(), OpenSubdiv_Converter::getEdgeFaces, OpenSubdiv_Converter::getEdgeSharpness, OpenSubdiv_Converter::getEdgeVertices, OpenSubdiv_Converter::getFaceCornerUVIndex, OpenSubdiv_Converter::getFaceEdges, OpenSubdiv_Converter::getFaceVertices, OpenSubdiv_Converter::getFVarLinearInterpolation, OpenSubdiv_Converter::getNumEdgeFaces, OpenSubdiv_Converter::getNumEdges, OpenSubdiv_Converter::getNumFaces, OpenSubdiv_Converter::getNumFaceVertices, OpenSubdiv_Converter::getNumUVCoordinates, OpenSubdiv_Converter::getNumUVLayers, OpenSubdiv_Converter::getNumVertexEdges, OpenSubdiv_Converter::getNumVertexFaces, OpenSubdiv_Converter::getNumVertices, OpenSubdiv_Converter::getSchemeType, OpenSubdiv_Converter::getVertexEdges, OpenSubdiv_Converter::getVertexFaces, OpenSubdiv_Converter::getVertexSharpness, OpenSubdiv_Converter::getVtxBoundaryInterpolation, is_infinite_sharp_vertex(), OpenSubdiv_Converter::isInfiniteSharpVertex, NULL, precalc_uv_layer(), OpenSubdiv_Converter::precalcUVLayer, specifies_full_topology(), and OpenSubdiv_Converter::specifiesFullTopology.

Referenced by BKE_subdiv_converter_init_for_mesh().

◆ init_user_data()

static void init_user_data ( OpenSubdiv_Converter converter,
const SubdivSettings settings,
const Mesh mesh 
)
static

◆ initialize_manifold_index_array()

static void initialize_manifold_index_array ( const BLI_bitmap used_map,
const int  num_elements,
int **  r_indices,
int **  r_indices_reverse,
int *  r_num_manifold_elements 
)
static

◆ initialize_manifold_indices()

static void initialize_manifold_indices ( ConverterStorage storage)
static

◆ is_infinite_sharp_vertex()

static bool is_infinite_sharp_vertex ( const OpenSubdiv_Converter converter,
int  manifold_vertex_index 
)
static

◆ precalc_uv_layer()

static void precalc_uv_layer ( const OpenSubdiv_Converter converter,
const int  layer_index 
)
static

◆ specifies_full_topology()

static bool specifies_full_topology ( const OpenSubdiv_Converter UNUSEDconverter)
static

Definition at line 93 of file subdiv_converter_mesh.c.

Referenced by init_functions().