2011-02-18 14:05:18 +01:00
|
|
|
/*
|
2008-01-07 20:13:47 +01: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-01-07 20:13:47 +01: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-01-07 20:13:47 +01:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 13:37:38 +02:00
|
|
|
*/
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __BKE_LIBRARY_H__
|
|
|
|
#define __BKE_LIBRARY_H__
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2011-02-18 14:05:18 +01:00
|
|
|
/** \file BKE_library.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \since March 2001
|
|
|
|
* \author nzc
|
|
|
|
*/
|
2010-10-05 02:05:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-09-01 17:01:15 +02:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
struct ListBase;
|
|
|
|
struct ID;
|
|
|
|
struct Main;
|
|
|
|
struct Library;
|
2007-12-24 19:38:03 +01:00
|
|
|
struct wmWindowManager;
|
|
|
|
struct bContext;
|
2011-06-29 06:34:20 +02:00
|
|
|
struct PointerRNA;
|
|
|
|
struct PropertyRNA;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2014-01-15 16:37:03 +01:00
|
|
|
void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
2013-09-01 17:01:15 +02:00
|
|
|
void *BKE_libblock_copy_ex(struct Main *bmain, struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
2014-03-21 13:44:38 +01:00
|
|
|
void *BKE_libblock_copy_nolib(struct ID *id) ATTR_NONNULL();
|
2013-09-01 17:01:15 +02:00
|
|
|
void *BKE_libblock_copy(struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
2013-03-10 06:46:24 +01:00
|
|
|
void BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const bool do_action);
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2011-11-30 01:32:13 +01:00
|
|
|
void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
|
2002-10-12 13:37:38 +02:00
|
|
|
void id_lib_extern(struct ID *id);
|
2011-10-23 19:52:20 +02:00
|
|
|
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
|
2012-12-18 09:41:38 +01:00
|
|
|
void id_us_ensure_real(struct ID *id);
|
2002-10-12 13:37:38 +02:00
|
|
|
void id_us_plus(struct ID *id);
|
2009-05-27 02:03:49 +02:00
|
|
|
void id_us_min(struct ID *id);
|
2012-05-05 16:03:12 +02:00
|
|
|
|
2013-03-10 06:46:24 +01:00
|
|
|
bool id_make_local(struct ID *id, bool test);
|
|
|
|
bool id_single_user(struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop);
|
|
|
|
bool id_copy(struct ID *id, struct ID **newid, bool test);
|
|
|
|
bool id_unlink(struct ID *id, int test);
|
2012-04-06 18:19:30 +02:00
|
|
|
void id_sort_by_name(struct ListBase *lb, struct ID *id);
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2013-03-10 06:46:24 +01:00
|
|
|
bool new_id(struct ListBase *lb, struct ID *id, const char *name);
|
2011-10-26 23:22:35 +02:00
|
|
|
void id_clear_lib_data(struct Main *bmain, struct ID *id);
|
2002-10-12 13:37:38 +02:00
|
|
|
|
* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
/usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
2010-03-30 14:15:16 +02:00
|
|
|
struct ListBase *which_libbase(struct Main *mainlib, short type);
|
2006-09-06 11:51:30 +02:00
|
|
|
|
2012-06-04 18:42:58 +02:00
|
|
|
#define MAX_LIBARRAY 41
|
2002-10-12 13:37:38 +02:00
|
|
|
int set_listbasepointers(struct Main *main, struct ListBase **lb);
|
|
|
|
|
2014-01-15 16:37:03 +01:00
|
|
|
void BKE_libblock_free(struct Main *bmain, void *idv);
|
|
|
|
void BKE_libblock_free_ex(struct Main *bmain, void *idv, bool do_id_user);
|
|
|
|
void BKE_libblock_free_us(struct Main *bmain, void *idv);
|
2012-10-28 18:09:50 +01:00
|
|
|
void BKE_libblock_free_data(struct ID *id);
|
2013-12-26 12:24:42 +01:00
|
|
|
|
2013-12-30 03:25:27 +01:00
|
|
|
|
|
|
|
/* Main API */
|
2013-12-26 12:24:42 +01:00
|
|
|
struct Main *BKE_main_new(void);
|
2013-12-30 03:25:27 +01:00
|
|
|
void BKE_main_free(struct Main *mainvar);
|
|
|
|
|
|
|
|
void BKE_main_id_tag_idcode(struct Main *mainvar, const short type, const bool tag);
|
|
|
|
void BKE_main_id_tag_listbase(struct ListBase *lb, const bool tag);
|
|
|
|
void BKE_main_id_tag_all(struct Main *mainvar, const bool tag);
|
|
|
|
|
|
|
|
void BKE_main_id_flag_listbase(ListBase *lb, const short flag, const bool value);
|
|
|
|
void BKE_main_id_flag_all(struct Main *bmain, const short flag, const bool value);
|
|
|
|
|
|
|
|
void BKE_main_id_clear_newpoins(struct Main *bmain);
|
2011-01-05 06:33:27 +01:00
|
|
|
|
2013-12-30 03:25:27 +01:00
|
|
|
void BKE_main_lib_objects_recalc_all(struct Main *bmain);
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2010-12-03 18:05:21 +01:00
|
|
|
void rename_id(struct ID *id, const char *name);
|
2013-03-10 06:46:24 +01:00
|
|
|
void name_uiprefix_id(char *name, const struct ID *id);
|
2002-10-12 13:37:38 +02:00
|
|
|
void test_idbutton(char *name);
|
2013-12-30 03:25:27 +01:00
|
|
|
|
2013-03-10 06:46:24 +01:00
|
|
|
void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagged_only);
|
2013-12-30 03:25:27 +01:00
|
|
|
|
2013-09-01 17:01:15 +02:00
|
|
|
struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2007-12-24 19:38:03 +01:00
|
|
|
void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
|
2013-04-08 15:03:04 +02:00
|
|
|
void set_free_notifier_reference_cb(void (*func)(const void *) );
|
2007-12-24 19:38:03 +01:00
|
|
|
|
2010-03-06 19:21:57 +01:00
|
|
|
/* use when "" is given to new_id() */
|
2013-03-25 09:29:06 +01:00
|
|
|
#define ID_FALLBACK_NAME N_("Untitled")
|
2010-03-06 19:21:57 +01:00
|
|
|
|
2010-12-20 08:21:08 +01:00
|
|
|
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
|
|
|
|
|
2010-10-05 02:05:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-10 06:46:24 +01:00
|
|
|
#endif /* __BKE_LIBRARY_H__ */
|