[Bf-blender-cvs] [9ae928f] id-remap: Merge branch 'master' into id-remap
Bastien Montagne
noreply at git.blender.org
Thu Dec 31 12:50:21 CET 2015
Commit: 9ae928ff9df0342a31614bcfa0e03559d0ba43f7
Author: Bastien Montagne
Date: Thu Dec 31 12:50:08 2015 +0100
Branches: id-remap
https://developer.blender.org/rB9ae928ff9df0342a31614bcfa0e03559d0ba43f7
Merge branch 'master' into id-remap
Conflicts:
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_material.h
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_library.h
index a92edb5,7af126f..fb1ebf5
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@@ -57,33 -57,17 +57,45 @@@ void *BKE_libblock_copy_nolib(struct I
void *BKE_libblock_copy(struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const bool do_action);
void BKE_libblock_relink(struct ID *id);
+ void BKE_libblock_rename(struct Main *bmain, struct ID *id, const char *name) ATTR_NONNULL();
+ void BLI_libblock_ensure_unique_name(struct Main *bmain, const char *name) ATTR_NONNULL();
+
+ void BKE_libblock_free(struct Main *bmain, void *idv) ATTR_NONNULL();
+ void BKE_libblock_free_ex(struct Main *bmain, void *idv, bool do_id_user) ATTR_NONNULL();
+ void BKE_libblock_free_us(struct Main *bmain, void *idv) ATTR_NONNULL();
+ void BKE_libblock_free_data(struct Main *bmain, struct ID *id) ATTR_NONNULL();
+
++void BKE_libblock_delete(struct Main *bmain, void *idv) ATTR_NONNULL();
++
+ struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+ struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+/* Also IDRemap->flag. */
+enum {
+ /* Do not remap indirect usages of IDs (that is, when user is some linked data). */
+ ID_REMAP_SKIP_INDIRECT_USAGE = 1 << 0,
+ /* This flag should always be set, *except for 'unlink' scenarios* (only relevant when new_id == NULL).
+ * Basically, when unset, NEVER_NULL ID usages will keep pointing to old_id, but (if needed) old_id user count
+ * will still be decremented. This is mandatory for 'delete ID' case, but in all other situation this would lead
+ * to invalid user counts! */
+ ID_REMAP_SKIP_NEVER_NULL_USAGE = 1 << 1,
+ /* This tells the callback func to flag with LIB_DOIT all IDs using target one with a 'never NULL' pointer
+ * (like e.g. Object->data). */
+ ID_REMAP_FLAG_NEVER_NULL_USAGE = 1 << 2,
+};
+
+/* Note: Requiring new_id to be non-null, this *may* not be the case ultimately, but makes things simpler for now. */
+void BKE_libblock_remap_locked(
+ struct Main *bmain, void *old_idv, void *new_idv,
+ const short remap_flags) ATTR_NONNULL(1, 2);
+void BKE_libblock_remap(
+ struct Main *bmain, void *old_idv, void *new_idv,
+ const short remap_flags) ATTR_NONNULL(1, 2);
+
+void BKE_libblock_unlink(struct Main *bmain, void *idv, const bool do_flag_never_null) ATTR_NONNULL();
+
+void BKE_libblock_relink_ex(void *idv, void *old_idv, void *new_idv, const bool us_min_never_null) ATTR_NONNULL(1);
+
void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
void id_lib_extern(struct ID *id);
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
@@@ -141,12 -118,9 +145,9 @@@ void BKE_id_ui_prefix(char name[66 + 1]
void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagged_only);
- struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
- struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-
typedef void (*BKE_library_free_window_manager_cb)(struct bContext *, struct wmWindowManager *);
typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
-typedef void (*BKE_library_free_editor_id_reference_cb)(const struct ID *);
+typedef void (*BKE_library_remap_editor_id_reference_cb)(struct ID *, struct ID *);
void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func);
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func);
More information about the Bf-blender-cvs
mailing list