Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-01-24 19:38:36 +0300
committerBastien Montagne <bastien@blender.org>2022-01-25 11:12:13 +0300
commit2e9b8689e408c9b8b22a0ff21c5fa02d776d2d40 (patch)
tree7ea619569365ea4cd67153d5248c0a32287c8575 /source/blender/blenkernel/BKE_lib_id.h
parenta2301b1d9110a16c84b6fcf539f8099d7eb0ae65 (diff)
Fix T95037: Allow making local IDs that are not used by anything.
Some IDs (like text ones) can be linked and only kept around thanks to editors, allow making such IDs local in `BKE_lib_id_make_local_generic`. Also refactor logic checking whether ID should be made directly local or copied into its own util function, so that we can remain sure all special-cases 'make local' code still uses the same logic here.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index 1d905ad85b1..ebd35cad965 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -383,6 +383,16 @@ enum {
};
/**
+ * Helper to decide whether given `id` can be directly made local, or needs to be copied.
+ * `r_force_local` and `r_force_copy` cannot be true together. But both can be false, in case no
+ * action should be performed.
+ *
+ * \note low-level helper to de-duplicate logic between `BKE_lib_id_make_local_generic` and the
+ * specific corner-cases implementations needed for objects and brushes.
+ */
+void BKE_lib_id_make_local_generic_action_define(
+ struct Main *bmain, struct ID *id, int flags, bool *r_force_local, bool *r_force_copy);
+/**
* Generic 'make local' function, works for most of data-block types.
*/
void BKE_lib_id_make_local_generic(struct Main *bmain, struct ID *id, int flags);