You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Fix MultiMesh visible_instance_count being ignored after the first frame
Co-authored-by: Clay John <claynjohn@gmail.com>
This commit is contained in:
@@ -1805,8 +1805,12 @@ void MeshStorage::multimesh_set_visible_instances(RID p_multimesh, int p_visible
|
||||
}
|
||||
|
||||
if (multimesh->data_cache.size()) {
|
||||
//there is a data cache..
|
||||
// There is a data cache, but we may need to update some sections.
|
||||
_multimesh_mark_all_dirty(multimesh, false, true);
|
||||
int start = multimesh->visible_instances >= 0 ? multimesh->visible_instances : multimesh->instances;
|
||||
for (int i = start; i < p_visible; i++) {
|
||||
_multimesh_mark_dirty(multimesh, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
multimesh->visible_instances = p_visible;
|
||||
|
||||
Reference in New Issue
Block a user