Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ctrl + R keyboard shortcut to restart particle emission in the editor #92134

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 19, 2024

Restarting particle animation frequently is often done in the VFX tweaking process.

This shortcut is available for both GPUParticles and CPUParticles, in 2D and 3D.

Ctrl + R is currently only used in the script editor, so we can safely use it in the 2D/3D editors.

@QbieShay
Copy link
Contributor

Is ctrl+space available? I'd like to have a shortcut to pause particles as well. So play/pause, restart, and frameskip too (, and . probably for frameskip)
would those work?

@Calinou
Copy link
Member Author

Calinou commented May 21, 2024

I'd like to have a shortcut to pause particles as well. So play/pause, restart, and frameskip too (, and . probably for frameskip)

Particle pausing can be implemented by toggling Speed Scale between its previous value and 0.0, but the issue is that this value change would be saved to the scene file. We'd need a separate method for temporarily pausing particles in a way that isn't serialized to the scene file.

The same goes for frameskip once seeking is implemented.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should define the shortcut once and use ED_GET_SHORTCUT.

@Calinou
Copy link
Member Author

Calinou commented May 21, 2024

You should define the shortcut once and use ED_GET_SHORTCUT.

I tried to do that in EditorNode's constructor, but I got "unknown shortcut" errors when I select a particles node.

@QbieShay
Copy link
Contributor

@Calinou yep! for now pause doesn't make sense, but i mentioned it in case we can reserve it ^^

@KoBeWi
Copy link
Member

KoBeWi commented May 21, 2024

I tried to do that in EditorNode's constructor, but I got "unknown shortcut" errors when I select a particles node.

It should work if you define them right after EditorSettings are created.

godot/editor/editor_node.cpp

Lines 6295 to 6298 in aaa4560

// Load settings.
if (!EditorSettings::get_singleton()) {
EditorSettings::create();
}

@Calinou
Copy link
Member Author

Calinou commented May 21, 2024

It should work if you define them right after EditorSettings are created.

I've amended the PR with this change, thanks 🙂

@Calinou Calinou force-pushed the editor-particles-restart-add-shortcut branch from b72b45e to 0109de7 Compare May 21, 2024 22:18
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will conflict with #92223

@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 22, 2024
@akien-mga
Copy link
Member

Needs rebase after #92223.

@Calinou Calinou force-pushed the editor-particles-restart-add-shortcut branch from 0109de7 to a7c9a6f Compare May 22, 2024 15:37
…itor

Restarting particle animation frequently is often done in the VFX
tweaking process.

This shortcut is available for both GPUParticles and CPUParticles,
in 2D and 3D.
@Calinou Calinou force-pushed the editor-particles-restart-add-shortcut branch from a7c9a6f to 57f5209 Compare May 22, 2024 16:42
@akien-mga akien-mga merged commit da979ec into godotengine:master May 23, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the editor-particles-restart-add-shortcut branch May 23, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants