[Bf-blender-cvs] [5d21c92] experimental-build: Squashed commit of the mesh-transfer-data branch.
Bastien Montagne
noreply at git.blender.org
Fri Nov 7 13:15:47 CET 2014
Commit: 5d21c925690ad0848f4ba0fa40556213f48849e1
Author: Bastien Montagne
Date: Fri Nov 7 13:14:32 2014 +0100
Branches: experimental-build
https://developer.blender.org/rB5d21c925690ad0848f4ba0fa40556213f48849e1
Squashed commit of the mesh-transfer-data branch.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/blenkernel/BKE_bvhutils.h
M source/blender/blenkernel/BKE_customdata.h
A source/blender/blenkernel/BKE_data_transfer.h
M source/blender/blenkernel/BKE_deform.h
M source/blender/blenkernel/BKE_mesh_mapping.h
M source/blender/blenkernel/BKE_object_deform.h
M source/blender/blenkernel/CMakeLists.txt
M source/blender/blenkernel/intern/bvhutils.c
M source/blender/blenkernel/intern/customdata.c
A source/blender/blenkernel/intern/data_transfer.c
A source/blender/blenkernel/intern/data_transfer_intern.h
M source/blender/blenkernel/intern/deform.c
M source/blender/blenkernel/intern/mesh_mapping.c
M source/blender/blenkernel/intern/object_deform.c
M source/blender/editors/include/ED_object.h
M source/blender/editors/object/CMakeLists.txt
A source/blender/editors/object/object_data_transfer.c
M source/blender/editors/object/object_intern.h
M source/blender/editors/object/object_ops.c
M source/blender/editors/object/object_vgroup.c
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_view3d/view3d_buttons.c
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/makesrna/RNA_enum_types.h
M source/blender/makesrna/intern/rna_modifier.c
M source/blender/modifiers/CMakeLists.txt
M source/blender/modifiers/MOD_modifiertypes.h
A source/blender/modifiers/intern/MOD_datatransfer.c
M source/blender/modifiers/intern/MOD_util.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index efc430d..e78b5e6 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1225,6 +1225,94 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "material_offset", text="Material Offset")
+ def DATA_TRANSFER(self, layout, ob, md):
+ row = layout.row(align=True)
+ row.prop(md, "ob_source")
+ sub = row.row(align=True)
+ sub.active = bool(md.ob_source)
+ sub.prop(md, "use_object_transform", text="", icon='GROUP')
+
+ layout.separator()
+
+ layout.prop(md, "vert_mapping")
+ col = layout.column(align=True)
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_verts_vgroup")
+ row = split.row(align=True)
+ row.prop(md, "fromlayers_vgroup_select", text="")
+ row.label(icon='RIGHTARROW')
+ row.prop(md, "tolayers_vgroup_select", text="")
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_verts")
+
+ layout.separator()
+
+ layout.prop(md, "edge_mapping")
+ col = layout.column(align=True)
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_edges")
+
+ layout.separator()
+
+ layout.prop(md, "loop_mapping")
+ col = layout.column(align=True)
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_loops")
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_loops_vcol")
+ row = split.row(align=True)
+ row.prop(md, "fromlayers_vcol_select", text="")
+ row.label(icon='RIGHTARROW')
+ row.prop(md, "tolayers_vcol_select", text="")
+
+ layout.separator()
+
+ layout.prop(md, "poly_mapping")
+ col = layout.column(align=True)
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_polys_uv")
+ row = split.row(align=True)
+ row.prop(md, "fromlayers_uv_select", text="")
+ row.label(icon='RIGHTARROW')
+ row.prop(md, "tolayers_uv_select", text="")
+ split = col.split(0.333, align=True)
+ sub = split.column(align=True)
+ sub.prop(md, "data_types_polys")
+
+ layout.separator()
+
+ split = layout.split()
+ col = split.column()
+ row = col.row(align=True)
+ sub = row.row(align=True)
+ sub.active = md.use_max_distance
+ sub.prop(md, "max_distance")
+ row.prop(md, "use_max_distance", text="", icon='STYLUS_PRESSURE')
+
+ col = split.column()
+ col.prop(md, "ray_radius")
+
+ layout.separator()
+
+ split = layout.split()
+ col = split.column()
+ col.prop(md, "mix_mode")
+ col.prop(md, "mix_factor")
+
+ col = split.column()
+ col.prop(md, "use_create")
+ row = col.row(align=True)
+ row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+ sub = row.row(align=True)
+ sub.active = bool(md.vertex_group)
+ sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
+
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 0ea552e..788698c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1082,6 +1082,7 @@ class VIEW3D_MT_object(Menu):
layout.separator()
layout.operator("object.join")
+ layout.operator("object.data_transfer")
layout.separator()
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 4bc8fc4..5a63b44 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -31,6 +31,7 @@
* \ingroup bke
*/
+#include "BLI_bitmap.h"
#include "BLI_kdopbvh.h"
/*
@@ -56,8 +57,8 @@ typedef struct BVHTreeFromMesh {
struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */
struct MFace *face;
bool vert_allocated;
- bool face_allocated;
bool edge_allocated;
+ bool face_allocated;
/* radius for raycast */
float sphere_radius;
@@ -69,36 +70,28 @@ typedef struct BVHTreeFromMesh {
} BVHTreeFromMesh;
/*
- * Builds a bvh tree where nodes are the vertexs of the given mesh.
+ * Builds a bvh tree where nodes are the relevant elements of the given mesh.
* Configures BVHTreeFromMesh.
*
* The tree is build in mesh space coordinates, this means special care must be made on queries
* so that the coordinates and rays are first translated on the mesh local coordinates.
- * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse
- * a BVHTree.
+ * Reason for this is that bvh_from_mesh_* can use a cache in some cases and so it becomes possible to reuse a BVHTree.
*
* free_bvhtree_from_mesh should be called when the tree is no longer needed.
*/
BVHTree *bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
-
-/*
- * Builds a bvh tree where nodes are the faces of the given mesh.
- * Configures BVHTreeFromMesh.
- *
- * The tree is build in mesh space coordinates, this means special care must be made on queries
- * so that the coordinates and rays are first translated on the mesh local coordinates.
- * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse
- * a BVHTree.
- *
- * The returned value is the same as in data->tree, its only returned to make it easier to test
- * the success
- *
- * free_bvhtree_from_mesh should be called when the tree is no longer needed.
- */
-BVHTree *bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
+BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data, struct MVert *vert, const int numVerts,
+ const bool vert_allocated, BLI_bitmap *mask, int numVerts_active,
+ float epsilon, int tree_type, int axis);
BVHTree *bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
+BVHTree *bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
+BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data, struct MVert *vert, const bool vert_allocated,
+ struct MFace *face, const int numFaces, const bool face_allocated,
+ BLI_bitmap *mask, int numFaces_active,
+ float epsilon, int tree_type, int axis);
+
/*
* Frees data allocated by a call to bvhtree_from_mesh_*.
*/
@@ -115,11 +108,12 @@ float nearest_point_in_tri_surface_squared(const float v0[3], const float v1[3],
*/
//Using local coordinates
-#define BVHTREE_FROM_FACES 0
-#define BVHTREE_FROM_VERTICES 1
-#define BVHTREE_FROM_EDGES 2
-
-#define BVHTREE_FROM_FACES_EDITMESH 3
+enum {
+ BVHTREE_FROM_VERTS = 0,
+ BVHTREE_FROM_EDGES = 1,
+ BVHTREE_FROM_FACES = 2,
+ BVHTREE_FROM_FACES_EDITMESH = 3,
+};
typedef struct LinkNode *BVHCache;
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 30a5889..5443a9c 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -41,6 +41,8 @@ extern "C" {
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
+#include "DNA_customdata_types.h"
+
struct BMesh;
struct ID;
struct CustomData;
@@ -77,6 +79,9 @@ extern const CustomDataMask CD_MASK_EVERYTHING;
void customData_mask_layers__print(CustomDataMask mask);
+typedef void (*cd_interp)(void **sources, const float *weights, const float *sub_weights, int count, void *dest);
+typedef void (*cd_copy)(const void *source, void *dest, int count);
+
/**
* Checks if the layer at physical offset \a layer_n (in data->layers) support math
* the below operations.
@@ -96,6 +101,9 @@ bool CustomData_bmesh_has_free(const struct CustomData *data);
* implemented for mloopuv/mloopcol, for now.*/
void CustomData_data_copy_value(int type, const void *source, void *dest);
+/* Same as above, but doing advanced mixing. Only available for a few types of data (like colors...). */
+void CustomData_data_mix_value(int type, const void *source, void *dest, const int mixmode, const float mixfactor);
+
/* compares if data1 is equal to data2. type is a valid CustomData type
* enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare
* the data, if it exists, otherwise memcmp is used.*/
@@ -246,14 +254,14 @@ void *CustomData_bmesh_get_n(const struct CustomData *data, void *block, int typ
void *CustomData_bmesh_get_layer_n(const struct CustomData *data, void *block, int n);
bool CustomData_set_layer_name(const struct CustomData *data, int type, int n, const char *name);
+const char *CustomData_get_layer_name(const struct CustomData *data, int type, int n);
/* gets a pointer to the active or first layer of type
* returns NULL if there is no layer of type
*/
void *CustomData_get_layer(const struct CustomData *data, int type);
void *CustomData_get_layer_n(const struct CustomData *data, int type, int n);
-void *CustomData_get_layer_named(const struct CustomData *data, int type,
- const char *name);
+void *CustomData_get_layer_named(const struct CustomData *data, int type, const char *name);
int CustomData_get_offset(const struct CustomData *data, int type);
int CustomData_get_n_off
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list