LibOverride: Remove 'auto override' option.
Now all overrides are handled that way. Performances of the process look decent enough, even with production characters... If performance issues still arise, we'll investigate other solutions. This should also make T73154 obsolete now.
This commit is contained in:
parent
b586f801fc
commit
fd8d245e6a
Notes:
blender-bot
2023-02-14 10:37:49 +01:00
Referenced by issue #80125, Constraint missing after save and reopen the blend file (fixed in 2.90 - request to backport to LTS) Referenced by issue #77881, GPencil: Type of stroke line not equal as expected Referenced by issue #77835, Flip Region operator is not discoverable in 2.90
|
@ -197,7 +197,6 @@ static ID *lib_override_library_create_from(Main *bmain, ID *reference_id)
|
|||
id_us_min(local_id);
|
||||
|
||||
BKE_lib_override_library_init(local_id, reference_id);
|
||||
local_id->override_library->flag |= OVERRIDE_LIBRARY_AUTO;
|
||||
|
||||
return local_id;
|
||||
}
|
||||
|
@ -736,13 +735,15 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
|
|||
* Generating diff values and applying overrides are much cheaper.
|
||||
*
|
||||
* \return true if new overriding op was created, or some local data was reset. */
|
||||
bool BKE_lib_override_library_operations_create(Main *bmain, ID *local, const bool force_auto)
|
||||
bool BKE_lib_override_library_operations_create(Main *bmain,
|
||||
ID *local,
|
||||
const bool UNUSED(force_auto))
|
||||
{
|
||||
BLI_assert(local->override_library != NULL);
|
||||
const bool is_template = (local->override_library->reference == NULL);
|
||||
bool ret = false;
|
||||
|
||||
if (!is_template && (force_auto || local->override_library->flag & OVERRIDE_LIBRARY_AUTO)) {
|
||||
if (!is_template) {
|
||||
/* Do not attempt to generate overriding rules from an empty place-holder generated by link
|
||||
* code when it cannot find to actual library/ID. Much better to keep the local datablock as
|
||||
* is in the file in that case, until broken lib is fixed. */
|
||||
|
@ -804,7 +805,7 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, const bool for
|
|||
|
||||
FOREACH_MAIN_ID_BEGIN (bmain, id) {
|
||||
if ((ID_IS_OVERRIDE_LIBRARY(id) && force_auto) ||
|
||||
(ID_IS_OVERRIDE_LIBRARY_AUTO(id) && (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
|
||||
(id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH)) {
|
||||
BKE_lib_override_library_operations_create(bmain, id, force_auto);
|
||||
id->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
|
||||
}
|
||||
|
|
|
@ -251,8 +251,7 @@ void flush_editors_id_update(Depsgraph *graph, const DEGEditorUpdateContext *upd
|
|||
if (graph->is_active && id_node->is_user_modified) {
|
||||
deg_editors_id_update(update_ctx, id_orig);
|
||||
}
|
||||
/* ID may need to get its auto-override operations refreshed. */
|
||||
if (ID_IS_OVERRIDE_LIBRARY_AUTO(id_orig)) {
|
||||
if (ID_IS_OVERRIDE_LIBRARY(id_orig)) {
|
||||
id_orig->tag |= LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
|
||||
}
|
||||
/* Inform draw engines that something was changed. */
|
||||
|
|
|
@ -2400,10 +2400,6 @@ static int make_override_library_exec(bContext *C, wmOperator *op)
|
|||
/* TODO: is setting active needed? */
|
||||
BKE_view_layer_base_select_and_set_active(view_layer, base);
|
||||
}
|
||||
else {
|
||||
/* Disable auto-override tags for non-active objects, will help with performaces... */
|
||||
new_ob->id.override_library->flag &= ~OVERRIDE_LIBRARY_AUTO;
|
||||
}
|
||||
/* We still want to store all objects' current override status (i.e. change of parent). */
|
||||
BKE_lib_override_library_operations_create(bmain, &new_ob->id, true);
|
||||
}
|
||||
|
|
|
@ -225,9 +225,6 @@ typedef struct IDOverrideLibrary {
|
|||
/** List of IDOverrideProperty structs. */
|
||||
ListBase properties;
|
||||
|
||||
short flag;
|
||||
char _pad[6];
|
||||
|
||||
/* Read/write data. */
|
||||
/* Temp ID storing extra override data (used for differential operations only currently).
|
||||
* Always NULL outside of read/write context. */
|
||||
|
@ -236,10 +233,6 @@ typedef struct IDOverrideLibrary {
|
|||
IDOverrideLibraryRuntime *runtime;
|
||||
} IDOverrideLibrary;
|
||||
|
||||
enum eOverrideLibrary_Flag {
|
||||
OVERRIDE_LIBRARY_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
|
||||
};
|
||||
|
||||
/* watch it: Sequence has identical beginning. */
|
||||
/**
|
||||
* ID is the first thing included in all serializable types. It
|
||||
|
@ -482,10 +475,6 @@ typedef enum ID_Type {
|
|||
#define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \
|
||||
(((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL)
|
||||
|
||||
#define ID_IS_OVERRIDE_LIBRARY_AUTO(_id) \
|
||||
(!ID_IS_LINKED((_id)) && ID_IS_OVERRIDE_LIBRARY((_id)) && \
|
||||
(((ID *)(_id))->override_library->flag & OVERRIDE_LIBRARY_AUTO))
|
||||
|
||||
/* Check whether datablock type is covered by copy-on-write. */
|
||||
#define ID_TYPE_IS_COW(_id_type) (!ELEM(_id_type, ID_BR, ID_PAL, ID_IM))
|
||||
|
||||
|
|
|
@ -1430,14 +1430,6 @@ static void rna_def_ID_override_library(BlenderRNA *brna)
|
|||
RNA_def_pointer(
|
||||
srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
|
||||
|
||||
prop = RNA_def_boolean(
|
||||
srna,
|
||||
"auto_generate",
|
||||
true,
|
||||
"Auto Generate Override",
|
||||
"Automatically generate overriding operations by detecting changes in properties");
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", OVERRIDE_LIBRARY_AUTO);
|
||||
|
||||
RNA_def_collection(srna,
|
||||
"properties",
|
||||
"IDOverrideLibraryProperty",
|
||||
|
|
Loading…
Reference in New Issue