Fix: missing null check leads to crash when rendering

The simulation cache is allocated lazily during evaluation when the
depsgraph is active. However, during rendering, the depsgraph is not
active, so it's not created.
This commit is contained in:
Jacques Lucke
2023-05-04 11:04:21 +02:00
parent 9d6659bf07
commit e674e32aa1

View File

@@ -1200,6 +1200,10 @@ static void prepare_simulation_states_for_evaluation(const NodesModifierData &nm
}
}
if (nmd_orig.simulation_cache == nullptr) {
return;
}
/* Load read-only states to give nodes access to cached data. */
const bke::sim::StatesAroundFrame sim_states =
nmd_orig.simulation_cache->get_states_around_frame(current_frame);