Fix rendering of Car Demo scene #37

Merged
Bogdan Nagirniak merged 2 commits from Vasyl-Pidhirskyi/blender_bn:BLEN-399 into hydra-render 2023-05-05 20:55:52 +02:00
2 changed files with 9 additions and 14 deletions
Showing only changes of commit 7f3048913e - Show all commits

View File

@ -434,11 +434,9 @@ void BlenderSceneDelegate::add_new_objects()
Object *,
object) {
if (!ObjectData::is_supported(object)) {
continue;
}
if (ObjectData::is_supported(object)) {
update_objects(object);
}
update_instancers(object);
}
ITER_END;
@ -462,10 +460,9 @@ void BlenderSceneDelegate::remove_unused_objects()
&data,
Object *,
object) {
if (!ObjectData::is_supported(object)) {
continue;
}
if (ObjectData::is_supported(object)) {
available_objects.insert(object_prim_id(object).GetName());
}
available_objects.insert(instancer_prim_id(object).GetName());
}
ITER_END;
@ -542,13 +539,11 @@ void BlenderSceneDelegate::update_visibility()
Object *,
object) {
if (!ObjectData::is_supported(object)) {
continue;
}
if (ObjectData::is_supported(object)) {
if (!object_data(object_prim_id(object))) {
update_objects(object);
}
}
if (!instancer_data(instancer_prim_id(object))) {
update_instancers(object);
}

View File

@ -64,7 +64,7 @@ void InstancerData::update()
ID_LOG(2, "");
Object *object = (Object *)id;
if (id->recalc & ID_RECALC_GEOMETRY || ((ID *)object->data)->recalc & ID_RECALC_GEOMETRY ||
if (id->recalc & ID_RECALC_GEOMETRY || (object->data && ((ID *)object->data)->recalc & ID_RECALC_GEOMETRY) ||
id->recalc & ID_RECALC_TRANSFORM) {
set_instances();
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(