forked from blender/blender
Fix visibility of instancer object #43
@ -40,11 +40,13 @@ bool InstancerData::is_visible(BlenderSceneDelegate *scene_delegate, Object *obj
|
|||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate->depsgraph);
|
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate->depsgraph);
|
||||||
|
int vis = BKE_object_visibility(object, deg_mode);
|
||||||
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
||||||
ret = BKE_object_is_visible_in_viewport(scene_delegate->view3d, object);
|
ret = BKE_object_is_visible_in_viewport(scene_delegate->view3d, object) &&
|
||||||
|
(vis & OB_VISIBLE_INSTANCES);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int vis = BKE_object_visibility(object, deg_mode);
|
vis = BKE_object_visibility(object, deg_mode);
|
||||||
ret = vis & (OB_VISIBLE_SELF | OB_VISIBLE_INSTANCES);
|
ret = vis & (OB_VISIBLE_SELF | OB_VISIBLE_INSTANCES);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@ -261,14 +263,14 @@ bool InstancerData::is_instance_visible(Object *object)
|
|||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate_->depsgraph);
|
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate_->depsgraph);
|
||||||
|
int vis = BKE_object_visibility(object, deg_mode);
|
||||||
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
||||||
ret = BKE_object_is_visible_in_viewport(scene_delegate_->view3d, object);
|
ret = vis & OB_VISIBLE_SELF;
|
||||||
if (ret && object->transflag & OB_DUPLI) {
|
//if (ret && object->transflag & OB_DUPLI) {
|
||||||
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT;
|
// ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int vis = BKE_object_visibility(object, deg_mode);
|
|
||||||
ret = vis & OB_VISIBLE_SELF;
|
ret = vis & OB_VISIBLE_SELF;
|
||||||
if (ret && object->transflag & OB_DUPLI) {
|
if (ret && object->transflag & OB_DUPLI) {
|
||||||
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER;
|
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER;
|
||||||
|
@ -64,14 +64,15 @@ bool ObjectData::is_visible(BlenderSceneDelegate *scene_delegate, Object *object
|
|||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate->depsgraph);
|
eEvaluationMode deg_mode = DEG_get_mode(scene_delegate->depsgraph);
|
||||||
|
int vis = BKE_object_visibility(object, deg_mode);
|
||||||
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
if (deg_mode == DAG_EVAL_VIEWPORT) {
|
||||||
ret = BKE_object_is_visible_in_viewport(scene_delegate->view3d, object);
|
ret = BKE_object_is_visible_in_viewport(scene_delegate->view3d, object) &&
|
||||||
if (ret && object->transflag & OB_DUPLI) {
|
(vis & OB_VISIBLE_SELF);
|
||||||
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT;
|
//if (ret && object->transflag & OB_DUPLI) {
|
||||||
}
|
// ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int vis = BKE_object_visibility(object, deg_mode);
|
|
||||||
ret = vis & OB_VISIBLE_SELF;
|
ret = vis & OB_VISIBLE_SELF;
|
||||||
if (ret && object->transflag & OB_DUPLI) {
|
if (ret && object->transflag & OB_DUPLI) {
|
||||||
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER;
|
ret = object->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER;
|
||||||
|
Loading…
Reference in New Issue
Block a user