Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/subsurf_ccg.c
| Show First 20 Lines • Show All 1,548 Lines • ▼ Show 20 Lines | if (index != -1) { | ||||
| func(userData, index, CCG_elem_offset_co(&key, edgeData, i), CCG_elem_offset_co(&key, edgeData, i + 1)); | func(userData, index, CCG_elem_offset_co(&key, edgeData, i), CCG_elem_offset_co(&key, edgeData, i + 1)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ccgEdgeIterator_free(ei); | ccgEdgeIterator_free(ei); | ||||
| } | } | ||||
| static void ccgDM_foreachMappedLoop( | |||||
| DerivedMesh *dm, | |||||
| void (*func)(void *userData, int vertex_index, int face_index, const float co[3], const float no[3]), | |||||
| void *userData, | |||||
| DMForeachFlag flag) | |||||
| { | |||||
| /* We can't use dm->getLoopDataLayout(dm) here, we want to always access dm->loopData, EditDerivedBMesh would | |||||
| * return loop data from bmesh itself. */ | |||||
| const float (*lnors)[3] = (flag & DM_FOREACH_USE_NORMAL) ? DM_get_loop_data_layer(dm, CD_NORMAL) : NULL; | |||||
| MVert *mv = dm->getVertArray(dm); | |||||
campbellbarton: prefer not to commit this really large chunk if its not used. For archival purposes it can… | |||||
| MLoop *ml = dm->getLoopArray(dm); | |||||
| MPoly *mp = dm->getPolyArray(dm); | |||||
| const int *v_index = dm->getVertDataArray(dm, CD_ORIGINDEX); | |||||
| const int *f_index = dm->getPolyDataArray(dm, CD_ORIGINDEX); | |||||
| int p_idx, i; | |||||
| for (p_idx = 0; p_idx < dm->numPolyData; ++p_idx, ++mp) { | |||||
| for (i = 0; i < mp->totloop; ++i, ++ml) { | |||||
| const int v_idx = v_index ? v_index[ml->v] : ml->v; | |||||
| const int f_idx = f_index ? f_index[p_idx] : p_idx; | |||||
| const float *no = lnors ? *lnors++ : NULL; | |||||
| if (!ELEM(ORIGINDEX_NONE, v_idx, f_idx)) { | |||||
| func(userData, v_idx, f_idx, mv[ml->v].co, no); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| static void ccgDM_drawVerts(DerivedMesh *dm) | static void ccgDM_drawVerts(DerivedMesh *dm) | ||||
| { | { | ||||
| CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm; | CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm; | ||||
| CCGSubSurf *ss = ccgdm->ss; | CCGSubSurf *ss = ccgdm->ss; | ||||
| int edgeSize = ccgSubSurf_getEdgeSize(ss); | int edgeSize = ccgSubSurf_getEdgeSize(ss); | ||||
| int gridSize = ccgSubSurf_getGridSize(ss); | int gridSize = ccgSubSurf_getGridSize(ss); | ||||
| CCGVertIterator *vi; | CCGVertIterator *vi; | ||||
| CCGEdgeIterator *ei; | CCGEdgeIterator *ei; | ||||
| ▲ Show 20 Lines • Show All 1,891 Lines • ▼ Show 20 Lines | #endif | ||||
| ccgdm->dm.calcNormals = ccgDM_calcNormals; | ccgdm->dm.calcNormals = ccgDM_calcNormals; | ||||
| ccgdm->dm.calcLoopNormals = CDDM_calc_loop_normals; | ccgdm->dm.calcLoopNormals = CDDM_calc_loop_normals; | ||||
| ccgdm->dm.recalcTessellation = ccgDM_recalcTessellation; | ccgdm->dm.recalcTessellation = ccgDM_recalcTessellation; | ||||
| ccgdm->dm.getVertCos = ccgdm_getVertCos; | ccgdm->dm.getVertCos = ccgdm_getVertCos; | ||||
| ccgdm->dm.foreachMappedVert = ccgDM_foreachMappedVert; | ccgdm->dm.foreachMappedVert = ccgDM_foreachMappedVert; | ||||
| ccgdm->dm.foreachMappedEdge = ccgDM_foreachMappedEdge; | ccgdm->dm.foreachMappedEdge = ccgDM_foreachMappedEdge; | ||||
| ccgdm->dm.foreachMappedLoop = ccgDM_foreachMappedLoop; | |||||
| ccgdm->dm.foreachMappedFaceCenter = ccgDM_foreachMappedFaceCenter; | ccgdm->dm.foreachMappedFaceCenter = ccgDM_foreachMappedFaceCenter; | ||||
| ccgdm->dm.drawVerts = ccgDM_drawVerts; | ccgdm->dm.drawVerts = ccgDM_drawVerts; | ||||
| ccgdm->dm.drawEdges = ccgDM_drawEdges; | ccgdm->dm.drawEdges = ccgDM_drawEdges; | ||||
| ccgdm->dm.drawLooseEdges = ccgDM_drawLooseEdges; | ccgdm->dm.drawLooseEdges = ccgDM_drawLooseEdges; | ||||
| ccgdm->dm.drawFacesSolid = ccgDM_drawFacesSolid; | ccgdm->dm.drawFacesSolid = ccgDM_drawFacesSolid; | ||||
| ccgdm->dm.drawFacesTex = ccgDM_drawFacesTex; | ccgdm->dm.drawFacesTex = ccgDM_drawFacesTex; | ||||
| ccgdm->dm.drawFacesGLSL = ccgDM_drawFacesGLSL; | ccgdm->dm.drawFacesGLSL = ccgDM_drawFacesGLSL; | ||||
| ▲ Show 20 Lines • Show All 479 Lines • Show Last 20 Lines | |||||
prefer not to commit this really large chunk if its not used. For archival purposes it can remain in this diff?