[Bf-blender-cvs] [74645d969b5] master: Merge branch 'blender-v3.3-release'
Bastien Montagne
noreply at git.blender.org
Fri Aug 12 12:41:03 CEST 2022
Commit: 74645d969b57b3cf6ca14ec7a218345aea311f16
Author: Bastien Montagne
Date: Fri Aug 12 12:40:46 2022 +0200
Branches: master
https://developer.blender.org/rB74645d969b57b3cf6ca14ec7a218345aea311f16
Merge branch 'blender-v3.3-release'
Conflicts:
source/blender/blenkernel/BKE_lib_override.h
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_lib_override.h.orig
index d1eb6e01ae3,00000000000..ee90f0676f7
mode 100644,000000..100644
--- a/source/blender/blenkernel/BKE_lib_override.h.orig
+++ b/source/blender/blenkernel/BKE_lib_override.h.orig
@@@ -1,504 -1,0 +1,510 @@@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright 2016 Blender Foundation. All rights reserved. */
+
+#pragma once
+
+/** \file
+ * \ingroup bke
+ *
+ * API to manage data-blocks inside of Blender's Main data-base, or as independent runtime-only
+ * data.
+ *
+ * \note `BKE_lib_` files are for operations over data-blocks themselves, although they might
+ * alter Main as well (when creating/renaming/deleting an ID e.g.).
+ *
+ * \section Function Names
+ *
+ * \warning Descriptions below is ideal goal, current status of naming does not yet fully follow it
+ * (this is WIP).
+ *
+ * - `BKE_lib_override_library_` should be used for function affecting a single ID.
+ * - `BKE_lib_override_library_main_` should be used for function affecting the whole collection
+ * of IDs in a given Main data-base.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct BlendFileReadReport;
+struct Collection;
+struct ID;
+struct IDOverrideLibrary;
+struct IDOverrideLibraryProperty;
+struct IDOverrideLibraryPropertyOperation;
+struct Library;
+struct Main;
+struct Object;
+struct PointerRNA;
+struct PropertyRNA;
+struct ReportList;
+struct Scene;
+struct ViewLayer;
+
+/**
+ * Initialize empty overriding of \a reference_id by \a local_id.
+ */
+struct IDOverrideLibrary *BKE_lib_override_library_init(struct ID *local_id,
+ struct ID *reference_id);
+/**
+ * Shallow or deep copy of a whole override from \a src_id to \a dst_id.
+ */
+void BKE_lib_override_library_copy(struct ID *dst_id, const struct ID *src_id, bool do_full_copy);
+/**
+ * Clear any overriding data from given \a override.
+ */
+void BKE_lib_override_library_clear(struct IDOverrideLibrary *override, bool do_id_user);
+/**
+ * Free given \a override.
+ */
+void BKE_lib_override_library_free(struct IDOverrideLibrary **override, bool do_id_user);
+
+/**
+ * Return the actual #IDOverrideLibrary data 'controlling' the given `id`, and the actual ID owning
+ * it.
+ *
+ * \note This is especially useful when `id` is a non-real override (e.g. embedded ID like a master
+ * collection or root node tree, or a shape key).
+ *
++<<<<<<< HEAD
+ * \param r_owner_id: If given, will be set with the actual ID owning the return liboverride data.
++=======
++ * \param owner_id_hint If not NULL, a potential owner for the given override-embedded `id`.
++ * \param r_owner_id If given, will be set with the actual ID owning the return liboverride data.
++>>>>>>> blender-v3.3-release
+ */
+IDOverrideLibrary *BKE_lib_override_library_get(struct Main *bmain,
+ struct ID *id,
++ struct ID *owner_id_hint,
+ struct ID **r_owner_id);
+
+/**
+ * Check if given ID has some override rules that actually indicate the user edited it.
+ */
+bool BKE_lib_override_library_is_user_edited(const struct ID *id);
+
+/**
+ * Check if given ID is a system override.
+ */
+bool BKE_lib_override_library_is_system_defined(const struct Main *bmain, const struct ID *id);
+
+/**
+ * Check if given Override Property for given ID is animated (through a F-Curve in an Action, or
+ * from a driver).
+ *
+ * \param override_rna_prop: if not NULL, the RNA property matching the given path in the
+ * `override_prop`.
+ * \param rnaprop_index: Array in the RNA property, 0 if unknown or irrelevant.
+ */
+bool BKE_lib_override_library_property_is_animated(const ID *id,
+ const IDOverrideLibraryProperty *override_prop,
+ const struct PropertyRNA *override_rna_prop,
+ const int rnaprop_index);
+
+/**
+ * Check if given ID is a leaf in its liboverride hierarchy (i.e. if it does not use any other
+ * override ID).
+ *
+ * NOTE: Embedded IDs of override IDs are not considered as leaves.
+ */
+bool BKE_lib_override_library_is_hierarchy_leaf(struct Main *bmain, struct ID *id);
+
+/**
+ * Create an overridden local copy of linked reference.
+ *
+ * \note This function is very basic, low-level. It does not consider any hierarchical dependency,
+ * and also prevents any automatic re-sync of this local override.
+ */
+struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain,
+ struct ID *reference_id,
+ bool do_tagged_remap);
+/**
+ * Create overridden local copies of all tagged data-blocks in given Main.
+ *
+ * \note Set `id->newid` of overridden libs with newly created overrides,
+ * caller is responsible to clean those pointers before/after usage as needed.
+ *
+ * \note By default, it will only remap newly created local overriding data-blocks between
+ * themselves, to avoid 'enforcing' those overrides into all other usages of the linked data in
+ * main. You can add more local IDs to be remapped to use new overriding ones by setting their
+ * LIB_TAG_DOIT tag.
+ *
+ * \param owner_library: the library in which the overrides should be created. Besides versioning
+ * and resync code path, this should always be NULL (i.e. the local .blend file).
+ *
+ * \param id_root_reference: the linked ID that is considered as the root of the overridden
+ * hierarchy.
+ *
+ * \param id_hierarchy_root: the override ID that is the root of the hierarchy. May be NULL, in
+ * which case it is assumed that the given `id_root_reference` is tagged for override, and its
+ * newly created override will be used as hierarchy root. Must be NULL if
+ * `id_hierarchy_root_reference` is not NULL.
+ *
+ * \param id_hierarchy_root_reference: the linked ID that is the root of the hierarchy. Must be
+ * tagged for override. May be NULL, in which case it is assumed that the given `id_root_reference`
+ * is tagged for override, and its newly created override will be used as hierarchy root. Must be
+ * NULL if `id_hierarchy_root` is not NULL.
+ *
+ * \param do_no_main: Create the new override data outside of Main database.
+ * Used for resyncing of linked overrides.
+ *
+ * \param do_fully_editable: if true, tag all created overrides as user-editable by default.
+ *
+ * \return \a true on success, \a false otherwise.
+ */
+bool BKE_lib_override_library_create_from_tag(struct Main *bmain,
+ struct Library *owner_library,
+ const struct ID *id_root_reference,
+ struct ID *id_hierarchy_root,
+ const struct ID *id_hierarchy_root_reference,
+ bool do_no_main,
+ const bool do_fully_editable);
+/**
+ * Advanced 'smart' function to create fully functional overrides.
+ *
+ * \note Currently it only does special things if given \a id_root is an object or collection, more
+ * specific behaviors may be added in the future for other ID types.
+ *
+ * \note It will override all IDs tagged with \a LIB_TAG_DOIT, and it does not clear that tag at
+ * its beginning, so caller code can add extra data-blocks to be overridden as well.
+ *
+ * \param view_layer: the active view layer to search instantiated collections in, can be NULL (in
+ * which case \a scene's master collection children hierarchy is used instead).
+ *
+ * \param owner_library: the library in which the overrides should be created. Besides versioning
+ * and resync code path, this should always be NULL (i.e. the local .blend file).
+ *
+ * \param id_root_reference: The linked root ID to create an override from. May be a sub-root of
+ * the overall hierarchy, in which case calling code is expected to have already tagged required
+ * 'path' of IDs leading from the given `id_hierarchy_root` to the given `id_root`.
+ *
+ * \param id_hierarchy_root_reference: The ID to be used a hierarchy root of the overrides to be
+ * created. Can be either the linked root ID of the whole override hierarchy, (typically the same
+ * as `id_root`, unless a sub-part only of the hierarchy is overridden), or the already existing
+ * override hierarchy root if part of the hierarchy is already overridden.
+ *
+ * \param id_instance_hint: Some ID used as hint/reference to do some post-processing after
+ * overrides have been created, may be NULL. Typically, the Empty object instantiating the linked
+ * collection we override, currently.
+ *
+ * \param r_id_root_override: if not NULL, the override generated for the given \a id_root.
+ *
+ * \param do_fully_editable: if true, tag all created overrides as user-editable by default.
+ *
+ * \return true if override was successfully created.
+ */
+bool BKE_lib_override_library_create(struct Main *bmain,
+ struct Scene *scene,
+ struct ViewLayer *view_layer,
+ struct Library *owner_library,
+ struct ID *id_root_reference,
+ struct ID *id_hierarchy_root_reference,
+ struct ID *id_instance_hint,
+ struct ID **r_id_root_override,
+ const bool do_fully_editable);
+/**
+ * Create a library override template.
+ */
+bool BKE_lib_override_library_template_create(struct ID *id);
+/**
+ * Convert a given proxy object into a library override.
+ *
+ * \note This is a thin wrapper around \a BKE_lib_override_library_create, only extra work is to
+ * actually conver
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list