2011-02-18 14:05:18 +01:00
|
|
|
/*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 13:37:38 +02:00
|
|
|
*
|
|
|
|
* 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
|
2008-04-17 00:40:48 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 13:37:38 +02:00
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 14:34:04 +01:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 13:37:38 +02:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 13:37:38 +02:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __BKE_DEFORM_H__
|
|
|
|
#define __BKE_DEFORM_H__
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2011-02-18 14:05:18 +01:00
|
|
|
/** \file BKE_deform.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \since June 2001
|
|
|
|
* \author Reevan McKay et al
|
|
|
|
* \brief support for deformation groups and hooks.
|
|
|
|
*/
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
struct Object;
|
|
|
|
struct ListBase;
|
|
|
|
struct bDeformGroup;
|
2008-08-22 14:10:02 +02:00
|
|
|
struct MDeformVert;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2010-01-26 14:50:17 +01:00
|
|
|
void defgroup_copy_list(struct ListBase *lb1, struct ListBase *lb2);
|
|
|
|
struct bDeformGroup *defgroup_duplicate(struct bDeformGroup *ingroup);
|
2010-08-22 16:15:28 +02:00
|
|
|
struct bDeformGroup *defgroup_find_name(struct Object *ob, const char *name);
|
2011-10-27 09:54:32 +02:00
|
|
|
int *defgroup_flip_map(struct Object *ob, int *flip_map_len, int use_default);
|
2011-11-01 09:11:55 +01:00
|
|
|
int *defgroup_flip_map_single(struct Object *ob, int *flip_map_len, int use_default, int defgroup);
|
2010-01-26 18:07:47 +01:00
|
|
|
int defgroup_flip_index(struct Object *ob, int index, int use_default);
|
|
|
|
int defgroup_name_index(struct Object *ob, const char *name);
|
2010-01-26 14:50:17 +01:00
|
|
|
void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob);
|
|
|
|
|
2010-12-03 02:52:28 +01:00
|
|
|
struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int defgroup);
|
|
|
|
struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup);
|
2011-12-08 04:47:45 +01:00
|
|
|
void defvert_add_index_notest(struct MDeformVert *dv, int defgroup, const float weight);
|
|
|
|
void defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw);
|
2010-01-26 18:07:47 +01:00
|
|
|
|
2011-11-30 08:39:54 +01:00
|
|
|
float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup);
|
|
|
|
float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup);
|
2010-01-26 14:50:17 +01:00
|
|
|
|
2011-11-30 08:39:54 +01:00
|
|
|
void defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src);
|
|
|
|
void defvert_copy_index(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const int defgroup);
|
|
|
|
void defvert_sync(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, int use_verify);
|
|
|
|
void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
|
|
|
|
const int *flip_map, const int flip_map_len, const int use_verify);
|
2011-12-09 09:20:27 +01:00
|
|
|
void defvert_remap (struct MDeformVert *dvert, int *map, const int map_len);
|
2011-10-27 09:54:32 +02:00
|
|
|
void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
|
2012-03-19 22:09:16 +01:00
|
|
|
void defvert_flip_merged(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
|
2010-01-26 14:50:17 +01:00
|
|
|
void defvert_normalize(struct MDeformVert *dvert);
|
2011-12-14 22:08:08 +01:00
|
|
|
void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock);
|
2010-01-26 14:50:17 +01:00
|
|
|
|
|
|
|
/* utility function, note that 32 chars is the maximum string length since its only
|
|
|
|
* used with defgroups currently */
|
2012-01-11 09:51:06 +01:00
|
|
|
void flip_side_name(char name[64], const char from_name[64], int strip_number);
|
2010-01-15 18:28:00 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
#endif
|
|
|
|
|