[Bf-blender-cvs] [7806b1ed817] soc-2019-adaptive-cloth: Cloth: remove uv islands from bmesh
ishbosamiya
noreply at git.blender.org
Wed Jul 10 15:33:16 CEST 2019
Commit: 7806b1ed8170b3cf938d7207dae69f0f87987376
Author: ishbosamiya
Date: Wed Jul 10 12:27:13 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB7806b1ed8170b3cf938d7207dae69f0f87987376
Cloth: remove uv islands from bmesh
===================================================================
M source/blender/blenkernel/intern/cloth_remeshing.cpp
===================================================================
diff --git a/source/blender/blenkernel/intern/cloth_remeshing.cpp b/source/blender/blenkernel/intern/cloth_remeshing.cpp
index 58e146cc1ed..feefc035bcf 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -88,109 +88,6 @@ static CustomData_MeshMasks cloth_remeshing_get_cd_mesh_masks(void)
return cddata_masks;
}
-/* copied from uvedit_ops.c uv_seams_from_islands_exec() */
-/* TODO(Ish): it seems that it can be ported to finding it for the
- * edge indivially, do this later to preserve user defined seams */
-static void cloth_remeshing_uv_from_islands(BMesh *bm)
-{
- const float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT};
- const bool mark_seams = true;
- const bool mark_sharp = false;
-
- UvVertMap *vmap;
- BMEdge *editedge;
- BMIter iter;
-
- /* This code sets editvert->tmp.l to the index. This will be useful later on. */
- BM_mesh_elem_table_ensure(bm, BM_FACE);
- vmap = BM_uv_vert_map_create(bm, limit, false, false);
-
- BM_ITER_MESH (editedge, &iter, bm, BM_EDGES_OF_MESH) {
- /* flags to determine if we uv is separated from first editface match */
- char separated1 = 0, separated2;
- /* set to denote edge must be flagged as seam */
- char faces_separated = 0;
- /* flag to keep track if uv1 is disconnected from first editface match */
- char v1coincident = 1;
- /* For use with v1coincident. v1coincident will change only if we've had commonFaces */
- int commonFaces = 0;
-
- BMFace *efa1, *efa2;
-
- UvMapVert *mv1, *mvinit1, *mv2, *mvinit2, *mviter;
- /* mv2cache stores the first of the list of coincident uv's for later comparison
- * mv2sep holds the last separator and is copied to mv2cache
- * when a hit is first found */
- UvMapVert *mv2cache = NULL, *mv2sep = NULL;
-
- mvinit1 = vmap->vert[BM_elem_index_get(editedge->v1)];
- if (mark_seams) {
- BM_elem_flag_disable(editedge, BM_ELEM_SEAM);
- }
-
- for (mv1 = mvinit1; mv1 && !faces_separated; mv1 = mv1->next) {
- if (mv1->separate && commonFaces) {
- v1coincident = 0;
- }
-
- separated2 = 0;
- efa1 = BM_face_at_index(bm, mv1->poly_index);
- mvinit2 = vmap->vert[BM_elem_index_get(editedge->v2)];
-
- for (mv2 = mvinit2; mv2; mv2 = mv2->next) {
- if (mv2->separate) {
- mv2sep = mv2;
- }
-
- efa2 = BM_face_at_index(bm, mv2->poly_index);
- if (efa1 == efa2) {
- /* if v1 is not coincident no point in comparing */
- if (v1coincident) {
- /* have we found previously anything? */
- if (mv2cache) {
- /* flag seam unless proved to be coincident with previous hit */
- separated2 = 1;
- for (mviter = mv2cache; mviter; mviter = mviter->next) {
- if (mviter->separate && mviter != mv2cache) {
- break;
- }
- /* coincident with previous hit, do not flag seam */
- if (mviter == mv2) {
- separated2 = 0;
- }
- }
- }
- /* First hit case, store the hit in the cache */
- else {
- mv2cache = mv2sep;
- commonFaces = 1;
- }
- }
- else {
- separated1 = 1;
- }
-
- if (separated1 || separated2) {
- faces_separated = 1;
- break;
- }
- }
- }
- }
-
- if (faces_separated) {
- if (mark_seams) {
- BM_elem_flag_enable(editedge, BM_ELEM_SEAM);
- }
- if (mark_sharp) {
- BM_elem_flag_disable(editedge, BM_ELEM_SMOOTH);
- }
- }
- }
-
- BM_uv_vert_map_free(vmap);
-}
-
static void cloth_remeshing_init_bmesh(Object *ob, ClothModifierData *clmd, Mesh *mesh)
{
if (clmd->sim_parms->remeshing_reset || !clmd->clothObject->bm_prev) {
More information about the Bf-blender-cvs
mailing list