Merge pull request #61718 from ArshPanesar/Fixed-Populating-MultimeshInstance-Crash

Fixed Issue #61553 - Populating MultimeshInstance Crash
This commit is contained in:
Rémi Verschelde 2022-06-07 14:12:02 +02:00 committed by GitHub
commit 9ca190dfe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,8 +160,15 @@ void MultiMeshEditor::_populate() {
int instance_count = populate_amount->get_value();
multimesh->set_transform_format(MultiMesh::TRANSFORM_3D);
multimesh->set_color_format(node->get_multimesh()->get_color_format());
multimesh->set_custom_data_format(node->get_multimesh()->get_custom_data_format());
if (node->get_multimesh().is_null()) {
multimesh->set_color_format(MultiMesh::COLOR_NONE);
multimesh->set_custom_data_format(MultiMesh::CUSTOM_DATA_NONE);
} else {
multimesh->set_color_format(node->get_multimesh()->get_color_format());
multimesh->set_custom_data_format(node->get_multimesh()->get_custom_data_format());
}
multimesh->set_instance_count(instance_count);
float _tilt_random = populate_tilt_random->get_value();