Fix visibility of instancer object #43

Merged
Bogdan Nagirniak merged 16 commits from BLEN-405_1 into hydra-render 2023-05-24 13:44:35 +02:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit 9692e36fc2 - Show all commits

View File

@ -268,8 +268,15 @@ void InstancerData::update_double_sided(MaterialData *mat_data)
bool InstancerData::is_instance_visible(Object *object) bool InstancerData::is_instance_visible(Object *object)
{ {
int vis = BKE_object_visibility(object, DEG_get_mode(scene_delegate_->depsgraph)); eEvaluationMode deg_mode = DEG_get_mode(scene_delegate_->depsgraph);
return vis & OB_VISIBLE_SELF; int vis = BKE_object_visibility(object, deg_mode);
bool ret = vis & OB_VISIBLE_SELF;
if (deg_mode == DAG_EVAL_VIEWPORT) {
if (!ret && (object->transflag & OB_DUPLI) == 0) {
ret = true;
}
}
return ret;
} }
pxr::SdfPath InstancerData::object_prim_id(Object *object) const pxr::SdfPath InstancerData::object_prim_id(Object *object) const

View File

@ -103,7 +103,6 @@ void ObjectData::update_parent()
scene_delegate_->instancer_prim_id(ob)); scene_delegate_->instancer_prim_id(ob));
if (i_data) { if (i_data) {
i_data->update_as_parent(); i_data->update_as_parent();
break;
} }
} }
} }