Revision: 60931
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60931
Author:   walid
Date:     2013-10-25 21:36:37 +0000 (Fri, 25 Oct 2013)
Log Message:
-----------
Code rewrite:
-removing unused definitions from bmesh_data_transfer.h
-code clean up for bmesh_data_transfer.c
-removing unused datatype from bmesh_data_transfer.c
-rewiring the calls from BM_mesh_data_copy2 to
BM_mesh_data_copy

Modified Paths:
--------------
    
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
    
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h
    branches/soc-2013-meshdata_transfer/source/blender/editors/mesh/mesh_data.c
    
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_shapekey.c
    
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c

Modified: 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
===================================================================
--- 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
        2013-10-25 14:12:22 UTC (rev 60930)
+++ 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
        2013-10-25 21:36:37 UTC (rev 60931)
@@ -45,27 +45,6 @@
 #include "BKE_bvhutils.h"                              //using the bvhutils.h
 #include "BKE_deform.h"
 
-//----------------stub-----------------------------------
-///shall be rewired to the main function after the rewrite
-bool BM_mesh_data_copy(BMesh *UNUSED(bm_src), BMesh* UNUSED(bm_dst), int 
UNUSED(type), const struct ReplaceLayerInfo *UNUSED(replace_info), bool 
UNUSED(relative_to_target),
-                  float UNUSED(tmp_mat[4][4]), bool UNUSED(use_tolerance), 
float UNUSED(tolerance))
-{
-       return true;
-}
-
-//******************
-//----------------------*
-//---------------------------*
-//Code rewrite starts!------------*
-//---------------------------*
-//----------------------*
-//******************
-
-typedef struct BMVert_match {
-       BMVert *v_src;
-       BMVert *v_dst;
-} BMVert_match;
-
 //---------------Declarations------------------------------
 
 //---------------helping functions declarations -----------
@@ -100,19 +79,11 @@
 
 //---------------Definitions---------------------------
 
-bool BM_mesh_data_copy2(BMesh *bm_src, BMesh* bm_dst, const struct 
ReplaceLayerInfo *replace_info, int type,
-                        TransferMode transfer_mode)
+bool BM_mesh_data_copy(BMesh *bm_src, BMesh* bm_dst, const struct 
ReplaceLayerInfo *replace_info, int type,
+                       TransferMode transfer_mode, bool 
UNUSED(relative_to_target), float UNUSED(tmp_mat[4][4]),
+                       bool UNUSED(use_tolerance), float UNUSED(tolerance))
 {
 
-/*     BMFace *f_src, *f_dst;
-       BMVert *v_src, *v_dst;
-       BMIter fiter, UNUSED(liter), iter;
-       int a;
-*/
-       //stub
-//     TransferMode transfer_mode = TRANSFER_BY_INDEX;         //working for 
the UV, Colors & DeformVert
-//     TransferMode transfer_mode = TRANSFER_BY_TOPOLOGY;
-
 //+-------------+
 //|                            |
 //|    Block 1         |       //get a tree for the source (using 
BKE_bmbvh_new)

Modified: 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h
===================================================================
--- 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h
        2013-10-25 14:12:22 UTC (rev 60930)
+++ 
branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h
        2013-10-25 21:36:37 UTC (rev 60931)
@@ -54,39 +54,9 @@
        TRANSFER_BY_INTERPOLATION = 3,
 } TransferMode;
 
-struct BM_loops_per_face_mapping;
+bool BM_mesh_data_copy(BMesh *bm_src, BMesh* bm_dst, const struct 
ReplaceLayerInfo *replace_info, int type,
+                        TransferMode transfer_mode, bool relative_to_target, 
float tmp_mat[4][4], bool use_tolerance,
+                        float tolerance);
 
-bool BKE_bmesh_calc_relative_deform(const int v_count, const float 
(*vert_cos_src)[], const float (*vert_cos_dst)[],
-                                                                       const 
float (*vert_cos_org)[],  float (*vert_cos_new)[]);
-bool BM_edge_has_consistant_loops(BMEdge *e, int CD_offset);
-bool BM_loop_in_loops(BMLoop **l_grp, int len, BMLoop *l);
-
-void mid_poly_v2(float r[2], float v[][2], const int n);
-void mid_poly_v3(float r[3], float v[][3], const int n);
-
-//Semi-finished WIP
-bool BM_mesh_shapekey_copy(BMesh *bm_src, BMesh *bm_dst, float tolerance, 
float radius_interp,
-                           int interp_pow, int no_pow, bool USE_NORMALS, const 
struct ReplaceLayerInfo replace_info,
-                           bool auto_tol, float auto_tol_percentage);
-
-//old/WIP implementation: projection based on looping vertices instead of faces
-bool BM_mesh_shapekey_copy2(BMesh *bm_src, BMesh* bm_dst, const struct 
ReplaceLayerInfo replace_info, bool relative_to_target,
-                            float tmp_mat[4][4]);
-
-//WIP spatial transfer for the UVs
-bool BM_mesh_uv_copy(BMesh *bm_src,BMesh *bm_dst, float tolerance, float 
radius_interp, int dist_pow, int no_pow,
-                     bool USE_NORMALS);
-
-//the projection functions
-bool BM_mesh_uv_copy2(BMesh *bm_src, BMesh *bm_dst, const struct 
ReplaceLayerInfo replace_info, bool relative_to_target,
-                      float tmp_mat[4][4]);
-
-bool BM_mesh_multi_layer_copy(BMesh* bm_src, BMesh *bm_dst, const struct 
ReplaceLayerInfo replace_info, int type, void *weights,
-                              struct BM_loops_per_face_mapping *fl_table);
-bool BM_mesh_data_copy(BMesh *bm_src, BMesh* bm_dst, int type, const struct 
ReplaceLayerInfo *replace_info, bool relative_to_target,
-                  float tmp_mat[4][4], bool use_tolerance, float tolerance);
-bool BM_mesh_data_copy2(BMesh *bm_src, BMesh* bm_dst, const struct 
ReplaceLayerInfo *replace_info, int type,
-                        TransferMode transfer_mode);
-
 #endif /* __BMESH_DATA_TRANSFER_H__ */
 

