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:
authorDalai Felinto <dfelinto@gmail.com>2017-01-17 16:58:38 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-01-17 16:58:41 +0300
commitb1ff8e8703778850bc7dfa2f2b614624c40f7ec3 (patch)
tree8f1ce03df8222cbbd639970a24168cd3db094ad2 /source/blender/editors/object/object_add.c
parent216273d9e9de8f256a99331d5478a4127f38fad5 (diff)
Remove OB_FROMGROUP from base, and add util funcs to sync base/object flags
I still want to remove the syncing of base/object flags. But for now this will at least help future refactor.
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r--source/blender/editors/object/object_add.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 3848d8e62aa..c0c6855f643 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1351,11 +1351,12 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
if (ob->mat == NULL) ob->totcol = 0;
basen = MEM_dupallocN(base);
- basen->flag &= ~(OB_FROMDUPLI | OB_FROMGROUP);
- ob->flag = basen->flag;
+
basen->lay = base->lay;
BLI_addhead(&scene->base, basen); /* addhead: othwise eternal loop */
basen->object = ob;
+ basen->flag &= ~OB_FROMDUPLI;
+ BKE_scene_base_flag_sync_from_base(basen);
/* make sure apply works */
BKE_animdata_free(&ob->id, true);
@@ -1985,11 +1986,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
* 2) Rigid Body sim participants MUST always be part of a group...
*/
// XXX: is 2) really a good measure here?
- if ((basen->flag & OB_FROMGROUP) || ob->rigidbody_object || ob->rigidbody_constraint) {
+ if ((ob->flag & OB_FROMGROUP) != 0 || ob->rigidbody_object || ob->rigidbody_constraint) {
Group *group;
for (group = bmain->group.first; group; group = group->id.next) {
if (BKE_group_object_exists(group, ob))
- BKE_group_object_add(group, obn, scene, basen);
+ BKE_group_object_add(group, obn);
}
}
@@ -2327,7 +2328,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
base = MEM_callocN(sizeof(Base), "duplibase");
base->object = ob;
- base->flag = ob->flag;
+ BKE_scene_base_flag_sync_from_object(base);
/* prepare dupli */
clear_sca_new_poins(); /* BGE logic */