diff options
Diffstat (limited to 'source/blender/blenkernel/intern/mball_tessellate.c')
-rw-r--r-- | source/blender/blenkernel/intern/mball_tessellate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index cd629c888a4..ad178e76ef6 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -44,6 +44,7 @@ #include "BKE_displist.h" #include "BKE_mball_tessellate.h" /* own include */ +#include "BKE_object.h" #include "BKE_scene.h" #include "DEG_depsgraph.h" @@ -1191,6 +1192,8 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje int obnr, zero_size = 0; char obname[MAX_ID_NAME]; SceneBaseIter iter; + const eEvaluationMode deg_eval_mode = DEG_get_mode(depsgraph); + const short parenting_dupli_transflag = (OB_DUPLIFACES | OB_DUPLIVERTS); copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from BKE_scene_base_iter_next */ invert_m4_m4(obinv, ob->obmat); @@ -1204,6 +1207,14 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje zero_size = 0; ml = NULL; + /* If this metaball is the original that's used for duplication, only have it it visible when + * the instancer is visible too. */ + if ((base->flag_legacy & OB_FROMDUPLI) == 0 && ob->parent != NULL && + (ob->parent->transflag & parenting_dupli_transflag) != 0 && + (BKE_object_visibility(ob->parent, deg_eval_mode) & OB_VISIBLE_SELF) == 0) { + continue; + } + if (bob == ob && (base->flag_legacy & OB_FROMDUPLI) == 0) { mb = ob->data; |