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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-12-04 12:18:21 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-12-04 12:18:21 +0300
commit36ca072375deea4803df4681716c1d3224095e07 (patch)
treeedbaee3dfcc62c6eb3d7196034a620d85eef1c90 /source/blender/editors/object/object_add.c
parent9b933ccdf6686c1c947cc8e70c36563b7f13068e (diff)
Fix T58481: "Make duplicates real" operator settings crashes
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r--source/blender/editors/object/object_add.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 09948d719f0..30c7811fa0b 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -95,6 +95,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -1520,7 +1521,8 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
return;
}
- lb_duplis = object_duplilist(depsgraph, scene, base->object);
+ Object *object_eval = DEG_get_evaluated_object(depsgraph, base->object);
+ lb_duplis = object_duplilist(depsgraph, scene, object_eval);
dupli_gh = BLI_ghash_ptr_new(__func__);
if (use_hierarchy) {
@@ -1533,7 +1535,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
}
for (dob = lb_duplis->first; dob; dob = dob->next) {
- Object *ob_src = dob->ob;
+ Object *ob_src = DEG_get_original_object(dob->ob);
Object *ob_dst = ID_NEW_SET(dob->ob, BKE_object_copy(bmain, ob_src));
Base *base_dst;
@@ -1579,7 +1581,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
}
for (dob = lb_duplis->first; dob; dob = dob->next) {
- Object *ob_src = dob->ob;
+ Object *ob_src = DEG_get_original_object(dob->ob);
Object *ob_dst = BLI_ghash_lookup(dupli_gh, dob);
/* Remap new object to itself, and clear again newid pointer of orig object. */
@@ -1663,6 +1665,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
BKE_main_id_clear_newpoins(bmain);
base->object->transflag &= ~OB_DUPLI;
+ DEG_id_tag_update(&base->object->id, DEG_TAG_COPY_ON_WRITE);
}
static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
@@ -1704,7 +1707,7 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
RNA_def_boolean(ot->srna, "use_base_parent", 0, "Parent", "Parent newly created objects to the original duplicator");
RNA_def_boolean(ot->srna, "use_hierarchy", 0, "Keep Hierarchy", "Maintain parent child relationships");