59 const int ptex_face_index,
72 float corner_u, corner_v;
74 *r_mask_grid = &
data->grid_paint_mask[start_grid_index +
corner];
78 *r_mask_grid = &
data->grid_paint_mask[start_grid_index];
92 const int x = roundf(grid_u * (grid_size - 1));
93 const int y = roundf(grid_v * (grid_size - 1));
94 return mask_grid->
data[
y * grid_size +
x];
98 const int ptex_face_index,
103 float grid_u, grid_v;
120 int num_ptex_faces = 0;
122 for (
int poly_index = 0; poly_index <
mesh->
totpoly; poly_index++) {
123 const MPoly *poly = &mpoly[poly_index];
126 return num_ptex_faces;
136 num_ptex_faces,
sizeof(*
data->ptex_poly_corner),
"ptex poly corner");
138 int ptex_face_index = 0;
140 for (
int poly_index = 0; poly_index <
mesh->
totpoly; poly_index++) {
141 const MPoly *poly = &mpoly[poly_index];
143 ptex_poly_corner[ptex_face_index].
poly_index = poly_index;
144 ptex_poly_corner[ptex_face_index].
corner = 0;
149 ptex_poly_corner[ptex_face_index].
poly_index = poly_index;
175 if (grid_paint_mask ==
NULL) {
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_get_layer(const struct CustomData *data, int type)
BLI_INLINE int BKE_subdiv_grid_size_from_level(const int level)
BLI_INLINE int BKE_subdiv_rotate_quad_to_corner(const float quad_u, const float quad_v, float *r_corner_u, float *r_corner_v)
BLI_INLINE void BKE_subdiv_ptex_face_uv_to_grid_uv(const float ptex_u, const float ptex_v, float *r_grid_u, float *r_grid_v)
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
PolyCornerIndex * ptex_poly_corner
const GridPaintMask * grid_paint_mask
struct CustomData pdata ldata
void(* free)(struct SubdivCCGMaskEvaluator *mask_evaluator)
float(* eval_mask)(struct SubdivCCGMaskEvaluator *mask_evaluator, const int ptex_face_index, const float u, const float v)
bool BKE_subdiv_ccg_mask_init_from_paint(SubdivCCGMaskEvaluator *mask_evaluator, const struct Mesh *mesh)
struct GridPaintMaskData GridPaintMaskData
static float eval_mask(SubdivCCGMaskEvaluator *mask_evaluator, const int ptex_face_index, const float u, const float v)
static void mask_init_data(SubdivCCGMaskEvaluator *mask_evaluator, const Mesh *mesh)
static int mask_get_grid_and_coord(SubdivCCGMaskEvaluator *mask_evaluator, const int ptex_face_index, const float u, const float v, const GridPaintMask **r_mask_grid, float *grid_u, float *grid_v)
static void mask_data_init_mapping(SubdivCCGMaskEvaluator *mask_evaluator, const Mesh *mesh)
static void mask_init_functions(SubdivCCGMaskEvaluator *mask_evaluator)
static int count_num_ptex_faces(const Mesh *mesh)
BLI_INLINE float read_mask_grid(const GridPaintMask *mask_grid, const float grid_u, const float grid_v)
struct PolyCornerIndex PolyCornerIndex
static void free_mask_data(SubdivCCGMaskEvaluator *mask_evaluator)