2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
31 /** \file BKE_deform.h
34 * \author Reevan McKay et al
35 * \brief support for deformation groups and hooks.
43 void defgroup_copy_list(struct ListBase *lb1, struct ListBase *lb2);
44 struct bDeformGroup *defgroup_duplicate(struct bDeformGroup *ingroup);
45 struct bDeformGroup *defgroup_find_name(struct Object *ob, const char *name);
46 int *defgroup_flip_map(struct Object *ob, int *flip_map_len, int use_default);
47 int *defgroup_flip_map_single(struct Object *ob, int *flip_map_len, int use_default, int defgroup);
48 int defgroup_flip_index(struct Object *ob, int index, int use_default);
49 int defgroup_name_index(struct Object *ob, const char *name);
50 void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob);
52 struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int defgroup);
53 struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup);
54 void defvert_add_index_notest(struct MDeformVert *dv, int defgroup, const float weight);
55 void defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw);
57 float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup);
58 float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup);
60 void defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src);
61 void defvert_copy_index(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const int defgroup);
62 void defvert_sync(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, int use_verify);
63 void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
64 const int *flip_map, const int flip_map_len, const int use_verify);
65 void defvert_remap (struct MDeformVert *dvert, int *map, const int map_len);
66 void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
67 void defvert_normalize(struct MDeformVert *dvert);
68 void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock);
70 /* utility function, note that 32 chars is the maximum string length since its only
71 * used with defgroups currently */
72 void flip_side_name(char name[64], const char from_name[64], int strip_number);