Revision: 59426 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59426 Author: walid Date: 2013-08-23 14:51:20 +0000 (Fri, 23 Aug 2013) Log Message: ----------- dropping the different transfer methods from the UI
Modified Paths: -------------- 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.h =================================================================== --- branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h 2013-08-23 14:37:22 UTC (rev 59425) +++ branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.h 2013-08-23 14:51:20 UTC (rev 59426) @@ -27,13 +27,6 @@ #ifndef __BMESH_DATA_TRANSFER_H__ #define __BMESH_DATA_TRANSFER_H__ -typedef enum ST_ShapekeyGroupMode { - ST_REPLACE_ACTIVE_SHAPEKEY_GROUP = 1, - ST_REPLACE_ENOUGH_SHAPEKEY_GROUPS = 2, - ST_REPLACE_ALL_SHAPEKEY_GROUPS = 3, - ST_APPEND_SHAPEKEY_GROUPS = 4 -} ST_ShapekeyGroupMode; - typedef enum ReplaceGroupMode { REPLACE_ACTIVE_GROUP = 1, REPLACE_ENOUGH_GROUPS = 2, 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-08-23 14:37:22 UTC (rev 59425) +++ branches/soc-2013-meshdata_transfer/source/blender/editors/mesh/mesh_data.c 2013-08-23 14:51:20 UTC (rev 59426) @@ -466,19 +466,6 @@ } } -typedef enum TransferMode { - SPATIAL_TRANSFER = 1, - PROJECTION_TRANSFER = 2 -} TransferMode; - -static EnumPropertyItem transfer_mode_item[] = { - {SPATIAL_TRANSFER, - "SPATIAL_TRANSFER", 0, "Spatial transfer", "Copy by analyzing the spatial relations"}, - {PROJECTION_TRANSFER, - "PROJECTION_TRANSFER", 0, "Projection transfer", "Copy by projecting the desitnation onto the source"}, - {0, NULL, 0, NULL, NULL} -}; - static EnumPropertyItem replace_mode_item[] = { {REPLACE_ACTIVE_GROUP, "REPLACE_ACTIVE_GROUP", 0, "Active", "Overwrite active group only"}, @@ -511,13 +498,7 @@ bool relative_to_target = RNA_boolean_get(op->ptr, "rel_to_target"); - float tolerance = RNA_float_get(op->ptr, "tolerance"); - float radius_interp = RNA_float_get(op->ptr, "interp_radius"); - int interp_pow = RNA_int_get(op->ptr, "interp_power"); - bool interp_normals = RNA_boolean_get(op->ptr, "interp_normals"); - int no_pow = RNA_int_get(op->ptr, "normals_power"); ReplaceGroupMode replace_mode = RNA_enum_get(op->ptr, "replace_mode"); - TransferMode transfer_mode = RNA_enum_get(op->ptr, "transfer_mode"); bool use_tolerance = RNA_boolean_get(op->ptr, "use_tol"); float tolerance2 = RNA_float_get(op->ptr, "tol"); @@ -656,18 +637,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 (transfer_mode == PROJECTION_TRANSFER) { - if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPUV, replace_info, relative_to_target, tmp_mat, use_tolerance, - tolerance2)) { - return false; - } + if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPUV, replace_info, relative_to_target, tmp_mat, use_tolerance, + tolerance2)) { + return false; } - //*******copy based on nearest vertex - else if (transfer_mode == SPATIAL_TRANSFER) { - if (!BM_mesh_uv_copy(bm_src, bm_dst, tolerance, radius_interp, interp_pow, no_pow, interp_normals)) { - return false; - } - } //transfer the BMesh back to Mesh BM_mesh_bm_to_me(bm_src, me_src, FALSE); @@ -780,13 +753,7 @@ BMesh *bm_dst, *bm_src; bool relative_to_target = RNA_boolean_get(op->ptr, "rel_to_target"); - float UNUSED(tolerance) = RNA_float_get(op->ptr, "tolerance"); - float UNUSED(radius_interp) = RNA_float_get(op->ptr, "interp_radius"); - int UNUSED(interp_pow) = RNA_int_get(op->ptr, "interp_power"); - bool UNUSED(interp_normals) = RNA_boolean_get(op->ptr, "interp_normals"); - int UNUSED(no_pow) = RNA_int_get(op->ptr, "normals_power"); ReplaceGroupMode replace_mode = RNA_enum_get(op->ptr, "replace_mode"); - TransferMode transfer_mode = RNA_enum_get(op->ptr, "transfer_mode"); bool use_tolerance = RNA_boolean_get(op->ptr, "use_tol"); float tolerance2 = RNA_float_get(op->ptr, "tol"); @@ -920,23 +887,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 (transfer_mode == PROJECTION_TRANSFER) { - if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPCOL, replace_info, relative_to_target, tmp_mat, use_tolerance, - tolerance2)) { - return false; - } + if (!BM_mesh_data_copy(bm_src, bm_dst, CD_MLOOPCOL, replace_info, relative_to_target, tmp_mat, use_tolerance, + tolerance2)) { + return false; } - //*******copy based on nearest vertex - else if (transfer_mode == SPATIAL_TRANSFER) { - BKE_report(op->reports, RPT_ERROR, - "Spatial transfer is not supported yet, the projection transfer would be a better choice :D"); -/* if (!BM_mesh_vertex_color_copy2(bm_src, bm_dst, tolerance, radius_interp, interp_pow, no_pow, interp_normals)) { - 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); @@ -1174,20 +1129,8 @@ /* properties */ RNA_def_boolean(ot->srna, "rel_to_target", false, "Relative to target", "select this if you want the transfer to be relative to the target"); - RNA_def_float(ot->srna, "tolerance", 0.01f, 0.001f, 10.0f, - "Tolerance", "Radius of source vertices to inherit from", 0.001f, 5.0f); - RNA_def_float(ot->srna, "interp_radius", 1.5f, 0.0f, 100.0f, - "Interp Radius", "Radius of accepted contagious vertices", 0.0f, 10.0f); - RNA_def_int(ot->srna, "interp_power", 1, 0, 20, - "Interp Power", "Add more influence from near vertices, 0 for linear interp", 0, 5); - RNA_def_boolean(ot->srna, "interp_normals", true, - "Interp with Normals", "Consider the normals while interpolating"); - RNA_def_int(ot->srna, "normals_power", 1, 1, 20, - "Normals power", "Weighting the normals effect in interp, 1 for linear effect", 1, 5); RNA_def_enum(ot->srna, "replace_mode", replace_mode_item, 2, "Replace/Append", "define which groups to move"); - RNA_def_enum(ot->srna, "transfer_mode", transfer_mode_item, 2, - "Transfer Mode", "Choose between different algorithms"); RNA_def_enum(ot->srna, "from_to_active", from_to_active, 2, "From/To active object", "Choose the transfer direction"); RNA_def_boolean(ot->srna, "use_tol", false, "Use Tolerance", @@ -1320,20 +1263,8 @@ /* properties */ RNA_def_boolean(ot->srna, "rel_to_target", false, "Relative to target", "select this if you want the transfer to be relative to the target"); - RNA_def_float(ot->srna, "tolerance", 0.01f, 0.001f, 10.0f, - "Tolerance", "Radius of source vertices to inherit from", 0.001f, 5.0f); - RNA_def_float(ot->srna, "interp_radius", 1.5f, 0.0f, 100.0f, - "Interp Radius", "Radius of accepted contagious vertices", 0.0f, 10.0f); - RNA_def_int(ot->srna, "interp_power", 1, 0, 20, - "Interp Power", "Add more influence from near vertices, 0 for linear interp", 0, 5); - RNA_def_boolean(ot->srna, "interp_normals", true, - "Interp with Normals", "Consider the normals while interpolating"); - RNA_def_int(ot->srna, "normals_power", 1, 1, 20, - "Normals power", "Weighting the normals effect in interp, 1 for linear effect", 1, 5); RNA_def_enum(ot->srna, "replace_mode", replace_mode_item, 2, "Replace/Append", "define which groups to move"); - RNA_def_enum(ot->srna, "transfer_mode", transfer_mode_item, 2, - "Transfer Mode", "Choose between different algorithms"); RNA_def_enum(ot->srna, "from_to_active", from_to_active, 2, "From/To active object", "Choose the transfer direction"); RNA_def_boolean(ot->srna, "use_tol", false, "Use Tolerance", 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-08-23 14:37:22 UTC (rev 59425) +++ branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_shapekey.c 2013-08-23 14:51:20 UTC (rev 59426) @@ -286,32 +286,18 @@ /*********************** transfer shape key ***********************/ -static EnumPropertyItem ST_replace_mode_item[] = { - {ST_REPLACE_ACTIVE_SHAPEKEY_GROUP, - "ST_REPLACE_ACTIVE_SHAPEKEY", 0, "Active", "Overwrite active shapekey only"}, - {ST_REPLACE_ENOUGH_SHAPEKEY_GROUPS, - "ST_REPLACE_ENOUGH_SHAPEKEYS", 0, "Enough", "Overwrite source shapekeys only as needed"}, - {ST_REPLACE_ALL_SHAPEKEY_GROUPS, - "ST_REPLACE_ALL_SHAPEKEYS", 0, "All", "Overwrite all shapekeys"}, - {ST_APPEND_SHAPEKEY_GROUPS, - "ST_APPEND_SHAPEKEYS", 0, "Append", "Add shapekeys without overwriting"}, +static EnumPropertyItem replace_mode_item[] = { + {REPLACE_ACTIVE_GROUP, + "REPLACE_ACTIVE_GROUP", 0, "Active", "Overwrite active group only"}, + {REPLACE_ENOUGH_GROUPS, + "REPLACE_ENOUGH_GROUPS", 0, "Enough", "Overwrite source groups only as needed"}, + {REPLACE_ALL_GROUPS, + "REPLACE_ALL_GROUPS", 0, "All", "Overwrite all groups"}, + {APPEND_GROUPS, + "APPEND_GROUPS", 0, "Append", "Add groups without overwriting"}, {0, NULL, 0, NULL, NULL} }; - -typedef enum ST_ShapekeyTransferMode { - ST_USE_NEAREST_VERTEX = 1, - ST_USE_NEAREST_FACE = 2 -} ST_ShapekeyTransferMode; - -static EnumPropertyItem ST_transfer_mode_item[] = { - {ST_USE_NEAREST_VERTEX, - "ST_USE_NEAREST_VERTEX", 0, "Nearest vertex", "Copy from the nearest vertices"}, - {ST_USE_NEAREST_FACE, - "ST_USE_NEAREST_FACE", 0, "Nearest face", "Copy from the nearest face"}, - {0, NULL, 0, NULL, NULL} -}; - typedef enum ST_FromToActive { ST_FROM_ACTIVE = 1, ST_TO_ACTIVE = 2 @@ -333,15 +319,7 @@ int *act_shapekey_lay = MEM_mallocN(sizeof(*act_shapekey_lay) * 2, "act_shapekey_lay object_shapekey.c"); bool relative_to_target = RNA_boolean_get(op->ptr, "rel_to_target"); - bool auto_tol = RNA_boolean_get(op->ptr, "auto_tol"); - float auto_tol_percentage = RNA_float_get(op->ptr, "auto_tol_percentage"); - float tolerance = RNA_float_get(op->ptr, "tolerance"); - float radius_interp = RNA_float_get(op->ptr, "interp_radius"); - int interp_pow = RNA_int_get(op->ptr, "interp_power"); @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs