2012-09-05 04:51:55 +02:00
|
|
|
/*
|
|
|
|
* ***** 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.
|
|
|
|
*
|
|
|
|
* Contributor(s): Campbell Barton
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BKE_OBJECT_DEFORM_H__
|
|
|
|
#define __BKE_OBJECT_DEFORM_H__
|
|
|
|
|
2012-09-06 04:10:09 +02:00
|
|
|
/** \file BKE_object_deform.h
|
2012-09-05 04:51:55 +02:00
|
|
|
* \ingroup bke
|
|
|
|
* \brief Functions for dealing with objects and deform verts,
|
|
|
|
* used by painting and tools.
|
|
|
|
*/
|
|
|
|
|
2014-11-18 23:52:17 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-09-05 04:51:55 +02:00
|
|
|
struct Object;
|
2014-11-18 23:52:17 +01:00
|
|
|
struct ID;
|
|
|
|
struct MDeformVert;
|
|
|
|
struct bDeformGroup;
|
|
|
|
|
|
|
|
/* General vgroup operations */
|
|
|
|
void BKE_object_defgroup_remap_update_users(struct Object *ob, int *map);
|
|
|
|
|
|
|
|
bool BKE_object_defgroup_array_get(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
|
|
|
|
|
|
|
|
struct bDeformGroup *BKE_object_defgroup_add(struct Object *ob);
|
|
|
|
struct bDeformGroup *BKE_object_defgroup_add_name(struct Object *ob, const char *name);
|
|
|
|
struct MDeformVert *BKE_object_defgroup_data_create(struct ID *id);
|
|
|
|
|
|
|
|
bool BKE_object_defgroup_clear(struct Object *ob, struct bDeformGroup *dg, const bool use_selection);
|
|
|
|
bool BKE_object_defgroup_clear_all(struct Object *ob, const bool use_selection);
|
|
|
|
|
|
|
|
void BKE_object_defgroup_remove(struct Object *ob, struct bDeformGroup *defgroup);
|
2016-10-31 15:31:47 +01:00
|
|
|
void BKE_object_defgroup_remove_all_ex(struct Object *ob, bool only_unlocked);
|
2014-11-18 23:52:17 +01:00
|
|
|
void BKE_object_defgroup_remove_all(struct Object *ob);
|
|
|
|
|
|
|
|
|
2016-10-31 15:31:47 +01:00
|
|
|
|
2014-11-18 23:52:17 +01:00
|
|
|
/* Select helpers */
|
|
|
|
enum eVGroupSelect;
|
|
|
|
bool *BKE_object_defgroup_subset_from_select_type(
|
|
|
|
struct Object *ob, enum eVGroupSelect subset_type, int *r_defgroup_tot, int *r_subset_count);
|
|
|
|
void BKE_object_defgroup_subset_to_index_array(
|
|
|
|
const bool *defgroup_validmap, const int defgroup_tot, int *r_defgroup_subset_map);
|
|
|
|
|
|
|
|
|
|
|
|
/* ********** */
|
|
|
|
|
|
|
|
bool *BKE_object_defgroup_lock_flags_get(struct Object *ob, const int defbase_tot);
|
|
|
|
bool *BKE_object_defgroup_validmap_get(struct Object *ob, const int defbase_tot);
|
|
|
|
bool *BKE_object_defgroup_selected_get(struct Object *ob, int defbase_tot, int *r_dg_flags_sel_tot);
|
2012-09-05 04:51:55 +02:00
|
|
|
|
2016-01-20 22:03:15 +01:00
|
|
|
void BKE_object_defgroup_mirror_selection(
|
|
|
|
struct Object *ob, int defbase_tot, const bool *selection,
|
|
|
|
bool *dg_flags_sel, int *r_dg_flags_sel_tot);
|
|
|
|
|
2014-11-18 23:52:17 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2012-09-05 04:51:55 +02:00
|
|
|
|
Transfer Data: add main core code and operators.
This add code needed to map a CD data layout from source mesh towards destination one,
and code needed to actually transfer data, using BKE's mesh remap generated data.
This allows to transfer most CD layers (vgroups, vcols, uvs...) as well as fake, boolean ones
(like smooth/sharp edges/faces, etc.). Some types are not yet transferable, mainly
shape keys, this is known TODO.
Data transfer can also use some advanced mixing in some cases (mostly, vgroups and vcols).
Notes:
* New transfer operators transfer data from active object towards selected ones.
* Modifier will be committed separately.
* Old weight transfer code (for vgroups) is kept for now, mostly because it is the only
usable one in weightpaint mode (it transfers from selected object to active one,
this is not sensible in Object mode, but needed in WeightPaint one). This will be addressed soon.
Again, heavily reviewed and enhanced by Campbell, thanks!
2015-01-09 19:11:40 +01:00
|
|
|
/* Select helpers */
|
|
|
|
bool *BKE_objdef_vgroup_subset_from_select_type(
|
|
|
|
struct Object *ob, enum eVGroupSelect subset_type, int *r_vgroup_tot, int *r_subset_count);
|
|
|
|
void BKE_objdef_vgroup_subset_to_index_array(
|
|
|
|
const bool *vgroup_validmap, const int vgroup_tot, int *r_vgroup_subset_map);
|
|
|
|
|
|
|
|
|
2012-09-05 04:51:55 +02:00
|
|
|
#endif /* __BKE_OBJECT_DEFORM_H__ */
|