Fix T47931: Missed world shader update when having object dependency

This commit is contained in:
Sergey Sharybin 2016-03-28 10:45:29 +02:00
parent 8a9dd6f6fb
commit e2e72a20ec
Notes: blender-bot 2023-02-14 08:03:08 +01:00
Referenced by issue #47985, VSE scene strip OpenGl render crash
Referenced by issue #47931, Refresh on real time rendering missing when a texture coordinate node is used in conjunction with empties
1 changed files with 12 additions and 4 deletions

View File

@ -133,10 +133,18 @@ bool BlenderSync::sync_recalc()
BL::BlendData::worlds_iterator b_world;
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world) {
if(world_map == b_world->ptr.data &&
(b_world->is_updated() || (b_world->node_tree() && b_world->node_tree().is_updated())))
{
world_recalc = true;
if(world_map == b_world->ptr.data) {
if(b_world->is_updated() ||
(b_world->node_tree() && b_world->node_tree().is_updated()))
{
world_recalc = true;
}
else if(b_world->node_tree() && b_world->use_nodes()) {
Shader *shader = scene->shaders[scene->default_background];
if(has_updated_objects && shader != NULL && shader->has_object_dependency) {
world_recalc = true;
}
}
}
}