[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47049] branches/meshdata_transfer/source/ blender/editors/object/object_vgroup.c: style edits
Campbell Barton
ideasman42 at gmail.com
Sat May 26 16:31:35 CEST 2012
Revision: 47049
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47049
Author: campbellbarton
Date: 2012-05-26 14:31:34 +0000 (Sat, 26 May 2012)
Log Message:
-----------
style edits
Modified Paths:
--------------
branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
Modified: branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c 2012-05-26 14:19:41 UTC (rev 47048)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c 2012-05-26 14:31:34 UTC (rev 47049)
@@ -29,7 +29,6 @@
* \ingroup edobj
*/
-
#include <string.h>
#include <stddef.h>
#include <math.h>
@@ -458,9 +457,10 @@
switch (method_option) {
case BY_INDEX:
- /*check if indices are matching, delete and return if not*/
- if (ob_dst == ob_src || dv_tot_dst == 0 || dv_tot_dst != dv_tot_src
- || dv_array_src == NULL || dv_array_dst == NULL) {
+ /* check if indices are matching, delete and return if not */
+ if (ob_dst == ob_src || dv_tot_dst == 0 || dv_tot_dst != dv_tot_src ||
+ dv_array_src == NULL || dv_array_dst == NULL)
+ {
ED_vgroup_delete(ob_dst, defgroup_find_name(ob_dst, dg_dst->name));
return 0;
}
@@ -491,7 +491,7 @@
/*node tree accelerated search for closest vetex*/
BLI_bvhtree_find_nearest(tree_mesh_vertices_src.tree, tmp_co,
- &nearest, tree_mesh_vertices_src.nearest_callback, &tree_mesh_vertices_src);
+ &nearest, tree_mesh_vertices_src.nearest_callback, &tree_mesh_vertices_src);
/*copy weight*/
dw_src = defvert_verify_index(dv_array_src[nearest.index], index_src);
@@ -523,20 +523,21 @@
/*node tree accelerated search for closest face*/
BLI_bvhtree_find_nearest(tree_mesh_faces_src.tree, tmp_co,
- &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
+ &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
index_nearest = nearest.index;
/*project onto face*/
normal_tri_v3(normal, mv_src[mface_src[nearest.index].v1].co,
- mv_src[mface_src[nearest.index].v2].co,
- mv_src[mface_src[nearest.index].v3].co);
+ mv_src[mface_src[nearest.index].v2].co,
+ mv_src[mface_src[nearest.index].v3].co);
+
project_v3_plane(tmp_co, normal, mv_src[mface_src[index_nearest].v1].co);
/*interpolate weights*/
interp_weights_face_v3(tmp_weight, mv_src[mface_src[index_nearest].v1].co,
- mv_src[mface_src[index_nearest].v2].co,
- mv_src[mface_src[index_nearest].v3].co,
- mv_src[mface_src[index_nearest].v4].co, tmp_co);
+ mv_src[mface_src[index_nearest].v2].co,
+ mv_src[mface_src[index_nearest].v3].co,
+ mv_src[mface_src[index_nearest].v4].co, tmp_co);
/*get weights*/
weight = tmp_weight[0] * defvert_verify_index(dv_array_src[mface_src[index_nearest].v1], index_src)->weight;
@@ -573,7 +574,7 @@
/*node tree accelerated search for closest face*/
BLI_bvhtree_find_nearest(tree_mesh_faces_src.tree, tmp_co,
- &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
+ &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
index_nearest = nearest.index;
/*get distances*/
@@ -2996,30 +2997,31 @@
int fail = 0;
bDeformGroup *dg_src;
- /*TODO: get these parameters from gui.
- *For now 1,3,1 is default because GUI doesnt contain more than one button yet:
- *Replace all weights in single vertexgroup based on interpolation of nearest face*/
+ /* TODO: get these parameters from gui.
+ * For now 1,3,1 is default because GUI doesnt contain more than one button yet:
+ * Replace all weights in single vertexgroup based on interpolation of nearest face*/
VertexGroupOption vertex_group_option = 1;
MethodOption method_option = 3;
ReplaceOption replace_option = 1;
/*Macro to loop through selected objects and perform operation depending on function, option and method*/
- CTX_DATA_BEGIN(C, Object*, ob_slc, selected_editable_objects){
+ CTX_DATA_BEGIN(C, Object*, ob_slc, selected_editable_objects) {
if (ob_act != ob_slc){
switch(vertex_group_option){
- case REPLACE_SINGLE_VERTEX_GROUP:
- if (ED_vgroup_transfer_weight(ob_slc, ob_act, BLI_findlink(&ob_act->defbase, ob_act->actdef - 1), method_option, replace_option))
- change++;
- else fail++; break;
+ case REPLACE_SINGLE_VERTEX_GROUP:
+ if (ED_vgroup_transfer_weight(ob_slc, ob_act, BLI_findlink(&ob_act->defbase, ob_act->actdef - 1), method_option, replace_option))
+ change++;
+ else fail++;
+ break;
- case REPLACE_ALL_VERTEX_GROUPS:
- for (dg_src = ob_act->defbase.first; dg_src; dg_src = dg_src->next){
- if (ED_vgroup_transfer_weight(ob_slc, ob_act, dg_src, method_option, replace_option)) change++;
- else fail++; break;
- }
+ case REPLACE_ALL_VERTEX_GROUPS:
+ for (dg_src = ob_act->defbase.first; dg_src; dg_src = dg_src->next){
+ if (ED_vgroup_transfer_weight(ob_slc, ob_act, dg_src, method_option, replace_option)) change++;
+ else fail++;break;
+ }
}
}
}
More information about the Bf-blender-cvs
mailing list