2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00: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-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00: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 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
2020-03-02 15:07:49 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-03-26 18:47:55 +11:00
|
|
|
struct Base;
|
2018-08-23 21:26:44 +02:00
|
|
|
struct BoundBox;
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Main;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct MetaBall;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct MetaElem;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Object;
|
2009-01-04 14:14:06 +00:00
|
|
|
struct Scene;
|
2004-06-29 17:10:13 +00:00
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
|
2004-06-29 17:10:13 +00:00
|
|
|
|
2018-05-12 22:16:09 +02:00
|
|
|
bool BKE_mball_is_any_selected(const struct MetaBall *mb);
|
2019-03-26 18:47:55 +11:00
|
|
|
bool BKE_mball_is_any_selected_multi(struct Base **bases, int bases_len);
|
2018-05-12 22:16:09 +02:00
|
|
|
bool BKE_mball_is_any_unselected(const struct MetaBall *mb);
|
2013-03-09 05:35:49 +00:00
|
|
|
bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2);
|
|
|
|
bool BKE_mball_is_basis(struct Object *ob);
|
2012-05-07 06:38:41 +00:00
|
|
|
struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob);
|
2004-06-29 17:10:13 +00:00
|
|
|
|
2012-05-07 06:38:41 +00:00
|
|
|
void BKE_mball_texspace_calc(struct Object *ob);
|
2018-08-23 21:26:44 +02:00
|
|
|
struct BoundBox *BKE_mball_boundbox_get(struct Object *ob);
|
2012-05-07 06:38:41 +00:00
|
|
|
float *BKE_mball_make_orco(struct Object *ob, struct ListBase *dispbase);
|
2004-06-29 17:10:13 +00:00
|
|
|
|
2012-05-07 06:38:41 +00:00
|
|
|
void BKE_mball_properties_copy(struct Scene *scene, struct Object *active_object);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2018-11-08 08:02:02 +11:00
|
|
|
bool BKE_mball_minmax_ex(const struct MetaBall *mb,
|
|
|
|
float min[3],
|
|
|
|
float max[3],
|
|
|
|
const float obmat[4][4],
|
|
|
|
const short flag);
|
|
|
|
bool BKE_mball_minmax(const struct MetaBall *mb, float min[3], float max[3]);
|
|
|
|
bool BKE_mball_center_median(const struct MetaBall *mb, float r_cent[3]);
|
|
|
|
bool BKE_mball_center_bounds(const struct MetaBall *mb, float r_cent[3]);
|
2019-08-23 09:03:57 +10:00
|
|
|
void BKE_mball_transform(struct MetaBall *mb, const float mat[4][4], const bool do_props);
|
2012-10-06 03:34:52 +00:00
|
|
|
void BKE_mball_translate(struct MetaBall *mb, const float offset[3]);
|
2012-02-26 08:55:31 +00:00
|
|
|
|
2012-05-07 06:38:41 +00:00
|
|
|
struct MetaElem *BKE_mball_element_add(struct MetaBall *mb, const int type);
|
2002-10-30 02:07:20 +00:00
|
|
|
|
2018-11-08 08:02:02 +11:00
|
|
|
int BKE_mball_select_count(const struct MetaBall *mb);
|
2019-03-26 18:47:55 +11:00
|
|
|
int BKE_mball_select_count_multi(struct Base **bases, int bases_len);
|
|
|
|
bool BKE_mball_select_all(struct MetaBall *mb);
|
|
|
|
bool BKE_mball_select_all_multi_ex(struct Base **bases, int bases_len);
|
|
|
|
bool BKE_mball_deselect_all(struct MetaBall *mb);
|
|
|
|
bool BKE_mball_deselect_all_multi_ex(struct Base **bases, int bases_len);
|
|
|
|
bool BKE_mball_select_swap(struct MetaBall *mb);
|
|
|
|
bool BKE_mball_select_swap_multi_ex(struct Base **bases, int bases_len);
|
2012-10-06 03:02:14 +00:00
|
|
|
|
2015-05-12 13:57:11 +05:00
|
|
|
/* **** Depsgraph evaluation **** */
|
|
|
|
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2015-05-12 13:57:11 +05:00
|
|
|
|
2017-11-16 15:12:32 -02:00
|
|
|
/* Draw Cache */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
BKE_MBALL_BATCH_DIRTY_ALL = 0,
|
|
|
|
};
|
2020-10-09 07:25:43 +02:00
|
|
|
void BKE_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode);
|
2017-11-16 15:12:32 -02:00
|
|
|
void BKE_mball_batch_cache_free(struct MetaBall *mb);
|
2015-05-12 13:57:11 +05:00
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
extern void (*BKE_mball_batch_cache_dirty_tag_cb)(struct MetaBall *mb, int mode);
|
2019-02-23 12:58:39 +11:00
|
|
|
extern void (*BKE_mball_batch_cache_free_cb)(struct MetaBall *mb);
|
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|