8 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
10 # pragma GCC diagnostic ignored "-Wvla"
59 #define USE_LOOP_LAYOUT_FAST
62 int drawInteriorEdges,
76 memcpy(p2,
ptr, oldSize);
106 int normalOffset = 0;
109 subdivLevels =
MAX2(subdivLevels, 1);
116 if ((oldUseAging != useAging) ||
135 normalOffset +=
sizeof(
float) * numLayers;
153 ccgSS =
ccgSubSurf_new(&ifc, subdivLevels, &allocatorIFC, allocator);
164 normalOffset +=
sizeof(
float);
190 if (
x == edgeSize - 1) {
194 return edgeBase +
x - 1;
203 if (
x == gridSize - 1 &&
y == gridSize - 1) {
207 if (
x == gridSize - 1) {
212 return edgeBase + (gridSize - 1 -
y) - 1;
215 return edgeBase + (edgeSize - 2 - 1) - ((gridSize - 1 -
y) - 1);
217 if (
y == gridSize - 1) {
222 return edgeBase + (gridSize - 1 -
x) - 1;
225 return edgeBase + (edgeSize - 2 - 1) - ((gridSize - 1 -
x) - 1);
227 if (
x == 0 &&
y == 0) {
231 S = (S + numVerts - 1) % numVerts;
232 return faceBase + 1 + (gridSize - 2) * S + (
y - 1);
235 return faceBase + 1 + (gridSize - 2) * S + (
x - 1);
238 return faceBase + 1 + (gridSize - 2) * numVerts + S * (gridSize - 2) * (gridSize - 2) +
239 (
y - 1) * (gridSize - 2) + (
x - 1);
246 int j, nverts = mpoly[fi].
totloop;
248 for (j = 0; j < nverts; j++) {
253 if (
v->poly_index == fi) {
280 float uv[3] = {0.0f, 0.0f, 0.0f};
295 for (i = 0; i < totvert; i++) {
311 int loopid = mpoly[
v->poly_index].
loopstart +
v->loop_of_poly_index;
324 for (i = 0; i < totface; i++) {
325 MPoly *mp = &mpoly[i];
341 for (j = 0, j_next = nverts - 1; j < nverts; j_next = j++) {
358 for (i = 0; i < totface; i++) {
359 MPoly *mp = &mpoly[i];
388 int index, gridSize, gridFaces, totface,
x,
y, S;
395 if (!dmloopuv || (!tface && !mloopuv)) {
411 gridFaces = gridSize - 1;
425 for (index = 0; index < totface; index++) {
429 for (S = 0; S < numVerts; S++) {
432 for (
y = 0;
y < gridFaces;
y++) {
433 for (
x = 0;
x < gridFaces;
x++) {
434 float *
a = faceGridData[(
y + 0) * gridSize +
x + 0];
435 float *
b = faceGridData[(
y + 0) * gridSize +
x + 1];
436 float *
c = faceGridData[(
y + 1) * gridSize +
x + 1];
437 float *d = faceGridData[(
y + 1) * gridSize +
x + 0];
469 #define SUB_ELEMS_FACE 50
486 float *
w, w1, w2, w4, fac, fac2, fx, fy;
488 if (wtable->
len <= faceLen) {
497 wtable->
len = faceLen + 1;
503 sizeof(
float) * faceLen * faceLen * (gridCuts + 2) * (gridCuts + 2),
"weight table alloc");
504 fac = 1.0f / (
float)faceLen;
506 for (i = 0; i < faceLen; i++) {
507 for (
x = 0;
x < gridCuts + 2;
x++) {
508 for (
y = 0;
y < gridCuts + 2;
y++) {
509 fx = 0.5f - (
float)
x / (
float)(gridCuts + 1) / 2.0f;
510 fy = 0.5f - (
float)
y / (
float)(gridCuts + 1) / 2.0f;
513 w1 = (1.0f - fx) * (1.0f - fy) + (-fac2 * fx * fy * fac);
514 w2 = (1.0f - fx + fac2 * fx * -fac) * (fy);
515 w4 = (fx) * (1.0f - fy + -fac2 * fy * fac);
519 fac2 = 1.0f - (w1 + w2 + w4);
520 fac2 = fac2 / (
float)(faceLen - 3);
521 for (j = 0; j < faceLen; j++) {
527 w[(i - 1 + faceLen) % faceLen] = w2;
528 w[(i + 1) % faceLen] = w4;
543 for (i = 0; i < wtable->
len; i++) {
556 float (*vertexCos)[3],
579 for (i = 0; i < totvert; i++,
mv++) {
594 for (i = 0; i < totedge; i++, me++) {
598 crease = useFlatSubdiv ? creaseFactor : me->
crease * creaseFactor / 255.0f;
618 ml = mloop + mp->loopstart;
619 for (j = 0; j < mp->totloop; j++, ml++) {
629 static int hasGivenError = 0;
631 if (!hasGivenError) {
653 float (*vertexCos)[3],
655 bool UNUSED(use_subdiv_uvs))
679 if (
min[0] > vec[0]) {
682 if (
min[1] > vec[1]) {
685 if (
min[2] > vec[2]) {
688 if (
max[0] < vec[0]) {
691 if (
max[1] < vec[1]) {
694 if (
max[2] < vec[2]) {
713 r_min[0] = r_min[1] = r_min[2] = r_max[0] = r_max[1] = r_max[2] = 0.0;
729 for (i = 0; i < edgeSize; i++) {
739 for (S = 0; S < numVerts; S++) {
742 for (
y = 0;
y < gridSize;
y++) {
743 for (
x = 0;
x < gridSize;
x++) {
789 int x,
y, grid, numVerts;
793 int gridInternalVerts;
805 gridSideVerts = gridSize - 2;
806 gridInternalVerts = gridSideVerts * gridSideVerts;
808 gridSideEnd = 1 + numVerts * gridSideVerts;
809 gridInternalEnd = gridSideEnd + numVerts * gridInternalVerts;
815 if (
offset < gridSideEnd) {
817 grid =
offset / gridSideVerts;
818 x =
offset % gridSideVerts + 1;
821 if (
offset < gridInternalEnd) {
823 grid =
offset / gridInternalVerts;
824 offset %= gridInternalVerts;
825 y =
offset / gridSideVerts + 1;
826 x =
offset % gridSideVerts + 1;
881 mv->flag =
mv->bweight = 0;
891 int totvert, totedge, totface;
899 for (index = 0; index < totface; index++) {
906 for (S = 0; S < numVerts; S++) {
907 for (
x = 1;
x < gridSize - 1;
x++) {
913 for (S = 0; S < numVerts; S++) {
914 for (
y = 1;
y < gridSize - 1;
y++) {
915 for (
x = 1;
x < gridSize - 1;
x++) {
924 for (index = 0; index < totedge; index++) {
928 for (
x = 1;
x < edgeSize - 1;
x++) {
938 for (index = 0; index < totvert; index++) {
960 int totedge, totface;
968 for (index = 0; index < totface; index++) {
972 for (S = 0; S < numVerts; S++) {
973 for (
x = 0;
x < gridSize - 1;
x++) {
980 for (
x = 1;
x < gridSize - 1;
x++) {
981 for (
y = 0;
y < gridSize - 1;
y++) {
996 for (index = 0; index < totedge; index++) {
1007 if (edgeIdx != -1) {
1015 for (
x = 0;
x < edgeSize - 1;
x++) {
1040 const int grid_size =
data->grid_size;
1041 const int edge_size =
data->edge_size;
1044 const int grid_index =
data->grid_offset[iter];
1045 const size_t loop_index = 4 * (size_t)grid_index * (grid_size - 1) * (grid_size - 1);
1047 for (
int S = 0; S < num_verts; S++) {
1048 for (
int y = 0;
y < grid_size - 1;
y++) {
1049 for (
int x = 0;
x < grid_size - 1;
x++) {
1081 if (!ccgdm->
ehash) {
1083 if (!ccgdm->
ehash) {
1110 data.mloop_index =
data.grid_size >= 5 ? 1 : 8;
1132 for (index = 0; index < totface; index++) {
1135 int flag = (faceFlags) ? faceFlags[index].flag :
ME_SMOOTH;
1136 int mat_nr = (faceFlags) ? faceFlags[index].mat_nr : 0;
1138 for (S = 0; S < numVerts; S++) {
1139 for (
y = 0;
y < gridSize - 1;
y++) {
1140 for (
x = 0;
x < gridSize - 1;
x++) {
1141 MPoly *mp = &mpoly[i];
1201 for (
uint i = 0; i < numGrids; i++) {
1237 int a, index, totnone, totorig;
1256 for (
a = 0;
a < totnone;
a++) {
1260 for (index = 0; index < totorig; index++,
a++) {
1279 int a, i, index, totnone, totorig, totedge;
1292 totorig = totedge * (edgeSize - 1);
1296 for (
a = 0;
a < totnone;
a++) {
1300 for (index = 0; index < totedge; index++) {
1304 for (i = 0; i < edgeSize - 1; i++,
a++) {
1305 origindex[
a] = mapIndex;
1322 int a, i, index, totface;
1336 for (
a = 0, index = 0; index < totface; index++) {
1341 for (i = 0; i < gridFaces * gridFaces * numVerts; i++,
a++) {
1342 origindex[
a] = mapIndex;
1355 int index, numFaces, numGrids;
1360 for (index = 0; index < numFaces; index++) {
1382 int index, numFaces, numGrids, S, gIndex ;
1393 gridOffset =
MEM_mallocN(
sizeof(
int) * numFaces,
"ccgdm.gridOffset");
1395 for (gIndex = 0, index = 0; index < numFaces; index++) {
1399 gridOffset[index] = gIndex;
1410 for (gIndex = 0, index = 0; index < numFaces; index++) {
1414 for (S = 0; S < numVerts; S++, gIndex++) {
1416 gridFaces[gIndex] = f;
1417 gridFlagMats[gIndex] = ccgdm->
faceFlags[index];
1479 for (i = 0, poly_index = 0; i < tottri; i += 2, poly_index += 1) {
1483 lt->
tri[0] = (poly_index * 4) + 0;
1484 lt->
tri[1] = (poly_index * 4) + 2;
1485 lt->
tri[2] = (poly_index * 4) + 3;
1486 lt->
poly = poly_index;
1488 lt = &mlooptri[i + 1];
1489 lt->
tri[0] = (poly_index * 4) + 0;
1490 lt->
tri[1] = (poly_index * 4) + 1;
1491 lt->
tri[2] = (poly_index * 4) + 2;
1492 lt->
poly = poly_index;
1536 int totvert, totedge, totface;
1579 int vertNum = 0, edgeNum = 0, faceNum = 0;
1582 int *polyidx =
NULL;
1584 int *loopidx =
NULL, *vertidx =
NULL;
1588 int loopindex, loopindex2;
1591 int gridFaces, gridCuts;
1593 int gridInternalEdges;
1600 gridFaces = gridSize - 1;
1601 gridCuts = gridSize - 2;
1603 gridSideEdges = gridSize - 1;
1604 gridInternalEdges = (gridSideEdges - 1) * gridSideEdges * 2;
1618 loopindex = loopindex2 = 0;
1619 for (index = 0; index < totface; index++) {
1622 int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges);
1624 int g2_wid = gridCuts + 2;
1628 int loopidx[numVerts], vertidx[numVerts];
1636 faceFlags->
flag = mpoly ? mpoly[origIndex].
flag : 0;
1637 faceFlags->
mat_nr = mpoly ? mpoly[origIndex].
mat_nr : 0;
1647 for (s = 0; s < numVerts; s++) {
1648 loopidx[s] = loopindex++;
1655 for (s = 0; s < numVerts; s++) {
1663 if (vertOrigIndex) {
1671 for (s = 0; s < numVerts; s++) {
1672 for (
x = 1;
x < gridFaces;
x++) {
1673 w2 =
w + s * numVerts * g2_wid * g2_wid +
x * numVerts;
1676 if (vertOrigIndex) {
1686 for (s = 0; s < numVerts; s++) {
1687 for (
y = 1;
y < gridFaces;
y++) {
1688 for (
x = 1;
x < gridFaces;
x++) {
1689 w2 =
w + s * numVerts * g2_wid * g2_wid + (
y * g2_wid +
x) * numVerts;
1692 if (vertOrigIndex) {
1702 if (edgeOrigIndex) {
1703 for (i = 0; i < numFinalEdges; i++) {
1708 for (s = 0; s < numVerts; s++) {
1710 for (
y = 0;
y < gridFaces;
y++) {
1711 for (
x = 0;
x < gridFaces;
x++) {
1712 w2 =
w + s * numVerts * g2_wid * g2_wid + (
y * g2_wid +
x) * numVerts;
1717 w2 =
w + s * numVerts * g2_wid * g2_wid + ((
y + 1) * g2_wid + (
x)) * numVerts;
1722 w2 =
w + s * numVerts * g2_wid * g2_wid + ((
y + 1) * g2_wid + (
x + 1)) * numVerts;
1727 w2 =
w + s * numVerts * g2_wid * g2_wid + ((
y)*g2_wid + (
x + 1)) * numVerts;
1735 if (polyOrigIndex) {
1736 *polyOrigIndex = base_polyOrigIndex ? base_polyOrigIndex[origIndex] : origIndex;
1744 polyidx[faceNum] = faceNum;
1752 edgeNum += numFinalEdges;
1755 for (index = 0; index < totedge; index++) {
1757 int numFinalEdges = edgeSize - 1;
1772 if (edgeIdx >= 0 && edgeFlags) {
1773 edgeFlags[edgeIdx] = medge[edgeIdx].
flag;
1779 for (
x = 1;
x < edgeSize - 1;
x++) {
1781 w[1] = (
float)
x / (edgeSize - 1);
1784 if (vertOrigIndex) {
1793 for (i = 0; i < numFinalEdges; i++) {
1798 if (edgeOrigIndex) {
1799 for (i = 0; i < numFinalEdges; i++) {
1800 edgeOrigIndex[edgeNum + i] = mapIndex;
1804 edgeNum += numFinalEdges;
1813 for (i = 0; i < numlayer && i < dmnumlayer; i++) {
1818 for (index = 0; index < totvert; index++) {
1832 if (vertOrigIndex) {
1833 *vertOrigIndex = mapIndex;
1852 int drawInteriorEdges,
1905 float (*vertCos)[3],
1918 int levels = (
scene !=
NULL && !ignore_simplify) ?
1936 int levels = (
scene !=
NULL && !ignore_simplify) ?
1954 int levels = (
scene !=
NULL && !ignore_simplify) ?
2025 float edge_sum[3], face_sum[3];
2043 for (i = 0; i <
N; i++) {
2047 for (i = 0; i < numFaces; i++) {
2054 if (numFaces && numFaces !=
N) {
2055 mul_v3_fl(face_sum, (
float)
N / (
float)numFaces);
2059 r_positions[idx][0] = (co[0] *
N *
N + edge_sum[0] * 4 + face_sum[0]) / (
N * (
N + 5));
2060 r_positions[idx][1] = (co[1] *
N *
N + edge_sum[1] * 4 + face_sum[1]) / (
N * (
N + 5));
2061 r_positions[idx][2] = (co[2] *
N *
N + edge_sum[2] * 4 + face_sum[2]) / (
N * (
N + 5));
typedef float(TangentPoint)[2]
void * DM_get_edge_data_layer(struct DerivedMesh *dm, int type)
void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest, int *src_indices, float *weights, int count, int dest_index)
void DM_copy_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count)
void * DM_get_poly_data_layer(struct DerivedMesh *dm, int type)
bool DM_release(DerivedMesh *dm)
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
void DM_ensure_looptri_data(DerivedMesh *dm)
void * DM_get_vert_data_layer(struct DerivedMesh *dm, int type)
void CCG_key_top_level(CCGKey *key, const struct CCGSubSurf *ss)
BLI_INLINE float * CCG_grid_elem_co(const CCGKey *key, CCGElem *elem, int x, int y)
BLI_INLINE float * CCG_elem_no(const CCGKey *key, CCGElem *elem)
BLI_INLINE float * CCG_elem_offset_co(const CCGKey *key, CCGElem *elem, int offset)
BLI_INLINE float * CCG_elem_co(const CCGKey *key, CCGElem *elem)
struct DerivedMesh * CDDM_from_mesh(struct Mesh *mesh)
int CustomData_number_of_layers(const struct CustomData *data, int type)
void CustomData_interp(const struct CustomData *source, struct CustomData *dest, const int *src_indices, const float *weights, const float *sub_weights, int count, int dest_index)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
UvMapVert * BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v)
UvVertMap * BKE_mesh_uv_vert_map_create(const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, const float limit[2], bool selected, bool use_winding)
void BKE_mesh_uv_vert_map_free(UvVertMap *vmap)
#define STD_UV_CONNECT_LIMIT
void multires_modifier_update_mdisps(struct DerivedMesh *dm, struct Scene *scene)
void multires_modifier_update_hidden(struct DerivedMesh *dm)
General operations, lookup, etc. for blender objects.
A BVH for high poly meshes.
int get_render_subsurf_level(const struct RenderData *r, int lvl, bool for_render)
@ MULTIRES_HIDDEN_MODIFIED
@ MULTIRES_COORDS_MODIFIED
@ SUBSURF_ALLOC_PAINT_MASK
@ SUBSURF_USE_RENDER_PARAMS
@ SUBSURF_IGNORE_SIMPLIFY
A (mainly) macro array library.
#define BLI_array_grow_items(arr, num)
#define BLI_array_declare(arr)
#define BLI_array_clear(arr)
#define BLI_array_free(arr)
void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP free_value)
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val)
bool BLI_edgeset_add(EdgeSet *es, unsigned int v0, unsigned int v1)
EdgeSet * BLI_edgeset_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_edgeset_free(EdgeSet *es)
#define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(totpoly)
EdgeHash * BLI_edgehash_new_ex(const char *info, unsigned int nentries_reserve)
void * BLI_edgehash_lookup(const EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
struct MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
void BLI_rw_mutex_end(ThreadRWMutex *mutex)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
#define THREAD_LOCK_WRITE
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
void BLI_rw_mutex_init(ThreadRWMutex *mutex)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
#define UNUSED_FUNCTION(x)
#define POINTER_FROM_INT(i)
#define POINTER_AS_UINT(i)
#define POINTER_AS_INT(i)
#define POINTER_FROM_UINT(i)
void ccgSubSurf_initFaceIterator(CCGSubSurf *ss, CCGFaceIterator *fiter)
int ccgSubSurf_getNumFinalEdges(const CCGSubSurf *ss)
int ccgSubSurf_getNumFaces(const CCGSubSurf *ss)
CCGVert * ccgVertIterator_getCurrent(CCGVertIterator *vi)
void ccgVertIterator_next(CCGVertIterator *vi)
int ccgSubSurf_getVertNumFaces(CCGVert *v)
CCGFace * ccgSubSurf_getVertFace(CCGVert *v, int index)
int ccgSubSurf_getNumFinalFaces(const CCGSubSurf *ss)
int ccgFaceIterator_isStopped(CCGFaceIterator *fi)
CCGSubSurf * ccgSubSurf_new(CCGMeshIFC *ifc, int subdivLevels, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator)
int ccgEdgeIterator_isStopped(CCGEdgeIterator *ei)
void * ccgSubSurf_getVertData(CCGSubSurf *ss, CCGVert *v)
void ccgSubSurf_initEdgeIterator(CCGSubSurf *ss, CCGEdgeIterator *eiter)
void ccgSubSurf_setNumLayers(CCGSubSurf *ss, int numLayers)
int ccgSubSurf_getNumVerts(const CCGSubSurf *ss)
void * ccgSubSurf_getFaceUserData(CCGSubSurf *ss, CCGFace *f)
CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGVertHDL *vHDLs, CCGFace **f_r)
int ccgSubSurf_getSubdivisionLevels(const CCGSubSurf *ss)
CCGVert * ccgSubSurf_getEdgeVert0(CCGEdge *e)
CCGVert * ccgSubSurf_getFaceVert(CCGFace *f, int index)
void * ccgSubSurf_getFaceGridData(CCGSubSurf *ss, CCGFace *f, int gridIndex, int x, int y)
CCGError ccgSubSurf_processSync(CCGSubSurf *ss)
int ccgSubSurf_getVertNumEdges(CCGVert *v)
CCGError ccgSubSurf_setCalcVertexNormals(CCGSubSurf *ss, int useVertNormals, int normalDataOffset)
CCGFace * ccgSubSurf_getFace(CCGSubSurf *ss, CCGFaceHDL f)
CCGError ccgSubSurf_syncVert(CCGSubSurf *ss, CCGVertHDL vHDL, const void *vertData, int seam, CCGVert **v_r)
int ccgSubSurf_getSimpleSubdiv(const CCGSubSurf *ss)
int ccgSubSurf_getGridSize(const CCGSubSurf *ss)
void * ccgSubSurf_getEdgeDataArray(CCGSubSurf *ss, CCGEdge *e)
float ccgSubSurf_getEdgeCrease(CCGEdge *e)
void * ccgSubSurf_getFaceGridEdgeData(CCGSubSurf *ss, CCGFace *f, int gridIndex, int x)
CCGEdgeHDL ccgSubSurf_getEdgeEdgeHandle(CCGEdge *e)
void * ccgSubSurf_getFaceCenterData(CCGFace *f)
CCGVert * ccgSubSurf_getEdgeVert1(CCGEdge *e)
void ccgEdgeIterator_next(CCGEdgeIterator *ei)
void ccgSubSurf_initVertIterator(CCGSubSurf *ss, CCGVertIterator *viter)
void ccgSubSurf_getUseAgeCounts(CCGSubSurf *ss, int *useAgeCounts_r, int *vertUserOffset_r, int *edgeUserOffset_r, int *faceUserOffset_r)
CCGFaceHDL ccgSubSurf_getFaceFaceHandle(CCGFace *f)
void * ccgSubSurf_getVertUserData(CCGSubSurf *ss, CCGVert *v)
void ccgSubSurf_setAllocMask(CCGSubSurf *ss, int allocMask, int maskOffset)
void ccgSubSurf_free(CCGSubSurf *ss)
CCGError ccgSubSurf_initFullSync(CCGSubSurf *ss)
CCGError ccgSubSurf_setUseAgeCounts(CCGSubSurf *ss, int useAgeCounts, int vertUserOffset, int edgeUserOffset, int faceUserOffset)
CCGEdge * ccgEdgeIterator_getCurrent(CCGEdgeIterator *ei)
int ccgSubSurf_getNumEdges(const CCGSubSurf *ss)
int ccgSubSurf_getNumFinalVerts(const CCGSubSurf *ss)
CCGEdge * ccgSubSurf_getVertEdge(CCGVert *v, int index)
void * ccgSubSurf_getEdgeData(CCGSubSurf *ss, CCGEdge *e, int x)
void ccgFaceIterator_next(CCGFaceIterator *fi)
int ccgVertIterator_isStopped(CCGVertIterator *vi)
int ccgSubSurf_getEdgeNumFaces(CCGEdge *e)
CCGEdge * ccgSubSurf_getFaceEdge(CCGFace *f, int index)
int ccgSubSurf_getEdgeSize(const CCGSubSurf *ss)
void * ccgSubSurf_getEdgeUserData(CCGSubSurf *ss, CCGEdge *e)
CCGError ccgSubSurf_setSubdivisionLevels(CCGSubSurf *ss, int subdivisionLevels)
CCGVertHDL ccgSubSurf_getVertVertHandle(CCGVert *v)
void * ccgSubSurf_getFaceGridDataArray(CCGSubSurf *ss, CCGFace *f, int gridIndex)
CCGError ccgSubSurf_syncEdge(CCGSubSurf *ss, CCGEdgeHDL eHDL, CCGVertHDL e_vHDL0, CCGVertHDL e_vHDL1, float crease, CCGEdge **e_r)
CCGFace * ccgFaceIterator_getCurrent(CCGFaceIterator *fi)
int ccgSubSurf_getFaceNumVerts(CCGFace *f)
@ eSubsurfModifierFlag_Incremental
@ eSubsurfModifierFlag_DebugIncr
@ eSubsurfModifierFlag_ControlEdges
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
_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 type
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
#define MEM_SIZE_OPTIMAL(size)
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE void * atomic_cas_ptr(void **v, void *old, void *_new)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual int getNumEdges() const
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void(* free)(CCGAllocatorHDL a, void *ptr)
void(* release)(CCGAllocatorHDL a)
void *(* realloc)(CCGAllocatorHDL a, void *ptr, int newSize, int oldSize)
void *(* alloc)(CCGAllocatorHDL a, int numBytes)
struct MeshElemMap * pmap
struct CCGFace ** gridFaces
struct DMFlagMat * faceFlags
struct CCGDerivedMesh::@72 * edgeMap
struct CCGDerivedMesh::@74 multires
struct MultiresModifierData * mmd
MultiresModifiedFlags modified_flags
ThreadMutex loops_cache_lock
unsigned int ** gridHidden
struct CCGDerivedMesh::@71 * vertMap
struct CCGElem ** gridData
struct CCGDerivedMesh::@73 * faceMap
struct DMFlagMat * gridFlagMats
ThreadRWMutex origindex_cache_rwlock
int(* getGridSize)(DerivedMesh *dm)
struct MLoop *(* getLoopArray)(DerivedMesh *dm)
void(* getVertNo)(DerivedMesh *dm, int index, float r_no[3])
void *(* getVertDataArray)(DerivedMesh *dm, int type)
DMFlagMat *(* getGridFlagMats)(DerivedMesh *dm)
struct MVert *(* getVertArray)(DerivedMesh *dm)
void(* copyLoopArray)(DerivedMesh *dm, struct MLoop *r_loop)
void(* copyEdgeArray)(DerivedMesh *dm, struct MEdge *r_edge)
int(* getNumVerts)(DerivedMesh *dm)
void(* copyPolyArray)(DerivedMesh *dm, struct MPoly *r_poly)
int(* getNumPolys)(DerivedMesh *dm)
int(* getNumEdges)(DerivedMesh *dm)
struct DerivedMesh::@16 looptris
struct CCGElem **(* getGridData)(DerivedMesh *dm)
int(* getNumGrids)(DerivedMesh *dm)
struct MLoopTri * array_wip
void(* copyVertArray)(DerivedMesh *dm, struct MVert *r_vert)
void *(* getPolyDataArray)(DerivedMesh *dm, int type)
unsigned int **(* getGridHidden)(DerivedMesh *dm)
void *(* getEdgeDataArray)(DerivedMesh *dm, int type)
struct MEdge *(* getEdgeArray)(DerivedMesh *dm)
void(* getGridKey)(DerivedMesh *dm, struct CCGKey *key)
struct MPoly *(* getPolyArray)(DerivedMesh *dm)
void(* recalcLoopTri)(DerivedMesh *dm)
void(* release)(DerivedMesh *dm)
void(* getVertCo)(DerivedMesh *dm, int index, float r_co[3])
int(* getNumLoops)(DerivedMesh *dm)
int *(* getGridOffset)(DerivedMesh *dm)
unsigned short loop_of_poly_index
FaceVertWeightEntry * weight_table
static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edgeSize, int gridSize)
static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float r_co[3])
static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, DerivedMesh *dm, bool useSubsurfUv)
static CCGSubSurf * _getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int numLayers, CCGFlags flags)
struct FaceVertWeightEntry FaceVertWeightEntry
static void * arena_realloc(CCGAllocatorHDL a, void *ptr, int newSize, int oldSize)
float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE]
static float * get_ss_weights(WeightTable *wtable, int gridCuts, int faceLen)
static void set_default_ccgdm_callbacks(CCGDerivedMesh *ccgdm)
static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm, const MLoopUV *mloopuv)
static CCGElem ** ccgDM_getGridData(DerivedMesh *dm)
static void ccgdm_create_grids(DerivedMesh *dm)
static void copyFinalLoopArray_task_cb(void *__restrict userdata, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
static void * ccgDM_get_vert_data_layer(DerivedMesh *dm, int type)
BLI_INLINE void ccgDM_to_MVert(MVert *mv, const CCGKey *key, CCGElem *elem)
static void UNUSED_FUNCTION() ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
static void ccgDM_copyFinalPolyArray(DerivedMesh *dm, MPoly *mpoly)
static int getEdgeIndex(CCGSubSurf *ss, CCGEdge *e, int x, int edgeSize)
static void free_ss_weights(WeightTable *wtable)
static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f)
static int ccgDM_getNumEdges(DerivedMesh *dm)
static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v)
static void minmax_v3_v3v3(const float vec[3], float min[3], float max[3])
static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e)
static void * ccgDM_get_poly_data_layer(DerivedMesh *dm, int type)
static int ccgDM_getNumVerts(DerivedMesh *dm)
static DMFlagMat * ccgDM_getGridFlagMats(DerivedMesh *dm)
struct DerivedMesh * subsurf_make_derived_from_derived(struct DerivedMesh *dm, struct SubsurfModifierData *smd, const struct Scene *scene, float(*vertCos)[3], SubsurfFlags flags)
static int ccgDM_getNumGrids(DerivedMesh *dm)
static int * ccgDM_getGridOffset(DerivedMesh *dm)
static int ccgDM_getNumLoops(DerivedMesh *dm)
void subsurf_calculate_limit_positions(Mesh *me, float(*r_positions)[3])
static void ccgDM_release(DerivedMesh *dm)
static void get_face_uv_map_vert(UvVertMap *vmap, struct MPoly *mpoly, struct MLoop *ml, int fi, CCGVertHDL *fverts)
static void ccgDM_recalcLoopTri(DerivedMesh *dm)
static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, float(*vertexCos)[3], int useFlatSubdiv)
static int ccgDM_getGridSize(DerivedMesh *dm)
BLI_INLINE void ccgDM_to_MEdge(MEdge *med, const int v1, const int v2, const short flag)
static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float r_no[3])
static void arena_free(CCGAllocatorHDL UNUSED(a), void *UNUSED(ptr))
static void * arena_alloc(CCGAllocatorHDL a, int numBytes)
static void arena_release(CCGAllocatorHDL a)
static int ccgDM_getNumPolys(DerivedMesh *dm)
static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, float(*vertexCos)[3], int use_flat_subdiv, bool UNUSED(use_subdiv_uvs))
static BLI_bitmap ** ccgDM_getGridHidden(DerivedMesh *dm)
static void set_subsurf_legacy_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result, int n)
struct CopyFinalLoopArrayData CopyFinalLoopArrayData
static CCGElem * get_vertex_elem(CCGDerivedMesh *ccgdm, int vertNum)
static void * ccgDM_get_edge_data_layer(DerivedMesh *dm, int type)
static void create_ccgdm_maps(CCGDerivedMesh *ccgdm, CCGSubSurf *ss)
static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
static CCGDerivedMesh * getCCGDerivedMesh(CCGSubSurf *ss, int drawInteriorEdges, int useSubsurfUv, DerivedMesh *dm)
static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result, int layer_index)
static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
static void ccgDM_getGridKey(DerivedMesh *dm, CCGKey *key)
static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
struct WeightTable WeightTable