[Bf-blender-cvs] [c544b39] mesh-transfer-data: Change default mapping to 'nearest', better than 'topology', which will error if source and dest are not topo-compatible.

Bastien Montagne noreply at git.blender.org
Thu Nov 13 14:28:24 CET 2014


Commit: c544b39afe137c7e2712f98bec040f79c5991a67
Author: Bastien Montagne
Date:   Thu Nov 13 11:54:27 2014 +0100
Branches: mesh-transfer-data
https://developer.blender.org/rBc544b39afe137c7e2712f98bec040f79c5991a67

Change default mapping to 'nearest', better than 'topology',
which will error if source and dest are not topo-compatible.

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

M	source/blender/editors/object/object_data_transfer.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_datatransfer.c

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

diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index 804dcb3..28f8128 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -405,13 +405,13 @@ void OBJECT_OT_data_transfer(wmOperatorType *ot)
 	RNA_def_boolean(ot->srna, "use_create", true, "Create Data", "Add data layers on destination meshes if needed");
 
 	/* Mapping methods. */
-	RNA_def_enum(ot->srna, "vert_mapping", DT_method_vertex_items, M2MMAP_MODE_TOPOLOGY, "Vertex Mapping",
+	RNA_def_enum(ot->srna, "vert_mapping", DT_method_vertex_items, M2MMAP_MODE_VERT_NEAREST, "Vertex Mapping",
 	             "Method used to map source vertices to destination ones");
-	RNA_def_enum(ot->srna, "edge_mapping", DT_method_edge_items, M2MMAP_MODE_TOPOLOGY, "Edge Mapping",
+	RNA_def_enum(ot->srna, "edge_mapping", DT_method_edge_items, M2MMAP_MODE_EDGE_NEAREST, "Edge Mapping",
 	             "Method used to map source edges to destination ones");
-	RNA_def_enum(ot->srna, "loop_mapping", DT_method_loop_items, M2MMAP_MODE_TOPOLOGY, "Face Corner Mapping",
-	             "Method used to map source faces' corners to destination ones");
-	RNA_def_enum(ot->srna, "poly_mapping", DT_method_poly_items, M2MMAP_MODE_TOPOLOGY, "Face Mapping",
+	RNA_def_enum(ot->srna, "loop_mapping", DT_method_loop_items, M2MMAP_MODE_LOOP_NEAREST_POLYNOR,
+	             "Face Corner Mapping", "Method used to map source faces' corners to destination ones");
+	RNA_def_enum(ot->srna, "poly_mapping", DT_method_poly_items, M2MMAP_MODE_POLY_NEAREST, "Face Mapping",
 	             "Method used to map source faces to destination ones");
 
 	/* Mapping options and filtering. */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index b33e0f8..633cbf0 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4155,22 +4155,22 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "dt_data_types_update");
 
 	/* Mapping methods. */
-	prop = RNA_def_enum(srna, "vert_mapping", DT_method_vertex_items, M2MMAP_MODE_TOPOLOGY, "Vertex Mapping",
+	prop = RNA_def_enum(srna, "vert_mapping", DT_method_vertex_items, M2MMAP_MODE_VERT_NEAREST, "Vertex Mapping",
 	                    "Method used to map source vertices to destination ones");
 	RNA_def_property_enum_sdna(prop, NULL, "vmap_mode");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop = RNA_def_enum(srna, "edge_mapping", DT_method_edge_items, M2MMAP_MODE_TOPOLOGY, "Edge Mapping",
+	prop = RNA_def_enum(srna, "edge_mapping", DT_method_edge_items, M2MMAP_MODE_EDGE_NEAREST, "Edge Mapping",
 	                    "Method used to map source edges to destination ones");
 	RNA_def_property_enum_sdna(prop, NULL, "emap_mode");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop = RNA_def_enum(srna, "loop_mapping", DT_method_loop_items, M2MMAP_MODE_TOPOLOGY, "Face Corner Mapping",
-	                    "Method used to map source faces' corners to destination ones");
+	prop = RNA_def_enum(srna, "loop_mapping", DT_method_loop_items, M2MMAP_MODE_LOOP_NEAREST_POLYNOR,
+	                    "Face Corner Mapping", "Method used to map source faces' corners to destination ones");
 	RNA_def_property_enum_sdna(prop, NULL, "lmap_mode");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop = RNA_def_enum(srna, "poly_mapping", DT_method_poly_items, M2MMAP_MODE_TOPOLOGY, "Face Mapping",
+	prop = RNA_def_enum(srna, "poly_mapping", DT_method_poly_items, M2MMAP_MODE_POLY_NEAREST, "Face Mapping",
 	                    "Method used to map source faces to destination ones");
 	RNA_def_property_enum_sdna(prop, NULL, "pmap_mode");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index a619cb6..5fafc7f 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -60,10 +60,10 @@ static void initData(ModifierData *md)
 	dtmd->ob_source          = NULL;
 	dtmd->data_types         = 0;
 
-	dtmd->vmap_mode          = M2MMAP_MODE_TOPOLOGY;
-	dtmd->emap_mode          = M2MMAP_MODE_TOPOLOGY;
-	dtmd->lmap_mode          = M2MMAP_MODE_TOPOLOGY;
-	dtmd->pmap_mode          = M2MMAP_MODE_TOPOLOGY;
+	dtmd->vmap_mode          = M2MMAP_MODE_VERT_NEAREST;
+	dtmd->emap_mode          = M2MMAP_MODE_EDGE_NEAREST;
+	dtmd->lmap_mode          = M2MMAP_MODE_LOOP_NEAREST_POLYNOR;
+	dtmd->pmap_mode          = M2MMAP_MODE_POLY_NEAREST;
 
 	dtmd->map_max_distance   = 1.0f;
 	dtmd->map_ray_radius     = 0.0f;




More information about the Bf-blender-cvs mailing list