diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-10-19 23:01:41 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-10-19 23:04:14 +0300 |
commit | fc10484f7c55d425f8374f2ea64f6b525cff2b7d (patch) | |
tree | 0e9a08aaa918f95bb8814ce316ac1e24fd65ea9d /source/blender/editors/object | |
parent | 4d2416b99c472c9735e074d864dcf82a85da8c58 (diff) |
Fix/properly implement: "make group proxy"
This was never correctly implemented. It now works as expected (ala 2.79 behaviour).
The proxy object is added to all the collections of the original empty.
Before not only this wasn't the case, but it would crash Blender.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index abc89d0e937..839f8094c43 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -341,7 +341,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op) Object *ob, *gob = ED_object_active_context(C); GroupObject *go; Scene *scene = CTX_data_scene(C); - SceneLayer *sl = CTX_data_scene_layer(C); + SceneLayer *scene_layer = CTX_data_scene_layer(C); if (gob->dup_group != NULL) { go = BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "object")); @@ -354,16 +354,16 @@ static int make_proxy_exec(bContext *C, wmOperator *op) if (ob) { Object *newob; - BaseLegacy *newbase, *oldbase = BASACT_NEW(sl); + Base *newbase, *oldbase = BASACT_NEW(scene_layer); char name[MAX_ID_NAME + 4]; BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name + 2); /* Add new object for the proxy */ - newob = BKE_object_add(bmain, scene, sl, OB_EMPTY, name); + newob = BKE_object_add_from(bmain, scene, scene_layer, OB_EMPTY, name, gob ? gob : ob); /* set layers OK */ - newbase = BASACT_NEW(sl); /* BKE_object_add sets active... */ + newbase = BASACT_NEW(scene_layer); /* BKE_object_add sets active... */ newbase->lay = oldbase->lay; newob->lay = newbase->lay; |