Modified: 
branches/soc-2013-meshdata_transfer/source/blender/editors/mesh/mesh_data.c
===================================================================
--- branches/soc-2013-meshdata_transfer/source/blender/editors/mesh/mesh_data.c 
2013-10-25 14:12:22 UTC (rev 60930)
+++ branches/soc-2013-meshdata_transfer/source/blender/editors/mesh/mesh_data.c 
2013-10-25 21:36:37 UTC (rev 60931)
@@ -580,15 +580,11 @@
        BM_mesh_bm_from_me(bm_src, me_src, TRUE, true, 0);      //TRUE -> 
should transfer shapekeys too!!
        BM_mesh_bm_from_me(bm_dst, me_dst, TRUE, true, 0);
 
-       if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPUV, &replace_info, 
relative_to_target, tmp_mat, use_tolerance,
-                                                  tolerance2)) {
+       if (!BM_mesh_data_copy(bm_src, bm_dst, &replace_info, CD_MLOOPUV, 
transfer_mode, relative_to_target, tmp_mat,
+                              use_tolerance, tolerance2)) {
                return false;
        }
 
-       if(!BM_mesh_data_copy2(bm_src, bm_dst, &replace_info, CD_MLOOPUV, 
transfer_mode)) {
-               return false;
-       }
-
        //transfer the BMesh back to Mesh
        BM_mesh_bm_to_me(bm_src, me_src, FALSE);
        BM_mesh_bm_to_me(bm_dst, me_dst, TRUE);
@@ -841,14 +837,11 @@
        BM_mesh_bm_from_me(bm_src, me_src, TRUE, true, 0);      //TRUE -> 
should transfer shapekeys too!!
        BM_mesh_bm_from_me(bm_dst, me_dst, TRUE, true, 0);
 
-       if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPCOL, &replace_info, 
relative_to_target, tmp_mat, use_tolerance,
-                                                  tolerance2)) {
+       if (!BM_mesh_data_copy(bm_src, bm_dst, &replace_info, CD_MLOOPCOL, 
transfer_mode, relative_to_target, tmp_mat,
+                              use_tolerance, tolerance2)) {
                return false;
        }
 
-       if(!BM_mesh_data_copy2(bm_src, bm_dst, &replace_info, CD_MLOOPCOL, 
transfer_mode)) {
-               return false;
-       }
 
        //transfer the BMesh back to Mesh
        BM_mesh_bm_to_me(bm_src, me_src, FALSE);

Modified: 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_shapekey.c
===================================================================
--- 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_shapekey.c
 2013-10-25 14:12:22 UTC (rev 60930)
+++ 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_shapekey.c
 2013-10-25 21:36:37 UTC (rev 60931)
@@ -525,15 +525,11 @@
        BM_mesh_bm_from_me(bm_src, me_src, TRUE, true, 0);      //TRUE -> 
should transfer shapekeys too!!
        BM_mesh_bm_from_me(bm_dst, me_dst, TRUE, true, 0);
 
-       if (!BM_mesh_data_copy(bm_src, bm_dst, CD_SHAPEKEY, &replace_info, 
relative_to_target, tmp_mat, use_tolerance,
-                                                  tolerance2)) {
+       if (!BM_mesh_data_copy(bm_src, bm_dst, &replace_info, CD_SHAPEKEY, 
transfer_mode, relative_to_target, tmp_mat,
+                              use_tolerance, tolerance2)) {
        return false;
        }
 
-       if (!BM_mesh_data_copy2(bm_src, bm_dst, &replace_info, CD_SHAPEKEY, 
transfer_mode)) {
-       return false;
-       }
-
        //transfer the BMesh back to Mesh
        BM_mesh_bm_to_me(bm_src, me_src, FALSE);
        BM_mesh_bm_to_me(bm_dst, me_dst, TRUE);

Modified: 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c
   2013-10-25 14:12:22 UTC (rev 60930)
+++ 
branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c
   2013-10-25 21:36:37 UTC (rev 60931)
@@ -405,13 +405,10 @@
        BM_mesh_bm_from_me(bm_src, me_src, TRUE, true, 0);      //TRUE -> 
should transfer shapekeys too!!
        BM_mesh_bm_from_me(bm_dst, me_dst, TRUE, true, 0);
 
-       if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MDEFORMVERT, &replace_info, 
relative_to_target, tmp_mat, use_tolerance,
-                                                  tolerance)) {
+       if (!BM_mesh_data_copy(bm_src, bm_dst, &replace_info, CD_MDEFORMVERT, 
transfer_mode, relative_to_target, tmp_mat,
+                              use_tolerance, tolerance)) {
                return false;
        }
-       if (!BM_mesh_data_copy2(bm_src, bm_dst, &replace_info, CD_MDEFORMVERT, 
transfer_mode)) {
-       return false;
-       }
 
        //transfer the BMesh back to Mesh
        BM_mesh_bm_to_me(bm_src, me_src, FALSE);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to