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
|
|
|
#ifndef __BKE_MBALL_H__
|
|
|
|
#define __BKE_MBALL_H__
|
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
|
|
|
*/
|
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
|
|
|
|
2012-05-07 06:38:41 +00:00
|
|
|
void BKE_mball_free(struct MetaBall *mb);
|
First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
|
|
|
void BKE_mball_init(struct MetaBall *mb);
|
2013-02-05 12:46:15 +00:00
|
|
|
struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
|
Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).
This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.
It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).
Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!
As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.
Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
|
|
|
void BKE_mball_copy_data(struct Main *bmain, struct MetaBall *mb_dst, const struct MetaBall *mb_src, const int flag);
|
2017-06-14 22:36:30 +02:00
|
|
|
struct MetaBall *BKE_mball_copy(struct Main *bmain, const struct MetaBall *mb);
|
2004-06-29 17:10:13 +00:00
|
|
|
|
2016-07-20 19:49:45 +02:00
|
|
|
void BKE_mball_make_local(struct Main *bmain, struct MetaBall *mb, const bool lib_local);
|
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);
|
2018-11-06 23:30:30 -02:00
|
|
|
bool BKE_mball_is_any_selected_multi(struct Object **objects, int objects_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]);
|
2017-08-11 22:16:44 +10:00
|
|
|
void BKE_mball_transform(struct MetaBall *mb, 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);
|
2018-11-06 23:36:50 -02:00
|
|
|
int BKE_mball_select_count_multi(struct Object **objects, int objects_len);
|
2012-10-06 03:02:14 +00:00
|
|
|
void BKE_mball_select_all(struct MetaBall *mb);
|
2018-11-06 23:30:30 -02:00
|
|
|
void BKE_mball_select_all_multi(struct Object **objects, int objects_len);
|
2012-10-06 03:02:14 +00:00
|
|
|
void BKE_mball_deselect_all(struct MetaBall *mb);
|
2018-11-06 23:30:30 -02:00
|
|
|
void BKE_mball_deselect_all_multi(struct Object **objects, int objects_len);
|
2012-10-06 03:02:14 +00:00
|
|
|
void BKE_mball_select_swap(struct MetaBall *mb);
|
2018-11-06 23:30:30 -02:00
|
|
|
void BKE_mball_select_swap_multi(struct Object **objects, int objects_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,
|
|
|
|
};
|
2018-08-23 10:14:29 -03: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
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
#endif
|