Commit: eed6abb27df3d1e4ab11c62e37e06dee7478a8db
Author: Phil Gosch
Date:   Fri Jun 3 11:28:58 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rBeed6abb27df3d1e4ab11c62e37e06dee7478a8db

WIP: Select Shortest Path: Directly set the MLOOPUV_*SEL selection tags

To get the edges tagged for selection from the parametrizer data structures we 
need to directly set the flag of MLoopUV

===================================================================

M       source/blender/editors/uvedit/uvedit_parametrizer.c
M       source/blender/editors/uvedit/uvedit_parametrizer.h
M       source/blender/editors/uvedit/uvedit_unwrap_ops.c

===================================================================

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c 
b/source/blender/editors/uvedit/uvedit_parametrizer.c
index ef48ef5..97fef19 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -684,7 +684,7 @@ static void p_flush_uvs(PHandle *handle, PChart *chart)
        /* ToDo (SaphireS): Find sensible variable names*/
        int MLOOPEDGE_SELECTED = (1 << 0); /* MLOOPUV_EDGESEL*/
        int MLOOPVERT_SELECTED = (1 << 1); /* MLOOPUV_VERTSEL*/
-
+       printf("--- DEBUG (SaphireS): p_flush_uvs() reached\n");
        for (e = chart->edges; e; e = e->nextlink) {
                if (e->orig_uv) {
                        e->orig_uv[0] = e->vert->uv[0] / handle->aspx;
@@ -694,11 +694,14 @@ static void p_flush_uvs(PHandle *handle, PChart *chart)
                /* ToDo (SaphireS): Move to own p_flush_uvs_selection() 
function ?*/
                if (e->flag & PEDGE_SELECT) {
                        //if (e->orig_flag) {
+                       printf("--- DEBUG (SaphireS): PEDGE_SELECT tagged edge 
found\n");
                                //printf("---param_flush_uvs: orig_flag 
found\n");
-                               sel_flag = e->orig_flag;
+                               sel_flag = *e->orig_flag;
                                sel_flag |= MLOOPEDGE_SELECTED;/* 
MLOOPUV_EDGESEL*/
                                sel_flag |= MLOOPVERT_SELECTED; /* 
MLOOPUV_VERTSEL*/
-                               e->orig_flag = sel_flag; //sel_flag
+                               printf("--- DEBUG (SaphireS): before 
*(e->orig_flag) = sel_flag;\n");
+                               *(e->orig_flag) = sel_flag; //sel_flag
+                               printf("--- DEBUG (SaphireS): after 
*(e->orig_flag) = sel_flag;\n");
                        //}
                }
        }
@@ -1117,7 +1120,7 @@ static PFace *p_face_add(PHandle *handle)
 
 static PFace *p_face_add_construct(PHandle *handle, ParamKey key, ParamKey 
*vkeys,
                                    float *co[4], float *uv[4], int i1, int i2, 
int i3,
-                                   ParamBool *pin, ParamBool *select, int 
flag[4])
+                                   ParamBool *pin, ParamBool *select, int 
**flag)
 {
        PFace *f = p_face_add(handle);
        PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
@@ -4178,7 +4181,7 @@ void param_delete(ParamHandle *handle)
 
 static void p_add_ngon(ParamHandle *handle, ParamKey key, int nverts,
                        ParamKey *vkeys, float **co, float **uv,
-                                          ParamBool *pin, ParamBool *select, 
const float normal[3], int *flag)
+                                          ParamBool *pin, ParamBool *select, 
const float normal[3], int **flag)
 {
        int *boundary = BLI_array_alloca(boundary, nverts);
 
@@ -4232,7 +4235,7 @@ static void p_add_ngon(ParamHandle *handle, ParamKey key, 
int nverts,
                        ParamKey tri_vkeys[3] = {vkeys[v0], vkeys[v1], 
vkeys[v2]};
                        float *tri_co[3] = {co[v0], co[v1], co[v2]};
                        float *tri_uv[3] = {uv[v0], uv[v1], uv[v2]};
-                       int tri_flag[3] = {flag[v0], flag[v1], flag[v2]};
+                       int *tri_flag[3] = {flag[v0], flag[v1], flag[v2]};
                        ParamBool tri_pin[3] = {pin[v0], pin[v1], pin[v2]};
                        ParamBool tri_select[3] = {select[v0], select[v1], 
select[v2]};
 
@@ -4249,7 +4252,7 @@ static void p_add_ngon(ParamHandle *handle, ParamKey key, 
int nverts,
 
 void param_face_add(ParamHandle *handle, ParamKey key, int nverts,
                     ParamKey *vkeys, float *co[4], float *uv[4],
-                    ParamBool *pin, ParamBool *select, float normal[3], int 
flag[4])
+                    ParamBool *pin, ParamBool *select, float normal[3], int 
**flag)
 {
        PHandle *phandle = (PHandle *)handle;
 
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h 
b/source/blender/editors/uvedit/uvedit_parametrizer.h
index 8223e44..5fc66f1 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -64,7 +64,7 @@ void param_face_add(ParamHandle *handle,
                     ParamBool *pin,
                     ParamBool *select,
                     float face_normal[3], 
-                                       int flag[4]);
+                                       int **flag);
 
 void param_edge_set_seam(ParamHandle *handle,
                          ParamKey *vkeys);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c 
b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 347cc6e..60339aa 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -235,7 +235,7 @@ static void construct_param_handle_face_add(ParamHandle 
*handle, Scene *scene,
        ParamBool *select = BLI_array_alloca(select, efa->len);
        float **co = BLI_array_alloca(co, efa->len);
        float **uv = BLI_array_alloca(uv, efa->len);
-       int *flag = BLI_array_alloca(flag, efa->len);
+       int **flag = BLI_array_alloca(flag, efa->len);
        int i;
 
        BMIter liter;
@@ -252,7 +252,7 @@ static void construct_param_handle_face_add(ParamHandle 
*handle, Scene *scene,
                co[i] = l->v->co;
                uv[i] = luv->uv;
                pin[i] = (luv->flag & MLOOPUV_PINNED) != 0;
-               flag[i] = luv->flag;
+               flag[i] = &(luv->flag);
                select[i] = uvedit_uv_select_test(scene, l, cd_loop_uv_offset);
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to