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>2021-08-24 13:23:39 +0300
committerBastien Montagne <bastien@blender.org>2021-08-24 13:23:39 +0300
commit46913bf0a08c7e9ae5525ff95af0c7dc3b2f622f (patch)
treecb7ba247bd1746e92a749fd66d35ee6475b7ea4a /source/blender/editors/object/object_add.c
parent4e4ac5a867add13035958479fb1e5bae419b7785 (diff)
Fix T90840: Can't duplicate or copy (Ctrl-C) object from linked file.
We need to separate the flag telling duplicate code to not handle remapping to new IDs etc., from the one telling the code that we are currently duplicating a 'root' ID (i.e. not a dependency of another duplicated ID). This whole duplicate code/logic is still fairly unsatisfying, think it will need further refactor, or maybe even re-design, at some point...
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r--source/blender/editors/object/object_add.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 12b52907057..34400462d38 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -3359,8 +3359,13 @@ Base *ED_object_add_duplicate(
Base *basen;
Object *ob;
- basen = object_add_duplicate_internal(
- bmain, scene, view_layer, base->object, dupflag, LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ basen = object_add_duplicate_internal(bmain,
+ scene,
+ view_layer,
+ base->object,
+ dupflag,
+ LIB_ID_DUPLICATE_IS_SUBPROCESS |
+ LIB_ID_DUPLICATE_IS_ROOT_ID);
if (basen == NULL) {
return NULL;
}
@@ -3395,8 +3400,13 @@ static int duplicate_exec(bContext *C, wmOperator *op)
BKE_main_id_newptr_and_tag_clear(bmain);
CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
- Base *basen = object_add_duplicate_internal(
- bmain, scene, view_layer, base->object, dupflag, LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ Base *basen = object_add_duplicate_internal(bmain,
+ scene,
+ view_layer,
+ base->object,
+ dupflag,
+ LIB_ID_DUPLICATE_IS_SUBPROCESS |
+ LIB_ID_DUPLICATE_IS_ROOT_ID);
/* note that this is safe to do with this context iterator,
* the list is made in advance */
@@ -3516,7 +3526,7 @@ static int object_add_named_exec(bContext *C, wmOperator *op)
* the case here. So we have to do the new-ID relinking ourselves
* (#copy_object_set_idnew()).
*/
- LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ LIB_ID_DUPLICATE_IS_SUBPROCESS | LIB_ID_DUPLICATE_IS_ROOT_ID);
}
else {
/* basen is actually not a new base in this case. */