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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user