[Bf-blender-cvs] [978deec] temp_custom_loop_normals: Merge branch 'master' into temp_custom_loop_normals

Bastien Montagne noreply at git.blender.org
Sat Jan 10 12:00:44 CET 2015


Commit: 978deec95b50c315d05aa6425198028de9cc00e6
Author: Bastien Montagne
Date:   Sat Jan 10 10:57:51 2015 +0100
Branches: temp_custom_loop_normals
https://developer.blender.org/rB978deec95b50c315d05aa6425198028de9cc00e6

Merge branch 'master' into temp_custom_loop_normals

Conflicts:
	release/datafiles/blender_icons.svg
	release/scripts/startup/bl_ui/properties_data_modifier.py
	source/blender/editors/include/UI_icons.h
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/makesdna/DNA_modifier_types.h
	source/blender/makesrna/intern/rna_modifier.c
	source/blender/modifiers/MOD_modifiertypes.h
	source/blender/modifiers/intern/MOD_util.c

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



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

diff --cc release/scripts/startup/bl_ui/properties_data_modifier.py
index 9ddd2cb,e13d007..ef62243
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@@ -1225,52 -1225,121 +1225,167 @@@ class DATA_PT_modifiers(ModifierButtons
  
          col.prop(md, "material_offset", text="Material Offset")
  
+     def DATA_TRANSFER(self, layout, ob, md):
+         row = layout.row(align=True)
+         row.prop(md, "object")
+         sub = row.row(align=True)
+         sub.active = bool(md.object)
+         sub.prop(md, "use_object_transform", text="", icon='GROUP')
+ 
+         layout.separator()
+ 
+         split = layout.split(0.333)
+         split.prop(md, "use_vert_data")
+         use_vert = md.use_vert_data
+         row = split.row()
+         row.active = use_vert
+         row.prop(md, "vert_mapping", text="")
+         if use_vert:
+             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, "layers_vgroup_select_src", text="")
+             row.label(icon='RIGHTARROW_THIN')
+             row.prop(md, "layers_vgroup_select_dst", text="")
+             split = col.split(0.333, align=True)
+             sub = split.column(align=True)
+             sub.prop(md, "data_types_verts")
+ 
+         layout.separator()
+ 
+         split = layout.split(0.333)
+         split.prop(md, "use_edge_data")
+         use_edge = md.use_edge_data
+         row = split.row()
+         row.active = use_edge
+         row.prop(md, "edge_mapping", text="")
+         if use_edge:
+             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()
+ 
+         split = layout.split(0.333)
+         split.prop(md, "use_loop_data")
+         use_loop = md.use_loop_data
+         row = split.row()
+         row.active = use_loop
+         row.prop(md, "loop_mapping", text="")
+         if use_loop:
+             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, "layers_vcol_select_src", text="")
+             row.label(icon='RIGHTARROW')
+             row.prop(md, "layers_vcol_select_dst", text="")
+             split = col.split(0.333, align=True)
+             sub = split.column(align=True)
+             sub.prop(md, "data_types_loops_uv")
+             row = split.row(align=True)
+             row.prop(md, "layers_uv_select_src", text="")
+             row.label(icon='RIGHTARROW')
+             row.prop(md, "layers_uv_select_dst", text="")
+             col.prop(md, "islands_precision")
+ 
+         layout.separator()
+ 
+         split = layout.split(0.333)
+         split.prop(md, "use_poly_data")
+         use_poly = md.use_poly_data
+         row = split.row()
+         row.active = use_poly
+         row.prop(md, "poly_mapping", text="")
+         if use_poly:
+             col = layout.column(align=True)
+             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()
+         row = col.row()
+         row.active = bool(md.object)
+         row.operator("object.datalayout_transfer", text="Generate Data Layers")
+         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')
+ 
 +    def SET_SPLIT_NORMAL(self, layout, ob, md):
 +        has_vgroup = bool(md.vertex_group)
 +        needs_object_bbox_center = (((md.mode == 'ELLIPSOID') and not md.target) or
 +                                    ((md.mode == 'TRACKTO') and md.use_trackto_parallel))
 +
 +        row = layout.row()
 +        row.prop(md, "mode", expand=True)
 +
 +        split = layout.split()
 +
 +        col = split.column()
 +        col.prop(md, "target", text="")
 +        sub = col.row()
 +        sub.active = needs_object_bbox_center
 +        sub.prop(md, "use_bbox_center")
 +        col.prop(md, "use_current_custom_split_normals")
 +
 +        col = split.column()
 +        row = col.row(align=True)
 +        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 +        sub = row.row(align=True)
 +        sub.active = has_vgroup
 +        sub.prop(md, "use_invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
 +        row = col.row(align=True)
 +        row.active = (md.mode == 'TRACKTO')
 +        row.prop(md, "use_trackto_parallel")
 +
 +    def COPY_SPLIT_NORMAL(self, layout, ob, md):
 +        has_vgroup = bool(md.vertex_group)
 +
 +        row = layout.row()
 +        row.prop(md, "mode", expand=True)
 +
 +        split = layout.split()
 +
 +        col = split.column()
 +        col.prop(md, "target", text="")
 +        col.prop(md, "use_current_custom_split_normals")
 +
 +        col = split.column()
 +        row = col.row(align=True)
 +        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 +        sub = row.row(align=True)
 +        sub.active = has_vgroup
 +        sub.prop(md, "use_invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
 +
  
  if __name__ == "__main__":  # only for live edit.
      bpy.utils.register_module(__name__)
diff --cc source/blender/blenkernel/intern/mesh_remap.c
index 0000000,73ddb18..c7f3ea8
mode 000000,100644..100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@@ -1,0 -1,1986 +1,1987 @@@
+ /*
+  * ***** BEGIN GPL LICENSE BLOCK *****
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * ***** END GPL LICENSE BLOCK *****
+  */
+ 
+ /** \file blender/blenkernel/intern/mesh_remap.c
+  *  \ingroup bke
+  *
+  * Functions for mapping data between meshes.
+  */
+ 
+ #include <limits.h>
+ 
+ #include "MEM_guardedalloc.h"
+ 
+ #include "DNA_meshdata_types.h"
+ 
+ #include "BLI_utildefines.h"
+ #include "BLI_alloca.h"
+ #include "BLI_astar.h"
+ #include "BLI_bitmap.h"
+ #include "BLI_math.h"
+ #include "BLI_memarena.h"
+ #include "BLI_polyfill2d.h"
+ #include "BLI_rand.h"
+ 
+ #include "BKE_bvhutils.h"
+ #include "BKE_customdata.h"
+ #include "BKE_DerivedMesh.h"
+ #include "BKE_mesh.h"
+ #include "BKE_mesh_mapping.h"
+ #include "BKE_mesh_remap.h"  /* own include */
+ 
+ #include "BLI_strict_flags.h"
+ 
+ 
+ /* -------------------------------------------------------------------- */
+ 
+ /** \name Mesh to mesh mapping
+  * \{ */
+ 
+ void BKE_mesh_remap_init(MeshPairRemap *map, const int items_num)
+ {
+ 	MemArena *mem = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
+ 
+ 	BKE_mesh_remap_free(map);
+ 
+ 	map->items = BLI_memarena_alloc(mem, sizeof(*map->items) * (size_t)items_num);
+ 	map->items_num = items_num;
+ 
+ 	map->mem = mem;
+ }
+ 
+ void BKE_mesh_remap_free(MeshPairRemap *map)
+ {
+ 	if (map->mem) {
+ 		BLI_memarena_free((MemArena *)map->mem);
+ 	}
+ 
+ 	map->items_num = 0;
+ 	map->items = NULL;
+ 	map->mem = NULL;
+ }
+ 
+ static void mesh_remap_item_define(
+         MeshPairRemap *map, const int index, const float UNUSED(hit_dist), const int island,
+         const int sources_num, const int *indices_src, const float *weights_src)
+ {
+ 	MeshPairRemapItem *mapit = &map->items[index];
+ 	MemArena *mem = map->mem;
+ 
+ 	if (sources_num) {
+ 		mapit->sources_num = sources_num;
+ 		mapit->indices_src = BLI_memarena_alloc(mem, sizeof(*mapit->indices_src) * (size_t)sources_num);
+ 		memcpy(mapit->indices_src, indices_src, sizeof(*mapit->indices_src) * (size_t)sources_num);
+ 		mapit->weights_src = BLI_memarena_alloc(mem, sizeof(*mapit->weights_src) * (size_t)sources_num);
+ 		memcpy(mapit->weights_src, weights_src, sizeof(*mapit->weights_src) * (size_t)sources_num);
+ 	}
+ 	else {
+ 		mapit->sources_num = 0;
+ 		mapit->indices_src = NULL;
+ 		mapit->weights_src = NULL;
+ 	}
+ 	/* UNUSED */
+ 	// mapit->hit_dist = hit_dist;
+ 	mapit->island = island;
+ }
+ 
+ void BKE_mesh_remap_item_define_invalid(MeshPairRemap *map, const int index)
+ {
+ 	mesh_remap_item_define(map, index, FLT_MAX, 0, 0, NULL, NULL);
+ }
+ 
+ static int mesh_remap_interp_poly_data_get(
+         const MPoly *mp, MLoop *mloops, const float (*vcos_src)[3], const float point[3],
+         size_t *buff_size, float (**vcos)[3], const bool use_loops, int **indices,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list