diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-01 11:44:31 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-01 11:44:31 +0300 |
commit | 98c767244d438bc4b62149b85af061e32d5a770a (patch) | |
tree | 1f020c2e114e888f55d3d70402ee6e29929c1d5e /source | |
parent | aad0e52e38581854a6ab6c6fcb0f35d5054d5bbf (diff) | |
parent | 2ce94cc24b2ce5fdb89ae5d503aaabe22687e285 (diff) |
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8
Diffstat (limited to 'source')
23 files changed, 106 insertions, 86 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index fe4a145b7b3..71c63df7bf3 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -69,10 +69,10 @@ bool BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct b void BKE_animdata_free(struct ID *id, const bool do_id_user); /* Copy AnimData */ -struct AnimData *BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, const bool do_action); +struct AnimData *BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, const bool do_action, const bool do_id_user); /* Copy AnimData */ -bool BKE_animdata_copy_id(struct Main *bmain, struct ID *id_to, struct ID *id_from, const bool do_action); +bool BKE_animdata_copy_id(struct Main *bmain, struct ID *id_to, struct ID *id_from, const bool do_action, const bool do_id_user); /* Copy AnimData Actions */ void BKE_animdata_copy_id_action(struct ID *id, const bool set_newid); diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index e50c33e258c..12525fe9a50 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -322,6 +322,11 @@ int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list); struct Depsgraph *CTX_data_depsgraph(const bContext *C); +/* Will Return NULL if depsgraph is not allocated yet. + * Only used by handful of operators which are run on file load. + */ +struct Depsgraph *CTX_data_depsgraph_on_load(const bContext *C); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 404b5a2fd4e..2f2193db51b 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -264,7 +264,7 @@ void BKE_animdata_free(ID *id, const bool do_id_user) /* Copying -------------------------------------------- */ /* Make a copy of the given AnimData - to be used when copying datablocks */ -AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action) +AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action, const bool do_id_user) { AnimData *dadt; @@ -279,7 +279,7 @@ AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action) BKE_id_copy_ex(bmain, (ID *)dadt->action, (ID **)&dadt->action, 0, false); BKE_id_copy_ex(bmain, (ID *)dadt->tmpact, (ID **)&dadt->tmpact, 0, false); } - else { + else if (do_id_user) { id_us_plus((ID *)dadt->action); id_us_plus((ID *)dadt->tmpact); } @@ -297,19 +297,19 @@ AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action) return dadt; } -bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, const bool do_action) +bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, const bool do_action, const bool do_id_user) { AnimData *adt; if ((id_to && id_from) && (GS(id_to->name) != GS(id_from->name))) return false; - BKE_animdata_free(id_to, true); + BKE_animdata_free(id_to, do_id_user); adt = BKE_animdata_from_id(id_from); if (adt) { IdAdtTemplate *iat = (IdAdtTemplate *)id_to; - iat->adt = BKE_animdata_copy(bmain, adt, do_action); + iat->adt = BKE_animdata_copy(bmain, adt, do_action, do_id_user); } return true; diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 72832e9f897..f420fd974cd 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -1244,3 +1244,10 @@ Depsgraph *CTX_data_depsgraph(const bContext *C) ViewLayer *view_layer = CTX_data_view_layer(C); return BKE_scene_get_depsgraph(scene, view_layer, true); } + +Depsgraph *CTX_data_depsgraph_on_load(const bContext *C) +{ + Scene *scene = CTX_data_scene(C); + ViewLayer *view_layer = CTX_data_view_layer(C); + return BKE_scene_get_depsgraph(scene, view_layer, false); +} diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index c08a8c4aa4c..fa38e3c441a 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1376,7 +1376,7 @@ static void id_copy_animdata(Main *bmain, ID *id, const bool do_action) if (adt) { IdAdtTemplate *iat = (IdAdtTemplate *)id; - iat->adt = BKE_animdata_copy(bmain, iat->adt, do_action); /* could be set to false, need to investigate */ + iat->adt = BKE_animdata_copy(bmain, iat->adt, do_action, true); /* could be set to false, need to investigate */ } } diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 39ad95e9183..2f2f2fb3599 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -199,7 +199,9 @@ Material *BKE_material_localize(Material *ma) BLI_listbase_clear(&man->gpumaterial); /* TODO Duplicate Engine Settings and set runtime to NULL */ - + + man->id.tag |= LIB_TAG_LOCALIZED; + return man; } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index def8ea1d239..62c3bb5be35 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2051,6 +2051,8 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree) if (ntree->typeinfo->localize) ntree->typeinfo->localize(ltree, ntree); + ltree->id.tag |= LIB_TAG_LOCALIZED; + BLI_mutex_unlock(ntree->duplilock); return ltree; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 4681f54e26f..4056a15fe47 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -865,6 +865,15 @@ void BKE_sculpt_update_mesh_elements( Depsgraph *depsgraph, Scene *scene, Sculpt *sd, Object *ob, bool need_pmap, bool need_mask) { + if (depsgraph == NULL) { + /* Happens on file load. + * + * We do nothing in this case, it will be taken care about on depsgraph + * evaluation. + */ + return; + } + DerivedMesh *dm; SculptSession *ss = ob->sculpt; Mesh *me = ob->data; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index f1869fdd916..201df94b691 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -211,7 +211,7 @@ OperationDepsNode *DepsgraphRelationBuilder::get_node( OperationDepsNode *op_node = find_node(key); if (op_node == NULL) { fprintf(stderr, "find_node_operation: Failed for (%s, '%s')\n", - DEG_OPNAMES[key.opcode], key.name); + operationCodeAsString(key.opcode), key.name); } return op_node; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc index 4b8e4faae3f..a965d890496 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc @@ -179,7 +179,7 @@ string OperationKey::identifier() const return string("OperationKey(") + "t: " + typebuf + ", cn: '" + component_name + - "', c: " + DEG_OPNAMES[opcode] + + "', c: " + operationCodeAsString(opcode) + ", n: '" + name + "')"; } diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cc b/source/blender/depsgraph/intern/depsgraph_type_defines.cc index c4fc9591611..6484d1f21ad 100644 --- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc +++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc @@ -71,11 +71,46 @@ DepsNodeFactory *deg_type_get_factory(const eDepsNode_Type type) return depsnode_typeinfo_registry[type]; } -/* Stringified opcodes ------------------------------------- */ +/* Stringified node types ---------------------------------- */ + +const char* nodeTypeAsString(eDepsNode_Type type) +{ + switch (type) { +#define STRINGIFY_TYPE(name) case DEG_NODE_TYPE_##name: return #name + + STRINGIFY_TYPE(UNDEFINED); + STRINGIFY_TYPE(OPERATION); + /* **** Generic Types **** */ + STRINGIFY_TYPE(TIMESOURCE); + STRINGIFY_TYPE(ID_REF); + /* **** Outer Types **** */ + STRINGIFY_TYPE(PARAMETERS); + STRINGIFY_TYPE(PROXY); + STRINGIFY_TYPE(ANIMATION); + STRINGIFY_TYPE(TRANSFORM); + STRINGIFY_TYPE(GEOMETRY); + STRINGIFY_TYPE(SEQUENCER); + STRINGIFY_TYPE(LAYER_COLLECTIONS); + STRINGIFY_TYPE(COPY_ON_WRITE); + /* **** Evaluation-Related Outer Types (with Subdata) **** */ + STRINGIFY_TYPE(EVAL_POSE); + STRINGIFY_TYPE(BONE); + STRINGIFY_TYPE(EVAL_PARTICLES); + STRINGIFY_TYPE(SHADING); + STRINGIFY_TYPE(SHADING_PARAMETERS); + STRINGIFY_TYPE(CACHE); + STRINGIFY_TYPE(BATCH_CACHE); + + /* Total number of meaningful node types. */ + case NUM_DEG_NODE_TYPES: return "SpecialCase"; +#undef STRINGIFY_TYPE + } + return "UNKNOWN"; +} -DepsOperationStringifier DEG_OPNAMES; +/* Stringified opcodes ------------------------------------- */ -static const char *stringify_opcode(eDepsOperation_Code opcode) +const char* operationCodeAsString(eDepsOperation_Code opcode) { switch (opcode) { #define STRINGIFY_OPCODE(name) case DEG_OPCODE_##name: return #name @@ -143,22 +178,6 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) return "UNKNOWN"; } -DepsOperationStringifier::DepsOperationStringifier() -{ - for (int i = 0; i < DEG_NUM_OPCODES; ++i) { - names_[i] = stringify_opcode((eDepsOperation_Code)i); - } -} - -const char *DepsOperationStringifier::operator[](eDepsOperation_Code opcode) -{ - BLI_assert((opcode >= 0) && (opcode < DEG_NUM_OPCODES)); - if (opcode >= 0 && opcode < DEG_NUM_OPCODES) { - return names_[opcode]; - } - return "UnknownOpcode"; -} - } // namespace DEG /* Register all node types */ diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index 6d328b399e0..766f02c0d26 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -155,6 +155,8 @@ typedef enum eDepsNode_Type { NUM_DEG_NODE_TYPES, } eDepsNode_Type; +const char* nodeTypeAsString(eDepsNode_Type type); + /* Identifiers for common operations (as an enum). */ typedef enum eDepsOperation_Code { /* Generic Operations. ------------------------------ */ @@ -268,16 +270,6 @@ typedef enum eDepsOperation_Code { DEG_NUM_OPCODES, } eDepsOperation_Code; -/* Some magic to stringify operation codes. */ -class DepsOperationStringifier { -public: - DepsOperationStringifier(); - const char *operator[](eDepsOperation_Code opcodex); -protected: - const char *names_[DEG_NUM_OPCODES]; -}; - -/* String defines for these opcodes, defined in depsgraph_type_defines.cpp */ -extern DepsOperationStringifier DEG_OPNAMES; +const char* operationCodeAsString(eDepsOperation_Code opcode); } // namespace DEG diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index d07c8c737ad..cb03c0dc92c 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -340,17 +340,6 @@ static bool check_datablocks_copy_on_writable(const ID *id_orig) struct RemapCallbackUserData { /* Dependency graph for which remapping is happening. */ const Depsgraph *depsgraph; - /* Temporarily allocated memory for copying purposes. This ID will - * be discarded after expanding is done, so need to make sure temp_id - * is replaced with proper real_id. - * - * NOTE: This is due to our logic of "inplace" duplication, where we - * use generic duplication routines (which gives us new ID) which then - * is followed with copying data to a placeholder we prepared before and - * discarding pointer returned by duplication routines. - */ - const ID *temp_id; - ID *real_id; /* Create placeholder for ID nodes for cases when we need to remap original * ID to it[s CoW version but we don't have required ID node yet. * @@ -371,12 +360,7 @@ int foreach_libblock_remap_callback(void *user_data_v, RemapCallbackUserData *user_data = (RemapCallbackUserData *)user_data_v; const Depsgraph *depsgraph = user_data->depsgraph; ID *id_orig = *id_p; - if (id_orig == user_data->temp_id) { - DEG_COW_PRINT(" Remapping datablock for %s: id_temp=%p id_cow=%p\n", - id_orig->name, id_orig, user_data->real_id); - *id_p = user_data->real_id; - } - else if (check_datablocks_copy_on_writable(id_orig)) { + if (check_datablocks_copy_on_writable(id_orig)) { ID *id_cow; if (user_data->create_placeholders) { /* Special workaround to stop creating temp datablocks for @@ -523,11 +507,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, * - We don't want bmain's content to be freed when main is freed. */ bool done = false; - /* Need to make sure the possibly temporary allocated memory is correct for - * until we are fully done with remapping original pointers with copied on - * write ones. - */ - ID *newid = NULL; /* First we handle special cases which are not covered by id_copy() yet. * or cases where we want to do something smarter than simple datablock * copy. @@ -569,8 +548,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, /* Perform remapping of the nodes. */ RemapCallbackUserData user_data; user_data.depsgraph = depsgraph; - user_data.temp_id = newid; - user_data.real_id = id_cow; user_data.node_builder = node_builder; user_data.create_placeholders = create_placeholders; BKE_library_foreach_ID_link(NULL, @@ -582,10 +559,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, * from above. */ update_special_pointers(depsgraph, id_orig, id_cow); - /* Now we can safely discard temporary memory used for copying. */ - if (newid != NULL) { - MEM_freeN(newid); - } id_cow->recalc = id_orig->recalc | id_cow_recalc; return id_cow; } @@ -608,7 +581,7 @@ static void deg_update_copy_on_write_animation(const Depsgraph * /*depsgraph*/, const IDDepsNode *id_node) { DEG_debug_print_eval(__func__, id_node->id_orig->name, id_node->id_cow); - BKE_animdata_copy_id(NULL, id_node->id_cow, id_node->id_orig, false); + BKE_animdata_copy_id(NULL, id_node->id_cow, id_node->id_orig, false, false); } ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, @@ -827,6 +800,8 @@ bool deg_validate_copy_on_write_datablock(ID *id_cow) void deg_tag_copy_on_write_id(ID *id_cow, const ID *id_orig) { + BLI_assert(id_cow != id_orig); + BLI_assert((id_orig->tag & LIB_TAG_COPY_ON_WRITE) == 0); id_cow->tag |= LIB_TAG_COPY_ON_WRITE; id_cow->orig_id = (ID *)id_orig; } diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index fdcfc129073..e09ba8c4f05 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -103,10 +103,7 @@ DepsNode::~DepsNode() /* Generic identifier for Depsgraph Nodes. */ string DepsNode::identifier() const { - char typebuf[7]; - sprintf(typebuf, "(%d)", type); - - return string(typebuf) + " : " + name; + return string(nodeTypeAsString(type)) + " : " + name; } eDepsNode_Class DepsNode::get_class() const { diff --git a/source/blender/depsgraph/intern/nodes/deg_node_id.cc b/source/blender/depsgraph/intern/nodes/deg_node_id.cc index edc5c0114f9..9f161db73ad 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_id.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_id.cc @@ -172,6 +172,15 @@ void IDDepsNode::destroy() id_orig = NULL; } +string IDDepsNode::identifier() const +{ + char orig_ptr[24], cow_ptr[24]; + BLI_snprintf(orig_ptr, sizeof(orig_ptr), "%p", id_orig); + BLI_snprintf(cow_ptr, sizeof(cow_ptr), "%p", id_cow); + return string(nodeTypeAsString(type)) + " : " + name + + " (orig: " + orig_ptr + ", eval: " + cow_ptr + ")"; +} + ComponentDepsNode *IDDepsNode::find_component(eDepsNode_Type type, const char *name) const { diff --git a/source/blender/depsgraph/intern/nodes/deg_node_id.h b/source/blender/depsgraph/intern/nodes/deg_node_id.h index 505a1129192..12dbc16b4fa 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_id.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_id.h @@ -51,6 +51,8 @@ struct IDDepsNode : public DepsNode { ~IDDepsNode(); void destroy(); + virtual string identifier() const; + ComponentDepsNode *find_component(eDepsNode_Type type, const char *name = "") const; ComponentDepsNode *add_component(eDepsNode_Type type, diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc index cbc0fbb4241..e82bbbc0e8a 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc @@ -56,7 +56,7 @@ OperationDepsNode::~OperationDepsNode() string OperationDepsNode::identifier() const { - return string(DEG_OPNAMES[opcode]) + "(" + name + ")"; + return string(operationCodeAsString(opcode)) + "(" + name + ")"; } /* Full node identifier, including owner name. diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index 0dafbf51d74..91f8a8713bc 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -373,7 +373,7 @@ int join_armature_exec(bContext *C, wmOperator *op) if (base->object->adt) { if (ob->adt == NULL) { /* no animdata, so just use a copy of the whole thing */ - ob->adt = BKE_animdata_copy(bmain, base->object->adt, false); + ob->adt = BKE_animdata_copy(bmain, base->object->adt, false, true); } else { /* merge in data - we'll fix the drivers manually */ @@ -384,7 +384,7 @@ int join_armature_exec(bContext *C, wmOperator *op) if (curarm->adt) { if (arm->adt == NULL) { /* no animdata, so just use a copy of the whole thing */ - arm->adt = BKE_animdata_copy(bmain, curarm->adt, false); + arm->adt = BKE_animdata_copy(bmain, curarm->adt, false, true); } else { /* merge in data - we'll fix the drivers manually */ diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 272478e46ff..fe53902d9a4 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1466,13 +1466,13 @@ static int make_links_data_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; case MAKE_LINKS_ANIMDATA: - BKE_animdata_copy_id(bmain, (ID *)ob_dst, (ID *)ob_src, false); + BKE_animdata_copy_id(bmain, (ID *)ob_dst, (ID *)ob_src, false, true); if (ob_dst->data && ob_src->data) { if (ID_IS_LINKED(obdata_id)) { is_lib = true; break; } - BKE_animdata_copy_id(bmain, (ID *)ob_dst->data, (ID *)ob_src->data, false); + BKE_animdata_copy_id(bmain, (ID *)ob_dst->data, (ID *)ob_src->data, false, true); } DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); break; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 1775d4b9c8b..7e9c98d3822 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2342,7 +2342,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op) ED_object_vpaintmode_exit_ex(ob); } else { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C); wmWindowManager *wm = CTX_wm_manager(C); ED_object_vpaintmode_enter_ex(depsgraph, wm, scene, ob); } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1d1c8460cfd..9817ca41832 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5793,7 +5793,7 @@ void ED_object_sculptmode_exit(bContext *C) static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C); Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); const int mode_flag = OB_MODE_SCULPT; diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index daa4a3d9ca3..bcce2764eaf 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -457,16 +457,17 @@ enum { /* RESET_AFTER_USE tag existing data before linking so we know what is new. */ LIB_TAG_PRE_EXISTING = 1 << 11, - /* The datablock is a copy-on-write version. */ + /* The datablock is a copy-on-write/localized version. */ LIB_TAG_COPY_ON_WRITE = 1 << 12, LIB_TAG_COPY_ON_WRITE_EVAL = 1 << 13, + LIB_TAG_LOCALIZED = 1 << 14, /* RESET_NEVER tag datablock for freeing etc. behavior (usually set when copying real one into temp/runtime one). */ - LIB_TAG_NO_MAIN = 1 << 14, /* Datablock is not listed in Main database. */ - LIB_TAG_NO_USER_REFCOUNT = 1 << 15, /* Datablock does not refcount usages of other IDs. */ + LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */ + LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */ /* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory * (usual type-specific freeing is called though). */ - LIB_TAG_NOT_ALLOCATED = 1 << 16, + LIB_TAG_NOT_ALLOCATED = 1 << 17, }; /* WARNING - when adding flags check on PSYS_RECALC */ diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 3c940e3dcbf..6eed4153e0d 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -601,7 +601,7 @@ bool rna_AnimaData_override_apply( if (adt_dst == NULL && adt_src != NULL) { /* Copy anim data from reference into final local ID. */ - BKE_animdata_copy_id(NULL, ptr_dst->id.data, ptr_src->id.data, false); + BKE_animdata_copy_id(NULL, ptr_dst->id.data, ptr_src->id.data, false, true); return true; } else if (adt_dst != NULL && adt_src == NULL) { |