BKE_object_deform.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. *
  18. * Contributor(s): Campbell Barton
  19. *
  20. * ***** END GPL LICENSE BLOCK *****
  21. */
  22. #ifndef __BKE_OBJECT_DEFORM_H__
  23. #define __BKE_OBJECT_DEFORM_H__
  24. /** \file BKE_object_deform.h
  25. * \ingroup bke
  26. * \brief Functions for dealing with objects and deform verts,
  27. * used by painting and tools.
  28. */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. struct Object;
  33. struct ID;
  34. struct MDeformVert;
  35. struct bDeformGroup;
  36. /* General vgroup operations */
  37. void BKE_object_defgroup_remap_update_users(struct Object *ob, int *map);
  38. bool BKE_object_defgroup_array_get(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
  39. struct bDeformGroup *BKE_object_defgroup_add(struct Object *ob);
  40. struct bDeformGroup *BKE_object_defgroup_add_name(struct Object *ob, const char *name);
  41. struct MDeformVert *BKE_object_defgroup_data_create(struct ID *id);
  42. bool BKE_object_defgroup_clear(struct Object *ob, struct bDeformGroup *dg, const bool use_selection);
  43. bool BKE_object_defgroup_clear_all(struct Object *ob, const bool use_selection);
  44. void BKE_object_defgroup_remove(struct Object *ob, struct bDeformGroup *defgroup);
  45. void BKE_object_defgroup_remove_all_ex(struct Object *ob, bool only_unlocked);
  46. void BKE_object_defgroup_remove_all(struct Object *ob);
  47. /* Select helpers */
  48. enum eVGroupSelect;
  49. bool *BKE_object_defgroup_subset_from_select_type(
  50. struct Object *ob, enum eVGroupSelect subset_type, int *r_defgroup_tot, int *r_subset_count);
  51. void BKE_object_defgroup_subset_to_index_array(
  52. const bool *defgroup_validmap, const int defgroup_tot, int *r_defgroup_subset_map);
  53. /* ********** */
  54. bool *BKE_object_defgroup_lock_flags_get(struct Object *ob, const int defbase_tot);
  55. bool *BKE_object_defgroup_validmap_get(struct Object *ob, const int defbase_tot);
  56. bool *BKE_object_defgroup_selected_get(struct Object *ob, int defbase_tot, int *r_dg_flags_sel_tot);
  57. void BKE_object_defgroup_mirror_selection(
  58. struct Object *ob, int defbase_tot, const bool *selection,
  59. bool *dg_flags_sel, int *r_dg_flags_sel_tot);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. /* Select helpers */
  64. bool *BKE_objdef_vgroup_subset_from_select_type(
  65. struct Object *ob, enum eVGroupSelect subset_type, int *r_vgroup_tot, int *r_subset_count);
  66. void BKE_objdef_vgroup_subset_to_index_array(
  67. const bool *vgroup_validmap, const int vgroup_tot, int *r_vgroup_subset_map);
  68. #endif /* __BKE_OBJECT_DEFORM_H__ */