forked from blender/blender
Fix visibility of instancer object #43
@ -88,7 +88,6 @@ void InstancerData::remove()
|
||||
void InstancerData::update()
|
||||
{
|
||||
ID_LOG(2, "");
|
||||
|
||||
Object *object = (Object *)id;
|
||||
if (id->recalc & ID_RECALC_GEOMETRY ||
|
||||
(object->data && ((ID *)object->data)->recalc & ID_RECALC_GEOMETRY) ||
|
||||
@ -215,7 +214,7 @@ void InstancerData::check_update(Object *object)
|
||||
if (l_inst) {
|
||||
if (!is_instance_visible(object)) {
|
||||
l_inst->transforms.clear();
|
||||
update_light_instance(l_it->second);
|
||||
update_light_instance(*l_inst);
|
||||
light_instances_.erase(path);
|
||||
return;
|
||||
}
|
||||
@ -231,19 +230,19 @@ void InstancerData::check_update(Object *object)
|
||||
|
||||
/* Checking if object wasn't added to instances before */
|
||||
if (is_supported(object) && is_instance_visible(object)) {
|
||||
bool do_set_instances = false;
|
||||
bool do_write_instances = false;
|
||||
ListBase *lb = object_duplilist(
|
||||
scene_delegate_->depsgraph, scene_delegate_->scene, (Object *)id);
|
||||
LISTBASE_FOREACH (DupliObject *, dupli, lb) {
|
||||
if (dupli->ob == object) {
|
||||
do_set_instances = true;
|
||||
do_write_instances = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free_object_duplilist(lb);
|
||||
|
||||
if (do_set_instances) {
|
||||
set_instances();
|
||||
if (do_write_instances) {
|
||||
write_instances();
|
||||
if (!mesh_instances_.empty()) {
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(
|
||||
prim_id, pxr::HdChangeTracker::AllDirty);
|
||||
|
Loading…
Reference in New Issue
Block a user