mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improve visibility rect/AABB generation usability in GPUParticles
- Don't display the time dialog if the automatically calculated generation time is short enough. - Clarify the purpose of waiting in the progress dialog.
This commit is contained in:
parent
1ed00dca88
commit
1bd214258e
2 changed files with 17 additions and 12 deletions
|
@ -238,14 +238,16 @@ void GPUParticles3DEditor::_notification(int p_notification) {
|
|||
void GPUParticles3DEditor::_menu_option(int p_option) {
|
||||
switch (p_option) {
|
||||
case MENU_OPTION_GENERATE_AABB: {
|
||||
float gen_time = node->get_lifetime();
|
||||
// Add one second to the default generation lifetime, since the progress is updated every second.
|
||||
generate_seconds->set_value(MAX(1.0, trunc(node->get_lifetime()) + 1.0));
|
||||
|
||||
if (gen_time < 1.0) {
|
||||
generate_seconds->set_value(1.0);
|
||||
if (generate_seconds->get_value() >= 11.0 + CMP_EPSILON) {
|
||||
// Only pop up the time dialog if the particle's lifetime is long enough to warrant shortening it.
|
||||
generate_aabb->popup_centered();
|
||||
} else {
|
||||
generate_seconds->set_value(trunc(gen_time) + 1.0);
|
||||
// Generate the visibility AABB immediately.
|
||||
_generate_aabb();
|
||||
}
|
||||
generate_aabb->popup_centered();
|
||||
} break;
|
||||
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
|
||||
Ref<ParticlesMaterial> material = node->get_process_material();
|
||||
|
@ -286,7 +288,7 @@ void GPUParticles3DEditor::_generate_aabb() {
|
|||
|
||||
double running = 0.0;
|
||||
|
||||
EditorProgress ep("gen_aabb", TTR("Generating AABB"), int(time));
|
||||
EditorProgress ep("gen_aabb", TTR("Generating Visibility AABB (Waiting for Particle Simulation)"), int(time));
|
||||
|
||||
bool was_emitting = node->is_emitting();
|
||||
if (!was_emitting) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue